历史记录详情显示

This commit is contained in:
TJH 2026-04-29 16:55:41 +08:00
parent 4e7fcae46c
commit 7dee3af062
3 changed files with 1523 additions and 1347 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { _decorator, Button, Color, Component, EventHandler, instantiate, JsonAsset, Label, Layout, Node, ScrollView, sp, Sprite, SpriteAtlas, SpriteFrame, tween, UITransform, v3, Vec3 } from 'cc';
import { ScrollControl } from './ScrollControl';
import { fixNum, getTimezoneOffsetString, getTranslate, hideAllChildren, updateLang, waitNextFrame } from './Tools';
import { fixNum, getTimezoneOffsetString, getTranslate, hideAllChildren, ICON_RATE, updateLang, waitNextFrame } from './Tools';
let { ccclass, property } = _decorator;
@ccclass('HistoryDetail')
@ -346,7 +346,7 @@ export class HistoryDetail extends Component {
// 加载一盘数据
loadOne(item: Node, pan, idx, formattedData) {
let winInfo = pan.WinInfo;
let winInfo = pan.SymbolWinInfos;
item.position = new Vec3()
this.list_detail.content.addChild(item)
@ -399,19 +399,16 @@ export class HistoryDetail extends Component {
roller_wins.removeAllChildren();
let upIconIndexs = [];
if (winInfo != null) {
if (winInfo.Desc != null) {
let desc = winInfo.Desc;
if (winInfo[0] != null) {
// 对{}进行遍历
roller_gray.active = true;
for (let key in desc) {
let middle = desc[key];
upIconIndexs.push(...middle.Middle);
for (let key in winInfo) {
let middle = winInfo[key];
upIconIndexs.push(...middle.BottomPos);
}
// 去重
upIconIndexs = upIconIndexs.filter((value, index, self) => self.indexOf(value) === index);
}
}
for (let index = 0; index < pan.PanColor.Bottom.length; index++) {
let iconServerIndex = pan.PanColor.Bottom[index];
@ -479,7 +476,7 @@ export class HistoryDetail extends Component {
// No Winning Combination
let node_no_winning = content.getChildByName("node_no_winning")
node_no_winning.active = pan.WinInfo == null;
node_no_winning.active = winInfo[0] == null;
//
let node_feature_buy = content.getChildByName("node_feature_buy")
@ -494,20 +491,20 @@ export class HistoryDetail extends Component {
node_win_multiplier_1.active = false;
if (winInfo != null) {
if (winInfo.MulDesc != null) {
let mulDesc = winInfo.MulDesc;
if (pan.RoundInfo.Mul > 1) {
// let mulDesc = winInfo.MulDesc;
let txt_win_multiplier = node_win_multiplier.getChildByName("txt_win_multiplier")
txt_win_multiplier.getComponent(Label).string = getTranslate(this.dict, "Win Multiplier") + " x " + mulDesc.Mul;
txt_win_multiplier.getComponent(Label).string = getTranslate(this.dict, "Win Multiplier") + " x " + pan.RoundInfo.Mul;
node_win_multiplier.active = true;
let txt_win_multiplier_1 = node_win_multiplier_1.getChildByName("txt_win_multiplier_1");
txt_win_multiplier_1.getComponent(Label).string = getTranslate(this.dict, "Win Multiplier");
let mulited = node_win_multiplier_1.getChildByName("mulited");
mulited.getComponent(Label).string = `${currencySymbol} ${fixNum(mulDesc.Multied)}` + '';
mulited.getComponent(Label).string = `${currencySymbol} ${fixNum(pan.RoundInfo.Score)}` + '';
let unmulited = node_win_multiplier_1.getChildByName("unmulited");
unmulited.getComponent(Label).string = `${currencySymbol} ${fixNum(mulDesc.UnMultied)} x ${mulDesc.Mul}`;
unmulited.getComponent(Label).string = `${currencySymbol} ${fixNum(pan.RoundInfo.AllScoreMul)} x ${pan.RoundInfo.Mul}`;
node_win_multiplier_1.active = true;
}
@ -543,22 +540,23 @@ export class HistoryDetail extends Component {
// let item_kind = instantiate(this.item_win_kind);
if (winInfo != null) {
if (winInfo.Desc != null) {
if (winInfo[0] != null) {
let node_formula = content.getChildByName('node_formula');
let desc = winInfo.Desc;
for (let key in desc) {
let symbolWinInfo = desc[key];
for (let key in winInfo) {
let symbolWinInfo = winInfo[key];
let hitColor = this.ICON_SERVER_MAP[pan.PanColor.Bottom[symbolWinInfo.BottomPos[0]]]
let item_win_kind = instantiate(this.item_win_kind)
item_win_kind.name = `item_win_kind_${key}`;
item_win_kind.name = `item_win_kind_${hitColor}`;
let sp = item_win_kind.getChildByName("sp").getComponent(Sprite);
let path_symbol = `${this.ICON_SERVER_MAP[key]}`;
let bg = item_win_kind.getChildByName("bg").getComponent(Sprite);
let sp = item_win_kind.getChildByPath("bg/sp").getComponent(Sprite);
let path_symbol = `${hitColor}`;
bg.spriteFrame = this.bgAtlas.getSpriteFrame(path_symbol);
sp.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_symbol);
let txt_kind = item_win_kind.getChildByName("txt_kind").getComponent(Label);
txt_kind.string = 'x' + symbolWinInfo.Middle.length;
txt_kind.string = 'x' + symbolWinInfo.BottomPos.length;
let txt_win = item_win_kind.getChildByName("txt_win").getComponent(Label)
txt_win.string = `${currencySymbol}${fixNum(symbolWinInfo.Score)}`
@ -569,7 +567,7 @@ export class HistoryDetail extends Component {
Label_Formual.string = getTranslate(this.dict, "BxS")
let txt_formual_detail = formula_detail.getChildByName("txt_formual_detail").getComponent(Label)
txt_formual_detail.string = symbolWinInfo.Formula || 'No Data !!';
txt_formual_detail.string = fixNum(pan.Bet) + ' x ' + this.getWinSymbolMulti(pan.PanColor.Bottom, symbolWinInfo.BottomPos).toFixed(2);
formula_detail.active = false;
item_win_kind.position = new Vec3()
@ -599,12 +597,28 @@ export class HistoryDetail extends Component {
// 多给一截滑动空间
content.getComponent(UITransform).height = content.getComponent(UITransform).height + 200
}
}
hideAllChildren(item)
}
getWinSymbolMulti(panColor, BottomPos: any[]) {
let hitColor: number = this.ICON_SERVER_MAP[panColor[BottomPos[0]]]
let winLevel: number = 0
if (BottomPos.length <= 9) {
winLevel = 0
} else if (BottomPos.length <= 11) {
winLevel = 1
} else {
winLevel = 3
}
return ICON_RATE[hitColor][winLevel]
}
async loadDetailList() {
// 时间

View File

@ -36,6 +36,19 @@ interface LangTxt {
richTexts: RichText[]; // RichText 组件数组
}
export let ICON_RATE: number[][] = [
[0, 0, 0], // scatter
[10, 25, 50], // 神灯
[2.5, 10, 25], // 魔毯
[2, 5, 15], // 刀
[1.5, 2, 12], // 戒指
[1, 1.5, 10], // 项链
[0.8, 1.2, 8], // 瓶子
[0.5, 1, 5], // 金币
[0.4, 0.9, 4], // 银币
[0.2, 0.75, 2], // 铜币
]
export function fixNum(num: number): string {
return (num / 10000).toFixed(2)
}