Files
app-govern/pages/mine/deleteUser.vue

69 lines
1.9 KiB
Vue
Raw Normal View History

2023-10-26 09:03:16 +08:00
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="index">
<view>成功注销后所有的账号信息将会被删除且无法找回原账号将无法登陆请谨慎操作</view>
<view class="btn-wrap">
<view class="btn-wrap-item" @click="submit"> 注销</view>
</view>
</view>
</view>
</Cn-page>
</template>
<script>
import { apiDeleteUser } from '@/common/api/user.js'
export default {
data() {
return {
loading: false,
}
},
methods: {
submit() {
uni.showModal({
title: '注销提示',
content: '确认注销账号吗?',
success: (res) => {
if (res.confirm) {
apiDeleteUser().then((res) => {
uni.showToast({
title: '注销成功',
icon: 'none',
})
setTimeout(() => {
uni.reLaunch({
url: `/pages/user/login`,
})
}, 1000)
})
}
},
})
},
},
}
</script>
<style lang="scss">
.index {
padding: 34rpx;
font-size: 28rpx;
.btn-wrap {
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
.btn-wrap-item {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background: $uni-theme-color;
color: #fff;
height: 80rpx;
border-radius: 12rpx;
}
}
}
</style>