FileSystemManager.readFile iOS高版本报错
发布于 5 年前 作者 qiangshi 11682 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo
  • 当前 Bug 的表现(可附上截图)  如题,9张图片循环转base64时进行不下去,机型:iphonex 系列;iOS版本12以后

  • 预期表现

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

for (var i = 0; i < that.data.imagesList.length; i++) {

var item = that.data.imagesList[i].path.toString()

setTimeout(() => {

wx.getFileSystemManager().readFile({

filePath: item, //选择图片返回的相对路径

encoding: ‘base64’, //编码格式

success: res => { //成功的回调

console.log(res.data)

imagesArr.push(res.data)

},

fail: res => {

console.log(res)

}

})

// let base64 = wx.getFileSystemManager().readFileSync(item, ‘base64’)

// imagesArr.push(base64)

}, 200)

1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部