feat 添加商品收藏的提示

This commit is contained in:
AERWEN\26795 2023-10-24 11:19:13 +08:00
parent ec7668a991
commit 7e20569886

View File

@ -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');