<template>
	<view>
		<view class="list">
			<view class="li ddflex" @click="jumpUrl('/mine/userinfo/userinfo')">
				<image src="../../mine/static/mine/images/mico7.png" class="mico"></image>
				<view class="fflex">修改个人信息</view>
				<image src="../../mine/static/mine/images/n_rico.png" class="n_rico"></image>
			</view>
			<view class="li ddflex" @click="jumpUrl('/mine/address/address')">
				<image src="../../mine/static/mine/images/mico5.png" class="mico"></image>
				<view class="fflex">收货地址</view>
				<image src="../../mine/static/mine/images/n_rico.png" class="n_rico"></image>
			</view>
		</view>
		<view class="loginout" @click="loginout">退出登录</view>
	</view>
</template>

<script>
//index.js
const app = getApp();
const req = require('../../utils/request.js');
const api = require('../../utils/api.js');
const utils = require('../../utils/util.js');
export default {
	data() {
		return {};
	},

	onLoad(options) {},

	methods: {
		jumpUrl(url) {
			uni.navigateTo({
				url: url
			});
		},
		loginout() {
			var that = this;
			uni.showModal({
				title: '提示',
				content: '确定退出登录吗',
				confirmText: '确定',
				cancelText: '取消',
				success(res) {
					if (res.confirm) {
						req.postRequest(
							'/api/logout',
							{},
							data => {
								console.log('退出登录');
								req.removeStorage('userInfo');
								req.removeStorage('AUTH_TOKEN');
								uni.navigateBack();
							},
							true
						);
					}
				}
			});
		}
	}
};
</script>

<style>
@import './index.css';
</style>
