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 @@