feat(game): 添加连续奖励表格和银行选项图标
- 在游戏规则模态框中添加连续奖励表格组件 - 更新英文和印尼语的游戏规则文本内容 - 添加银行选项的图标显示功能,支持自定义logo或默认地标图标 - 实现连续奖励数据类型和接口定义 - 在游戏会话存储中添加连续奖励行数据管理 - 集成银行选择下拉菜单中的图标展示 - 更新WithdrawField组件以支持银行图标显示
This commit is contained in:
@@ -33,6 +33,7 @@ import type {
|
||||
GameLobbyInitDto,
|
||||
GameLobbyInitResult,
|
||||
GameLobbyPeriodDto,
|
||||
GameLobbyStreakWinRewardRowDto,
|
||||
GamePeriodTickDto,
|
||||
GamePlaceBetDto,
|
||||
GamePlaceBetRequestDto,
|
||||
@@ -45,6 +46,7 @@ import type {
|
||||
RoundPhase,
|
||||
RoundSnapshot,
|
||||
RoundSnapshotDto,
|
||||
StreakWinRewardRow,
|
||||
TrendEntry,
|
||||
TrendEntryDto,
|
||||
} from '@/type'
|
||||
@@ -260,6 +262,26 @@ function normalizeLobbyCells(dictionary: GameLobbyInitDto['dictionary']) {
|
||||
)
|
||||
}
|
||||
|
||||
function normalizeStreakWinRewardRows(rows?: GameLobbyStreakWinRewardRowDto[]) {
|
||||
if (!Array.isArray(rows)) {
|
||||
return []
|
||||
}
|
||||
|
||||
return rows
|
||||
.filter((row) => Number.isFinite(row.streak))
|
||||
.map(
|
||||
(row) =>
|
||||
({
|
||||
fixedAmount: row.fixed_amount,
|
||||
isJackpot: row.is_jackpot,
|
||||
oddsFactor: Number(row.odds_factor) || 0,
|
||||
rewardType: row.reward_type,
|
||||
streak: Math.floor(row.streak),
|
||||
}) satisfies StreakWinRewardRow,
|
||||
)
|
||||
.sort((left, right) => left.streak - right.streak)
|
||||
}
|
||||
|
||||
export function normalizePeriodTickRound(
|
||||
period: GamePeriodTickDto,
|
||||
previousRound?: Pick<RoundSnapshot, 'id' | 'startedAt'> | null,
|
||||
@@ -408,6 +430,9 @@ export async function getGameLobbyInit() {
|
||||
runtimeEnabled: dto.runtime_enabled,
|
||||
serverTime: dto.server_time,
|
||||
snapshot: normalizeGameLobbyInit(dto),
|
||||
streakWinRewardRows: normalizeStreakWinRewardRows(
|
||||
dto.streak_win_reward?.rows,
|
||||
),
|
||||
userSnapshot: dto.user_snapshot,
|
||||
} satisfies GameLobbyInitResult
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user