From d2a3fced78ccd12ddda88a3df5b252376712b89f Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Thu, 29 Jun 2023 14:41:44 +0800 Subject: [PATCH] 2022.6.29 --- manifest.json | 2 +- pages/certificate/certificate.vue | 85 ++++++++++++------------------- 2 files changed, 34 insertions(+), 53 deletions(-) diff --git a/manifest.json b/manifest.json index e5b4fe4..13c991b 100644 --- a/manifest.json +++ b/manifest.json @@ -74,7 +74,7 @@ "base" : "h5hssnx" }, "devServer" : { - "disableHostCheck":true + "disableHostCheck" : true } } } diff --git a/pages/certificate/certificate.vue b/pages/certificate/certificate.vue index bd59ccf..765b64b 100644 --- a/pages/certificate/certificate.vue +++ b/pages/certificate/certificate.vue @@ -51,7 +51,7 @@ 分享 - 保存 + 保存 @@ -130,60 +130,41 @@ export default { }) }, save() { - this.$u.throttle(() => { - let sysinfo = uni.getSystemInfoSync(); - console.log(sysinfo) - if (sysinfo) { - if (sysinfo.platform === 'android') { - uni.showToast({ - title: "请长按分享图片进行保存或者分享", - icon: "none" - }) - } else { - - let a = document.createElement("a") - a.href = this.imgData - a.setAttribute("download", "gmesign") - a.click() - } - } else { - uni.showToast({ - title: "请长按分享图片进行保存或者分享", - icon: "none" - }) - } + uni.showToast({ + title: "请长按分享图片进行保存或者分享", + icon: "none" + }) - let form = new FormData() - form.append('file', base64ToFile(this.imgData, 'sign')) - form.append('active_tag', 'map_point') - let vuex_token = this.vuex_token; - form.append('token', vuex_token) - let xhr = new XMLHttpRequest() - xhr.open('post', `${ROOTPATH}/api/mobile/upload-file`) - - xhr.onreadystatechange = () => { - if (xhr.status === 200 && xhr.readyState === 4) { - let val = JSON.parse(xhr.responseText); - console.log(val); - this.$u.api.savePoster({ - upload_id: val.id, - type: 1 - }).then(res => { - // uni.showToast({ - // title: "保存成功", - // icon: "none" - // }) - }).catch(err => { - // uni.showToast({ - // title: "保存成功", - // icon: "none" - // }) - }) - } + let form = new FormData() + form.append('file', base64ToFile(this.imgData, 'sign')) + form.append('active_tag', 'map_point') + let vuex_token = this.vuex_token; + form.append('token', vuex_token) + let xhr = new XMLHttpRequest() + xhr.open('post', `${ROOTPATH}/api/mobile/upload-file`) + + xhr.onreadystatechange = () => { + if (xhr.status === 200 && xhr.readyState === 4) { + let val = JSON.parse(xhr.responseText); + console.log(val); + this.$u.api.savePoster({ + upload_id: val.id, + type: 1 + }).then(res => { + // uni.showToast({ + // title: "保存成功", + // icon: "none" + // }) + }).catch(err => { + // uni.showToast({ + // title: "保存成功", + // icon: "none" + // }) + }) } - xhr.send(form) - }) + } + xhr.send(form) } }, async onShow() {