Commit 10783d78 authored by Damon's avatar Damon

refactor: 收藏

parent 23d96ba0
...@@ -218,10 +218,9 @@ export default { ...@@ -218,10 +218,9 @@ export default {
} }
}, },
onLoad(e) { onLoad(e) {
this.questionWarehouseId = parseInt(e?.questionWarehouseId) || 1414854649273384960 this.questionWarehouseId = parseInt(e?.questionWarehouseId) || '1414854649273384960'
if (e?.source) this.source = parseInt(e.source) if (e?.source) this.source = parseInt(e.source)
if (e?.recordId) this.recordId = parseInt(e.recordId) if (e?.recordId) this.recordId = parseInt(e.recordId)
switch (this.source) { switch (this.source) {
case 1: case 1:
case 2: case 2:
...@@ -480,8 +479,10 @@ export default { ...@@ -480,8 +479,10 @@ export default {
// 收藏 // 收藏
collection(status) { collection(status) {
const info = this.list.find(v => v.index === this.currentIndex) const info = this.list.find(v => v.index === this.currentIndex)
const action = status ? 'joinCollection' : 'removeCollection' const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}) this.$u.api[action]({questionId: info.id}).then(res => {
info.collectionFlag = !status
})
}, },
// 移除 // 移除
remove() { 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