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

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 class="item-bottom">
<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>取消收藏
</view>
</view>
@@ -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'
});
}
})
}
}
})
});
}
}
};