From 5c971ef2e8f8b211312f5ac81b7cc0d688deedf4 Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Tue, 10 Sep 2024 16:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/invoiceDetail/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/invoiceDetail/index.js b/pages/invoiceDetail/index.js index c28234f..810279a 100644 --- a/pages/invoiceDetail/index.js +++ b/pages/invoiceDetail/index.js @@ -36,9 +36,9 @@ Page({ const that = this; wx.showActionSheet({ itemList: ['发票XML文件下载', '发票PDF文件下载'], - async success(res) { + async success(sheetRes) { loadingFunc(async () => { - const { code, message, data } = await downloadInvoice(that.data.id, res.tapIndex); + const { code, message, data } = await downloadInvoice(that.data.id, sheetRes.tapIndex); if (code !== OK) { alertInfo(message) return; @@ -55,9 +55,10 @@ Page({ alertError("没有开票信息") return; } + console.log('res.tempFilePath', res.tempFilePath, sheetRes.tapIndex) wx.openDocument({ filePath: res.tempFilePath, - fileType: [res.tapIndex === 0 ? 'xml' : "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!! + fileType: [sheetRes.tapIndex === 0 ? 'xml' : "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!! success: function (res) { },