【BUG】华为 P30 调用 chooseImage 返回错误
发布于 5 年前 作者 fangdong 12224 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

选择了 9 张图片,界面只能显示 1 张。查看日志只返回了 1 张,没有完全返回。在其它机型上未遇到此情况。

选择了 9 张图片之后的日志信息:

机型信息如下:

  • 预期表现

日志应该打印 “共选择了 9 张”

界面显示应该也显示 9 张

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

代码片段: https://developers.weixin.qq.com/s/UN0c3VmI7a8e

核心代码如下:

let _this = this;
wx.chooseImage({
      count: 9 - _this.data.tempFiles.length,
      sizeType: ['compressed'],
      sourceType: ['album', 'camera'],
      success: (res) => {
        util.log("[pages/publish] chooseImageHelper 共选择了", res.tempFiles.length, "张.", JSON.stringify(res.tempFiles))
        _this.data.tempFiles = _this.data.tempFiles.concat(res.tempFiles)
        this.setData({
          tempFiles: _this.data.tempFiles
        })
      }
    })
回到顶部