Merge branch 'feature/huangqijiuguan' into dev
This commit is contained in:
commit
001a8166b5
@ -6,7 +6,7 @@ import { fightResult } from "../../../shared/fightControl/fightType";
|
||||
import { FightFun } from "../../../public/fight";
|
||||
|
||||
export default async function (call: ApiCall<ReqFight, ResFight>) {
|
||||
let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
|
||||
let hd = await HQJGFun.HdInfo(call, call.req.hdid);
|
||||
|
||||
if (!hd) {
|
||||
// 无此活动
|
||||
|
@ -1,10 +1,9 @@
|
||||
import HQJGFun from "./fun";
|
||||
import { ApiCall } from "tsrpc";
|
||||
import { HuoDongFun } from "../../../public/huodongfun";
|
||||
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huangqijiuguan/PtlOpen";
|
||||
|
||||
export default async (call: ApiCall<ReqOpen, ResOpen>) => {
|
||||
let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
|
||||
let hd = await HQJGFun.HdInfo(call, call.req.hdid);
|
||||
if (!hd || Object.keys(hd).length <= 0) {
|
||||
// 无此活动
|
||||
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
|
||||
|
@ -1,11 +1,10 @@
|
||||
import { ApiCall } from "tsrpc";
|
||||
import HQJGFun, { Data } from "./fun";
|
||||
import { HuoDongFun } from "../../../public/huodongfun";
|
||||
import { ReqRecDpsPrize, ResRecDpsPrize } from "../../../shared/protocols/event/huangqijiuguan/PtlRecDpsPrize";
|
||||
import { PlayerFun } from "../../../public/player";
|
||||
|
||||
export default async function (call: ApiCall<ReqRecDpsPrize, ResRecDpsPrize>) {
|
||||
let hd = await HuoDongFun.getHdidInfo(call, call.req.hdid);
|
||||
let hd = await HQJGFun.HdInfo(call, call.req.hdid);
|
||||
|
||||
if (!hd) {
|
||||
// 无此活动
|
||||
|
@ -14,13 +14,19 @@ export default async function (call: ApiCall<ReqZhaoMuPrizeRec, ResZhaoMuPrizeRe
|
||||
let mydata = await HQJGFun.getMydata(call, call.req.hdid);
|
||||
|
||||
for (let rec of call.req.recid) {
|
||||
let con = hd.data.choukajiangli[rec];
|
||||
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec)) {
|
||||
let con = hd.data.choukajiangli[rec.idx];
|
||||
|
||||
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec.idx)) {
|
||||
continue
|
||||
}
|
||||
|
||||
mydata.zhaomu.prize.push(rec);
|
||||
prize = prize.concat(con.prize);
|
||||
if (con.dlz) {
|
||||
prize.push(con.dlz[rec.sec]);
|
||||
} else {
|
||||
prize = prize.concat(con.prize);
|
||||
}
|
||||
|
||||
mydata.zhaomu.prize.push(rec.idx);
|
||||
}
|
||||
|
||||
if (prize.length <= 0) {
|
||||
|
@ -26,7 +26,7 @@ export interface Data {
|
||||
|
||||
chouka: { a: string, t: string, n: number, p: number, gailv: number, cishu: number }[]
|
||||
|
||||
choukajiangli: { num: number, prize: any[] }[]
|
||||
choukajiangli: { num: number, prize?: any[], dlz: { [k: string]: atn } }[]
|
||||
|
||||
baodi: { num: number, prize: any[] }[]
|
||||
|
||||
@ -151,14 +151,14 @@ export default class HQJGFun {
|
||||
}
|
||||
|
||||
/** 获取活动数据 */
|
||||
static async HdInfo(call: ApiCall, hdid?: number): Promise<ReqAddHuoDong> {
|
||||
static async HdInfo(call: ApiCall, hdid?: number): Promise<ReqAddHuoDong & { data: Data }> {
|
||||
if (!hdid) {
|
||||
let hdlist = await HuoDongFun.gethdList(
|
||||
call, this.htype
|
||||
);
|
||||
return hdlist.length > 0 ? hdlist[0] : null
|
||||
} else {
|
||||
return await HuoDongFun.getHdidInfo(call, hdid) as ReqAddHuoDong
|
||||
return await HuoDongFun.getHdidInfo(call, hdid) as any as ReqAddHuoDong & { data: Data }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { PlayerData } from "../../../../api_s2c/event/huangqijiuguan/fun"
|
||||
|
||||
export interface ReqZhaoMuPrizeRec {
|
||||
hdid: number
|
||||
recid: number[]
|
||||
recid: { idx: number, sec: string }[]
|
||||
}
|
||||
|
||||
export interface ResZhaoMuPrizeRec {
|
||||
|
Loading…
Reference in New Issue
Block a user