wx.downloadFile({
url: FileName,
filePath: cachePath + `/${AgreementName}`,
success: function (res) {
if (res.statusCode === 200) {
wx.openDocument({
fileType: "pdf",
filePath: cachePath + `/${AgreementName}`,
success: function (res) {
console.log('打开PDF成功');
},
fail() {
wx.showToast({
title: '打开文件失败',
icon: 'none',
duration: 3000
})
}
})
}
},
fail: function (res) {
wx.showToast({
title: '缓存文件失败',
icon: 'none',
duration: 3000
})
}
})
iphone xs max并不是偶现,每次都走了wx.openDocument成功的回调,但就是不显示pdf文件。。。不显示的频率远大于出现的频率,看这个问题社区已经出现可很久了。