注意记得加next(),要不然页面刷新
场景:[图片上传中...(image.png-be64c-1552273101501-0)]
beforeRouteLeave (to, from, next) {
instance.close(); // 监控离开钩子,关闭预览vant预览弹窗
next(); // 记得加这个!!!!
},
// 更新导购助力活动的推广海报
let instance = null
refreshPoster(url) {
return new Promise(resolve => {
const params = {
token: localStorage.token,
hd_id: this.id, // 活动id
poster_url: url // 上传至腾讯云的海报url
}
Http.ai['activity/collection/updateSalesmanPoster'](params)
(e => {
if(e.code == 0){
let mediaID = e.data.media_id
this.loadingFlag = false
resolve(mediaID)
instance = ImagePreview({
images: [
url
],
className: 'down-image',
showIndex: false,
showIndicators: false,
startPosition: 1
});
}else {
Toast(e.msg)
}
})
})
},
image.png
网友评论