<template>
	<uv-navbar :fixed="false" @leftClick="$onClickLeft" bgColor="#09b4f1">
		<template v-slot:left>
			<uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon>
		</template>
		<template v-slot:center>
			<text style="color:#ffffff">{{title}}</text>
		</template>
	</uv-navbar>
	<view class="bg-white">
		<uv-cell-group :border='false'>
			<!-- <uv-cell customStyle="padding:10rpx 0" title="修改个人信息" :isLink="true" arrow-direction="right"
				@click="gopage('/pages/components/pages/mine/edit')"></uv-cell>
			<uv-cell customStyle="padding:10rpx 0" title="修改密码" :isLink="true" arrow-direction="right"
				@click="gopage('/pages/components/pages/mine/pass')"></uv-cell> -->
			<uv-cell size="large" title="退出登录" :isLink="true" arrow-direction="right" @click="logout"></uv-cell>
		</uv-cell-group>
	</view>
</template>

<script setup>
	import {
		ref,
		computed
	} from 'vue'
	import {
		useMainStore
	} from '@/store/store'
	import {
		storeToRefs
	} from 'pinia'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		formatDateTime
	} from '@/utils/util'
	import {
		userLogout
	} from '@/api/auth'
	import {
		VUE_APP_UPLOAD_URL,
		TENANT_ID
	} from '@/config';
	const main = useMainStore()
	const {
		openid,
		lang
	} = storeToRefs(main)

	const title = ref('设置')
	const date = ref('')
	const member = ref({})

	onLoad(() => {
		member.value = main.member;
	})

	const logout = () => {
		uni.showModal({
			title: '提示',
			content: '确定退出吗？',
			success: async function(res) {
				if (res.confirm) {
					await userLogout()
					uni.showToast({
						title: '退出成功',
						icon: 'success',
						duration: 2000
					})
					setTimeout(() => {
						gopage('/pages/components/pages/login/login')
					}, 1500);

				}
			}
		});
	}

	const gopage = (url) => {
		uni.navigateTo({
			url
		})
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
	}

	.container {
		padding: 20rpx 30rpx;
	}

	.form {
		border-radius: 8rpx;
	}

	.form-input {
		.label {
			width: 160rpx;
			font-size: $font-size-base;
			color: $text-color-base;
		}

		.input {}

		.radio-group {
			display: flex;
			justify-content: flex-start;

			.radio {
				padding: 10rpx 30rpx;
				border-radius: 6rpx;
				border: 2rpx solid $text-color-assist;
				color: $text-color-assist;
				font-size: $font-size-base;

				&.checked {
					background-color: $color-primary;
					color: $text-color-white;
					border: 2rpx solid $color-primary;
				}
			}
		}
	}

	.btn-box {
		// height: calc((100vh - 40rpx) / 2);
	}

	.save-btn {
		width: 90%;
		border-radius: 50rem !important;
		font-size: $font-size-lg;
	}

	.logout-btn {
		width: 90%;
		border-radius: 50rem !important;
		font-size: $font-size-lg;
		background-color: rgb(237, 81, 29);
	}
</style>