🐞 fix(活动): 月旦基金购买一个之后另一个就不隐藏了

This commit is contained in:
luying
2023-06-19 17:20:16 +08:00
parent 36f734556b
commit 7f2f745410

View File

@@ -86,7 +86,7 @@ class MonthlyFundPage {
return !this.rewards.find(cur => !cur.hasReceived);
}
public getShowResult() {
public canShow() {
if(this.buyEndTime < Date.now() && !this.hasBought) return null;
if(this.hasReceivedAll()) return null
return this;
@@ -129,9 +129,15 @@ export class MonthlyFundData extends ActivityBase {
}
public getShowResult() {
let canShow = false;
for(let list of this.list) {
if(list.canShow()) canShow = true;
}
if(!canShow) return null;
return {
...this.getBaseKeys(),
list: this.list.map(data => data.getShowResult()).filter(cur => cur)
list: this.list
}
}
}