From 1f3b0ef915c59f1349c37ebfd9882f62b62ed468 Mon Sep 17 00:00:00 2001 From: GJW200011 <2399547226@qq.com> Date: Mon, 13 Dec 2021 14:39:25 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invoice_history/invoice_history.js | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/pages/user/invoice/invoice_history/invoice_history.js b/pages/user/invoice/invoice_history/invoice_history.js index 9692e40..169c1d1 100644 --- a/pages/user/invoice/invoice_history/invoice_history.js +++ b/pages/user/invoice/invoice_history/invoice_history.js @@ -19,24 +19,32 @@ Page({ }, get_download(e) { // console.log(e); - let url =e.currentTarget.dataset.url + wx.showLoading({ + title: '正在加载', + mask: true, + }) + + let url = e.currentTarget.dataset.url wx.downloadFile({ url, header: { - 'content-type': 'application/json', - }, + 'content-type': 'application/json', + }, success: function (res) { - let filePath = res.tempFilePath - wx.openDocument({ - filePath: filePath, - fileType:"pdf", - showMenu:true, - success: function (res) { - console.log('打开文档成功') - } - }) - } - }) + let filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + fileType: "pdf", + showMenu: true, + success: function (res) { + console.log('打开文档成功') + } + }) + }, + }) + setTimeout(() => { + wx.hideLoading() + }, 1000); }, /** * 生命周期函数--监听页面初次渲染完成