<template xmlns="">
|
<view class="setting-container">
|
<view class="setting-list">
|
<uv-cell-group>
|
<uv-cell @click="toProtocol('A')" title="用户协议" :isLink="true"></uv-cell>
|
<uv-cell @click="toProtocol('B')" title="用户隐私协议" :isLink="true"></uv-cell>
|
<uv-cell @click="toProtocol('C')" title="关于我们" :isLink="true"></uv-cell>
|
<uv-cell @click="handleShowDeleteConfirm" title="自动注销" :isLink="true"></uv-cell>
|
</uv-cell-group>
|
<!-- 设置项列表 -->
|
|
</view>
|
|
<view class="but">
|
|
<uv-button @click="toLogin" shape="circle" type="primary" text="退出登录"></uv-button>
|
</view>
|
</view>
|
</template>
|
|
<script >
|
import {logoutUser} from '@/api/modules/user'
|
export default defineComponent({
|
methods: {
|
toLogin(){
|
uni.reLaunch({
|
url: '/pages/login/index'
|
})
|
},
|
toProtocol(flg) {
|
let obj = {
|
"A":{
|
title: '用户注册协议',
|
code: this.$Protocol.user
|
},
|
"B":{
|
title: '用户隐私协议',
|
code: this.$Protocol.privacy
|
},
|
"C":{
|
title: '关于我们',
|
code: this.$Protocol.about
|
},
|
"D":{
|
title: '自动注销',
|
code: 'AUTO_CANCEL_APP_KD'
|
}
|
};
|
const code = obj[flg]['code'];
|
const title = obj[flg]['title'];
|
console.log(code);
|
uni.navigateTo({
|
url: `/pages/protocol/index?code=${code}&title=${title}`
|
})
|
},
|
|
async handleDeleteUser() {
|
logoutUser().then(res=>{
|
uni.showToast({
|
title: '注销成功',
|
icon: 'none',
|
duration: 1000,
|
})
|
uni.clearStorageSync();
|
setTimeout(() => {
|
|
uni.reLaunch({
|
url: '/pages/login/index'
|
})
|
|
}, 300)
|
})
|
|
},
|
handleShowDeleteConfirm() {
|
uni.showModal({
|
title: '提示',
|
content: '注销后,您的所有信息将会被删除且无法恢复。确认注销吗?',
|
confirmText: '确认',
|
cancelText: '取消',
|
success: (res) => {
|
if (res.confirm) {
|
this.handleDeleteUser()
|
}
|
},
|
})
|
},
|
},
|
name: "index"
|
})
|
|
|
|
|
</script>
|
|
<style lang="scss">
|
.setting-container {
|
background-color: #f5f5f5;
|
}
|
|
.setting-list {
|
background-color: #ffffff;
|
}
|
|
|
|
.item-text {
|
font-size: 28rpx;
|
color: #333333;
|
}
|
.but{
|
position: fixed;
|
bottom: 100rpx;
|
width: 100%;
|
padding: 0 60rpx;
|
|
:deep(.uv-button) {
|
height: 100rpx;
|
background-color: #4766FE !important;
|
border-color: #4766FE !important;
|
font-size: 28rpx;
|
}
|
}
|
|
|
</style>
|