部分userInfo信息传递

InstallationAgreement.vue->signature.vue
This commit is contained in:
WindowBird 2025-09-12 11:30:53 +08:00
parent b88d42f2dd
commit d877c68f8e
2 changed files with 41 additions and 7 deletions

View File

@ -190,7 +190,9 @@ export default {
//
console.log('表单数据:', this.userInfo)
uni.navigateTo({
url: '/pages/signature/signature',
url: `/pages/signature/signature?${Object.entries(this.userInfo)
.map(([key, val]) => `${key}=${encodeURIComponent(val)}`)
.join('&')}`,
})
})
.catch(errors => {

View File

@ -20,16 +20,29 @@
<script>
import { tempUrlToRealUrl } from '../../utils/tempUrl-to-realUrl'
import { postProtocolPartner } from '../../api/protocol/protocol'
export default {
onLoad(options) {
this.userInfo = {
name: decodeURIComponent(options.name || ''),
code: decodeURIComponent(options.code || ''),
phone: decodeURIComponent(options.phone || ''),
location: decodeURIComponent(options.location || ''),
businessLicenseUrl: decodeURIComponent(options.businessLicenseUrl || ''),
signatureUrl: decodeURIComponent(options.signatureUrl || ''),
templateId: 1,
// ...
}
},
data() {
return {
title: 'Hello',
penColor: 'white',
penColor: 'black',
penSize: 5,
url: '',
openSmooth: true,
signatureUrl: '',
resProtocolPartnerUrl: '',
}
},
methods: {
@ -44,7 +57,7 @@ export default {
//
console.log('签名返回是否为空', res.isEmpty)
if (res.isEmpty) {
this.signatureUrl = ''
this.userInfo.signatureUrl = ''
return
}
@ -52,11 +65,30 @@ export default {
// H5 base64
this.tempUrl = res.tempFilePath
console.log('临时路径', res.tempFilePath)
uni.showLoading({
title: '签名上传中',
mask: 'true',
})
this.userInfo.signatureUrl = await tempUrlToRealUrl(res.tempFilePath)
this.signatureUrl = await tempUrlToRealUrl(res.tempFilePath)
console.log('签名路径', this.signatureUrl)
console.log('签名路径', this.userInfo.signatureUrl)
console.log('签名上传成功')
uni.showToast({ title: '签名上传成功', icon: 'success' })
//uni.showToast({ title: '', icon: 'success' })
console.log('表单数据:', this.userInfo)
let resProtocolPartner = await postProtocolPartner(this.userInfo)
this.resProtocolPartnerUrl = resProtocolPartner.msg
uni.hideLoading()
uni.downloadFile({
url: this.resProtocolPartnerUrl,
success: function (res) {
var filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {},
})
},
})
},
})
return