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";
|
import { FightFun } from "../../../public/fight";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqFight, ResFight>) {
|
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) {
|
if (!hd) {
|
||||||
// 无此活动
|
// 无此活动
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import HQJGFun from "./fun";
|
import HQJGFun from "./fun";
|
||||||
import { ApiCall } from "tsrpc";
|
import { ApiCall } from "tsrpc";
|
||||||
import { HuoDongFun } from "../../../public/huodongfun";
|
|
||||||
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huangqijiuguan/PtlOpen";
|
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/huangqijiuguan/PtlOpen";
|
||||||
|
|
||||||
export default async (call: ApiCall<ReqOpen, ResOpen>) => {
|
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) {
|
if (!hd || Object.keys(hd).length <= 0) {
|
||||||
// 无此活动
|
// 无此活动
|
||||||
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
|
return call.error('', { code: -1, message: globalThis.lng.huodong_open_1 })
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import { ApiCall } from "tsrpc";
|
||||||
import HQJGFun, { Data } from "./fun";
|
import HQJGFun, { Data } from "./fun";
|
||||||
import { HuoDongFun } from "../../../public/huodongfun";
|
|
||||||
import { ReqRecDpsPrize, ResRecDpsPrize } from "../../../shared/protocols/event/huangqijiuguan/PtlRecDpsPrize";
|
import { ReqRecDpsPrize, ResRecDpsPrize } from "../../../shared/protocols/event/huangqijiuguan/PtlRecDpsPrize";
|
||||||
import { PlayerFun } from "../../../public/player";
|
import { PlayerFun } from "../../../public/player";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqRecDpsPrize, ResRecDpsPrize>) {
|
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) {
|
if (!hd) {
|
||||||
// 无此活动
|
// 无此活动
|
||||||
|
@ -14,13 +14,19 @@ export default async function (call: ApiCall<ReqZhaoMuPrizeRec, ResZhaoMuPrizeRe
|
|||||||
let mydata = await HQJGFun.getMydata(call, call.req.hdid);
|
let mydata = await HQJGFun.getMydata(call, call.req.hdid);
|
||||||
|
|
||||||
for (let rec of call.req.recid) {
|
for (let rec of call.req.recid) {
|
||||||
let con = hd.data.choukajiangli[rec];
|
let con = hd.data.choukajiangli[rec.idx];
|
||||||
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec)) {
|
|
||||||
|
if (con.num > mydata.zhaomu.num || mydata.zhaomu.prize.includes(rec.idx)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
mydata.zhaomu.prize.push(rec);
|
if (con.dlz) {
|
||||||
prize = prize.concat(con.prize);
|
prize.push(con.dlz[rec.sec]);
|
||||||
|
} else {
|
||||||
|
prize = prize.concat(con.prize);
|
||||||
|
}
|
||||||
|
|
||||||
|
mydata.zhaomu.prize.push(rec.idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prize.length <= 0) {
|
if (prize.length <= 0) {
|
||||||
|
@ -26,7 +26,7 @@ export interface Data {
|
|||||||
|
|
||||||
chouka: { a: string, t: string, n: number, p: number, gailv: number, cishu: number }[]
|
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[] }[]
|
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) {
|
if (!hdid) {
|
||||||
let hdlist = await HuoDongFun.gethdList(
|
let hdlist = await HuoDongFun.gethdList(
|
||||||
call, this.htype
|
call, this.htype
|
||||||
);
|
);
|
||||||
return hdlist.length > 0 ? hdlist[0] : null
|
return hdlist.length > 0 ? hdlist[0] : null
|
||||||
} else {
|
} 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 {
|
export interface ReqZhaoMuPrizeRec {
|
||||||
hdid: number
|
hdid: number
|
||||||
recid: number[]
|
recid: { idx: number, sec: string }[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResZhaoMuPrizeRec {
|
export interface ResZhaoMuPrizeRec {
|
||||||
|
Loading…
Reference in New Issue
Block a user