<template>
	<view class="content">
		<u-cell-group>
			<u-cell size="large" title="邀请与推广" :isLink="true" @click="toinvite"></u-cell>
			<u-cell size="large" title="账号安全" :isLink="true" @click="toaccount"></u-cell>
			<u-cell size="large" title="推送通知" :isLink="true" @click="totuisong"></u-cell>
			<u-cell size="large" title="用户协议" :isLink="true" @click="toxieyi('user')"></u-cell>
			<u-cell size="large" title="隐私政策" :isLink="true" @click="toxieyi('yinsi')"></u-cell>
			<u-cell size="large" title="个人信息收集清单" :isLink="true" @click="toxieyi('geren')"></u-cell>
			<u-cell size="large" title="开源软件声明" :isLink="true" @click="toxieyi('shengming')"></u-cell>
			<u-cell size="large" title="错误反馈" :isLink="true" @click="toerror"></u-cell>
			<u-cell size="large" title="清除缓存" :isLink="true" @click="toclean"></u-cell>
			<u-cell size="large" title="软件更新" :value="version" :isLink="false"></u-cell>
			<u-cell size="large" title="关于忆象" :isLink="true" @click="toabout"></u-cell>
		</u-cell-group>
		<view class="btn" @click="exit">
			退出登录
		</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	export default {
		data() {
			return {
				version: ''
			}
		},
		onLoad() {
			this.version = plus.runtime.version;
		},
		methods: {
			exit() {
				uni.showModal({
					title: '提示',
					content: '是否确定退出登录',
					success: function(res) {
						if (res.confirm) {
							uni.removeStorageSync('token')
							uni.removeStorageSync('userid')
							uni.$u.toast('您已退出登录');
							uni.reLaunch({
								url: '/pages/login/index'
							})
						} else if (res.cancel) {

						}
					}
				});
			},
			toxieyi(type) {
				uni.navigateTo({
					url: '/pageC/xieyi?type=' + type
				})
			},
			toclean() {
				uni.clearStorageSync();
			},
			totuisong() {
				uni.navigateTo({
					url: '/pageC/tuisong'
				})
			},
			toabout() {
				uni.navigateTo({
					url: '/pageC/about'
				})
			},
			toerror() {
				uni.navigateTo({
					url: '/pageC/error'
				})
			},
			toaccount() {
				uni.navigateTo({
					url: '/pageC/account'
				})
			},
			toinvite() {
				uni.navigateTo({
					url: '/pageC/invite-list'
				})
			},
		}
	}
</script>

<style lang="scss">
	.content {
		background: #FFFFFF;
		padding: 0 24rpx;

		.btn {
			width: 702rpx;
			height: 88rpx;
			background: #00B0B0;
			border-radius: 44rpx;
			font-size: 32rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 88rpx;
			text-align: center;
			margin: 62rpx 0 0;
		}
	}
</style>