wx.openDocument在真机上打不开的次数居多,但每次都返回“文档打开成功”
const downTask= wx.downloadFile({
url: e, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
console.log(res);
var filePath = res.tempFilePath;
wx.openDocument({
filePath:filePath,
fileType: this.filetype,
success: function (res) {
console.log('打开文档成功');
},
});
}
}
});
参考下这个楼主的解决策略:openDocument无法打开文件? 提示“未找到可以打开该类型文档的应用”? 田迪 的评论 - 微信开放社区 https://developers.weixin.qq.com/community/develop/doc/000a6427e24a102d0e09f3b7456c00?jumpto=reply&parent_commentid=00042cd97289d828c719b810d56c&commentid=000c4a805282b029db19a33955bc