Commit 10783d78 authored by Damon's avatar Damon

refactor: 收藏

parent 23d96ba0
......@@ -218,10 +218,9 @@ export default {
}
},
onLoad(e) {
this.questionWarehouseId = parseInt(e?.questionWarehouseId) || 1414854649273384960
this.questionWarehouseId = parseInt(e?.questionWarehouseId) || '1414854649273384960'
if (e?.source) this.source = parseInt(e.source)
if (e?.recordId) this.recordId = parseInt(e.recordId)
switch (this.source) {
case 1:
case 2:
......@@ -480,8 +479,10 @@ export default {
// 收藏
collection(status) {
const info = this.list.find(v => v.index === this.currentIndex)
const action = status ? 'joinCollection' : 'removeCollection'
this.$u.api[action]({questionId: info.id})
const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}).then(res => {
info.collectionFlag = !status
})
},
// 移除
remove() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment