| | |
| | | const result = res.data.url; |
| | | let that = this; |
| | | const fileExtName = ".pdf"; |
| | | const randfile = new Date().getTime() +res.data.fileExtName; |
| | | const randfile = new Date().getTime() +res.data.fileName; |
| | | const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`; |
| | | if(result){ |
| | | wx.downloadFile({ |
| | | url: `${BaseUrl}${result}`, |
| | | filePath:newPath, |
| | | filePath:wx.env.USER_DATA_PATH+`/${randfile}`, |
| | | header: { |
| | | Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), |
| | | CLIENT_TOC: 'Y' |
| | |
| | | success(res){ |
| | | const filePath = res.tempFilePath; |
| | | wx.openDocument({ |
| | | filePath: newPath, |
| | | filePath: res.filePath, |
| | | showMenu: true, |
| | | fileType: 'pdf', |
| | | success: function (res) {} |
| | |
| | | // wx.showModal({ |
| | | // title: '文件已保存到手机相册', |
| | | // content: '位于tencent/MicroMsg/WeiXin下 \r\n将保存的文件重命名改为[ .pdf ]后缀即可', |
| | | // confirmColor: '#0bc183', |
| | | // confirmText: '知道了', |
| | | // showCancel: false |
| | | // confirmText: '知道了', |
| | | // s confirmColor: '#0bc183', |
| | | // howCancel: false |
| | | // }) |
| | | // }, |
| | | // fail(res) { |