实名相关更新

This commit is contained in:
GaoHao
2025-01-08 19:56:39 +08:00
parent 7cbadc5638
commit 84c66e6529
4 changed files with 344 additions and 88 deletions

View File

@@ -0,0 +1,155 @@
<template>
<view class="containerView">
<up-cell-group label-width="80" :border="false">
<up-cell :label-style="{ width: '100rpx' }" title="姓名">
<template #right-icon> <up-input border="none" v-model="data.certName" placeholder="请输入姓名"></up-input> </template>
</up-cell>
<up-cell title="身份证号码">
<template #right-icon> <up-input border="none" v-model="data.certNum" placeholder="请输入身份证号码"></up-input> </template>
</up-cell>
<up-cell title="银行卡号码">
<template #right-icon> <up-input border="none" v-model="data.accountNo" placeholder="请输入银行卡号码"></up-input> </template>
</up-cell>
<up-cell title="手机号">
<template #right-icon> <up-input border="none" v-model="data.mobile" placeholder="请输入银行预留号码"></up-input> </template>
</up-cell>
</up-cell-group>
<button class="confirm-btn" @click="toLogin"
:disabled="data.logining">认证</button>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的银行卡号和真实的收款人姓名</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">手机号需是银行卡银行卡预留手机号</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">银行卡号需与收款人姓名一致</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;;margin-bottom: 10rpx;">身份证信息仅可使用一次</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款请须知</view>
</view>
</template>
<script setup>
import { reactive, nextTick, ref } from 'vue';
import { onReady,onLoad,onShow } from '@dcloudio/uni-app'
import { updateUser } from '@/api/me/withdraw.js';
import { commonType } from '@/api/init.js';
let data = reactive({
certName: null,
mobile: null,
certNum: null,
accountNo: null,
logining: false
})
onLoad(() => {
data.certName = uni.getStorageSync('userInfo').certName;
data.mobile = uni.getStorageSync('userInfo').mobile;
data.certNum = uni.getStorageSync('userInfo').certNo;
data.accountNo = uni.getStorageSync('userInfo').accountNo;
})
function inputChange(e) {
const key = e.currentTarget.dataset.key;
data[key] = e.detail.value;
}
async function toLogin() {
if (!data.certName) {
uni.showToast({
title: '请设置收款人姓名',
icon: 'none'
})
} else if (!data.mobile) {
uni.showToast({
title: '请设置收款人支付宝账号',
icon: 'none'
})
} else if (!data.certNum) {
uni.showToast({
title: '请设置收款人支付宝账号',
icon: 'none'
})
} else if (!data.accountNo) {
uni.showToast({
title: '请设置收款人支付宝账号',
icon: 'none'
})
} else {
data.logining = true
let res = await updateUser({
certName: data.certName,
mobile: data.mobile,
certNum: data.certNum,
accountNo: data.accountNo.replace(/\s+/g, ''),
})
if( res) {
data.logining = false
let userInfo = uni.getStorageSync('userInfo')
userInfo.mobile = data.mobile
userInfo.mobile = data.mobile
userInfo.certNo = data.certNum
userInfo.accountNo = data.accountNo
uni.setStorageSync('userInfo', userInfo)
uni.showToast({
title: '修改成功',
icon: 'none',
complete() {
setTimeout(function() {
uni.navigateBack();
}, 1000)
}
})
}
}
}
</script>
<style lang='scss'>
page {
background: #FFFFFF;
}
.containerView {
padding:30rpx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
}
.confirm-btn1 {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 70upx;
/* background: whitesmoke; */
background: #ff7581;
color: #FFFFFF;
font-size: 32rpx;
&:after {
border: none;
}
}
.confirm-btn {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 70upx;
background: #ff7581;
color: #ffffff;
font-size: 32rpx;
border: none;
&:after {
border: none;
}
}
</style>