feat(活动): 添加两种密卷 ed96aa4ac

This commit is contained in:
luying
2023-09-05 16:47:33 +08:00
parent 0b96397e80
commit 0e11635c5e
14 changed files with 167 additions and 17 deletions

View File

@@ -72,6 +72,11 @@ export enum ACTIVITY_TYPE {
QIXI = 57, // 七夕活动
MID_AUTUMN = 58, // 中秋活动
AUTHOR_GACHA = 59, //百家争鸣祈灵活动
GROWTH_FUND_ROUGE = 60, //学宫普通密卷
GROWTH_FUND_ROUGE_VIP = 61, //学宫高级密卷
GROWTH_FUND_AUTHOR = 62, //列传普通密卷
GROWTH_FUND_AUTHOR_VIP = 63, //列传高级密卷
}
/**

View File

@@ -929,6 +929,9 @@ export enum TASK_TYPE {
MINI_GAME_SCORE = 139, // 小游戏超过X分
MINI_GAME_STEP = 140, // 小游戏小于X步
FUND_ROUGE = 143, // 学宫密卷
FUND_AUTHOR = 144, // 列传密卷
}
// 任务累积类型

View File

@@ -51,6 +51,15 @@ export default class AuthorBook extends BaseModel {
return result;
}
public static async findProgressByRoleId(roleId:string, select = '-_id') {
let progressCount = 0;
let result: AuthorBookType[] = await AuthorBookModel.find({ roleId }).select(select).lean();
for(let {progress} of result){
progressCount+=progress;
}
return progressCount;
}
}
export const AuthorBookModel = getModelForClass(AuthorBook);

View File

@@ -9,6 +9,7 @@ interface AuthorGachaDataInDb {
box: {
count: number; // 次数
rewards: string; // type&id&count, type: 1-武将 2-道具 3-礼包
isSpecial: boolean; // 重要节点奖励标记
hasReceived?: boolean; // 是否获得
}[];
}
@@ -45,10 +46,10 @@ export class AuthorGachaData extends ActivityBase {
public getShowResult() {
let box: AuthorGachaDataInDb['box'] = [];
for (let { count, rewards } of this.box) {
for (let { count, rewards, isSpecial = false } of this.box) {
let hasReceived = false;
if (this.record.indexOf(count) != -1) hasReceived = true;
box.push({ count, rewards, hasReceived })
box.push({ count, rewards, hasReceived, isSpecial })
}
return {

View File

@@ -95,6 +95,22 @@ export class GrowthFundData extends ActivityBase {
}
break;
}
case ACTIVITY_TYPE.GROWTH_FUND_ROUGE:
case ACTIVITY_TYPE.GROWTH_FUND_ROUGE_VIP: {
if (!this.isReceive(page.pageIndex, item.cellIndex) && item.taskParamArray[0] == condition) {
item.isComplete = true;
items.push(Object.assign(item, { pageIndex: page.pageIndex, activityId: this.activityId }))
}
break;
}
case ACTIVITY_TYPE.GROWTH_FUND_AUTHOR:
case ACTIVITY_TYPE.GROWTH_FUND_AUTHOR_VIP: {
if (!this.isReceive(page.pageIndex, item.cellIndex) && item.taskParamArray[0] <= condition) {
item.isComplete = true;
items.push(Object.assign(item, { pageIndex: page.pageIndex, activityId: this.activityId }))
}
break;
}
}
}
}
@@ -111,6 +127,8 @@ export class GrowthFundData extends ActivityBase {
return this.type == ACTIVITY_TYPE.GROWTH_FUND_MAIN_VIP
|| this.type == ACTIVITY_TYPE.GROWTH_FUND_TOWER_VIP
|| this.type == ACTIVITY_TYPE.GROWTH_FUND_MAIN_ELITE_VIP
|| this.type == ACTIVITY_TYPE.GROWTH_FUND_ROUGE_VIP
|| this.type == ACTIVITY_TYPE.GROWTH_FUND_AUTHOR_VIP
}
//是否购买page

View File

@@ -65,6 +65,8 @@ export class TaskParamInter {
score?: number; // 小游戏得分
step?: number; // 步数
gameType?: number; // 小游戏类型
rougeId?:number; //学宫
authorProgress?:number; // 列传
};
export class TaskParam extends TaskParamInter {

View File

@@ -328,5 +328,29 @@
"activityType": 59,
"name": "MID_AUTUMN",
"string": "百家争鸣活动"
},
{
"id": 60,
"activityType": 60,
"name": "MID_AUTUMN",
"string": "学宫普通密卷"
},
{
"id": 61,
"activityType": 61,
"name": "MID_AUTUMN",
"string": "学宫高级密卷"
},
{
"id": 62,
"activityType": 62,
"name": "MID_AUTUMN",
"string": "列传普通密卷"
},
{
"id": 63,
"activityType": 63,
"name": "MID_AUTUMN",
"string": "列传高级密卷"
}
]