From 7ad9d1e3fb0b550e61aa01cea13cc0ec7090b441 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Mon, 27 Oct 2025 11:13:11 +0800 Subject: [PATCH] feat: h5; --- config.js | 12 +++---- index.html | 2 +- pages.json | 4 +-- pages/report/index.vue | 77 ++++++++++++++++++++++++----------------- pages/report/progressCircle.vue | 6 ++-- 5 files changed, 59 insertions(+), 42 deletions(-) diff --git a/config.js b/config.js index 387ea38..1c1080b 100644 --- a/config.js +++ b/config.js @@ -17,7 +17,7 @@ const config = { baseUrl : 'http://augcl.natapp1.cc/assessment-admin/assessment', }, prod : { - baseUrl : 'https://assessment.augcl.com/assessment-admin/assessment', + baseUrl : 'https://admin.kjetax.com/assessment-admin/assessment', } } @@ -26,17 +26,17 @@ const config = { const defaultConfig = { mapKey : 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', aliOss: { - url: 'https://image.hhlm1688.com/', + url: 'https://image.kjetax.com/', config: { //桶的地址 region: 'oss-cn-guangzhou', //id - accessKeyId: 'LTAI5tQSs47izVy8DLVdwUU9', + accessKeyId: 'LTAI5tSfSyNKzrvkyCn3Tmon', //密钥 - accessKeySecret: 'qHI7C3PaXYZySr84HTToviC71AYlFq', + accessKeySecret: '5Tax04eUSHBlYiDpCTBR5YsTwtPf2B', //桶的名字 - bucket: 'hanhaiimage', - endpoint: 'oss-cn-shenzhen.aliyuncs.com', + bucket: 'risk-assessment', + endpoint: 'oss-cn-guangzhou.aliyuncs.com', } }, } diff --git a/index.html b/index.html index fdce395..617bd91 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ '') - + 报告保存&分享 diff --git a/pages.json b/pages.json index b8cd19d..1185c9a 100644 --- a/pages.json +++ b/pages.json @@ -3,7 +3,7 @@ { "path": "pages/report/index", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "报告保存&分享", "navigationStyle": "custom" } } @@ -16,7 +16,7 @@ }, "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "报告", + "navigationBarTitleText": "报告保存&分享", "navigationBarBackgroundColor": "#014FA2", "backgroundColor": "#F8F8F8", "navigationStyle": "custom" diff --git a/pages/report/index.vue b/pages/report/index.vue index fc961cc..c1130cd 100644 --- a/pages/report/index.vue +++ b/pages/report/index.vue @@ -32,7 +32,7 @@ - - - @@ -75,6 +70,7 @@ }, data() { return { + batchNo: null, detail: null, tableList: [], canvas: null, @@ -95,8 +91,22 @@ const { batchNo, token } = arg token && uni.setStorageSync('token', token) - - await this.getData(batchNo) + this.batchNo = batchNo + }, + async mounted() { + console.log('mounted', this.batchNo) + await this.getData(this.batchNo) + + let fetchs = [ + { ref: 'qr', url: this.configList.company_qrcode }, + { ref: 'info', url: this.configList.company_info }, + { ref: 'logo', url: this.configList.company_logo }, + { ref: 'succ', url: this.configList.compliance_img }, + ].map(item => { + return this.preLoadImage(item.ref, item.url) + }) + + await Promise.all(fetchs) setTimeout(async () => { await this.createImage() @@ -109,7 +119,7 @@ showCancel: false, confirmText: '知道了' }) - }, 800) + }, 1000) }, methods: { async getData(batchNo) { @@ -167,6 +177,28 @@ } }, + async preLoadImage(ref, url) { + return new Promise((resolve) => { + console.log(ref, url) + if (!this.$refs[ref] || !url) { + resolve() + return + } + uni.downloadFile({ + url, + success: (res) => { + if (res.statusCode === 200) { + console.log('下载成功'); + this.$refs[ref].src = res.tempFilePath + resolve() + } + }, + fail: (err) => { + resolve() + } + }); + }) + }, async createImage() { console.log('createImage') const node = document.querySelector('.export') @@ -181,23 +213,6 @@ }); }, - onDownload() { - if (!this.tempFilePath) { - uni.showToast({ - title: '图片还未生成完成', - icon: 'none' - }) - return - } - - // H5环境下提示用户长按保存 - uni.showModal({ - title: '保存图片', - content: '请长按上方图片,选择"保存图片"即可保存到手机', - showCancel: false, - confirmText: '知道了' - }) - }, }, } diff --git a/pages/report/progressCircle.vue b/pages/report/progressCircle.vue index 6250a08..8313999 100644 --- a/pages/report/progressCircle.vue +++ b/pages/report/progressCircle.vue @@ -1,7 +1,7 @@