优化协议签署,使用动态协议路径

This commit is contained in:
WindowBird 2025-09-15 17:23:09 +08:00
parent d31c791394
commit d48615c30c
6 changed files with 24 additions and 10 deletions

View File

@ -43,3 +43,11 @@ export function isSignProtocolPartner() {
url: '/app/agreement/isSignHhrxy',
})
}
export function getProtocol(id) {
return request({
url: '/app/agreementTemplate/getById',
method: 'GET',
id,
})
}

View File

@ -76,6 +76,7 @@
<script>
import { tempUrlToRealUrl } from '../../utils/tempUrl-to-realUrl'
import { getProtocol } from '../../api/protocol/protocol'
export default {
onLoad() {
@ -91,7 +92,7 @@ export default {
location: '',
businessLicenseUrl: '',
signatureUrl: '',
templateId: '1',
templateId: '2',
},
rules: {
@ -139,9 +140,10 @@ export default {
}
},
methods: {
openProtocol() {
async openProtocol() {
let res = await getProtocol(this.userInfo.templateId)
uni.downloadFile({
url: 'https://api.ccttiot.com/安装协议(准备好)-1757570264575.pdf',
url: res.data.templeUrl,
success: function (res) {
var filePath = res.tempFilePath
uni.openDocument({

View File

@ -417,7 +417,8 @@ export default {
confirmText: '确定',
success: () => {
//
this.resetForm()
// this.resetForm()
uni.navigateBack()
},
})
} else {

View File

@ -45,6 +45,8 @@
</template>
<script>
import { getProtocol } from '../../api/protocol/protocol'
export default {
onLoad() {
// this.openProtocol()
@ -59,7 +61,7 @@ export default {
location: '',
businessLicenseUrl: '',
signatureUrl: '',
templateId: '2',
templateId: '1',
},
rules: {
@ -95,9 +97,10 @@ export default {
}
},
methods: {
openProtocol() {
async openProtocol() {
let res = await getProtocol(this.userInfo.templateId)
uni.downloadFile({
url: 'https://api.ccttiot.com/hhrxy-1757582246358.pdf',
url: res.data.templeUrl,
success: function (res) {
var filePath = res.tempFilePath
uni.openDocument({

View File

@ -81,9 +81,9 @@ export default {
title: '正在生成协议',
mask: 'true',
})
if (this.userInfo.templateId === '1') {
if (this.userInfo.templateId === '2') {
this.resProtocol = await postProtocolInstallation(this.userInfo)
} else if (this.userInfo.templateId === '2') {
} else if (this.userInfo.templateId === '1') {
this.resProtocol = await postProtocolPartner(this.userInfo)
}

View File

@ -20,7 +20,7 @@ const ENV_CONFIG = {
// 正式版
// baseUrl: 'https://chu.chuangtewl.com/prod-api',
// baseUrl: 'http://192.168.2.100:4601',
baseUrl: 'https://chu.chuangtewl.com/prod-api',
baseUrl: 'http://192.168.2.100:4601',
appId: 1,
},
}