From b9911d573535e99c14e542180d89bea5d6433478 Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Tue, 15 Nov 2022 10:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=81=97=E6=BC=8F=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E5=8A=9F=E8=83=BD=EF=BC=88=E9=97=AE=E7=AD=94=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/myFavorites.vue | 45 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 17 deletions(-) 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' + }); + } + }) + } } - }) + }); + + + } } };