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