添加租赁需要实名校验

This commit is contained in:
WindowBird 2025-09-15 17:37:52 +08:00
parent d48615c30c
commit 62ea84fd78

View File

@ -186,6 +186,7 @@ import {
} from '@/api/lease/lease.js'
import { checkLoginStatus } from '../../utils/checkLogin'
import { isSignProtocolInstallation } from '../../api/protocol/protocol'
import { getIsRealName } from '../../api'
export default {
name: 'LeasePage',
@ -224,6 +225,7 @@ export default {
},
data() {
return {
isRealName: false,
isLogin: false,
hasAgreed: false,
formData: {
@ -440,7 +442,33 @@ export default {
uni.$uv.debounce(this.handlePayment, 1000, true)
},
handlePayment() {
async goToRealName() {
const res = await getIsRealName()
if (!res.data) {
uni.showModal({
title: '提示',
content: '需要租赁,请先实名',
showCancel: true,
confirmText: '去实名',
cancelText: '暂不',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/realNameAuthentication/realNameAuthentication',
})
}
},
})
} else {
this.isRealName = true
}
},
async handlePayment() {
await this.goToRealName()
if (!this.isRealName) {
return
}
this.formData.payAmount = this.payAmount
if (checkLoginStatus()) {
return