迁移钓鱼游戏脚本

This commit is contained in:
2026-04-25 14:43:33 +08:00
parent dac8adfc5a
commit 9f61dcc619
4 changed files with 631 additions and 575 deletions
+7
View File
@@ -30,6 +30,11 @@
$operatorActivePosition = Auth::user()->activePosition?->load('position.department')->position;
$operatorDepartmentRank = (int) ($operatorActivePosition?->department?->rank ?? 0);
$operatorPositionRank = (int) ($operatorActivePosition?->rank ?? 0);
// 自动钓鱼状态下发给 Vite 模块,避免钓鱼面板继续在 Blade 内写业务脚本。
$autoFishingMinutesLeft = app(\App\Services\ShopService::class)->getActiveAutoFishingMinutesLeft(Auth::user());
$fishingCooldownKey = 'fishing:cd:'.Auth::id();
$fishingCooldownSeconds = \Illuminate\Support\Facades\Redis::ttl($fishingCooldownKey);
$fishingCooldownSeconds = $fishingCooldownSeconds > 0 ? $fishingCooldownSeconds : 0;
@endphp
<script>
window.chatContext = {
@@ -49,6 +54,8 @@
heartbeatUrl: "{{ route('chat.heartbeat', $room->id) }}",
fishCastUrl: "{{ route('fishing.cast', $room->id) }}",
fishReelUrl: "{{ route('fishing.reel', $room->id) }}",
autoFishingMinutesLeft: {{ (int) $autoFishingMinutesLeft }},
fishingCooldownSeconds: {{ (int) $fishingCooldownSeconds }},
chatBotUrl: "{{ route('chatbot.chat') }}",
chatBotClearUrl: "{{ route('chatbot.clear') }}",
@php