diff --git a/resources/views/rooms/guide.blade.php b/resources/views/rooms/guide.blade.php index 5125d7f..6ce1810 100644 --- a/resources/views/rooms/guide.blade.php +++ b/resources/views/rooms/guide.blade.php @@ -1,10 +1,10 @@ {{-- 文件功能:聊天室使用说明页面 - 动态读取后台配置(sysparam、vip_levels、gifts)展示规则 + 动态读取后台配置(sysparam、vip_levels、gifts、game_configs)展示规则 @extends layouts.app @author ChatRoom Laravel - @version 1.0.0 + @version 2.0.0 --}} @extends('layouts.app') @@ -44,6 +44,7 @@ @endsection @php + use App\Models\GameConfig; use App\Models\Sysparam; use App\Models\VipLevel; use App\Models\Gift; @@ -75,6 +76,140 @@ // 礼物列表 $gifts = Gift::activeList(); + + // 已启用的游戏配置(按 game_key 索引) + $enabledGames = GameConfig::query()->where('enabled', true)->get()->keyBy('game_key'); + + // 各游戏展示定义(icon / 名称 / 简介 / 参数解析回调) + // 每条对应 gameKey => [ icon, label, intro, details[] ] + $gameDefinitions = [ + 'fishing' => [ + 'icon' => '🎣', + 'label' => '钓鱼小游戏', + 'color' => 'teal', + 'intro' => '在聊天室内消耗金币参与钓鱼,根据鱼的稀有度赢取不同奖励。', + 'details' => function ($p) { + return [ + '每次消耗 ' . ($p['fishing_cost'] ?? 5) . ' 金币', + '等待 ' . ($p['fishing_wait_min'] ?? 8) . '~' . ($p['fishing_wait_max'] ?? 15) . ' 秒后收竿', + '冷却时间 ' . (int) (($p['fishing_cooldown'] ?? 300) / 60) . ' 分钟', + ]; + }, + ], + 'slot_machine' => [ + 'icon' => '🎰', + 'label' => '老虎机', + 'color' => 'violet', + 'intro' => '消耗金币拉动老虎机,连线相同符号即可赢取倍率奖励,全图案一致赢取 Jackpot!', + 'details' => function ($p) { + return [ + '每次消耗 ' . ($p['cost_per_spin'] ?? 100) . ' 金币', + '每日最多拉 ' . ($p['daily_limit'] ?? 100) . ' 次', + '对子 ×' . ($p['pair_payout'] ?? 2) . ',三同 ×' . ($p['same_payout'] ?? 10) . ',全同 ×' . ($p['triple_payout'] ?? 50) . ',Jackpot ×' . ($p['jackpot_payout'] ?? 100), + ]; + }, + ], + 'baccarat' => [ + 'icon' => '🃏', + 'label' => '百家乐', + 'color' => 'red', + 'intro' => '竞猜庄闲大小,系统每 2 分钟开一局,在投注窗口内下注,猜中即赢。', + 'details' => function ($p) { + $interval = $p['interval_minutes'] ?? 2; + $window = $p['bet_window_seconds'] ?? 60; + return [ + '投注范围 ' . number_format($p['min_bet'] ?? 100) . '~' . number_format($p['max_bet'] ?? 50000) . ' 金币', + '每 ' . $interval . ' 分钟一局,投注窗口 ' . $window . ' 秒', + '大/小/庄/闲赔率 ×' . (1 + ($p['payout_big'] ?? 1)) . ',三公赔率 ×' . (1 + ($p['payout_triple'] ?? 24)), + ]; + }, + ], + 'horse_racing' => [ + 'icon' => '🏇', + 'label' => '赛马竞猜', + 'color' => 'amber', + 'intro' => '从 4 匹马中选择你看好的,押注金币,赛后按赔率发放奖励。', + 'details' => function ($p) { + return [ + '投注范围 ' . number_format($p['min_bet'] ?? 100) . '~' . number_format($p['max_bet'] ?? 100000) . ' 金币', + '每 ' . ($p['interval_minutes'] ?? 30) . ' 分钟一场,投注窗口 ' . ($p['bet_window_seconds'] ?? 90) . ' 秒', + '平台抽成 ' . ($p['house_take_percent'] ?? 5) . '%,剩余按得票比例派奖', + ]; + }, + ], + 'mystery_box' => [ + 'icon' => '📦', + 'label' => '神秘箱子', + 'color' => 'indigo', + 'intro' => '管理员不定时在大厅投放神秘箱子,在线用户可点击领取,有惊喜也有陷阱!', + 'details' => function ($p) { + return [ + '普通奖励 ' . number_format($p['normal_reward_min'] ?? 500) . '~' . number_format($p['normal_reward_max'] ?? 2000) . ' 金币', + '稀有奖励 ' . number_format($p['rare_reward_min'] ?? 5000) . '~' . number_format($p['rare_reward_max'] ?? 20000) . ' 金币', + '陷阱概率 ' . ($p['trap_chance_percent'] ?? 10) . '%,触发扣除 ' . number_format($p['trap_penalty_min'] ?? 200) . '~' . number_format($p['trap_penalty_max'] ?? 1000) . ' 金币', + '领取窗口 ' . ($p['claim_window_seconds'] ?? 60) . ' 秒,先到先得', + ]; + }, + ], + 'fortune_telling' => [ + 'icon' => '🔮', + 'label' => '神秘占卜', + 'color' => 'purple', + 'intro' => '向神秘占卜师请卦,每日免费一次,获得吉凶预言和 24 小时加成 Buff。', + 'details' => function ($p) { + return [ + '每日免费 ' . ($p['free_count_per_day'] ?? 1) . ' 次,额外次数消耗 ' . number_format($p['extra_cost'] ?? 500) . ' 金币', + '大吉 ' . ($p['jackpot_chance'] ?? 5) . '%・吉 ' . ($p['good_chance'] ?? 20) . '%・凶 ' . ($p['bad_chance'] ?? 20) . '%・诅咒 ' . ($p['curse_chance'] ?? 5) . '%', + 'Buff 持续 ' . ($p['buff_duration_hours'] ?? 24) . ' 小时(影响金币 / 经验加成)', + ]; + }, + ], + 'lottery' => [ + 'icon' => '🎟️', + 'label' => '双色球彩票', + 'color' => 'rose', + 'intro' => '每日一期,3 颗红球 + 1 颗蓝球,猜中越多奖励越丰厚,奖池无人中奖时自动滚存!', + 'details' => function ($p) { + $drawH = $p['draw_hour'] ?? 20; + $drawM = str_pad($p['draw_minute'] ?? 0, 2, '0', STR_PAD_LEFT); + return [ + '每注 ' . number_format($p['ticket_price'] ?? 100) . ' 金币,每人每期最多 ' . ($p['max_tickets_per_user'] ?? 50) . ' 注', + '每日 ' . $drawH . ':' . $drawM . ' 开奖,停售提前 ' . ($p['stop_sell_minutes'] ?? 2) . ' 分钟', + '一等奖 = 奖池 ' . ($p['prize_1st_ratio'] ?? 60) . '%,二等 ' . ($p['prize_2nd_ratio'] ?? 20) . '%,三等 ' . ($p['prize_3rd_ratio'] ?? 10) . '%', + '四等固定 ' . ($p['prize_4th_fixed'] ?? 150) . ' 金币,五等固定 ' . ($p['prize_5th_fixed'] ?? 50) . ' 金币', + '连续 ' . ($p['super_issue_threshold'] ?? 3) . ' 期无一等奖触发超级期,系统额外注入 ' . number_format($p['super_issue_inject'] ?? 20000) . ' 金币', + ]; + }, + ], + 'gomoku' => [ + 'icon' => '♟️', + 'label' => '五子棋', + 'color' => 'slate', + 'intro' => '15×15 棋盘,率先五子连珠者胜。支持玩家对战(PvP)和人机对战(PvE)两种模式。', + 'details' => function ($p) { + return [ + 'PvP 对战:胜者获得 ' . ($p['pvp_reward'] ?? 80) . ' 金币,邀请超时 ' . ($p['invite_timeout'] ?? 60) . ' 秒', + '简单(免费)胜奖 ' . ($p['pve_easy_reward'] ?? 20) . ' 金币', + '普通(入场 ' . ($p['pve_normal_fee'] ?? 10) . ' 金币)胜奖 ' . ($p['pve_normal_reward'] ?? 50) . ' 金币', + '困难(入场 ' . ($p['pve_hard_fee'] ?? 30) . ' 金币)胜奖 ' . ($p['pve_hard_reward'] ?? 120) . ' 金币', + '专家(入场 ' . ($p['pve_expert_fee'] ?? 80) . ' 金币)胜奖 ' . ($p['pve_expert_reward'] ?? 300) . ' 金币', + '每步限时 ' . ($p['move_timeout'] ?? 30) . ' 秒,超时判负', + ]; + }, + ], + ]; + + // 颜色主题映射 + $colorMap = [ + 'teal' => ['bg' => 'bg-teal-50', 'border' => 'border-teal-200', 'icon' => 'bg-teal-100', 'title' => 'text-teal-700', 'tag' => 'bg-teal-100 text-teal-700'], + 'violet' => ['bg' => 'bg-violet-50', 'border' => 'border-violet-200','icon' => 'bg-violet-100', 'title' => 'text-violet-700','tag' => 'bg-violet-100 text-violet-700'], + 'red' => ['bg' => 'bg-red-50', 'border' => 'border-red-200', 'icon' => 'bg-red-100', 'title' => 'text-red-700', 'tag' => 'bg-red-100 text-red-700'], + 'amber' => ['bg' => 'bg-amber-50', 'border' => 'border-amber-200', 'icon' => 'bg-amber-100', 'title' => 'text-amber-700', 'tag' => 'bg-amber-100 text-amber-700'], + 'indigo' => ['bg' => 'bg-indigo-50', 'border' => 'border-indigo-200','icon' => 'bg-indigo-100', 'title' => 'text-indigo-700','tag' => 'bg-indigo-100 text-indigo-700'], + 'purple' => ['bg' => 'bg-purple-50', 'border' => 'border-purple-200','icon' => 'bg-purple-100', 'title' => 'text-purple-700','tag' => 'bg-purple-100 text-purple-700'], + 'rose' => ['bg' => 'bg-rose-50', 'border' => 'border-rose-200', 'icon' => 'bg-rose-100', 'title' => 'text-rose-700', 'tag' => 'bg-rose-100 text-rose-700'], + 'slate' => ['bg' => 'bg-slate-50', 'border' => 'border-slate-200', 'icon' => 'bg-slate-100', 'title' => 'text-slate-700', 'tag' => 'bg-slate-100 text-slate-700'], + ]; @endphp @section('content') @@ -86,6 +221,9 @@ ✨ 魅力系统 🎁 礼物系统 👑 VIP 会员 + @if($enabledGames->count() > 0) + 🎮 娱乐游戏 + @endif 🛡️ 管理权限 🏆 排行榜 💬 基础操作 @@ -99,7 +237,7 @@ {{-- 页面标题 --}}
了解如何获取经验、金币、魅力,以及各项功能的使用规则
+了解如何获取经验、金币、魅力,以及各项功能和游戏的使用规则
金币用途
点击聊天室工具栏中的游戏图标即可参与,金币可通过挂机获得。
+ +{{ $def['intro'] }}
+