wx.openDocument安卓成功显示内容,ios显示空白
发布于 5 年前 作者 wei65 445 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

iphone手机的微信小程序下载xls文件成功后,转到一个空白的页面

  • 预期表现

下载成功后,应该像安卓版本一样显示成功打开,显示XLS内容

  • 复现路径
  • 提供一个最简复现 Demo

wx.downloadFile({

url: http://47.107.154.114/examples/2019.xls,

header: {},

success: function (res) {

var filePath = res.tempFilePath;

console.log(filePath);

wx.openDocument({

filePath: filePath,

fileType: ‘xls’,

success: function (res) {

console.log(‘打开文档成功’)

},

fail: function (res) {

console.log(res);

},

complete: function (res) {

console.log(res);

}

})

},

fail: function (res) {

console.log(‘文件下载失败’);

},

complete: function (res) { },

})

3 回复

贴一下调试日志,看看有没有报错

 没有任何报错,我是把这段代码片断单独做成一个小项目,我看到别人能有这样的链接看到项目  https://developers.weixin.qq.com/s/ONdxqHmd7s31,可是我不知道如何把这几个代码文件提交成这样。

我在安卓机上能成功打开这个xls文件,可是用iphone却不能打开。

这是在真机IPHONE 调试状态下的日志:

index.js? [sm]:19 wxfile://tmp_18c11ec.xls

index.js? [sm]:24 打开文档成功

index.js? [sm]:30

  1. {errMsg"openDocument:ok"}

    1. errMsg:"openDocument:ok"

    2. __proto__:Object

回到顶部