ios系统中openDocument API调用成功但是打开文件无反应
-
当前 Bug 的表现(可附上截图)
-
预期表现
-
复现路径
-
提供一个最简复现 Demo
ios系统中openDocument API调用成功但是打开文件无反应
wx.downloadFile({
url: path,
success: function (res) {
console.log(res)
var Path = res.tempFilePath //返回的文件临时地址,用于后面打开本地预览所用
var imgtypes = [‘bmp’, ‘jpg’, ‘png’, ‘gif’, ‘tif’, ‘fpx’, ‘svg’, ‘jpeg’];
for (var idx in imgtypes) {
if (Path.endsWith(imgtypes[idx])) {
wx.previewImage({
urls: [Path],
})
return;
}
}
wx.openDocument({
filePath: Path,
success: function (res) {
console.log(‘打开成功’);
}, fail: function (res) {
console.log(res);
}
})
},
fail: function (res) {
console.log(res);
},
complete: function () {
wx.hideLoading();
}
});
