<!-- 个人信息 -->
<template>
	<view class="aircraft-setting">
		<u-toast ref="uToast"></u-toast>
		<Loading :show="loading" />
	</view>
</template>

<script>
import configService from '@/common/config.service.js';
export default {
	// #ifdef MP
	options: {
		styleIsolation: 'shared'
	},
	// #endif
	data() {
		return {
			// #ifdef MP
			// 微信小程序自定义导航栏参数
			StatusBar: this.StatusBar || 0,
			CustomBarHeight: this.Custom.height+(this.Custom.top-this.StatusBar)*2 || 0,
			// #endif
			loading: true, // 加载
			
		}
	},
	
	computed:{
		
	},
	methods: {
		// 返回
		back() {
			uni.navigateBack();
		},
		// 提交申请
		async submit(e){
			
		},
		// 注销
		logout(){
			let that = this;
			uni.showModal({
				title: '注销',
				content: '是否确认退出登录？',
				confirmColor: '#94d500',
				success: async(res) => {
					if (res.confirm) {
						that.$u.vuex('vuex_token', '');
						that.$u.vuex('user_message', {});
						that.form = {};
						that.$api.logOut();
						// that.$emit('userLogOut');
						uni.navigateBack({complete() {
							setTimeout(()=>{
								uni.showToast({
									icon: 'none',title: '退出登录成功!'
								})
							},300);
						}})
					}
				}
			})
		}
	},
	onLoad(options) {
		try{
			this.form = JSON.parse(this.$store.state.user_message);
		}catch(e){
			this.form = {};
		}finally{
			this.loading = false;
		}
	},
}
</script>

<style scoped lang="scss">
.aircraft-setting {
}
</style>