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
})
}
})
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
showMenu: true,
展示菜单默认false了,手动加一下
加载的pdf文件如何修改标题呢