- 当前 Bug 的表现(可附上截图)
点击图片预览大图正常,但是控制台却报错提示:
app error: appServiceSDKScriptError
Cannot read property ‘mode’ of undefined;at api onAppEnterBackground callback function
TypeError: Cannot read property ‘mode’ of undefined
- 预期表现
点击图片预览大图,控制台没有报错信息。
- 复现路径
wx.previewImage({
current: e.currentTarget.dataset.thisimgurl, //点的是哪张图片
urls: [e.currentTarget.dataset.thisimgurl],
complete(e) {
console.log(“previewImage”, urls);
}
})
- 提供一个最简复现 Demo
wxml:
<image bindtap=‘bindPrevewPicture’ data-thisimgurl=‘https://shijiu.jiusanye.com/file/images/userheadimage/userdefaultheadimg.png’ src=‘https://shijiu.jiusanye.com/file/images/userheadimage/userdefaultheadimg.png’ />
js:
bindPrevewPicture(e) {
console.log(“tapPrevewPictureHandler”, e);
wx.previewImage({
current: e.currentTarget.dataset.thisimgurl, //点的是哪张图片
urls: [e.currentTarget.dataset.thisimgurl],
complete(e) {
console.log(“previewImage”, urls);
}
})
},