merchapp/java-mall-app-shop-admin/pages/my/delUser.vue
2025-10-22 14:51:27 +08:00

75 lines
1.5 KiB
Vue

<template>
<view class="del_user">
<u-textarea
v-model="text"
placeholder="请填写注销理由"
class="area"
height="150"
count
></u-textarea>
<u-button
type="error"
text="提交申请"
class="btn"
@click="handleDelUser"
></u-button>
</view>
</template>
<script>
import { DelUser } from "@/api/shop.js";
export default {
data() {
return {
text: "",
};
},
methods: {
async handleDelUser() {
if (!this.text) {
uni.showToast({
title: `请填写理由`,
});
return false;
}
uni.showModal({
title: "账户安全提示",
content: `账号注销操作不可恢复,为了确保账号资金和个人信息安全,请谨慎操作,一旦注销账号,您的手机号和个人隐私信息将会自动解绑或清空数据,确定要注销账号吗?`,
success: async (res) => {
if (res.confirm) {
await DelUser({
cancelReason: this.text,
});
uni.showToast({
title: `账号已注销`,
});
setTimeout(() => {
this.$store.dispatch("user/LoginOut", true);
}, 2000);
}
},
});
},
},
};
</script>
<style lang="scss" scoped>
.del_user {
background: #fff;
margin: 20rpx;
padding: 20rpx;
.area {
border-bottom: 1px solid rgba(238, 238, 238, 0.5);
}
.btn {
margin-top: 40rpx;
margin-bottom: 12rpx;
}
}
</style>