wx.previewImage无法预览wx.chooseImage返回的临时路径
发布于 6 年前 作者 fhuang 11772 次浏览 来自 问答

var tempFilePaths

wx.chooseImage({
     count: 1,
     sizeType: [‘original’, ‘compressed’],
     sourceType: [‘album’, ‘camera’],
     success: function (res) {
       tempFilePaths = res.tempFilePaths
     }
})

wx.previewImage({
         current:tempFilePaths[0],
         urls: [tempFilePaths[0]]

})

调用wx.previewImage后黑屏,参数使用tempFilePaths[0]和tempFilePaths都不行。如果current和urls设置成网络地址就可以成功

调用临时路径如下:

网络图片:

2 回复

嗯。我后面采用image绑定临时路径替代的。这个接口就是无法预览本地的临时路径

貌似不能预览本地的,只能是网络图片,https…我也遇到这个问题。。。。。

回到顶部