<template>
	<view class=" padding-lr">
		<!-- <view class="flex  padding-tb" @click="goNav('/pages/public/pwd')">
			<view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
			<image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
			</image>
		</view> -->
		<view class="flex  padding-tb" @click="goNav('/pages/riderMy/trainingList')">
			<view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
			<image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
			</image>
		</view>
		<view class="flex  padding-tb" @click="goNav('/pages/riderMy/set/xieyi')">
			<view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
			<image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
			</image>
		</view>
		<view class="flex  padding-tb" @click="goNav('/pages/riderMy/set/mimi')">
			<view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
			<image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
			</image>
		</view>
		<view class="flex  padding-tb" @click="goNav('/pages/riderMy/set/about')">
			<view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
			<image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
			</image>
		</view>
		<view class="btn" @click="TuiLogin">退出登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userId: ""
			}
		},
		onLoad() {
			this.userId = uni.getStorageSync('userId')
		},
		methods: {
			goNav(e) {
				uni.navigateTo({
					url: e
				})
			},
			//退出登录
			TuiLogin() {
				let that = this

				if (that.userId) {
					uni.showModal({
						title: '提示',
						content: '确认退出登录吗?',
						success: function(res) {
							if (res.confirm) {
								uni.removeStorageSync('userId')
								uni.removeStorageSync('token')
								uni.removeStorageSync('avatar')
								uni.removeStorageSync('nickName')
								uni.removeStorageSync('phone')
								uni.removeStorageSync('invitationCode')
								uni.removeStorageSync('inviterCode')
								uni.removeStorageSync('platform')
								uni.removeStorageSync('sex')
								uni.removeStorageSync('zhiFuBao')
								uni.removeStorageSync('zhiFuBaoName')
								uni.removeStorageSync('checkCertification')

								// uni.navigateBack()
								uni.redirectTo({
									url:'/pages/index/index'
								})
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				} else {
					uni.showModal({
						title: '提示',
						content: '您还未登录,请先登录',
						success: function(res) {
							if (res.confirm) {
								console.log('用户点击确定');
								uni.navigateTo({
									url: '/pages/my/loginphone'
								})
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					})
				}


			},
		}

	}
</script>

<style>
	page {
		background: #FFFFFF;
	}

	.btn {
		width: 100%;
		height: 80upx;
		background: #FF6A04;
		color: #FFFFFF;
		border-radius: 6upx;
		text-align: center;
		line-height: 80upx;
		margin-top: 40upx;
		font-size: 34upx;
		/* color: #fff; */
	}
</style>
