lease页面安装协议跳转逻辑
This commit is contained in:
parent
d877c68f8e
commit
74051e4831
45
api/protocol/protocol.js
Normal file
45
api/protocol/protocol.js
Normal file
|
|
@ -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',
|
||||
})
|
||||
}
|
||||
|
|
@ -104,7 +104,10 @@
|
|||
<text v-if="hasAgreed">✓</text>
|
||||
</view>
|
||||
<!-- <text class="text">去签署</text>-->
|
||||
<text class="link" @click="goToInstallationProtocol">去签署《安装协议》</text>
|
||||
<text v-if="!hasAgreed" class="link" @click="goToInstallationProtocol"
|
||||
>去签署《安装协议》
|
||||
</text>
|
||||
<text v-else class="link" @click="goToInstallationProtocol">已签署《安装协议》</text>
|
||||
</view>
|
||||
|
||||
<view class="payment-details">
|
||||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<script>
|
||||
import { tempUrlToRealUrl } from '../../utils/tempUrl-to-realUrl'
|
||||
import { postProtocolPartner } from '../../api/protocol/protocol'
|
||||
import { postProtocolInstallation } from '../../api/protocol/protocol'
|
||||
|
||||
export default {
|
||||
onLoad(options) {
|
||||
|
|
@ -31,7 +31,6 @@ export default {
|
|||
location: decodeURIComponent(options.location || ''),
|
||||
businessLicenseUrl: decodeURIComponent(options.businessLicenseUrl || ''),
|
||||
signatureUrl: decodeURIComponent(options.signatureUrl || ''),
|
||||
templateId: 1,
|
||||
// 其他字段...
|
||||
}
|
||||
},
|
||||
|
|
@ -75,7 +74,7 @@ export default {
|
|||
console.log('签名上传成功')
|
||||
//uni.showToast({ title: '签名上传成功', icon: 'success' })
|
||||
console.log('表单数据:', this.userInfo)
|
||||
let resProtocolPartner = await postProtocolPartner(this.userInfo)
|
||||
let resProtocolPartner = await postProtocolInstallation(this.userInfo)
|
||||
this.resProtocolPartnerUrl = resProtocolPartner.msg
|
||||
uni.hideLoading()
|
||||
uni.downloadFile({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user