From 7e20569886f6e882078fd34f169e47b319eb9bc5 Mon Sep 17 00:00:00 2001 From: "AERWEN\\26795" <123456789a> Date: Tue, 24 Oct 2023 11:19:13 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/details/index.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pages/goods/details/index.js b/pages/goods/details/index.js index 003105e..6ba95e2 100644 --- a/pages/goods/details/index.js +++ b/pages/goods/details/index.js @@ -138,10 +138,26 @@ Page({ if (title == "收藏") { if(this.data.details.isCollect){ - CancelGoodsCollection({goodsGuid: this.data.details.spuId}) + CancelGoodsCollection({goodsGuid: this.data.details.spuId}).then(() => { + Toast({ + context: this, + selector: '#t-toast', + message: '收藏取消', + icon: '', + duration: 1000, + }); + }) } else{ - addOrUpdateGoodsCollection({goodsGuid: this.data.details.spuId}) + addOrUpdateGoodsCollection({goodsGuid: this.data.details.spuId}).then(() => { + Toast({ + context: this, + selector: '#t-toast', + message: '收藏成功', + icon: '', + duration: 1000, + }); + }) } this.getDetail(this.data.spuId) // console.log(this.data.details.spuId, '点击收藏的id');