From b5ef3056543cb31e91a808ea1cced0a3718b0a0e Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Thu, 11 Sep 2025 18:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=AE=89=E8=A3=85=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E4=BF=A1=E6=81=AF=E5=A1=AB=E5=86=99=E5=90=8E=E5=8E=BB?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=88=86=E6=AD=A5?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstallationAgreement.vue | 91 ++++++++++--------- pages/signature/signature.vue | 43 ++++++--- 2 files changed, 78 insertions(+), 56 deletions(-) diff --git a/pages/InstallationAgreement/InstallationAgreement.vue b/pages/InstallationAgreement/InstallationAgreement.vue index 3621beb..ebdbeb5 100644 --- a/pages/InstallationAgreement/InstallationAgreement.vue +++ b/pages/InstallationAgreement/InstallationAgreement.vue @@ -46,9 +46,9 @@ @@ -148,9 +148,7 @@ export default { }, }) }, - goToSignature() { - uni.navigateTo(/pages/) - }, + handleUploadSuccess(result) { console.log('图片上传成功:', result.url) this.userInfo.businessLicenseUrl = result.url @@ -170,13 +168,13 @@ export default { }) return } - if (this.userInfo.signatureUrl === '') { - uni.showToast({ - icon: 'error', - title: '请确认签名', - }) - return - } + // if (this.userInfo.signatureUrl === '') { + // uni.showToast({ + // icon: 'error', + // title: '请确认签名', + // }) + // return + // } // 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true this.$refs.form @@ -188,6 +186,9 @@ export default { }) // 这里可以添加实际的提交逻辑 console.log('表单数据:', this.userInfo) + uni.navigateTo({ + url: '/pages/signature/signature', + }) }) .catch(errors => { uni.showToast({ @@ -207,39 +208,39 @@ export default { hideKeyboard() { uni.hideKeyboard() }, - async onClick(type) { - if (type === 'openSmooth') { - this.openSmooth = !this.openSmooth - return - } - if (type === 'save') { - await this.$refs.signatureRef.canvasToTempFilePath({ - success: async res => { - // 是否为空画板 无签名 - console.log('签名返回是否为空', res.isEmpty) - if (res.isEmpty) { - this.userInfo.signatureUrl = '' - return - } - - // 生成图片的临时路径 - // H5 生成的是base64 - this.tempUrl = res.tempFilePath - console.log('临时路径', res.tempFilePath) - - this.userInfo.signatureUrl = await tempUrlToRealUrl(res.tempFilePath) - console.log('签名路径', this.userInfo.signatureUrl) - console.log('签名上传成功') - uni.showToast({ title: '签名上传成功', icon: 'success' }) - }, - }) - return - } - if (type === 'clear') { - this.userInfo.signatureUrl = '' - } - if (this.$refs.signatureRef) this.$refs.signatureRef[type]() - }, + // async onClick(type) { + // if (type === 'openSmooth') { + // this.openSmooth = !this.openSmooth + // return + // } + // if (type === 'save') { + // await this.$refs.signatureRef.canvasToTempFilePath({ + // success: async res => { + // // 是否为空画板 无签名 + // console.log('签名返回是否为空', res.isEmpty) + // if (res.isEmpty) { + // this.userInfo.signatureUrl = '' + // return + // } + // + // // 生成图片的临时路径 + // // H5 生成的是base64 + // this.tempUrl = res.tempFilePath + // console.log('临时路径', res.tempFilePath) + // + // this.userInfo.signatureUrl = await tempUrlToRealUrl(res.tempFilePath) + // console.log('签名路径', this.userInfo.signatureUrl) + // console.log('签名上传成功') + // uni.showToast({ title: '签名上传成功', icon: 'success' }) + // }, + // }) + // return + // } + // if (type === 'clear') { + // this.userInfo.signatureUrl = '' + // } + // if (this.$refs.signatureRef) this.$refs.signatureRef[type]() + // }, }, } diff --git a/pages/signature/signature.vue b/pages/signature/signature.vue index 2957cc2..7268401 100644 --- a/pages/signature/signature.vue +++ b/pages/signature/signature.vue @@ -1,39 +1,59 @@ + +