import React, { useState } from "react"; import { ScreenId, AppState, ClaimedHistoryData, ClaimedReward } from "../types"; import { ArrowLeft, Landmark, Gift, CheckCircle2, HelpCircle, Trophy, ChevronRight, Sparkles } from "lucide-react"; // Import local promotion character images cropped from original screenshots import charDeposit from "../assets/images/promotions/char-deposit.png"; import charRescue from "../assets/images/promotions/char-rescue.png"; import charVipLevel from "../assets/images/promotions/char-vip-level.png"; import charFeedback from "../assets/images/promotions/char-feedback.png"; import charSlots from "../assets/images/promotions/char-slots.png"; import charLive from "../assets/images/promotions/char-live.png"; import charSports from "../assets/images/promotions/char-sports.png"; import charWeekly from "../assets/images/promotions/char-weekly.png"; import charMonthly from "../assets/images/promotions/char-monthly.png"; import charFishingCartoon from "../assets/images/promotions/generated/fishing-cartoon-shark-clean.png"; // Import clean detail images (with logos and webpage navigation footers cropped out) import detailFishing from "../assets/images/promotions/details/fishing-gate-detail-clean.png"; import detailDeposit from "../assets/images/promotions/details/daily-deposit-detail-clean.png"; import detailRescue from "../assets/images/promotions/details/daily-rescue-detail-clean.png"; import detailVipLevel from "../assets/images/promotions/details/vip-level-reward-detail-clean.png"; import detailFeedback from "../assets/images/promotions/details/daily-deposit-reward-detail-clean.png"; import detailSlots from "../assets/images/promotions/details/slots-gate-detail-clean.png"; import detailLive from "../assets/images/promotions/details/live-gate-detail-clean.png"; import detailSports from "../assets/images/promotions/details/sports-gate-detail-clean.png"; import detailWeekly from "../assets/images/promotions/details/vip-weekly-bonus-detail-clean.png"; import detailMonthly from "../assets/images/promotions/details/vip-monthly-bonus-detail-clean.png"; interface PromotionsViewProps { state: AppState; onNavigate: (screen: ScreenId) => void; onSetState: (updater: (prev: AppState) => AppState) => void; } const PROMOTION_ITEMS = [ { id: "fishing-gate", title: "捕鱼闯关", subtitle: "每日领取专属福利", badgeText: "每日福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "最高 188.00U", val: 188.00, desc: "在任意捕鱼游戏中,每日达成指定闯关关卡,即可一键申领专属最高 188U 闯关红利!", image: charFishingCartoon, duration: "长期有效", bgColor: "from-[#0a364a] via-[#062130] to-[#03111a] border-cyan-500/30", detailImage: detailFishing }, { id: "daily-deposit", title: "每日充值", subtitle: "最高赠送", badgeText: "每日福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "588.88U", val: 588.88, desc: "每日首单充值满额,即可额外获得高达 588.88U 的充值回馈礼金,自动存入总余额。", image: charDeposit, duration: "每日结算", bgColor: "from-[#4c160a] via-[#300c05] to-[#180502] border-red-500/30", detailImage: detailDeposit }, { id: "daily-rescue", title: "每日拯救金", subtitle: "最高返利", badgeText: "每日福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "3888U", val: 3888.00, desc: "助您重整旗鼓!每日在电子或棋牌中产生负盈利,可一键申请最高 3888U 拯救基金!", image: charRescue, duration: "每日自动结算", bgColor: "from-[#0a3835] via-[#052422] to-[#021211] border-teal-500/30", detailImage: detailRescue }, { id: "vip-level-reward", title: "晋级奖励无门槛", subtitle: "完成流水马上领", badgeText: "火爆活动", badgeColor: "bg-amber-500/20 text-amber-400 border border-amber-500/30 font-bold", valText: "VIP晋级奖励,福利不停", val: 888.00, desc: "跨越 VIP 等级门槛即可无限制领取对应的晋级奖励,流水达成即可极速出款!", image: charVipLevel, duration: "长期有效", bgColor: "from-[#341b54] via-[#1f1035] to-[#0d0717] border-purple-500/30 shadow-[inset_0_1px_1px_rgba(251,191,36,0.1)]", detailImage: detailVipLevel }, { id: "daily-deposit-reward", title: "每日充值大回馈", subtitle: "充值达100U", badgeText: "每日福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "次日即可领取最高 18888U", val: 18888.00, desc: "当日充值满 100U 以上,次日即可获得超高比例回馈,最高可领取 18888U 大礼包!", image: charFeedback, duration: "每日有效", bgColor: "from-[#4a2e0a] via-[#2f1c05] to-[#170d02] border-amber-500/30", detailImage: detailFeedback }, { id: "slots-gate", title: "电子闯关", subtitle: "每日领取专属福利", badgeText: "每日福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "最高 288.00U", val: 288.00, desc: "在任意电子游艺中,每日达成指定下注流水关卡,即可一键申领专属最高 288U 电子闯关红利!", image: charSlots, duration: "长期有效", bgColor: "from-[#1c1a4b] via-[#111030] to-[#080718] border-purple-500/30", detailImage: detailSlots }, { id: "live-gate", title: "视讯闯关", subtitle: "真人视讯专属", badgeText: "闯关福利", badgeColor: "bg-emerald-500/20 text-emerald-400 border border-emerald-500/30", valText: "最高 588.00U", val: 588.00, desc: "投注百家乐、龙虎斗等真人视讯项目,达成指定连赢或流水关卡,最高可申领 588U 红利!", image: charLive, duration: "长期有效", bgColor: "from-[#0e2c4d] via-[#091c32] to-[#040e1b] border-indigo-500/30", detailImage: detailLive }, { id: "sports-gate", title: "体育闯关", subtitle: "连胜连赢大奖", badgeText: "火爆活动", badgeColor: "bg-amber-500/20 text-amber-400 border border-amber-500/30 font-bold", valText: "最高 388U 连胜礼金", val: 388.00, desc: "体育赛事连胜闯关!投注英超、西甲、美职篮滚盘连赢指定场次即可领取最高 388U 的连胜礼金!", image: charSports, duration: "长期有效", bgColor: "from-[#083654] via-[#052237] to-[#02111d] border-teal-500/30", detailImage: detailSports }, { id: "vip-weekly-bonus", title: "VIP专属周俸禄", subtitle: "每周一次不间断", badgeText: "火爆活动", badgeColor: "bg-amber-500/20 text-amber-400 border border-amber-500/30 font-bold", valText: "游戏升级,福利不停", val: 188.00, desc: "每周一系统根据您的 VIP 等级,自动发放专属 of 周薪福利,晋级越高,周俸禄越丰厚!", image: charWeekly, duration: "每周一发放", bgColor: "from-[#3d1222] via-[#240a14] to-[#11050a] border-rose-500/30 shadow-[inset_0_1px_1px_rgba(244,63,94,0.1)]", detailImage: detailWeekly }, { id: "vip-monthly-bonus", title: "VIP专属月俸禄", subtitle: "每月轻松领取奖励", badgeText: "火爆活动", badgeColor: "bg-amber-500/20 text-amber-400 border border-amber-500/30 font-bold", valText: "游戏升级,福利不停", val: 888.00, desc: "每月一号自动到账!VIP 会员专属月薪大礼,让您每月开局即享高人一等的充裕资金!", image: charMonthly, duration: "每月1号发放", bgColor: "from-[#42220f] via-[#271309] to-[#120904] border-orange-500/30 shadow-[inset_0_1px_1px_rgba(249,115,22,0.1)]", detailImage: detailMonthly } ]; type TaskLevel = { condition: string; reward: string; progressText?: string; }; type TaskItem = { id: string; title: string; desc: string; levels: TaskLevel[]; detailPromoId: string; image: string; imageClass: string; }; const TASK_ITEMS: TaskItem[] = [ { id: "daily-deposit-task", title: "每日充值福利", desc: "每日充值送,达标最高可领取588.88U", levels: [ { condition: "充值>=100U", reward: "5.88U" }, { condition: "充值>=500U", reward: "18.88U" }, { condition: "充值>=1000U", reward: "58.88U" }, { condition: "充值>=5000U", reward: "188.88U" }, { condition: "充值>=10000U", reward: "588.88U" } ], detailPromoId: "daily-deposit", image: charDeposit, imageClass: "h-[110px] -translate-y-1 translate-x-2" }, { id: "daily-rescue-task", title: "每日救援金", desc: "电子亏损次日奖励助力翻盘,最多3888U", levels: [ { condition: "电子亏损金>=500U", reward: "38U" }, { condition: "电子亏损金>=1000U", reward: "88U" }, { condition: "电子亏损金>=3000U", reward: "188U" }, { condition: "电子亏损金>=10000U", reward: "888U" }, { condition: "电子亏损金>=50000U", reward: "3888U" } ], detailPromoId: "daily-rescue", image: charRescue, imageClass: "h-[110px] -translate-y-1 translate-x-2" }, { id: "fishing-rescue-task", title: "捕鱼救援金", desc: "捕鱼亏损次日奖励助力翻盘,最多3888U", levels: [ { condition: "捕鱼亏损金>=500U", reward: "38U" }, { condition: "捕鱼亏损金>=1000U", reward: "88U" }, { condition: "捕鱼亏损金>=3000U", reward: "188U" }, { condition: "捕鱼亏损金>=10000U", reward: "888U" }, { condition: "捕鱼亏损金>=50000U", reward: "3888U" } ], detailPromoId: "fishing-gate", image: charFishingCartoon, imageClass: "h-[112px] -translate-y-1 translate-x-2" }, { id: "slots-flow-task", title: "电子流水闯关", desc: "每日投注,最高可领1888U", levels: [ { condition: "有效流水1000U", reward: "5U", progressText: "0.00/1000" }, { condition: "有效流水5000U", reward: "18U", progressText: "0.00/5000" }, { condition: "有效流水10000U", reward: "58U", progressText: "0.00/10000" }, { condition: "有效流水50000U", reward: "188U", progressText: "0.00/50000" }, { condition: "有效流水100000U", reward: "1888U", progressText: "0.00/100000" } ], detailPromoId: "slots-gate", image: charSlots, imageClass: "h-[110px] -translate-y-1 translate-x-2" }, { id: "sports-flow-task", title: "体育流水闯关", desc: "每日投注,最高可领1888U", levels: [ { condition: "有效流水1000U", reward: "5U", progressText: "0.00/1000" }, { condition: "有效流水5000U", reward: "18U", progressText: "0.00/5000" }, { condition: "有效流水10000U", reward: "58U", progressText: "0.00/10000" }, { condition: "有效流水50000U", reward: "188U", progressText: "0.00/50000" }, { condition: "有效流水100000U", reward: "1888U", progressText: "0.00/100000" } ], detailPromoId: "sports-gate", image: charSports, imageClass: "h-[108px] -translate-y-1 translate-x-2" }, { id: "live-flow-task", title: "视讯流水闯关", desc: "每日投注,最高可领1888U", levels: [ { condition: "有效流水1000U", reward: "5U", progressText: "0.00/1000" }, { condition: "有效流水5000U", reward: "18U", progressText: "0.00/5000" }, { condition: "有效流水10000U", reward: "58U", progressText: "0.00/10000" }, { condition: "有效流水50000U", reward: "188U", progressText: "0.00/50000" }, { condition: "有效流水100000U", reward: "1888U", progressText: "0.00/100000" } ], detailPromoId: "live-gate", image: charLive, imageClass: "h-[110px] -translate-y-1 translate-x-2" }, { id: "fishing-flow-task", title: "捕鱼流水闯关", desc: "每日投注,最高可领1888U", levels: [ { condition: "有效流水1000U", reward: "5U", progressText: "0.00/1000" }, { condition: "有效流水5000U", reward: "18U", progressText: "0.00/5000" }, { condition: "有效流水10000U", reward: "58U", progressText: "0.00/10000" }, { condition: "有效流水50000U", reward: "188U", progressText: "0.00/50000" }, { condition: "有效流水100000U", reward: "1888U", progressText: "0.00/100000" } ], detailPromoId: "fishing-gate", image: charFishingCartoon, imageClass: "h-[112px] -translate-y-1 translate-x-2" } ]; export const PromotionsView: React.FC = ({ state, onNavigate, onSetState }) => { // Mode can be: "PROMOS" (Screen 7), "CLAIM_HISTORY" (Screen 29) const [promoMode, setPromoMode] = useState<"PROMOS" | "CLAIM_HISTORY">("PROMOS"); const [activeSubTab, setActiveSubTab] = useState("活动"); const [claimedLog, setClaimedLog] = useState(ClaimedHistoryData); // Local state for interactive tasks & rebates const [weeklyRebateClaimed, setWeeklyRebateClaimed] = useState(false); const [selectedPromo, setSelectedPromo] = useState(null); const [selectedTaskLevels, setSelectedTaskLevels] = useState>({}); const handleClaimPromo = (promo: { title: string; val: number }) => { // Prevent double claim const already = claimedLog.some(c => c.title === promo.title); if (already) { alert(`您今天已经申领过了:${promo.title},请勿重复申领!`); return; } // Add bonus and insert claim histories onSetState((prev) => { const generatedReward: ClaimedReward = { id: Math.floor(Math.random() * 9999 + 1111).toString(), title: promo.title, amount: promo.val, date: new Date().toISOString().substring(0, 10), vipLevel: `VIP ${prev.vipLevel}` }; setClaimedLog(prevLog => [generatedReward, ...prevLog]); return { ...prev, balance: prev.balance + promo.val, }; }); alert(`🎉 恭喜!申领成功:USDT ${promo.val.toFixed(2)} 已直接汇入您的中心账户。`); }; const handleClaimWeeklyRebate = () => { if (weeklyRebateClaimed) return; setWeeklyRebateClaimed(true); onSetState((prev) => { const reward: ClaimedReward = { id: Math.floor(Math.random() * 9999 + 1111).toString(), title: "VIP每周无上限返水红利", amount: 120.50, date: new Date().toISOString().substring(0, 10), vipLevel: `VIP ${prev.vipLevel}` }; setClaimedLog(prevLog => [reward, ...prevLog]); return { ...prev, balance: prev.balance + 120.50 }; }); alert("🎉 120.50U 自动返水红利已存入您的中心账户!"); }; const openTaskDetail = (promoId: string) => { const promo = PROMOTION_ITEMS.find((item) => item.id === promoId); if (promo) { setSelectedPromo(promo); } }; const setTaskLevel = (taskId: string, nextLevel: number, levelCount: number) => { const boundedLevel = Math.max(0, Math.min(nextLevel, levelCount - 1)); setSelectedTaskLevels(prev => ({ ...prev, [taskId]: boundedLevel })); }; return (
{/* 1. PROMOTIONS LIST OVERVIEW (Screen 7) */} {promoMode === "PROMOS" && ( <> {/* Custom Header with sub-navigation matching image */}
{["活动", "任务", "返水", "VIP", "教程"].map((tab) => { const isActive = activeSubTab === tab; return ( ); })}
{/* TAB PANELS */} {/* A. ACTIVITES TAB PANEL (活动) */} {activeSubTab === "活动" && (

当前火热专享活动列表 ({PROMOTION_ITEMS.length})

{PROMOTION_ITEMS.map((promo) => (
setSelectedPromo(promo)} className={`w-full relative overflow-hidden rounded-2xl shadow-lg border border-white/5 bg-gradient-to-br ${promo.bgColor} group min-h-[164px] p-4 flex flex-col justify-between select-none transition-all duration-300 hover:brightness-105 active:scale-[0.99] cursor-pointer`} > {/* Left Content Side */}
{/* Top Badge & Duration */}
{promo.badgeText} {promo.duration}
{/* Title & Subtitle */}

{promo.subtitle}

{promo.title}

{/* Val Text */}

{promo.valText}

{/* Description */}

{promo.desc}

{/* Right promo visual */}
{promo.title}
))}
)} {/* B. TASKS TAB PANEL (任务) */} {activeSubTab === "任务" && (

每日任务挑战中心

{TASK_ITEMS.map((task) => { const selectedLevelIndex = selectedTaskLevels[task.id] ?? 0; const currentLevel = task.levels[selectedLevelIndex] ?? task.levels[0]; const canGoPrevious = selectedLevelIndex > 0; const canGoNext = selectedLevelIndex < task.levels.length - 1; return (

{task.title}

{task.desc}

{currentLevel.condition}
{currentLevel.progressText && (
{currentLevel.progressText}
)}
{task.levels.map((_, levelIndex) => ( ))}
{currentLevel.reward}
{task.title}
); })}
)} {/* C. REBATES TAB PANEL (返水) */} {activeSubTab === "返水" && (

每日实时无上限返水

今日可领结算返水 (Available Rebates) {weeklyRebateClaimed ? "0.00" : "120.50"}U
电子游戏总有效流水 50,000.00 U
电子返水比例 (VIP 4) 1.2%
棋牌游戏总有效流水 12,000.00 U
棋牌返水比例 (VIP 4) 1.0%
)} {/* D. VIP TAB PANEL (VIP) */} {activeSubTab === "VIP" && (

我的 VIP 会员特权

VIP 4 会员等级 尊贵身份,豪礼享不停
特权专属
晋级流水进度 (Slots Turnover) 78,500 / 100,000 U
)} {/* E. TUTORIALS TAB PANEL (教程) */} {activeSubTab === "教程" && (

新手指导教程中心

{/* Guide 1 */}
如何使用 USDT (TRC20) 快速充值?

打开数字货币交易所,选择转账网络为 TRC20,扫描充值通道展示的二维码,转账最快 30 秒自动到账,无手续费。

{/* Guide 2 */}
绑定提现地址的安全性保障

进入提现中心,添加您的 TRC20 收币钱包地址。绑定后,系统使用双重指纹链,保证资金提领安全无虞。

)}
)} {/* 2. PROMOTIONS CLAIMED HISTORY (Screen 29) */} {promoMode === "CLAIM_HISTORY" && ( <>
我的优惠领取历史
{/* Statistics claimed summaries */}
累计已下账红利奖金 USDT {claimedLog.reduce((acc, curr) => acc + curr.amount, 12588.00).toFixed(2)} 优惠红利已通过智能协议自动汇入您的总账户余额,直接可以投注。

活动红利派发细则 ({claimedLog.length}) 已完全出账

{/* List */}
{claimedLog.map((claim) => (
{claim.title}
领奖日期: {claim.date} • {claim.vipLevel}
+{claim.amount.toFixed(2)}U
))}
)} {/* Floating Recharge Access FAB */}
{/* Bottom Nav Bar */} {/* 3. PROMOTION DETAIL MODAL */} {selectedPromo && (
{/* Modal Header */}
{selectedPromo.title}详情
{/* Scrollable Content Area */}
{selectedPromo.detailImage ? ( {`${selectedPromo.title}详情规则`} ) : (
暂无详情海报图
)}
{/* Fixed Bottom Action Bar */}
)}
); };