From cfad35ec52b3819b67c2f7b3804fe60bc97fdafe Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Tue, 26 Nov 2024 09:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/rechargeDetail/index.js | 31 ++++++++++++++++--------------- utils/index.js | 1 + 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/pages/rechargeDetail/index.js b/pages/rechargeDetail/index.js index f2625f5..dcf73f0 100644 --- a/pages/rechargeDetail/index.js +++ b/pages/rechargeDetail/index.js @@ -59,12 +59,13 @@ Page({ // 开发版 case 'develop': // api = `http://localhost:9001`; + // api = `https://zgd.hbhcbn.com/recharge-print-api`; api = `https://zgd.hbhcbn.com/recharge-print-api-test`; - // api = `https://zgd.hbhcbn.com/recharge-print-api-test`; break; // 体验版 case 'trial': api = `https://zgd.hbhcbn.com/recharge-print-api-test`; + // api = `https://zgd.hbhcbn.com/recharge-print-api`; break; // 正式版 case 'release': @@ -84,14 +85,14 @@ Page({ alertInfo("下载文件失败") return; } - const fs = wx.getFileSystemManager() - const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf` - fs.rename({ - oldPath: res.tempFilePath, - newPath: newPath, - success(r) { + // const fs = wx.getFileSystemManager() + // const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf` + // fs.rename({ + // oldPath: res.tempFilePath, + // newPath: newPath, + // success(r) { wx.openDocument({ - filePath: newPath, + filePath: res.tempFilePath, fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!! success: function (res) { resolve() @@ -101,13 +102,13 @@ Page({ console.log('打开失败错误为', e) rej() } - }); - }, - fail(res) { - console.error(res) - alertInfo("下载失败") - rej() - } + // }); + // }, + // fail(res) { + // console.error(res) + // alertInfo("下载失败") + // rej() + // } }) diff --git a/utils/index.js b/utils/index.js index a9359ec..5faab9f 100644 --- a/utils/index.js +++ b/utils/index.js @@ -54,6 +54,7 @@ export function getConfigByEnv() { // 体验版 case 'trial': api = "https://zgd.hbhcbn.com/wxApi" + // api = "https://zgd.hbhcbn.com/api3" break; // 正式版 case 'release':