收藏
回答

wx.openDocument在ios端无法打开docx文件,而安卓端可以?

在安卓端可以直接打开,而在ios端则提示The XML document isnlU2019t in Wordformat.(null)

代码片段如下:

wx.downloadFile({
    url: url,
    success: function (res) {
        let filePath = res.tempFilePath;
        wx.openDocument({
            filePath: filePath,
            fileType: 'docx',
            showMenu: true,
            success: function (res) {
                console.log('打开文档成功', res);
            },
            fail: function (err) {
                console.log('打开失败', err);
            }
        });
    }
});
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容