From 74051e48312cfe853d42dc0ff70b3b32d5aa5bbb Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Fri, 12 Sep 2025 12:03:18 +0800 Subject: [PATCH] =?UTF-8?q?lease=E9=A1=B5=E9=9D=A2=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/protocol/protocol.js | 45 +++++++++++++++++++++++++++++++++++ pages/lease/lease.vue | 27 +++++++++++++++++++-- pages/signature/signature.vue | 5 ++-- 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 api/protocol/protocol.js diff --git a/api/protocol/protocol.js b/api/protocol/protocol.js new file mode 100644 index 0000000..648447b --- /dev/null +++ b/api/protocol/protocol.js @@ -0,0 +1,45 @@ +import request from '../../utils/request' + +export function postProtocolPartner(userInfo) { + return request({ + url: '/app/agreement/hhrxy', + method: 'POST', + data: { + name: userInfo.name, + phone: userInfo.phone, + address: userInfo.location, + businessLicense: userInfo.businessLicenseUrl, + code: userInfo.code, + autographImg: userInfo.signatureUrl, + templateId: 1, + }, + }) +} + +export function postProtocolInstallation(userInfo) { + return request({ + url: '/app/agreement/azxy', + method: 'POST', + data: { + name: userInfo.name, + phone: userInfo.phone, + address: userInfo.location, + businessLicense: userInfo.businessLicenseUrl, + code: userInfo.code, + autographImg: userInfo.signatureUrl, + templateId: 2, + }, + }) +} + +export function isSignProtocolInstallation() { + return request({ + url: '/app/agreement/isSignAzxy', + }) +} + +export function isSignProtocolPartner() { + return request({ + url: '/app/agreement/isSignHhrxy', + }) +} diff --git a/pages/lease/lease.vue b/pages/lease/lease.vue index 287e827..68772dc 100644 --- a/pages/lease/lease.vue +++ b/pages/lease/lease.vue @@ -104,7 +104,10 @@ - 去签署《安装协议》 + 去签署《安装协议》 + + 已签署《安装协议》 @@ -182,6 +185,7 @@ import { createLeaseOrder, } from '@/api/lease/lease.js' import { checkLoginStatus } from '../../utils/checkLogin' +import { isSignProtocolInstallation } from '../../api/protocol/protocol' export default { name: 'LeasePage', @@ -198,6 +202,7 @@ export default { }, }, onShow() { + this.getIsSignProtocolInstallationOnshow() // if (!this.hasAgreed) { // uni.navigateTo({ // url: '/pages/InstallationAgreement/InstallationAgreement', @@ -205,7 +210,8 @@ export default { // } }, onLoad() { - this.goToInstallationProtocol() + this.getIsSignProtocolInstallation() + uni.authorize({ scope: 'scope.userLocation', success: function () { @@ -241,6 +247,23 @@ export default { } }, methods: { + async getIsSignProtocolInstallationOnshow() { + let res = await isSignProtocolInstallation() + console.log('res', res) + console.log('res.data', res.data) + this.hasAgreed = res.data + console.log('this.hasAgreed', this.hasAgreed) + }, + + async getIsSignProtocolInstallation() { + let res = await isSignProtocolInstallation() + console.log('res', res) + console.log('res.data', res.data) + this.hasAgreed = res.data + console.log('this.hasAgreed', this.hasAgreed) + this.goToInstallationProtocol() + }, + goToInstallationProtocol() { if (!this.hasAgreed) { uni.navigateTo({ diff --git a/pages/signature/signature.vue b/pages/signature/signature.vue index 008bc37..14500e3 100644 --- a/pages/signature/signature.vue +++ b/pages/signature/signature.vue @@ -20,7 +20,7 @@