Files
frontend-app/pages/rwa_package/outCode/outCode.vue
T
2026-07-23 14:00:03 +08:00

155 lines
3.5 KiB
Vue

<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="注销账号" />
<view class="setting-view">
<view class="name-box">
<text class="text-zu text-38">请输入验证码</text>
<text class="text-fu text-28 mt-24" >验证码已发送至 {{userInfo && userInfo.mobile1}}</text>
<u-code-input size="40" focus disabledDot @finish="onCode" :maxlength="6" v-model="code" style="margin-top:32rpx"></u-code-input>
<view class="flex-c mt-32">
<view v-if="countdown" class="code-warp">
<up-count-down :time="60 * 1000" format="ss" @finish="countdown = false"></up-count-down>
<text style="margin-left: 10rpx;">s</text>
</view>
<view v-else @click="getMobileCode" class="code_msg">
获取验证码
</view>
</view>
</view>
</view>
<view class="bottom-btn">
<MyBtn text="确定注销" @ok="onOut"></MyBtn>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import { getUserList } from '@/api/common.js';
import { getUserInfo,deleteAccount } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import { clear } from '@/utils/auth.js';
import CryptoJS from 'crypto-js';
import MyBtn from '@/components/common/my-btn.vue'
import func from '@/utils/func.js';
export default {
components: { Header, TopSafe,MyBtn },
data() {
return {
userInfo: null,
code:'',
countdown:false
};
},
onShow() {
},
onLoad() {
this.init();
// this.userinfo();
},
methods: {
init() {
this.userinfo()
},
onCode(){
},
async getMobileCode() {
this.countdown = true;
const params = {
mobile: this.userInfo.mobile,
type: this.type == '1' ? 'tradepw' : 'passwd'
}
const response = await getUserList(params);
if (response && response.bizcode === 100) {
this.$refs.uToastRef.show({
type: 'success',
message: response.msg,
});
} else {
this.countdown = false;
}
},
userinfo() {
getUserInfo().then(res => {
if (res.bizcode == 100) {
this.userInfo = res.data;
this.userInfo.mobile1 = this.userInfo.mobile.replace(this.userInfo.mobile.substring(3,7),'****')
}
})
}
}
}
</script>
<style lang="scss" scoped>
.bottom-btn{
width: 100%;
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));
display: flex;
flex-direction: column;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.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%;
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%;
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;
}
}
}
</style>