<template>
	<view>
		 <view class="info">
		 	<view class="title">
		 		请告诉我们注销账号的原因
		 	</view>
			<view class="item-box u-flex u-col-center u-row-between" @click="zhuxiao">
				<text class="text1" style="flex: 1;">重新注册/换绑手机号</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
			<view class="item-box u-flex u-col-center u-row-between"  @click="zhuxiao">
				<text class="text1" style="flex: 1;">找到伴侣不再使用了</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
			<view class="item-box u-flex u-col-center u-row-between"  @click="zhuxiao">
				<text class="text1" style="flex: 1;">其他原因</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
		 </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			zhuxiao(){
				var that=this
				uni.showModal({
					title: '账号注销提醒',
					content: '账号注销无法恢复，请谨慎操作',
					cancelColor:'#B1B1B1',
					cancelText:'确定注销',
					confirmColor:'#A890FE',
					confirmText:'我再想想',
					success: function (res) {
						if (res.confirm) {
							console.log('用户点击取消');
						} else if (res.cancel) {
							uni.$u.http.post('/api/user/user_cancellation').then(res => {
								if(res.code==1){
									that.$u.toast(res.msg)
									setTimeout(()=>{
										uni.clearStorageSync();
										uni.navigateTo({
											url:'./login'
										})
									},2000)
							
								}
							})
						}
					}
				});

			}
		}
	}
</script>

<style lang="scss">
	.item-box {
		background-color: #fff;
		padding: 30rpx 36rpx;
	
		.text1 {
			font-size: 28rpx;
			font-family: SF Pro;
			font-weight: 500;
			color: #444;
		}
	
		image {
			width: 116rpx;
			height: 116rpx;
			border-radius: 100rpx;
		}
	
		input {
			flex: 1;
			text-align: right;
		}
	}
	page{
		background-color: #F3F3F3;
	}
.info{
	background-color: #fff;
	padding: 0 50rpx;
	.title{
		font-size: 20rpx;
		color: #888888;
		height: 72rpx;
		line-height: 72rpx;
		border-bottom: 2rpx solid #F2F2F2;
	}
}
</style>
