每次都执行打开成功,但是文件就是没有打开,要点好几次才会成功打开一次
wx.downloadFile({
url:'.........pdf',
success: (res) => {
wx.hideLoading();
wx.showLoading({
title: '正在打开文件...',
mask:true,
});
if (res.statusCode === 200) {
var filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
fileType: 'pdf',
success: function (res) {
wx.hideLoading();
console.log(res);
console.log('打开文档成功');
},
fail(res) {
wx.showLoading({
title: '打开文档失败',
mask:true,
});
console.log(res);
}
});
}
},
fail: (res) => {
wx.showToast({
title: "下载失败",
mask:true,
icon: 'none'
});
}
});
不是因为QQ浏览器,我QQ浏览器卸了还是那样,要点好几次才能打开,每次都返回打开成功