微信小程序图片模块,选择图片上传,显示图片都正常,然后点击预览图片后无法预?
这是wxml代码 [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"section"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"flex-wrp"[代码] [代码]style[代码][代码]=[代码][代码]"flex-direction:row;"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"flex-item loadpic"[代码] [代码]bindtap[代码][代码]=[代码][代码]'chooseImage'[代码][代码]>点击添加图片[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'showPic'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:for[代码][代码]=[代码][代码]"{{imagesList}}"[代码] [代码]wx:for-item[代码][代码]=[代码][代码]"image"[代码] [代码]wx:key[代码][代码]=[代码][代码]"index"[代码] [代码]class[代码][代码]=[代码][代码]"previewimg"[代码][代码]> [代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]class[代码][代码]=[代码][代码]'image'[代码] [代码]src[代码][代码]=[代码][代码]"{{image}}"[代码] [代码]data-src[代码][代码]=[代码][代码]"{{image}}"[代码] [代码]bindtap[代码][代码]=[代码][代码]"previewImage"[代码][代码]></[代码][代码]image[代码][代码]> [代码][代码] [代码][代码]</[代码][代码]view[代码][代码]> [代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码] 这是js代码 [代码]chooseImage: [代码][代码]function[代码][代码](){[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: 1,[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]],[代码][代码] [代码][代码]sourceType: [[代码][代码]'album'[代码][代码], [代码][代码]'camera'[代码][代码]],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]// console.log(res)[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'正在上传'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'loading'[代码][代码],[代码][代码] [代码][代码]mask: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]duration: 1000[代码][代码] [代码][代码]})[代码][代码] [代码][代码]var[代码] [代码]tempFilePaths = res.tempFilePaths[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]imageList: tempFilePaths[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(tempFilePaths)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]previewImage:[代码][代码]function[代码][代码](e){[代码][代码] [代码][代码]var[代码] [代码]current = e.target.dataset.src;[代码][代码] [代码][代码]wx.previewImage({[代码][代码] [代码][代码]urls:[代码][代码]this[代码][代码].data.imageList,[代码][代码] [代码][代码]current: current,[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](e){[代码][代码] [代码][代码]console.log([代码][代码]"预览成功"[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] 选择图片正常,还可以打印出 url ;["http://tmp/wx5958ef33e1aeaf56.o6zAJs7eDvKwg0bUs9EW….T8JsDPzqZqIydaf9e5582f28c4ff41f527fa53d60a5f.jpg"] 然后就是预览不出 找了很多参考还是没解决啊