部分userInfo信息传递
InstallationAgreement.vue->signature.vue
This commit is contained in:
parent
b88d42f2dd
commit
d877c68f8e
|
|
@ -190,7 +190,9 @@ export default {
|
||||||
// 这里可以添加实际的提交逻辑
|
// 这里可以添加实际的提交逻辑
|
||||||
console.log('表单数据:', this.userInfo)
|
console.log('表单数据:', this.userInfo)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/signature/signature',
|
url: `/pages/signature/signature?${Object.entries(this.userInfo)
|
||||||
|
.map(([key, val]) => `${key}=${encodeURIComponent(val)}`)
|
||||||
|
.join('&')}`,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(errors => {
|
.catch(errors => {
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,29 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { tempUrlToRealUrl } from '../../utils/tempUrl-to-realUrl'
|
import { tempUrlToRealUrl } from '../../utils/tempUrl-to-realUrl'
|
||||||
|
import { postProtocolPartner } from '../../api/protocol/protocol'
|
||||||
|
|
||||||
export default {
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: 'Hello',
|
title: 'Hello',
|
||||||
penColor: 'white',
|
penColor: 'black',
|
||||||
penSize: 5,
|
penSize: 5,
|
||||||
url: '',
|
url: '',
|
||||||
openSmooth: true,
|
openSmooth: true,
|
||||||
signatureUrl: '',
|
resProtocolPartnerUrl: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -44,7 +57,7 @@ export default {
|
||||||
// 是否为空画板 无签名
|
// 是否为空画板 无签名
|
||||||
console.log('签名返回是否为空', res.isEmpty)
|
console.log('签名返回是否为空', res.isEmpty)
|
||||||
if (res.isEmpty) {
|
if (res.isEmpty) {
|
||||||
this.signatureUrl = ''
|
this.userInfo.signatureUrl = ''
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,11 +65,30 @@ export default {
|
||||||
// H5 生成的是base64
|
// H5 生成的是base64
|
||||||
this.tempUrl = res.tempFilePath
|
this.tempUrl = res.tempFilePath
|
||||||
console.log('临时路径', 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.userInfo.signatureUrl)
|
||||||
console.log('签名路径', this.signatureUrl)
|
|
||||||
console.log('签名上传成功')
|
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
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user