增加遗漏收藏功能(问答)

This commit is contained in:
weinan2087
2022-11-15 10:07:21 +08:00
parent 83eb91e2e4
commit b9911d5735

View File

@@ -106,7 +106,7 @@
</view> </view>
<view class="item-bottom"> <view class="item-bottom">
<text class="item-time">收藏时间{{ item.time }}</text> <text class="item-time">收藏时间{{ item.time }}</text>
<view style="margin-top: 10upx;" class="rowbtn rowbtn-primary"> <view style="margin-top: 10upx;" @click="delCollectItem(item)" class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏 <image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
</view> </view>
</view> </view>
@@ -390,7 +390,12 @@ export default {
return obj; return obj;
}, },
delCollectItem(item) { delCollectItem(item) {
let that = this;
uni.showModal({
title: '提示',
content: '您确定要取消此收藏吗?',
success: function (res) {
if (res.confirm) {
apiFavorites.del(item.id).then(res => { apiFavorites.del(item.id).then(res => {
if (res.status == 200) { if (res.status == 200) {
uni.showToast({ uni.showToast({
@@ -398,7 +403,7 @@ export default {
duration: 1000 duration: 1000
}); });
setTimeout(()=>{ setTimeout(()=>{
this.findData(true) that.findData(true)
},1000) },1000)
} else { } else {
uni.showToast({ uni.showToast({
@@ -407,6 +412,12 @@ export default {
}); });
} }
}) })
}
}
});
} }
} }
}; };