Spaces:
Running

sdex / src /components /CustomerSupportView.tsx
vip
Upload Shengda frontend
25b8647
Raw History Blame Contribute Delete
11.1 kB
import React, { useState } from "react";
import { ScreenId, AppState } from "../types";
import { ArrowLeft, Headphones, Send, ChevronDown, ChevronUp, BellRing } from "lucide-react";
interface CustomerSupportViewProps {
state: AppState;
onNavigate: (screen: ScreenId) => void;
}
export const CustomerSupportView: React.FC<CustomerSupportViewProps> = ({ state, onNavigate }) => {
const [openFaq, setOpenFaq] = useState<number | null>(null);
const [typedMessage, setTypedMessage] = useState("");
const [chatLog, setChatLog] = useState<{ sender: "user" | "bot"; text: string; time: string }[]>([
{
sender: "bot",
text: "您好!我是盛大 24 小时智能金牌客服。请问有什么可以帮您?",
time: "刚刚"
}
]);
const toggleFaq = (idx: number) => {
setOpenFaq(openFaq === idx ? null : idx);
};
const handleSendMessage = (e: React.FormEvent) => {
e.preventDefault();
if (!typedMessage.trim()) return;
const userText = typedMessage.trim();
const nowStr = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
setChatLog(prev => [...prev, { sender: "user", text: userText, time: nowStr }]);
setTypedMessage("");
// Simulate smart support auto response base on keyword
setTimeout(() => {
let reply = "收到您的咨询。由于当前人工客服咨询量较大,为您推荐自助提速服务。如属于充值未到账,请在充值中心重新提交一遍订单重试;提现请耐心期待,一般 3-15 分钟极速到账。";
if (userText.includes("充值") || userText.includes("充钱")) {
reply = "【充值充能提速】如您充值未到账,请确认支付扣款成功。由于区块链或银行接口或有延迟,请耐心期待 3 分钟;或者将【订单编号、支付截图、您的会员ID】发送在这里,我们将在 1 分钟内为您手工录入。";
} else if (userText.includes("提现") || userText.includes("提款") || userText.includes("出金")) {
reply = "【提现到账说明】盛大娱乐城支持 24 小时无上限直提。正常提现预计 3-15 分钟内自动汇出。如超过 1 小时未到账,请联系对接专员帮您查看通道。";
} else if (userText.includes("活动") || userText.includes("红利") || userText.includes("返水")) {
reply = "【活动红利领取】每周返水、晋级礼金可在“优惠活动中心”一键领取。点击对应活动,即可看到自动匹配的流水要求和一键申领按钮。";
}
setChatLog(prev => [...prev, { sender: "bot", text: reply, time: nowStr }]);
}, 1000);
};
const FAQS = [
{
q: "💰 如何进行快速充值入金?",
a: "您可以在“充值中心”选择 USDT (TRC25)、微信扫码、支付宝或银行卡进行充值。对于数字货币充值,系统在检测到链上1个确认后即在 30 秒内自动充值到您的账户余额中,无需人工核实。"
},
{
q: "🏦 提现需要多长时间到账?有手续费吗?",
a: "提现中心全面支持 7x24 小时极速打款。单笔提现在 1-3 分钟内即可直接汇入您的绑定银行卡或 TRC20 钱包地址。盛大承诺:提现一律 0 手续费、0 扣税,绝对安全可靠。"
},
{
q: "🔒 为什么显示“未登录”可以进行游戏吗?",
a: "未登录用户默认只能浏览极速分类。如需享受极速试玩和真实赢利直提,可以点击任意界面的“登录/注册”或者“一键游客试玩”获取 10,000 美金测试额度,即刻畅快下注。"
},
{
q: "⭐️ VIP 周返水和晋级礼金如何计算?",
a: "作为 VIP 4-6 会员,您尊享每周高达 0.8% - 1.0% 的无上限投注返水,晋级礼金最高可达 ¥1,888.00。每周一中午 12:00 返水将自动发放到账,直接享受提款特权。"
}
];
return (
<div className="bg-[#000B14] text-[#d1e4ff] min-h-screen pb-6 font-sans flex flex-col justify-between select-none">
{/* Header Container */}
<header className="bg-[#0b2135] h-14 border-b border-[#414755] flex items-center px-4 relative sticky top-0 z-40">
<button
aria-label="Go back"
onClick={() => onNavigate(ScreenId.HOME)}
className="p-1.5 rounded-full text-[#afc6ff] hover:bg-[#22364c] transition-colors"
>
<ArrowLeft className="w-6 h-6" />
</button>
<span className="text-white text-base font-bold absolute left-1/2 -translate-x-1/2">
盛大极速在线客服
</span>
</header>
{/* Hero Welcome Unit */}
<section className="bg-gradient-to-b from-[#0b2135] to-[#000F20] py-6 px-4 text-center border-b border-white/5">
<div className="w-16 h-16 rounded-full bg-[#528dff]/20 border border-[#528dff]/40 flex items-center justify-center mx-auto mb-3 shadow-[0_0_20px_rgba(82,141,255,0.2)]">
<Headphones className="w-8 h-8 text-[#528dff] animate-bounce" />
</div>
<h2 className="text-sm font-bold text-white uppercase">24/7 专属金牌尊享客服</h2>
<p className="text-[11px] text-[#c1c6d7] mt-1 pr-6 pl-6">
您好!港资直营实体背书。全天候 24 小时为您提供充提、金流加速、特权晋升与红利审核答疑服务,无惧任何风控,大额无忧。
</p>
{/* Action button triggers for official channels */}
<div className="grid grid-cols-2 gap-3 mt-4 max-w-sm mx-auto">
<a
href="https://t.me/sdyl_vip"
target="_blank"
rel="noopener noreferrer"
onClick={(e) => { e.preventDefault(); alert("正在为您跳转至 Telegram 盛大特权客服专员..."); }}
className="bg-[#229ED9]/20 hover:bg-[#229ED9]/30 text-white rounded-xl py-2 flex items-center justify-center gap-1.5 text-xs font-semibold border border-[#229ED9]/30 transition-all cursor-pointer"
>
<span>Telegram 专道</span>
</a>
<a
href="https://wa.me/sdyl_ph"
target="_blank"
rel="noopener noreferrer"
onClick={(e) => { e.preventDefault(); alert("正在为您跳转至 WhatsApp 在线技术支持..."); }}
className="bg-[#25D366]/20 hover:bg-[#25D366]/30 text-white rounded-xl py-2 flex items-center justify-center gap-1.5 text-xs font-semibold border border-[#25D366]/30 transition-all cursor-pointer"
>
<span>WhatsApp 专线</span>
</a>
</div>
</section>
{/* Live Interactive Chat Area */}
<section className="p-4 flex-1 flex flex-col gap-3">
<div className="text-[10px] text-[#c1c6d7]/60 font-semibold tracking-wider text-center uppercase">
智能互动聊天室 (Type below to interact)
</div>
<div className="bg-[#0b2135]/50 border border-white/5 rounded-xl p-3 flex-1 flex flex-col gap-2 min-h-[180px] h-[220px] overflow-y-auto">
{chatLog.map((chat, idx) => (
<div
key={idx}
className={`flex flex-col max-w-[85%] ${chat.sender === "user" ? "self-end items-end" : "self-start items-start"}`}
>
<div
className={`p-2.5 rounded-2xl text-xs leading-relaxed ${
chat.sender === "user"
? "bg-[#528dff] text-[#00275f] font-medium rounded-tr-none"
: "bg-[#22364c] text-[#d1e4ff] rounded-tl-none border border-white/5"
}`}
>
{chat.text}
</div>
<span className="text-[9px] text-[#c1c6d7] opacity-60 mt-1 px-1">{chat.time}</span>
</div>
))}
</div>
{/* Input box */}
<form onSubmit={handleSendMessage} className="flex gap-2">
<input
type="text"
value={typedMessage}
onChange={(e) => setTypedMessage(e.target.value)}
placeholder="打字输入充提未到账或活动咨询..."
className="flex-1 bg-[#001428] border border-[#414755]/50 rounded-xl px-4 py-2 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-[#528dff]"
/>
<button
type="submit"
className="px-4 py-2 bg-[#528dff] hover:bg-[#528dff]/90 text-[#00275f] font-bold rounded-xl text-xs transition-transform active:scale-95 cursor-pointer flex items-center gap-1"
>
<span>发送</span>
<Send className="w-3 h-3" />
</button>
</form>
</section>
{/* Accordion List FAQ */}
<section className="px-4 mt-2">
<h3 className="text-xs font-bold text-white mb-2 tracking-wider flex items-center gap-1">
<BellRing className="w-4 h-4 text-amber-500" /> 常见热点问题指南 (Click to view)
</h3>
<div className="space-y-2">
{FAQS.map((faq, idx) => (
<div
key={idx}
className="bg-[#0b2135] border border-white/5 rounded-xl overflow-hidden transition-all"
>
<button
onClick={() => toggleFaq(idx)}
className="w-full text-left p-3 flex justify-between items-center hover:bg-[#22364c]/20 transition-colors"
>
<span className="text-xs font-semibold text-[#afc6ff]">{faq.q}</span>
{openFaq === idx ? (
<ChevronUp className="w-4 h-4 text-[#c1c6d7]" />
) : (
<ChevronDown className="w-4 h-4 text-[#c1c6d7]" />
)}
</button>
{openFaq === idx && (
<div className="p-3 bg-[#071d31] border-t border-white/5 text-[11px] text-[#c1c6d7] leading-relaxed">
{faq.a}
</div>
)}
</div>
))}
</div>
</section>
{/* Safety Policy Claims */}
<footer className="mt-8 px-4 py-3 border-t border-white/5 text-center">
<div className="flex justify-center gap-4 text-[10px] text-[#afc6ff]">
<a onClick={() => alert("盛大服务条款已加载:安全博彩、防止低龄行为。")} className="hover:underline cursor-pointer">服务条款</a>
<span className="text-white/10">•</span>
<a onClick={() => alert("本平台隐私政策承诺绝不公开或向任何第三方透露您的IP及资金往来地址。")} className="hover:underline cursor-pointer">隐私政策</a>
<span className="text-white/10">•</span>
<a onClick={() => alert("责任博彩:理性娱乐,健康游戏。")} className="hover:underline cursor-pointer">责任博彩</a>
</div>
<p className="text-[9px] text-[#c1c6d7]/60 mt-1">
盛大国际娱乐城(SDYL.PH)特权加密通道. 客户信息由瑞安全天候监控.
</p>
</footer>
</div>
);
};