✨ feat(活动): 鹊桥活动添加接口
This commit is contained in:
@@ -703,6 +703,7 @@ export const STATUS = {
|
||||
ACTIVITY_QIXI_GAMECODE_HAS_PLAY: { code: 50079, simStr: '该挑战已结算过' },
|
||||
ACTIVITY_QIXI_BUY_COUNT_OVER: { code: 50080, simStr: '购买挑战次数不足' },
|
||||
ACTIVITY_QIXI_CANNOT_BUY: { code: 50081, simStr: '不可在免费次数未用完的时候购买次数' },
|
||||
ACTIVITY_QIXI_CANNOT_SWEEP: { code: 50082, simStr: '必须在当天手动玩一次后才可以碾压' },
|
||||
|
||||
|
||||
// GM后台相关状态 60000 - 69999
|
||||
|
||||
@@ -19,7 +19,9 @@ export class QixiRecord {
|
||||
@prop({ required: true })
|
||||
rewards: string; // 奖励
|
||||
@prop({ required: true })
|
||||
hasPass: boolean; // 奖励
|
||||
hasPass: boolean; // 是否通过
|
||||
@prop({ required: true })
|
||||
isSkip?: boolean; // 是否跳过
|
||||
}
|
||||
|
||||
@index({ roleId: 1, activityId: 1 })
|
||||
|
||||
@@ -11,6 +11,7 @@ interface QixiDataInDb {
|
||||
freeCnt: number; // 每天可以免费划船的次数
|
||||
maxProgress: number; // 最大进度
|
||||
rewards: string; // 奖励
|
||||
countdown: number;
|
||||
}
|
||||
|
||||
export class QixiData extends ActivityBase {
|
||||
@@ -19,6 +20,7 @@ export class QixiData extends ActivityBase {
|
||||
freeCntDaily: number; // 每天可以免费的次数
|
||||
maxProgress: number; // 最大进度
|
||||
rewards: string; // 奖励
|
||||
countdown: number; // 倒计时
|
||||
|
||||
freeCnt: number = 0; // 累积到现在可以免费的次数
|
||||
maxBuyCnt: number = 0; // 累积到现在可以购买的次数
|
||||
@@ -39,6 +41,7 @@ export class QixiData extends ActivityBase {
|
||||
let dataObj: QixiDataInDb = JSON.parse(data);
|
||||
if (!dataObj) return;
|
||||
|
||||
this.countdown = dataObj.countdown;
|
||||
this.buyCost = dataObj.buyCost || '&';
|
||||
this.dailyBuyCnt = dataObj.dailyBuyCnt || 0;
|
||||
this.freeCntDaily = dataObj.freeCnt || 0;
|
||||
@@ -63,10 +66,10 @@ export class QixiData extends ActivityBase {
|
||||
if(playerData.record) {
|
||||
playerData.record.sort((a, b) => a.time.getTime() - b.time.getTime());
|
||||
for(let data of playerData.record) {
|
||||
let { todayIndex, afterProgress, progress, hasPass } = data;
|
||||
let { todayIndex, afterProgress, progress, hasPass, isSkip } = data;
|
||||
if(todayIndex == this.todayIndex && hasPass) this.todayPlayCnt ++;
|
||||
if(hasPass) this.playCnt ++;
|
||||
this.progress = afterProgress||progress;
|
||||
if(!isSkip) this.progress = afterProgress||progress;
|
||||
this.records.push(data);
|
||||
}
|
||||
if(this.todayPlayCnt >= this.freeCntDaily && this.playCnt < this.freeCnt) {
|
||||
@@ -93,6 +96,7 @@ export class QixiData extends ActivityBase {
|
||||
maxProgress: this.maxProgress,
|
||||
progress: this.progress,
|
||||
rewards: this.rewards,
|
||||
countdown: this.countdown,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user