关于wx.chooseImage的问题success回调的问题?
发布于 6 年前 作者 flu 987 次浏览 来自 官方Issues

首先,想吐槽一下这个提出问题的部分,为啥标题一定要带问号??

好了,开始正题

最近开发碰到一个问题,微信小程序使用wx.chooseImage,经常选择了多张图片,但是tempFilePaths里只有一个url,不知道是不是我哪里理解错或者写错了,求各位大神来解答

这个是选择图片的代码

chooseImages: function(e) {
    let _this = this
    wx.chooseImage({
      count: 9,
      sizeType: ['original'],
      sourceType: ['album', 'camera'],
      success (res) {
        if (res.tempFilePaths.length > 0) {
          console.log(res.tempFilePaths)
          _this.setData({
            houseImages: res.tempFilePaths
          })
        }
      },
      fail (res) {
        console.log(res)
      }
    })
  },
3 回复

建议你认真做一个代码片段

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

一加7pro v7.0.6 测试会出问题, iPhone测试没问题

回到顶部