This commit is contained in:
2025-10-10 13:41:42 +08:00
parent a2faab2646
commit f1f65961dd
33 changed files with 4424 additions and 119 deletions
+88 -79
View File
@@ -1,84 +1,102 @@
<template>
<view class="content">
<TopSafe bgColor="rgba(0,0,0,0)"></TopSafe>
<Header title="注销账号" bgColor="rgba(0,0,0,0)" />
<Header title="账户管理" bgColor="rgba(0,0,0,0)" />
<view class="setting-view">
<view class="tab-view">
<view class="tab-list" v-for="(item,index) in tabList" :key="index" @click="onTab(index)">
<text class="text-fu text-28" :style="{color:type == index ? '#7934F6' :'#666' }">{{item}}</text>
<view class="tab-line" v-if="type == index"></view>
</view>
</view>
<view class="mid-view">
<AccountItem :type="type" :itemData="item" @ok="onItemOk" v-for="(item,index) in dataList" :key="index"></AccountItem>
</view>
</view>
<view class="bottom-btn">
<MyBtn text="已清楚风险,确定注销" @ok="onZhu"></MyBtn>
<MyBtn :text="type == 0 ? '添加支付宝账户' : '添加微信账户'" @ok="onJump"></MyBtn>
</view>
<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 { getWithdraw,unbindWithdraw } from '@/api/common.js';
import Header from '@/components/common/header.vue';
import { clear } from '@/utils/auth.js';
import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import func from '@/utils/func.js';
import AccountItem from './components/account-item.vue'
export default {
components: { Header, TopSafe,MyBtn },
components: { Header, TopSafe,MyBtn,AccountItem },
data() {
return {
userInfo: null,
inputText:'',
tipsShow:false,
content:'是否确定注销账号?'
type:0,
tabList:['支付宝账户','微信账户'],
dataList:[]
};
},
onShow() {
},
onLoad() {
this.init();
// this.userinfo();
},
methods: {
init() {
this.userinfo()
// this.userinfo()
// #ifdef WEB
this.tabList = ['支付宝账户'];
// #endif
this.getList();
},
onItemOk(item){
let params = {
bindId:item.id
}
unbindWithdraw(params).then(res=>{
if (res.bizcode === 100) {
this.$refs.uToastRef.show({
type: 'success',
message:'解绑成功',
});
this.init();
return null;
} else {
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
return null;
}
})
},
getList(){
getWithdraw({platform:this.type == 0?1:2}).then(res=>{
if (res.bizcode === 100) {
this.dataList = res.data;
this.dataList.forEach(item=>{
item.name = item.accountName;
item.account = item.accountNumber;
})
} else {
this.$refs.uToastRef.show({
type: 'error',
message: res.msg,
});
return null;
}
})
},
onTab(index){
if(index != this.type){
this.type = index;
this.init();
}
},
onJump(){
uni.navigateTo({
url:'/pages/rwa_package/setting/out-agreement'
})
},
onZhu(){
this.tipsShow = true;
},
onConfirm(){
// uni.navigateTo({
// url:'/pages/rwa_package/setting/out-code'
// })
this.onCancel();
deleteAccount().then(res=>{
if (res.bizcode == 100) {
clear()
this.$refs.uToastRef.show({
type: 'success',
message: "注销成功",
});
setTimeout(()=>{
uni.redirectTo({
url:'/pages/login_package/login/login'
})
},2000)
}
})
},
onCancel(){
this.tipsShow = false;
},
userinfo() {
getUserInfo().then(res => {
if (res.bizcode == 100) {
this.userInfo = res.data;
this.inputText = this.userInfo.nickname;
}
url:`/pages/rwa_package/account/bind?type=${this.type}`
})
}
}
@@ -107,43 +125,34 @@ export default {
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.name-box{
.mid-view{
width:100%;
border-radius: 16rpx;
height:calc(100% - 88rpx);
display: flex;
flex-direction: column;
background-color: #fff;
padding: 64rpx 32rpx;
overflow-y: auto;
padding-bottom: 24rpx;
box-sizing: border-box;
margin-top:24rpx;
.mid-view{
width:100%;
padding: 40rpx 32rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
border:2rpx solid #eaeaea;
border-radius: 16rpx;
margin-top:48rpx;
}
.top-view{
width:100%;
}
.tab-view{
width:100%;
height:88rpx;
display: flex;
flex-direction: row;
// align-items: center;
.tab-list{
margin-right:32rpx;
height:55rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.input-view{
border-radius: 20rpx;
margin-top:52rpx;
width:100%;
padding: 0 32rpx;
min-height:104rpx;
display: flex;
flex-direction: row;
align-items: center;
background-color: #f5f5f5;
box-sizing: border-box;
justify-content: space-between;
.tab-line{
width:50rpx;
height:4rpx;
min-height:4rpx;
background-color: #7934F6;
}
}
}