<template>
	<view style="display: flex;flex-direction: column;">
		<text class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="top: 10rpx;"></text>
		<view>
			<menu-list v-if="menuList != 'undefined '" :menuList="minorMenuLists"></menu-list>
		</view>
		<view class="footer">
			<view class="foter-btn">
				<button class="btn" @click="outLing()">退出登录</button>
			</view>
			
		</view>
	</view>

</template>

<script>
import  MenuList from "@/components/menuList/menuList.vue"
	
	export default {
		components:{ MenuList },
		data() {
			return {
				menuList:null,
				minorMenuLists: [{
						title: '账号绑定设置',
						icon: 'shareEcode',
						link: '/pages/personalCenter/system/accontsetting',
						isOpen: true,
						isShow: true,
						isTips: false,
					},
					{
						title: '清除缓存',
						icon: 'card',
						link: '',
						isOpen: true,
						isShow: true,
						isTips: true,
					},
					{
						title: '关于CFFP财富中心',
						icon: 'myCertify',
						link: '/pages/personalCenter/accountoperation/aboutcffp',
						isOpen: true,
						isShow: true,
						isTips: false,
					},
				]
			}
		},
		destroyed() {
			uni.hideToast();
		},
		methods:{
			goBack(){
				uni.switchTab({
					url: '/pages/personalCenter/personalCenter'
				});
			},
			outLing(){
				uni.showModal({
					title: '退出登录',
					content: '确定要退出登录吗?',
					showCancel: true,
					success: function(res) {
						if (res.confirm) {
							console.log(getCurrentPages().length)
								uni.redirectTo({
									url:'/components/login/login'
								})
								try {
								    uni.clearStorageSync();
								} catch (e) {
									console.log(e)
								    // error
								}
							uni.showToast({
								title: '操作成功',
								icon: 'none'
							});
						} else {
							console.log('已取消')
						}
					}
				});
			},
		},
		
	}
</script>

<style scoped>
	.footer{
		width: 100vw;
		position: fixed;
		bottom: 40rpx;
	}
	.foter-btn{
		padding: 0 20rpx;
	}
	.btn{
		background:  #20269B;
		border-radius: 40rpx;
	}
</style>
