收藏
回答

wx.openDocument IOS 无法打开文档?

IOS错误如下图所示

pc、安卓均能正常打开

wx.downloadFile({
    url: src, //仅为示例,并非真实的资源
    success (res) {
        // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
        if (res.statusCode === 200) {
            wx.openDocument({
                filePath: res.tempFilePath,
                showMenu: true,
                fileType: 'xlsx',
                success (data) {
                    console.log('打开文档成功')
                },
                fail (err) {
                    console.log(err);
                }
            });
        }
    },
    fail (err) {
        console.log(err);
    }
})
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签