<template>
	<div class="view">
		<div class="card">
			<div class="row">
				<div class="left">
					账号信息
				</div>
				<div class="right" @click="toAccountDetail">
					<image :src="$util.img('/upload/weapp/user/arrow-right.png')" mode=""></image>
				</div>
			</div>
			<u-line></u-line>

			<div class="row">
				<div class="left">
					更换手机号
				</div>
				<div class="right" @click="toChangePhone">
					<image :src="$util.img('/upload/weapp/user/arrow-right.png')" mode=""></image>
				</div>
			</div>
			<u-line></u-line>

			<div class="row">
				<div class="left">
					修改密码
				</div>
				<div class="right" @click="toChangePwd">
					<image :src="$util.img('/upload/weapp/user/arrow-right.png')" mode=""></image>
				</div>
			</div>
			<u-line></u-line>
			<div class="row">
				<div class="left">
					注销账号
				</div>
				<div class="right" @click="logOff">
					<image :src="$util.img('/upload/weapp/user/arrow-right.png')" mode=""></image>
				</div>
			</div>
			<!-- <u-line></u-line> -->

			<!-- <div class="row">
				<div class="left">
					支付密码
				</div>
				<div class="right" @click="toPayPwd">
					<image  :src="$util.img('/upload/weapp/user/arrow-right.png')" mode=""></image>
				</div>
			</div> -->

		</div>
		<div class="btnBox">
			<div class="btn" @click="signOut">退出登录</div>
		</div>
	</div>
</template>

<script>
	export default {
		methods: {
			toAccountDetail() {
				uni.navigateTo({
					url: '/pages_tool/member/account_info'
				})
			},
			toChangePwd() {
				uni.navigateTo({
					url: '/pages_tool/member/change_pwd'
				})
			},
			logOff() {
				uni.navigateTo({
					url: '/pages_tool/logOff/logOff'
				})
			},
			toChangePhone() {
				uni.navigateTo({
					url: '/pages_tool/member/change_phone'
				})
			},
			toPayPwd() {
				uni.navigateTo({
					url: "/pages_tool/member/pay_password"
				})
			},
			signOut() {

				uni.removeStorage({
					key: 'token',
					success: res => {
						uni.setStorageSync('loginLock', 1);
						//购物车数量
						uni.removeStorageSync('DIY_VIEW_INDEX_popwindow_count')
						uni.removeStorageSync('userInfo')
						this.$store.dispatch('clearCartNumber');
						uni.reLaunch({
							url: "/pages_tool/login/login"
						})
					},
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.view {
		padding: 30rpx;

		.card {
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 24rpx;
			padding: 10rpx 30rpx;

			.row {
				padding: 30rpx 0 30rpx 0;
				display: flex;

				.left {
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					color: #333333;
				}

				.right {
					flex: 1;
					text-align: right;

					image {
						width: 32rpx;
						height: 32rpx;
					}
				}

			}
		}

		.btnBox {
			position: fixed;
			bottom: 76rpx;
			// height: 92rpx;
			width: calc(100% - 60rpx);

			.btn+.btn {
				margin-top: 40rpx;
			}

			.btn {
				width: 100%;
				height: 92rpx;
				background: #FFFFFF;
				border-radius: 24rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;

			}
		}

	}
</style>