Download src/components/PromotionsView.tsx from xx911121/sdex: direct link, hf CLI and curl.
- Browser
- Download file 43.9 kB
-
https://huggingface.co/spaces/xx911121/sdex/resolve/main/src/components/PromotionsView.tsx
- Command line
-
hf download hf://spaces/xx911121/sdex/src/components/PromotionsView.tsx
-
curl -L -o PromotionsView.tsx https://huggingface.co/spaces/xx911121/sdex/resolve/main/src/components/PromotionsView.tsx
43.9 kB
| 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<PromotionsViewProps> = ({ 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<ClaimedReward[]>(ClaimedHistoryData); | |
| // Local state for interactive tasks & rebates | |
| const [weeklyRebateClaimed, setWeeklyRebateClaimed] = useState(false); | |
| const [selectedPromo, setSelectedPromo] = useState<typeof PROMOTION_ITEMS[0] | null>(null); | |
| const [selectedTaskLevels, setSelectedTaskLevels] = useState<Record<string, number>>({}); | |
| 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 ( | |
| <div className="bg-[#000B14] text-[#d1e4ff] min-h-screen pb-24 font-sans select-none overflow-x-hidden"> | |
| {/* 1. PROMOTIONS LIST OVERVIEW (Screen 7) */} | |
| {promoMode === "PROMOS" && ( | |
| <> | |
| {/* Custom Header with sub-navigation matching image */} | |
| <header className="bg-[#0b2135] fixed top-0 w-full z-45 h-14 border-b border-[#414755] flex items-center px-2"> | |
| <button | |
| onClick={() => onNavigate(ScreenId.HOME)} | |
| className="p-2 rounded-full text-[#afc6ff] hover:bg-[#22364c] transition-colors" | |
| > | |
| <ArrowLeft className="w-5 h-5" /> | |
| </button> | |
| <div className="flex-1 flex justify-around items-center h-full px-1"> | |
| {["活动", "任务", "返水", "VIP", "教程"].map((tab) => { | |
| const isActive = activeSubTab === tab; | |
| return ( | |
| <button | |
| key={tab} | |
| onClick={() => setActiveSubTab(tab)} | |
| className={`relative h-full px-3 text-sm font-bold transition-all ${ | |
| isActive ? "text-[#528dff] font-black scale-105" : "text-[#c1c6d7]/85 hover:text-white" | |
| }`} | |
| > | |
| <span>{tab}</span> | |
| {isActive && ( | |
| <span className="absolute bottom-0 left-2 right-2 h-0.5 bg-[#528dff] rounded-t-full shadow-[0_-2px_6px_rgba(82,141,255,0.6)]"></span> | |
| )} | |
| </button> | |
| ); | |
| })} | |
| </div> | |
| <div className="w-8 shrink-0"></div> | |
| </header> | |
| <main className="px-4 mt-20 max-w-md mx-auto space-y-4"> | |
| {/* TAB PANELS */} | |
| {/* A. ACTIVITES TAB PANEL (活动) */} | |
| {activeSubTab === "活动" && ( | |
| <div className="space-y-4"> | |
| <div className="flex justify-between items-center px-1"> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider border-l-4 border-amber-400 pl-3">当前火热专享活动列表 ({PROMOTION_ITEMS.length})</h3> | |
| </div> | |
| <div className="space-y-3.5 select-none pb-4"> | |
| {PROMOTION_ITEMS.map((promo) => ( | |
| <div | |
| key={promo.id} | |
| onClick={() => 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 */} | |
| <div className="z-10 flex flex-col max-w-[62%]"> | |
| {/* Top Badge & Duration */} | |
| <div className="flex items-center gap-2"> | |
| <span className={`text-[9px] font-bold px-2 py-0.5 rounded-md ${promo.badgeColor}`}> | |
| {promo.badgeText} | |
| </span> | |
| <span className="text-[9px] text-[#afc6ff]/60 font-semibold font-mono"> | |
| {promo.duration} | |
| </span> | |
| </div> | |
| {/* Title & Subtitle */} | |
| <div className="mt-2.5"> | |
| <p className="text-[10px] text-[#afc6ff]/70 font-semibold leading-tight"> | |
| {promo.subtitle} | |
| </p> | |
| <h4 className="text-base font-black text-white mt-0.5 tracking-wide leading-tight"> | |
| {promo.title} | |
| </h4> | |
| </div> | |
| {/* Val Text */} | |
| <p className="text-[19px] font-black text-amber-400 mt-2 tracking-wide font-mono leading-none"> | |
| {promo.valText} | |
| </p> | |
| {/* Description */} | |
| <p className="text-[9px] text-[#c1c6d7]/85 mt-2 leading-relaxed font-medium"> | |
| {promo.desc} | |
| </p> | |
| </div> | |
| {/* Right promo visual */} | |
| <div className="absolute right-2 bottom-3 top-3 w-[44%] pointer-events-none z-0 flex items-center justify-center"> | |
| <img | |
| src={promo.image} | |
| alt={promo.title} | |
| className="h-full max-h-[136px] w-full max-w-full object-contain object-center transition-transform duration-500 group-hover:scale-[1.03] select-none pointer-events-none" | |
| draggable={false} | |
| /> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| )} | |
| {/* B. TASKS TAB PANEL (任务) */} | |
| {activeSubTab === "任务" && ( | |
| <div className="space-y-4"> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider border-l-4 border-amber-400 pl-3">每日任务挑战中心</h3> | |
| <div className="space-y-3.5 pb-4"> | |
| {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 ( | |
| <div | |
| key={task.id} | |
| className="relative min-h-[174px] overflow-hidden rounded-2xl border border-[#2a4a66] bg-gradient-to-br from-[#102a42] via-[#092034] to-[#061421] p-4 shadow-[0_10px_24px_rgba(0,0,0,0.22)]" | |
| > | |
| <div className="relative z-10 max-w-[68%]"> | |
| <div className="flex items-center gap-2"> | |
| <h4 className="text-base font-black text-white tracking-wide leading-tight"> | |
| {task.title} | |
| </h4> | |
| <button | |
| onClick={() => openTaskDetail(task.detailPromoId)} | |
| className="shrink-0 rounded-full bg-gradient-to-r from-[#6ebeff] to-[#148dff] px-3 py-1 text-[10px] font-black text-white shadow-[0_3px_10px_rgba(20,141,255,0.28)] active:scale-95" | |
| > | |
| 活动详情> | |
| </button> | |
| </div> | |
| <p className="mt-3 text-[11px] font-medium leading-relaxed text-[#c1c6d7]"> | |
| {task.desc} | |
| </p> | |
| <div className="mt-3 flex items-center gap-1.5 text-[11px] font-semibold text-[#c1c6d7]"> | |
| <CheckCircle2 className="w-3.5 h-3.5 text-slate-400" /> | |
| <span>{currentLevel.condition}</span> | |
| </div> | |
| {currentLevel.progressText && ( | |
| <div className="mt-2 h-2 w-[150px] overflow-hidden rounded-full bg-slate-900/90"> | |
| <div | |
| className="h-full rounded-full bg-[#528dff]" | |
| style={{ width: "0%" }} | |
| ></div> | |
| <span className="absolute -mt-3 ml-2 text-[10px] font-black text-white/75"> | |
| {currentLevel.progressText} | |
| </span> | |
| </div> | |
| )} | |
| <div className="mt-4 flex items-center gap-1"> | |
| <button | |
| onClick={() => setTaskLevel(task.id, selectedLevelIndex - 1, task.levels.length)} | |
| disabled={!canGoPrevious} | |
| className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-black transition-all ${ | |
| canGoPrevious | |
| ? "bg-white/35 text-white active:scale-90" | |
| : "bg-white/12 text-white/35" | |
| }`} | |
| > | |
| ‹ | |
| </button> | |
| {task.levels.map((_, levelIndex) => ( | |
| <React.Fragment key={levelIndex}> | |
| <span className="h-0.5 w-2.5 bg-[#2e7bff]"></span> | |
| <button | |
| onClick={() => setTaskLevel(task.id, levelIndex, task.levels.length)} | |
| className={`flex h-6 min-w-6 items-center justify-center rounded-full px-1.5 text-xs font-black transition-all ${ | |
| selectedLevelIndex === levelIndex | |
| ? "bg-[#2f7dff] text-white shadow-[0_3px_12px_rgba(47,125,255,0.45)] scale-110" | |
| : "bg-[#2f7dff]/70 text-white/80 shadow-[0_3px_10px_rgba(47,125,255,0.16)]" | |
| }`} | |
| > | |
| {levelIndex + 1} | |
| </button> | |
| </React.Fragment> | |
| ))} | |
| <button | |
| onClick={() => setTaskLevel(task.id, selectedLevelIndex + 1, task.levels.length)} | |
| disabled={!canGoNext} | |
| className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-black transition-all ${ | |
| canGoNext | |
| ? "bg-white/35 text-white active:scale-90" | |
| : "bg-white/12 text-white/35" | |
| }`} | |
| > | |
| › | |
| </button> | |
| </div> | |
| <div className="mt-6 text-xl font-black leading-none text-[#528dff]"> | |
| {currentLevel.reward} | |
| </div> | |
| </div> | |
| <div className="absolute right-3 top-3 z-0 flex h-[110px] w-[116px] items-center justify-center pointer-events-none"> | |
| <img | |
| src={task.image} | |
| alt={task.title} | |
| className={`${task.imageClass} w-auto max-w-none object-contain drop-shadow-[0_8px_18px_rgba(0,0,0,0.28)]`} | |
| draggable={false} | |
| /> | |
| </div> | |
| <button | |
| disabled | |
| className="absolute bottom-5 right-4 z-10 rounded-xl bg-slate-400/80 px-5 py-2.5 text-sm font-black text-white shadow-sm" | |
| > | |
| 不可领取 | |
| </button> | |
| </div> | |
| ); | |
| })} | |
| </div> | |
| </div> | |
| )} | |
| {/* C. REBATES TAB PANEL (返水) */} | |
| {activeSubTab === "返水" && ( | |
| <div className="space-y-4"> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider border-l-4 border-amber-400 pl-3">每日实时无上限返水</h3> | |
| <div className="bg-[#0b2135] border border-white/5 rounded-2xl p-5 shadow-lg space-y-4"> | |
| <div className="text-center space-y-1"> | |
| <span className="text-[10px] text-[#c1c6d7] font-semibold block uppercase">今日可领结算返水 (Available Rebates)</span> | |
| <span className="text-3xl font-black font-mono text-amber-400 mt-1 block"> | |
| {weeklyRebateClaimed ? "0.00" : "120.50"}<span className="text-xs ml-0.5">U</span> | |
| </span> | |
| </div> | |
| <button | |
| onClick={handleClaimWeeklyRebate} | |
| disabled={weeklyRebateClaimed} | |
| className={`w-full py-3 font-bold rounded-xl text-xs uppercase shadow-md transition-all ${ | |
| weeklyRebateClaimed | |
| ? "bg-slate-800 text-slate-500 border border-white/5" | |
| : "bg-gradient-to-r from-amber-400 to-[#FFD700] text-slate-950 hover:brightness-105 active:scale-95 cursor-pointer font-black" | |
| }`} | |
| > | |
| {weeklyRebateClaimed ? "暂无可领返水" : "一键立即领取返水"} | |
| </button> | |
| <div className="border-t border-white/5 pt-3.5 space-y-2"> | |
| <div className="flex justify-between items-center text-[10px]"> | |
| <span className="text-slate-400">电子游戏总有效流水</span> | |
| <span className="text-white font-mono font-bold">50,000.00 U</span> | |
| </div> | |
| <div className="flex justify-between items-center text-[10px]"> | |
| <span className="text-slate-400">电子返水比例 (VIP 4)</span> | |
| <span className="text-emerald-400 font-mono font-bold">1.2%</span> | |
| </div> | |
| <div className="flex justify-between items-center text-[10px] border-t border-white/5 pt-2"> | |
| <span className="text-slate-400">棋牌游戏总有效流水</span> | |
| <span className="text-white font-mono font-bold">12,000.00 U</span> | |
| </div> | |
| <div className="flex justify-between items-center text-[10px]"> | |
| <span className="text-slate-400">棋牌返水比例 (VIP 4)</span> | |
| <span className="text-emerald-400 font-mono font-bold">1.0%</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| )} | |
| {/* D. VIP TAB PANEL (VIP) */} | |
| {activeSubTab === "VIP" && ( | |
| <div className="space-y-4"> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider border-l-4 border-amber-400 pl-3">我的 VIP 会员特权</h3> | |
| <div className="bg-gradient-to-br from-[#402a10] to-[#1a0f03] border border-amber-400/30 rounded-2xl p-5 shadow-lg space-y-4"> | |
| <div className="flex justify-between items-center"> | |
| <div className="flex items-center gap-2"> | |
| <div className="w-8 h-8 rounded-full bg-amber-400/20 flex items-center justify-center border border-amber-400/30"> | |
| <Trophy className="w-4 h-4 text-amber-400" /> | |
| </div> | |
| <div> | |
| <span className="text-xs font-bold text-white block">VIP 4 会员等级</span> | |
| <span className="text-[9px] text-[#ffebbe]">尊贵身份,豪礼享不停</span> | |
| </div> | |
| </div> | |
| <span className="text-[9px] bg-amber-400/20 text-amber-300 font-bold px-2 py-0.5 rounded-full border border-amber-400/30"> | |
| 特权专属 | |
| </span> | |
| </div> | |
| <div className="space-y-1"> | |
| <div className="flex justify-between text-[10px] text-slate-300"> | |
| <span>晋级流水进度 (Slots Turnover)</span> | |
| <span className="font-mono">78,500 / 100,000 U</span> | |
| </div> | |
| <div className="w-full bg-slate-950 h-2 rounded-full overflow-hidden"> | |
| <div className="bg-gradient-to-r from-amber-500 to-amber-300 h-full rounded-full" style={{ width: "78.5%" }}></div> | |
| </div> | |
| </div> | |
| <button | |
| onClick={() => onNavigate(ScreenId.VIP_LEVEL_CENTER)} | |
| className="w-full py-2.5 bg-gradient-to-r from-amber-500 to-amber-300 text-slate-950 hover:brightness-105 active:scale-95 font-bold rounded-xl text-[10px] uppercase shadow-md flex items-center justify-center gap-1 cursor-pointer" | |
| > | |
| <span>进入 VIP 等级详情中心</span> | |
| <ChevronRight className="w-3.5 h-3.5" /> | |
| </button> | |
| </div> | |
| </div> | |
| )} | |
| {/* E. TUTORIALS TAB PANEL (教程) */} | |
| {activeSubTab === "教程" && ( | |
| <div className="space-y-4"> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider border-l-4 border-amber-400 pl-3">新手指导教程中心</h3> | |
| <div className="space-y-3"> | |
| {/* Guide 1 */} | |
| <div className="bg-[#0b2135] border border-white/5 rounded-2xl p-4 flex items-start gap-3 shadow-sm"> | |
| <div className="w-7 h-7 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-400 shrink-0 mt-0.5"> | |
| <HelpCircle className="w-4 h-4" /> | |
| </div> | |
| <div className="space-y-1"> | |
| <span className="text-xs font-bold text-white block">如何使用 USDT (TRC20) 快速充值?</span> | |
| <p className="text-[10px] text-[#c1c6d7] leading-relaxed"> | |
| 打开数字货币交易所,选择转账网络为 TRC20,扫描充值通道展示的二维码,转账最快 30 秒自动到账,无手续费。 | |
| </p> | |
| </div> | |
| </div> | |
| {/* Guide 2 */} | |
| <div className="bg-[#0b2135] border border-white/5 rounded-2xl p-4 flex items-start gap-3 shadow-sm"> | |
| <div className="w-7 h-7 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-400 shrink-0 mt-0.5"> | |
| <HelpCircle className="w-4 h-4" /> | |
| </div> | |
| <div className="space-y-1"> | |
| <span className="text-xs font-bold text-white block">绑定提现地址的安全性保障</span> | |
| <p className="text-[10px] text-[#c1c6d7] leading-relaxed"> | |
| 进入提现中心,添加您的 TRC20 收币钱包地址。绑定后,系统使用双重指纹链,保证资金提领安全无虞。 | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| )} | |
| </main> | |
| </> | |
| )} | |
| {/* 2. PROMOTIONS CLAIMED HISTORY (Screen 29) */} | |
| {promoMode === "CLAIM_HISTORY" && ( | |
| <> | |
| <header className="bg-[#0b2135] fixed top-0 w-full z-45 h-14 border-b border-[#414755] flex items-center px-4 justify-between"> | |
| <button | |
| onClick={() => setPromoMode("PROMOS")} | |
| className="p-1 rounded-full text-[#afc6ff] hover:bg-[#22364c] transition-colors" | |
| > | |
| <ArrowLeft className="w-6 h-6" /> | |
| </button> | |
| <span className="text-white text-base font-bold">我的优惠领取历史</span> | |
| <div className="w-6"></div> | |
| </header> | |
| <main className="max-w-md mx-auto px-4 mt-20 space-y-4"> | |
| {/* Statistics claimed summaries */} | |
| <div className="bg-[#0b2135] border border-white/5 rounded-2xl p-4 flex justify-between items-center"> | |
| <div> | |
| <span className="text-[10px] text-[#c1c6d7] block uppercase font-bold text-slate-400">累计已下账红利奖金</span> | |
| <span className="text-xl font-bold font-mono text-[#FFD700] mt-1 block"> | |
| USDT {claimedLog.reduce((acc, curr) => acc + curr.amount, 12588.00).toFixed(2)} | |
| </span> | |
| <span className="text-[9px] text-[#c1c6d7] mt-1.5 block leading-normal"> | |
| 优惠红利已通过智能协议自动汇入您的总账户余额,直接可以投注。 | |
| </span> | |
| </div> | |
| <div className="w-10 h-10 rounded-full bg-amber-400/10 flex items-center justify-center border border-amber-400/25 shrink-0"> | |
| <CheckCircle2 className="w-5.5 h-5.5 text-amber-500" /> | |
| </div> | |
| </div> | |
| <h3 className="text-xs font-bold text-[#afc6ff] tracking-wider pt-2 flex justify-between items-center px-1"> | |
| <span>活动红利派发细则 ({claimedLog.length})</span> | |
| <span className="text-[10px] text-zinc-500 font-mono">已完全出账</span> | |
| </h3> | |
| {/* List */} | |
| <div className="space-y-3 select-none"> | |
| {claimedLog.map((claim) => ( | |
| <div | |
| key={claim.id} | |
| className="bg-[#0b2135] border border-white/5 rounded-xl p-4 flex items-center justify-between shadow-sm" | |
| > | |
| <div className="flex items-center gap-3"> | |
| <div className="w-8 h-8 rounded-full bg-[#528dff]/15 flex items-center justify-center text-[#528dff]"> | |
| <Gift className="w-4 h-4" /> | |
| </div> | |
| <div> | |
| <span className="text-xs font-semibold text-white block">{claim.title}</span> | |
| <div className="flex items-center gap-2 mt-0.5 font-mono text-[9px] text-zinc-500"> | |
| <span>领奖日期: {claim.date}</span> | |
| <span>•</span> | |
| <span className="text-amber-500 font-bold">{claim.vipLevel}</span> | |
| </div> | |
| </div> | |
| </div> | |
| <span className="text-xs font-bold text-emerald-400 font-mono"> | |
| +{claim.amount.toFixed(2)}U | |
| </span> | |
| </div> | |
| ))} | |
| </div> | |
| <button | |
| onClick={() => setPromoMode("PROMOS")} | |
| className="w-full bg-[#528dff] hover:bg-[#528dff]/90 text-[#00275f] font-bold py-3.5 rounded-xl text-xs uppercase" | |
| > | |
| 返回活动大厅 | |
| </button> | |
| </main> | |
| </> | |
| )} | |
| {/* Floating Recharge Access FAB */} | |
| <div className="fixed bottom-5 left-1/2 -translate-x-1/2 z-[60]"> | |
| <div className="relative"> | |
| <div className="absolute -inset-1 bg-[#afc6ff]/35 blur-xl rounded-full animate-pulse"></div> | |
| <button | |
| onClick={() => onNavigate(ScreenId.DEPOSIT)} | |
| className="w-14 h-14 bg-gradient-to-b from-[#528dff] to-[#afc6ff] text-[#002d6c] rounded-full shadow-[0_4px_16px_rgba(82,141,255,0.4)] border-4 border-[#0b2135] flex flex-col items-center justify-center active:scale-90 transition-transform relative hover:brightness-105 cursor-pointer" | |
| > | |
| <Landmark className="w-5 h-5 mx-auto" /> | |
| <span className="text-[10px] font-bold mt-0.5">充值</span> | |
| </button> | |
| </div> | |
| </div> | |
| {/* Bottom Nav Bar */} | |
| <nav className="bg-[#22364c] border-t border-[#414755] fixed bottom-0 left-0 w-full z-50 rounded-t-xl shadow-xl flex justify-around items-center h-16 px-1"> | |
| <a | |
| onClick={() => onNavigate(ScreenId.HOME)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">首页</span> | |
| <span className="text-[9px] mt-0.5">Home</span> | |
| </a> | |
| <a | |
| onClick={() => onNavigate(ScreenId.GAME_CENTER)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">游戏</span> | |
| <span className="text-[9px] mt-0.5">Games</span> | |
| </a> | |
| <div className="w-16"></div> | |
| <a | |
| onClick={() => onNavigate(ScreenId.PROMOTIONS)} | |
| className="flex flex-col items-center justify-center text-[#afc6ff] font-bold drop-shadow-[0_0_8px_rgba(175,198,255,0.5)] scale-105 cursor-pointer flex-1" | |
| > | |
| <span className="text-xl">活动</span> | |
| <span className="text-[10px] tracking-wide mt-1">Promos</span> | |
| </a> | |
| <a | |
| onClick={() => onNavigate(ScreenId.PROFILE)} | |
| className="flex flex-col items-center justify-[#c1c6d7] hover:text-[#afc6ff] transition-colors cursor-pointer flex-1" | |
| > | |
| <span className="text-sm font-semibold">我的</span> | |
| <span className="text-[9px] mt-0.5">Profile</span> | |
| </a> | |
| </nav> | |
| {/* 3. PROMOTION DETAIL MODAL */} | |
| {selectedPromo && ( | |
| <div className="fixed inset-0 z-50 bg-[#000B14]/95 backdrop-blur-md flex justify-center animate-in fade-in duration-200"> | |
| <div className="relative w-full max-w-md h-full bg-[#001224] flex flex-col shadow-2xl border-x border-[#1e2d42] animate-in slide-in-from-bottom-12 duration-300"> | |
| {/* Modal Header */} | |
| <header className="bg-[#0b2135] h-14 border-b border-[#22364c] flex items-center px-4 justify-between sticky top-0 z-10 shrink-0"> | |
| <button | |
| onClick={() => setSelectedPromo(null)} | |
| className="p-1 rounded-full text-[#afc6ff] hover:bg-[#22364c] transition-colors cursor-pointer" | |
| > | |
| <ArrowLeft className="w-6 h-6" /> | |
| </button> | |
| <span className="text-white text-base font-bold tracking-wide"> | |
| {selectedPromo.title}详情 | |
| </span> | |
| <div className="w-8"></div> | |
| </header> | |
| {/* Scrollable Content Area */} | |
| <div className="flex-1 overflow-y-auto px-4 py-6 space-y-4 pb-28 scrollbar-thin scrollbar-thumb-blue-900 scrollbar-track-transparent"> | |
| <div className="relative rounded-2xl overflow-hidden border border-white/5 bg-[#071626] p-1.5 shadow-inner"> | |
| {selectedPromo.detailImage ? ( | |
| <img | |
| src={selectedPromo.detailImage} | |
| alt={`${selectedPromo.title}详情规则`} | |
| className="w-full h-auto object-contain rounded-xl select-none" | |
| draggable={false} | |
| /> | |
| ) : ( | |
| <div className="py-20 text-center text-[#afc6ff]/50 text-xs"> | |
| 暂无详情海报图 | |
| </div> | |
| )} | |
| </div> | |
| </div> | |
| {/* Fixed Bottom Action Bar */} | |
| <div className="absolute bottom-0 left-0 right-0 bg-[#071626]/95 backdrop-blur-md border-t border-[#1e2d42] p-4 flex gap-3 z-10"> | |
| <button | |
| onClick={() => setSelectedPromo(null)} | |
| className="px-5 py-3.5 bg-[#172c42] hover:bg-[#203954] text-[#afc6ff] font-bold rounded-xl text-xs transition-all active:scale-95 cursor-pointer border border-[#2d4b6b]" | |
| > | |
| 返回 | |
| </button> | |
| <button | |
| onClick={() => { | |
| handleClaimPromo(selectedPromo); | |
| setSelectedPromo(null); | |
| }} | |
| className="flex-1 py-3.5 bg-gradient-to-r from-amber-400 to-[#FFD700] hover:brightness-105 active:scale-95 text-slate-950 font-black rounded-xl text-xs shadow-[0_4px_16px_rgba(245,158,11,0.4)] transition-all cursor-pointer border border-amber-500/20 text-center flex items-center justify-center gap-1.5" | |
| > | |
| <Sparkles className="w-4 h-4 text-slate-950" /> | |
| <span>立即申领 {selectedPromo.valText}</span> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| )} | |
| </div> | |
| ); | |
| }; | |