diff --git a/pages/my/myFavorites.vue b/pages/my/myFavorites.vue index 275be5c..e705a80 100644 --- a/pages/my/myFavorites.vue +++ b/pages/my/myFavorites.vue @@ -106,7 +106,7 @@ 收藏时间:{{ item.time }} - + 取消收藏 @@ -390,23 +390,34 @@ export default { return obj; }, delCollectItem(item) { - - apiFavorites.del(item.id).then(res => { - if (res.status == 200) { - uni.showToast({ - title:"取消收藏成功" , - duration: 1000 - }); - setTimeout(()=>{ - this.findData(true) - },1000) - } else { - uni.showToast({ - title: "操作失败", - icon:'none' - }); + let that = this; + uni.showModal({ + title: '提示', + content: '您确定要取消此收藏吗?', + success: function (res) { + if (res.confirm) { + apiFavorites.del(item.id).then(res => { + if (res.status == 200) { + uni.showToast({ + title:"取消收藏成功" , + duration: 1000 + }); + setTimeout(()=>{ + that.findData(true) + },1000) + } else { + uni.showToast({ + title: "操作失败", + icon:'none' + }); + } + }) + } } - }) + }); + + + } } };