wx.previewImage无法预览wx.chooseImage返回的临时路径

发布于 8 年前作者 fhuang11872 次浏览最后编辑 8 年前来自 ask

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 回复
jie84
jie841 楼6 年前

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

nayuan
nayuan2 楼6 年前

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