Files
chatroom/resources/views/admin/holiday-events/create.blade.php
lkddi 040dbdef3c 优化:全站金币图标由 🪙(银灰色)统一替换为 💰(金黄色)
🪙 在多数平台/字体上渲染为银灰色,与「金币」语义不符;
💰 各平台均渲染为金黄色,更直观传达金币概念。

涉及文件(43处):
- app/Jobs:百家乐、赛马结算广播
- app/Http/Controllers:管理员命令、红包、老虎机、神秘箱子
- app/Listeners
- resources/views:聊天室各游戏面板、商店、toolbar、后台页面等
2026-03-04 15:00:02 +08:00

192 lines
12 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('admin.layouts.app')
@section('title', '创建节日福利活动')
@section('content')
<div class="max-w-3xl mx-auto space-y-6">
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
<div class="flex items-center gap-3 mb-6">
<a href="{{ route('admin.holiday-events.index') }}" class="text-gray-400 hover:text-gray-600"> 返回列表</a>
<h2 class="text-lg font-bold text-gray-800">🎊 创建节日福利活动</h2>
</div>
@if ($errors->any())
<div class="bg-red-50 border border-red-200 rounded-lg p-4 mb-6">
<ul class="list-disc list-inside text-sm text-red-700 space-y-1">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form action="{{ route('admin.holiday-events.store') }}" method="POST" x-data="holidayForm()">
@csrf
{{-- 基础信息 --}}
<div class="mb-6">
<h3 class="text-sm font-bold text-gray-700 mb-3 pb-2 border-b">📋 基础信息</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">活动名称 <span
class="text-red-500">*</span></label>
<input type="text" name="name" value="{{ old('name') }}" required placeholder="例:元旦快乐🎊"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm focus:border-amber-400 focus:ring-amber-400">
</div>
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">活动描述 <span
class="text-gray-400 font-normal">(可选,公屏广播时显示)</span></label>
<textarea name="description" rows="2" placeholder="例:新年快乐!感谢大家一直以来的陪伴,送上新年礼物!"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm focus:border-amber-400 focus:ring-amber-400">{{ old('description') }}</textarea>
</div>
</div>
</div>
{{-- 奖励配置 --}}
<div class="mb-6">
<h3 class="text-sm font-bold text-gray-700 mb-3 pb-2 border-b">💰 奖励配置</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">总金币奖池 <span
class="text-red-500">*</span></label>
<input type="number" name="total_amount" value="{{ old('total_amount', 100000) }}" required
min="1" class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
</div>
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">可领取人数上限 <span
class="text-gray-400 font-normal">0=不限)</span></label>
<input type="number" name="max_claimants" value="{{ old('max_claimants', 0) }}" min="0"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
</div>
<div class="col-span-2">
<label class="block text-xs font-bold text-gray-600 mb-2">分配方式 <span
class="text-red-500">*</span></label>
<div class="flex gap-4">
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="distribute_type" value="random" x-model="distributeType"
{{ old('distribute_type', 'random') === 'random' ? 'checked' : '' }}>
<span class="text-sm font-bold">🎲 随机分配</span>
<span class="text-xs text-gray-400">(二倍均值算法,每人金额不同)</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="distribute_type" value="fixed" x-model="distributeType"
{{ old('distribute_type') === 'fixed' ? 'checked' : '' }}>
<span class="text-sm font-bold">📏 定额发放</span>
<span class="text-xs text-gray-400">(每人相同金额)</span>
</label>
</div>
</div>
{{-- 随机模式配置 --}}
<div x-show="distributeType === 'random'" class="col-span-2">
<div class="grid grid-cols-2 gap-4 bg-purple-50 rounded-lg p-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">最低保底金额</label>
<input type="number" name="min_amount" value="{{ old('min_amount', 100) }}"
min="1" class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
</div>
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">单人最高上限 <span
class="text-gray-400 font-normal">(可选)</span></label>
<input type="number" name="max_amount" value="{{ old('max_amount') }}" min="1"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm"
placeholder="不填则自动计算">
</div>
</div>
</div>
{{-- 定额模式配置 --}}
<div x-show="distributeType === 'fixed'" class="col-span-2">
<div class="bg-blue-50 rounded-lg p-4">
<label class="block text-xs font-bold text-gray-600 mb-1">每人固定金额 <span
class="text-red-500">*</span></label>
<input type="number" name="fixed_amount" value="{{ old('fixed_amount', 500) }}"
min="1" class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
<p class="text-xs text-gray-400 mt-1">💡 总发放 = 固定金额 × 在线人数(受最大领取人数限制)</p>
</div>
</div>
</div>
</div>
{{-- 时间配置 --}}
<div class="mb-6">
<h3 class="text-sm font-bold text-gray-700 mb-3 pb-2 border-b"> 时间配置</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">触发时间 <span
class="text-red-500">*</span></label>
<input type="datetime-local" name="send_at" value="{{ old('send_at') }}" required
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
</div>
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">领取有效期(分钟)</label>
<input type="number" name="expire_minutes" value="{{ old('expire_minutes', 30) }}"
min="1" max="1440"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
</div>
<div class="col-span-2">
<label class="block text-xs font-bold text-gray-600 mb-1">重复方式</label>
<select name="repeat_type" class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
<option value="once" {{ old('repeat_type', 'once') === 'once' ? 'selected' : '' }}>仅一次
</option>
<option value="daily" {{ old('repeat_type') === 'daily' ? 'selected' : '' }}>每天(相同时间)
</option>
<option value="weekly" {{ old('repeat_type') === 'weekly' ? 'selected' : '' }}>每周(相同时间)
</option>
<option value="monthly" {{ old('repeat_type') === 'monthly' ? 'selected' : '' }}>
每月(相同日期时间)</option>
</select>
</div>
</div>
</div>
{{-- 目标用户 --}}
<div class="mb-6">
<h3 class="text-sm font-bold text-gray-700 mb-3 pb-2 border-b">🎯 目标用户</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">用户范围</label>
<select name="target_type" x-model="targetType"
class="w-full border border-gray-300 rounded-lg p-2.5 text-sm">
<option value="all">全部在线用户</option>
<option value="vip"> VIP 用户</option>
<option value="level">指定等级以上</option>
</select>
</div>
<div x-show="targetType === 'level'">
<label class="block text-xs font-bold text-gray-600 mb-1">最低用户等级</label>
<input type="number" name="target_value" value="{{ old('target_value', 1) }}"
min="1" class="w-full border border-gray-300 rounded-lg p-2.5 text-sm"
placeholder="10">
</div>
</div>
</div>
{{-- 提交 --}}
<div class="flex gap-3 pt-4 border-t">
<button type="submit"
class="px-8 py-2.5 bg-amber-500 text-white rounded-lg font-bold hover:bg-amber-600 transition shadow-sm">
🎊 创建活动
</button>
<a href="{{ route('admin.holiday-events.index') }}"
class="px-6 py-2.5 bg-gray-100 text-gray-600 rounded-lg font-bold hover:bg-gray-200 transition">
取消
</a>
</div>
</form>
</div>
</div>
<script>
/**
* 节日福利创建表单 Alpine 组件
*/
function holidayForm() {
return {
distributeType: '{{ old('distribute_type', 'random') }}',
targetType: '{{ old('target_type', 'all') }}',
};
}
</script>
@endsection