showMenu: true, [图片] 展示菜单默认false了,手动加一下
wx.downloadFile只能打开pdf文件,不能另存为https://developers.weixin.qq.com/miniprogram/dev/api/network/download/wx.downloadFile.html 开始是先打开,然后有三个小点里面有另存为按扭,现在无缘无故只能打开pdf文件了,没有右边三个小点进行另存为了,已经试过多个手机结果都一样,现在界面如下:[图片] 代码如下: wx.request({ url: app.d.url+'/api.php/report/download', data: { id }, method: 'POST', success:(res)=> { wx.downloadFile({ url: res.data.data.url, //仅为测试接口,并非真实的 success: function(res){ var filePath = res.tempFilePath let type = res.tempFilePath.slice(res.tempFilePath.lastIndexOf(".")+1) console.log(type); wx.openDocument({ filePath: filePath, fileType:type, }) } }) var _this = this; _this.setData({ loading:true }) } }) },
2022-01-26