部分userInfo信息传递
InstallationAgreement.vue->signature.vue
This commit is contained in:
parent
b88d42f2dd
commit
d877c68f8e
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user