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); }, /** * 生命周期函数--监听页面初次渲染完成