openDocument无法打开文件

发布于 8 年前作者 fgao9856 次浏览最后编辑 8 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

在编辑器上可以正常打开pdf文档,可是在真机上一直提示“未找到可以打开该类型文档的应用”,控制台打印,可以看到文档的在线路径和下载的路径都能拿到

  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

gotoCase(e){
        let
        self = this,
        fileurl = e.currentTarget.dataset.fileurl;
        console.log(fileurl);
        wx.downloadFile({
            url: fileurl,
            success(res){
                let filePath = res.tempFilePath;
                console.log(filePath);
                wx.openDocument({
                    filePath: filePath,
                    fileType: "pdf",
                    success(res){
                        // console.log("打开文档成功");
                    },
                    fail(res){
                        console.log(res);
                    },
                    complete(){
                    }
                });
            }
        });
}

2 回复
yong98
yong981 楼6 年前

关注 已经修复了么。有临时的解决方法么

yanlin
yanlin2 楼6 年前

问题已知,会在后续的版本进行修复