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) { },