diff --git a/pages/lease/lease.vue b/pages/lease/lease.vue index a24c7f6..d718e25 100644 --- a/pages/lease/lease.vue +++ b/pages/lease/lease.vue @@ -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