mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 10:56:47 +08:00
增加遗漏收藏功能(问答)
This commit is contained in:
@@ -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'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user