feat:新增退出

This commit is contained in:
2026-09-02 09:14:01 +08:00
parent e9f07e8ede
commit 469451232a
4 changed files with 103 additions and 95 deletions
+40 -34
View File
@@ -19,18 +19,19 @@
<text class="text-zi" @click="onJump">《信任桥账号注销协议》</text>
</text>
</view>
</view>
<view class="bottom-btn">
<MyBtn text="已清楚风险,确定注销" @ok="onZhu"></MyBtn>
</view>
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm" :content='content'></u-modal>
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm"
:content='content'></u-modal>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import { getUserInfo,updateName,deleteAccount } from '@/api/auth.js';
import { getUserInfo, updateName, deleteAccount } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import { clear } from '@/utils/auth.js';
import TopSafe from '@/components/common/top-safe.nvue'
@@ -38,13 +39,13 @@ import MyBtn from '@/components/common/my-btn.vue'
import func from '@/utils/func.js';
export default {
components: { Header, TopSafe,MyBtn },
components: { Header, TopSafe, MyBtn },
data() {
return {
userInfo: null,
inputText:'',
tipsShow:false,
content:'是否确定注销账号?'
inputText: '',
tipsShow: false,
content: '是否确定注销账号?'
};
},
onShow() {
@@ -57,35 +58,35 @@ export default {
init() {
this.userinfo()
},
onJump(){
onJump() {
uni.navigateTo({
url:'/pages/rwa_package/outAgreement/outAgreement'
url: '/pages/rwa_package/outAgreement/outAgreement'
})
},
onZhu(){
onZhu() {
this.tipsShow = true;
},
onConfirm(){
onConfirm() {
// uni.navigateTo({
// url:'/pages/rwa_package/outCode/outCode'
// })
this.onCancel();
deleteAccount().then(res=>{
deleteAccount().then(res => {
if (res.bizcode == 100) {
clear()
this.$refs.uToastRef.show({
type: 'success',
message: "注销成功",
});
setTimeout(()=>{
setTimeout(() => {
uni.redirectTo({
url:'/pages/login_package/login/login'
url: '/pages/login_package/login/login'
})
},2000)
}, 1000)
}
})
},
onCancel(){
onCancel() {
this.tipsShow = false;
},
userinfo() {
@@ -101,17 +102,18 @@ export default {
</script>
<style lang="scss" scoped>
.bottom-btn{
.bottom-btn {
width: 100%;
margin-bottom:92rpx;
margin-bottom: 92rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - 92rpx - 88rpx - var(--status-bar-height));
@@ -122,45 +124,49 @@ export default {
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.name-box{
width:100%;
.name-box {
width: 100%;
border-radius: 16rpx;
display: flex;
flex-direction: column;
background-color: #fff;
padding: 64rpx 32rpx;
box-sizing: border-box;
margin-top:24rpx;
.mid-view{
width:100%;
margin-top: 24rpx;
.mid-view {
width: 100%;
padding: 40rpx 32rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
border:2rpx solid #eaeaea;
border: 2rpx solid #eaeaea;
border-radius: 16rpx;
margin-top:48rpx;
margin-top: 48rpx;
}
.top-view{
width:100%;
.top-view {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.input-view{
.input-view {
border-radius: 20rpx;
margin-top:52rpx;
width:100%;
margin-top: 52rpx;
width: 100%;
padding: 0 32rpx;
min-height:104rpx;
min-height: 104rpx;
display: flex;
flex-direction: row;
align-items: center;
background-color: #f5f5f5;
box-sizing: border-box;
}
}
}
</style>