<template>
	<view>
		<view class="" style="text-align: center;font-size: 40rpx;">
			<text>注销手机号：</text>
			<text style="color: #20269B;">{{mobile}}</text>
		</view>
		<view class="" style="margin: 40rpx;">
			<text style="font-size: 28rpx;">注销账号后不可恢复，该账号绑定的所有权益、积分、记录等数据也将都被清空且无法恢复，包括：</text>
		</view>
		<view class="" style="margin: 20rpx 40rpx;color: #666666;">
			<p>1.所有积分权益不可使用</p>
			<p>2.已购买的课程无法观看</p>
			<p>3.已获得认证的证书无法查看</p>
			<p>4.学习数据将被清除</p>
		</view>
		<view class="footer" style="">
			<view class="footer-cancelbtn" style="" @click="cancel()">
				<text>取消</text>
			</view>
			<view class="footer-submitbtn" style="" @click="sunmit()">
				<text>确认</text>
			</view>
			
		</view>
	</view>
</template>

<script>
	import api from "../../../api/api";
	export default {
		data() {
			return {
				mobile:'',
				userId: uni.getStorageSync('cffp_userId')
			}
		},
		onLoad() {
			let dataForm = uni.getStorageSync('userinfodataForm')
			this.mobile = dataForm.mobile
		},
		destroyed() {
			uni.hideToast();
		},
		methods: {
			cancel(){
				uni.navigateBack({delta:1})
			},
			sunmit(){
				api.cancellation({userId: this.userId}).then(res =>{
					if(res['success']){
						uni.showToast({
							title: '操作成功',
							icon: 'none'
						});
						uni.redirectTo({
							url:'/components/login/login'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.footer{
		display: flex;justify-content: center;position: fixed;bottom: 40rpx;width: 100vw;
		.footer-submitbtn{
			text-align: center;
			line-height: 80rpx;
			width: 300rpx;
			height: 80rpx;
			border-radius: 20rpx;
			margin: 0 40rpx;
			color: #FFFFFF;
			background-color: #20269B;
			opacity: 1;
			border: 2rpx solid #20269B;
		}
		.footer-cancelbtn{
			text-align: center;
			line-height: 80rpx;
			width: 300rpx;
			height: 80rpx;
			border-radius: 20rpx;
			margin: 0 40rpx;
			opacity: 1;
			border: 2rpx solid #20269B;
		}
	}

</style>
