功能:/guide 使用说明页面新增娱乐游戏板块
- 动态读取 game_configs 表,仅展示已启用的游戏
- 新增「🎮 娱乐游戏」板块,包含8款游戏的规则和关键参数
(钓鱼、老虎机、百家乐、赛马竞猜、神秘箱子、神秘占卜、双色球彩票、五子棋)
- 金币用途列表动态遍历已启用游戏
- 右侧导航加入「娱乐游戏」入口(按游戏开启状态条件渲染)
This commit is contained in:
@@ -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 @@
|
||||
<a href="#sec-charm">✨ 魅力系统</a>
|
||||
<a href="#sec-gift">🎁 礼物系统</a>
|
||||
<a href="#sec-vip">👑 VIP 会员</a>
|
||||
@if($enabledGames->count() > 0)
|
||||
<a href="#sec-games">🎮 娱乐游戏</a>
|
||||
@endif
|
||||
<a href="#sec-admin">🛡️ 管理权限</a>
|
||||
<a href="#sec-rank">🏆 排行榜</a>
|
||||
<a href="#sec-basic">💬 基础操作</a>
|
||||
@@ -99,7 +237,7 @@
|
||||
{{-- 页面标题 --}}
|
||||
<div class="text-center mb-10">
|
||||
<h1 class="text-3xl font-extrabold text-gray-800 mb-2">🌟 飘落流星聊天室 · 使用说明</h1>
|
||||
<p class="text-gray-500">了解如何获取经验、金币、魅力,以及各项功能的使用规则</p>
|
||||
<p class="text-gray-500">了解如何获取经验、金币、魅力,以及各项功能和游戏的使用规则</p>
|
||||
</div>
|
||||
|
||||
{{-- ═══ 1. 经验与等级 ═══ --}}
|
||||
@@ -163,12 +301,17 @@
|
||||
<li>与经验一起,挂机聊天自动获得</li>
|
||||
<li>每次存点获得 <strong class="text-amber-600">{{ $jjbPerHb }}</strong> 枚金币(支持范围随机)</li>
|
||||
<li>VIP 会员享受金币加倍</li>
|
||||
<li>参与游戏获胜可赢取金币奖励</li>
|
||||
</ul>
|
||||
|
||||
<p class="font-bold text-amber-800 mt-4 mb-2">金币用途</p>
|
||||
<ul class="list-disc list-inside space-y-1 text-gray-600">
|
||||
<li>🎁 送礼物 — 向其他用户赠送鲜花等礼物(消耗金币)</li>
|
||||
<li>🎣 钓鱼 — 消耗金币参与钓鱼游戏</li>
|
||||
<li>🎁 <strong>送礼物</strong> — 向其他用户赠送礼物(消耗金币)</li>
|
||||
@foreach($gameDefinitions as $key => $def)
|
||||
@if($enabledGames->has($key))
|
||||
<li>{{ $def['icon'] }} <strong>{{ $def['label'] }}</strong> — 参与{{ $def['label'] }}游戏</li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -259,7 +402,45 @@
|
||||
</section>
|
||||
@endif
|
||||
|
||||
{{-- ═══ 6. 管理权限 ═══ --}}
|
||||
{{-- ═══ 6. 娱乐游戏 ═══ --}}
|
||||
@if($enabledGames->count() > 0)
|
||||
<section id="sec-games" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6 mb-6">
|
||||
<h2 class="text-xl font-bold text-green-700 mb-1 flex items-center gap-2">🎮 娱乐游戏</h2>
|
||||
<p class="text-sm text-gray-500 mb-5">点击聊天室工具栏中的游戏图标即可参与,金币可通过挂机获得。</p>
|
||||
|
||||
<div class="space-y-4">
|
||||
@foreach($gameDefinitions as $key => $def)
|
||||
@if($enabledGames->has($key))
|
||||
@php
|
||||
$game = $enabledGames->get($key);
|
||||
$params = $game->params ?? [];
|
||||
$c = $colorMap[$def['color']] ?? $colorMap['slate'];
|
||||
$details = ($def['details'])($params);
|
||||
@endphp
|
||||
<div class="rounded-xl border {{ $c['border'] }} {{ $c['bg'] }} p-4">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<span class="text-2xl w-10 h-10 flex items-center justify-center rounded-xl {{ $c['icon'] }}">{{ $def['icon'] }}</span>
|
||||
<div>
|
||||
<h3 class="font-bold {{ $c['title'] }} text-base">{{ $def['label'] }}</h3>
|
||||
<p class="text-xs text-gray-500 mt-0.5">{{ $def['intro'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="space-y-1">
|
||||
@foreach($details as $detail)
|
||||
<li class="text-xs text-gray-600 flex items-start gap-1.5">
|
||||
<span class="mt-0.5 shrink-0 w-4 h-4 rounded-full text-center leading-4 text-[10px] font-bold {{ $c['tag'] }}">✓</span>
|
||||
{{ $detail }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</section>
|
||||
@endif
|
||||
|
||||
{{-- ═══ 7. 管理权限 ═══ --}}
|
||||
<section id="sec-admin" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6 mb-6">
|
||||
<h2 class="text-xl font-bold text-red-700 mb-4 flex items-center gap-2">🛡️ 管理权限</h2>
|
||||
|
||||
@@ -297,7 +478,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{-- ═══ 7. 排行榜 ═══ --}}
|
||||
{{-- ═══ 8. 排行榜 ═══ --}}
|
||||
<section id="sec-rank" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6 mb-6">
|
||||
<h2 class="text-xl font-bold text-emerald-700 mb-4 flex items-center gap-2">🏆 排行榜</h2>
|
||||
|
||||
@@ -311,7 +492,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{-- ═══ 8. 基础操作 ═══ --}}
|
||||
{{-- ═══ 9. 基础操作 ═══ --}}
|
||||
<section id="sec-basic" class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6 mb-6">
|
||||
<h2 class="text-xl font-bold text-gray-700 mb-4 flex items-center gap-2">💬 基础操作</h2>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user