<template>
	<view class="set">
		<view class="" @click="$goBack(2,'/pages/my/cell')">
			修改手机号
		</view>
		<view class="" @click="$goBack(2,'/pages/my/password')">
			修改密码
		</view>
		<view class="logout" @click="dialogToggle()">
			注销
		</view>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog type="warn" cancelText="关闭" confirmText="同意" title="提示" content="您确定要注销吗?"
				@confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},
		onLoad() {

		},
		methods: {
			dialogToggle() {
				this.$refs.alertDialog.open()
			},
			dialogConfirm() {
				uni.removeStorage({
					key: 'username'
				});
				uni.removeStorage({
					key: 'passwork'
				});
				uni.removeStorage({
					key: 'tokenInfo'
				});
				uni.reLaunch({
					url: '/pages/login/login'
				})
			},
			dialogClose() {
				this.$refs.alertDialog.open()
			},
		}
	}
</script>

<style lang="scss">
	.set {
		height: 100%;
		display: flex;
		flex-direction: column;
		background-color: #efefef;

		view {
			padding: 25rpx 0;
			text-align: center;
			background-color: #fff;
			border-bottom: 1rpx solid #c3c3c3;

			&:last-child {
				border-bottom: 0;
			}
		}

		.logout {
			color: #e40315;
			font-weight: bold;
			font-size: 32rpx;
		}
	}
	
</style>