收藏
回答

安卓真机上调用wx.openDocument打开文档失败?

在安卓真机上调用wx.openDocument一直打开不了,报错:document viewer already starting。

但是在开发者工具和ios真机上都能打开成功。

回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--阳光
    社区技术运营专员--阳光
    04-02

    没复现,提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    04-02
    有用
    回复 1
  • 王火火
    王火火
    21小时前

    安卓机打开pdf一直有这个问题:

    wx.downloadFile({
            url: fileUrl,
            success(res) {
              console.log(res, '下载成功');
              const filePath = res.tempFilePath;
              wx.openDocument({
                filePath: filePath,
                fileType'pdf',
                showMenutrue,
                successfunction (res{
                  wx.showToast({
                    title'打开文档成功',
                    icon'none'
                  });
                },
                failfunction (res{
                  wx.showToast({
                    title'打开文档失败',
                    icon'none'
                  });
                  console.error('打开文档失败', res);
                }
              });
            },
            fail(res) {
              wx.showToast({
                title'下载文件失败',
                icon'none'
              });
              console.error('下载文件失败', res);
            }
          });
    
    21小时前
    有用
    回复
登录 后发表内容