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

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', url: '/app/agreement/isSignHhrxy',
}) })
} }
export function getProtocol(id) {
return request({
url: '/app/agreementTemplate/getById',
method: 'GET',
id,
})
}

View File

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

View File

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

View File

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

View File

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

View File

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