周末礼包红点

This commit is contained in:
dy 2023-12-14 18:52:17 +08:00
parent 0f7c1db0a1
commit 5fabfb2c5a
5 changed files with 97 additions and 36 deletions

View File

@ -2,6 +2,7 @@ import {ApiCall} from "tsrpc";
import {ReqReceive, ResReceive} from "../../../shared/protocols/event/zhoumolibao/PtlReceive"; import {ReqReceive, ResReceive} from "../../../shared/protocols/event/zhoumolibao/PtlReceive";
import {HuoDongFun} from "../../../public/huodongfun"; import {HuoDongFun} from "../../../public/huodongfun";
import {PlayerFun} from "../../../public/player"; import {PlayerFun} from "../../../public/player";
import {HongDianChange} from "../../hongdian/fun";
export default async function (call: ApiCall<ReqReceive, ResReceive>) { export default async function (call: ApiCall<ReqReceive, ResReceive>) {
// 查询活动是否有当前领奖的免费选项 // 查询活动是否有当前领奖的免费选项
@ -21,4 +22,6 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
}, {upsert: true}) }, {upsert: true})
call.succ({}) call.succ({})
HongDianChange.sendChangeKey(call.uid, ['zhoumolibao']);
} }

View File

@ -19,7 +19,7 @@ import { FunWeiXiuChang } from "../../public/weixiuchang";
const defaultKeys: hongdianKey[] = ['jiuba', 'jiaotang', 'shouchong', 'clslhd', 'dixiaqianzhuanghd', 'gonghuihd', 'hbzbhd', 'jjchd', 'taskhd', const defaultKeys: hongdianKey[] = ['jiuba', 'jiaotang', 'shouchong', 'clslhd', 'dixiaqianzhuanghd', 'gonghuihd', 'hbzbhd', 'jjchd', 'taskhd',
'xstaskhd', 'lingzhulaixihd', 'dxlthd', 'wzcjhd', 'slzdhd', 'qjzzdhd', 'kuangdonghd', 'qiandaohd', 'kaifukuanghuanhd', 'jijinhd', 'zhuishalinghd', 'xstaskhd', 'lingzhulaixihd', 'dxlthd', 'wzcjhd', 'slzdhd', 'qjzzdhd', 'kuangdonghd', 'qiandaohd', 'kaifukuanghuanhd', 'jijinhd', 'zhuishalinghd',
'yibaichouhd', 'huobanzhaomuhd', 'qirileichonghd', 'jierihd', 'kbzzhd', 'wzryhd', 'yuedujijin', 'mingdao', 'patahd', 'yibaichouhd', 'huobanzhaomuhd', 'qirileichonghd', 'jierihd', 'kbzzhd', 'wzryhd', 'yuedujijin', 'mingdao', 'patahd',
'heishihd', 'huodonghd', 'renown', 'weixiuchang', 'kaifujingsai']; 'heishihd', 'huodonghd', 'renown', 'weixiuchang', 'kaifujingsai', 'zhoumolibao'];
export default async function (call: ApiCall<ReqGet, ResGet>) { export default async function (call: ApiCall<ReqGet, ResGet>) {
@ -160,6 +160,9 @@ export default async function (call: ApiCall<ReqGet, ResGet>) {
case 'kaifujingsai': case 'kaifujingsai':
res[key] = await HongDianFun.kaifujingsai(call); res[key] = await HongDianFun.kaifujingsai(call);
break; break;
case 'zhoumolibao':
res[key] = await HongDianFun.zhoumolibao(call);
break;
} }
} }
} }

View File

@ -301,6 +301,18 @@ export class HongDianFun {
return {show: true, val: canGet} return {show: true, val: canGet}
} }
/**周末礼包 */
static async zhoumolibao(call: ApiCall): Promise<hongdianVal> {
let _hd = (await HuoDongFun.gethdList(call, 9))[0]
let gift = _hd?.data?.gift?.find(i => i.free)
if (!gift) return {show: false}
let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
let rec = data?.record?.[gift.id]
if (rec && rec >= gift?.buyNum) return {show: false}
return {show: true}
}
} }
@ -708,7 +720,8 @@ export class HuoDongHongDianFun {
if (_buyNum < _tmp.buynum) { if (_buyNum < _tmp.buynum) {
_res.show = true; _res.show = true;
return _res; return _res;
}} }
}
let _diff = PublicShared.getDiff(stime) let _diff = PublicShared.getDiff(stime)
// 循环判断是否有可以领取的 // 循环判断是否有可以领取的
for (let i = 0; i < _diff; i++) { for (let i = 0; i < _diff; i++) {

View File

@ -1,5 +1,3 @@
/** /**
* *
*/ */
@ -13,10 +11,47 @@ export const conf = {
timeIntervalLimit: 0 timeIntervalLimit: 0
}; };
export type hongdianKey = 'jiuba' | 'jiaotang' | 'shouchong' | 'dixiaqianzhuanghd' | 'taskhd' | 'xstaskhd' | 'gonghuihd' | 'jjchd' | 'hbzbhd' | export type hongdianKey =
'clslhd' | 'lingzhulaixihd' | 'dxlthd' | 'wzcjhd' | 'slzdhd' | 'qjzzdhd' | 'kuangdonghd' | 'qiandaohd' | 'kaifukuanghuanhd' | 'jijinhd' | 'zhuishalinghd' | 'jiuba'
'yibaichouhd' | 'huobanzhaomuhd' | 'qirileichonghd' | 'jierihd' | 'kbzzhd' | 'wzryhd' | 'yuedujijin' | 'patahd' | | 'jiaotang'
'mingdao' | 'heishihd' |'jitianhaoli'| 'huodonghd' | 'renown' | 'heishiMrjx' | 'weixiuchang' | 'kaifujingsai'; | 'shouchong'
| 'dixiaqianzhuanghd'
| 'taskhd'
| 'xstaskhd'
| 'gonghuihd'
| 'jjchd'
| 'hbzbhd'
|
'clslhd'
| 'lingzhulaixihd'
| 'dxlthd'
| 'wzcjhd'
| 'slzdhd'
| 'qjzzdhd'
| 'kuangdonghd'
| 'qiandaohd'
| 'kaifukuanghuanhd'
| 'jijinhd'
| 'zhuishalinghd'
|
'yibaichouhd'
| 'huobanzhaomuhd'
| 'qirileichonghd'
| 'jierihd'
| 'kbzzhd'
| 'wzryhd'
| 'yuedujijin'
| 'patahd'
|
'mingdao'
| 'heishihd'
| 'jitianhaoli'
| 'huodonghd'
| 'renown'
| 'heishiMrjx'
| 'weixiuchang'
| 'kaifujingsai'
| 'zhoumolibao';
export type hongdianVal = { export type hongdianVal = {

View File

@ -14894,6 +14894,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": "Literal", "type": "Literal",
"literal": "kaifujingsai" "literal": "kaifujingsai"
} }
},
{
"id": 36,
"type": {
"type": "Literal",
"literal": "zhoumolibao"
}
} }
] ]
}, },