| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <title>活动详情</title>
- <script src="https://cdn.tailwindcss.com"></script>
- <style>
- .no-scrollbar::-webkit-scrollbar { display: none; }
- .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
- .pb-safe { padding-bottom: env(safe-area-inset-bottom); }
- </style>
- </head>
- <body class="bg-gray-100 flex justify-center h-screen overflow-hidden font-sans">
- <!-- === 右侧全局控制面板 (仅用于演示和测试交互) === -->
- <div class="fixed top-[15%] right-0 z-[100] flex flex-col items-end gap-3 max-w-sm">
-
- <!-- 按钮状态控制 -->
- <div class="relative group">
- <button onclick="toggleBtnPanel()" class="bg-indigo-600/90 text-white text-[12px] py-2 px-3 rounded-l-md shadow-md flex items-center gap-1.5 backdrop-blur-sm">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="9" x2="15" y2="15"></line><line x1="15" y1="9" x2="9" y2="15"></line></svg>
- 按钮状态
- </button>
- <div id="btn-panel" class="absolute top-0 right-[110%] bg-white/95 backdrop-blur-md border border-gray-200 p-2.5 rounded-lg shadow-xl w-[140px] text-[12px] transition-all origin-right scale-0 opacity-0 pointer-events-none">
- <div class="font-bold mb-2 text-gray-800 border-b pb-1 text-center">底部按钮切换</div>
- <div class="flex flex-col gap-1.5">
- <button onclick="setBtnState('enroll')" id="ctrl-btn-enroll" class="px-2 py-1.5 rounded bg-[#d70014] text-white transition font-medium">报名 (默认)</button>
- <button onclick="setBtnState('progress')" id="ctrl-btn-progress" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">查看达标进度</button>
- <button onclick="setBtnState('benefits')" id="ctrl-btn-benefits" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">查看权益</button>
- <button onclick="setBtnState('more')" id="ctrl-btn-more" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">查看更多活动</button>
- </div>
- </div>
- </div>
-
- <!-- 报名结果控制 (仅在按钮为“报名”时显示) -->
- <div class="relative group transition-all duration-300" id="result-control-wrapper">
- <button onclick="toggleResultPanel()" class="bg-purple-600/90 text-white text-[12px] py-2 px-3 rounded-l-md shadow-md flex items-center gap-1.5 backdrop-blur-sm">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
- 报名结果
- </button>
- <div id="result-panel" class="absolute top-0 right-[110%] bg-white/95 backdrop-blur-md border border-gray-200 p-2.5 rounded-lg shadow-xl w-[140px] text-[12px] transition-all origin-right scale-0 opacity-0 pointer-events-none">
- <div class="font-bold mb-2 text-gray-800 border-b pb-1 text-center">点击报名后校验</div>
- <div class="flex flex-col gap-1.5">
- <button onclick="setEnrollCondition('success')" id="ctrl-cond-success" class="px-2 py-1.5 rounded bg-[#d70014] text-white transition font-medium">通过校验(确认)</button>
- <button onclick="setEnrollCondition('not_eligible')" id="ctrl-cond-not_eligible" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">不符合条件</button>
- <button onclick="setEnrollCondition('full')" id="ctrl-cond-full" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">名额不足</button>
- <button onclick="setEnrollCondition('exclusive')" id="ctrl-cond-exclusive" class="px-2 py-1.5 rounded bg-gray-100 text-gray-700 transition">命中互斥</button>
- </div>
- </div>
- </div>
- </div>
- <!-- === 移动端视图容器 === -->
- <div class="w-full max-w-[400px] h-full bg-white flex flex-col relative shadow-2xl overflow-hidden">
-
- <!-- 顶部状态栏 -->
- <div class="h-11 w-full flex justify-between items-center px-5 text-black bg-white/90 backdrop-blur-md z-30 relative shrink-0">
- <span class="text-[15px] font-medium">9:41</span>
- <div class="flex gap-1.5 items-center">
- <svg width="18" height="12" viewBox="0 0 18 12" fill="none"><path d="M1.5 12V9H3.5V12H1.5ZM6 12V6.5H8V12H6ZM10.5 12V3.5H12.5V12H10.5ZM15 12V0H17V12H15Z" fill="black"/></svg>
- <svg width="16" height="12" viewBox="0 0 16 12" fill="none"><path d="M8 12C9.10457 12 10 11.1046 10 10C10 8.89543 9.10457 8 8 8C6.89543 8 6 8.89543 6 10C6 11.1046 6.89543 12 8 12Z" fill="black"/><path d="M2.34315 5.65685C5.46734 2.53266 10.5327 2.53266 13.6569 5.65685" stroke="black" stroke-width="1.5" stroke-linecap="round"/><path d="M5.17157 8.48528C6.73367 6.92318 9.26633 6.92318 10.8284 8.48528" stroke="black" stroke-width="1.5" stroke-linecap="round"/></svg>
- <svg width="25" height="12" viewBox="0 0 25 12" fill="none"><rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke="black"/><rect x="2" y="2" width="18" height="8" rx="1" fill="black"/><path d="M23 4V8" stroke="black" stroke-width="1.5" stroke-linecap="round"/></svg>
- </div>
- </div>
- <!-- 导航栏 -->
- <header class="h-11 flex items-center justify-between px-4 bg-white/90 backdrop-blur-md z-20 shrink-0 border-b border-gray-100">
- <button class="text-gray-800 p-1"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg></button>
- <h1 class="text-[17px] font-medium text-gray-900 absolute left-1/2 -translate-x-1/2">活动详情</h1>
- <div class="w-8"></div>
- </header>
- <!-- 内容滚动区 (去除预留的底部高度,添加底部安全区距离) -->
- <div class="flex-1 overflow-y-auto no-scrollbar pb-safe relative bg-white">
-
- <!-- 头图 -->
- <img src="https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800&auto=format&fit=crop" class="w-full h-[200px] object-cover shrink-0 block">
-
- <div class="px-5 py-6">
- <!-- 基础信息 -->
- <h2 class="text-[20px] font-medium text-gray-900 mb-4 tracking-wide leading-tight">2025 汇丰母亲节特别活动</h2>
-
- <div class="text-[13px] text-gray-600 space-y-2.5 mb-8 tracking-wide">
- <p>活动对象:文字文字文字</p>
- <p>活动报名时间:年/月/日/时-年/月/日/时</p>
- <p>活动进行时间:年/月/日/时-年/月/日/时</p>
- <p>活动地点:北京华贸丽思卡尔顿酒店大宴会厅</p>
- <p>报名人数:80人</p>
- </div>
- <!-- 富文本活动内容 -->
- <h3 class="text-[17px] font-medium text-gray-900 mb-4">活动内容</h3>
- <div class="text-[14px] text-gray-600 leading-[1.8] mb-8 text-justify tracking-wide">
- <p class="mb-4">带领嘉宾初步进入风水的世界,探索古人智慧的深度。用传统智慧理念和专业的财富规划帮助客户更好把握机遇。实现财富积累,代代传承。</p>
- <p class="mb-4">特邀嘉宾:赵丹青<br>现系国际青年易经学会会员;<br>香港中美易经学会会员及“中华周易学会”理事;<br>担任香港《楼盘与风水》杂志编委,《财务圈》杂志上开设风水专栏,为LV, Tiffany, Ports等著名国际时尚品牌公司堪舆;<br>任澳大利亚周易研究会副会长。</p>
- <p>活动流程:<br>14:00 - 14:30 嘉宾签到<br>14:30 - 14:45 汇丰私人财富规划简介<br>14:45 - 16:15 嘉宾主题分享-习住家风水 创财富人生<br>16:15 - 17:00 茶歇&自由交流</p>
- </div>
- <!-- 达标层级 Tabs (支持最多5层) -->
- <div class="flex overflow-x-auto no-scrollbar border-b border-gray-200 mb-5 relative scroll-smooth" id="tier-tabs-container">
- <button class="shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-900 text-center" onclick="switchTier(1)" id="tab-tier-1">层级一</button>
- <button class="shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-500 text-center" onclick="switchTier(2)" id="tab-tier-2">层级二</button>
- <button class="shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-500 text-center" onclick="switchTier(3)" id="tab-tier-3">层级三</button>
- <button class="shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-500 text-center" onclick="switchTier(4)" id="tab-tier-4">层级四</button>
- <button class="shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-500 text-center" onclick="switchTier(5)" id="tab-tier-5">层级五</button>
- <!-- 滑动指示器 -->
- <div id="tier-indicator" class="absolute bottom-0 h-[2px] bg-[#d70014] transition-all duration-300" style="width: 72px; left: 0px;"></div>
- </div>
- <!-- 达标层级内容展示区 -->
- <div id="tier-content-area" class="min-h-[150px]">
- <h4 class="text-[15px] font-medium text-gray-900 mb-2">达标要求</h4>
- <p class="text-[14px] text-gray-600 leading-[1.6] mb-6 tracking-wide">活动期间,首次升级为“合格卓越理财”客户,且保持3个月,3个自然月任一月末日终,较2025年3月末新增持有1类以上资产大类。</p>
-
- <h4 class="text-[15px] font-medium text-gray-900 mb-2">达标奖励</h4>
- <p class="text-[14px] text-gray-600 leading-[1.6] tracking-wide mb-4">32万汇友荟积分(可兑换约等值¥500好礼)</p>
- </div>
- <!-- === 操作栏 (跟随滚动,放在内容最下方) === -->
- <div class="mt-8 mb-4">
- <button id="main-action-btn" class="w-full h-[44px] bg-[#d70014] text-white text-[16px] font-medium rounded-[2px] transition active:opacity-90" onclick="handleMainAction()">
- 报名
- </button>
- </div>
- </div>
- </div>
- <!-- ================= 弹窗区域 ================= -->
- <!-- 1. 报名通用提示弹窗 (不符合/已满/互斥) -->
- <div id="alert-modal-backdrop" class="absolute inset-0 bg-black/50 z-[60] opacity-0 pointer-events-none transition-opacity duration-300" onclick="closeAlertModal()"></div>
- <div id="alert-modal" class="absolute bottom-0 left-0 w-full bg-white z-[70] rounded-t-xl transform translate-y-full transition-transform duration-300 flex flex-col pb-safe">
- <div class="flex justify-between items-center px-5 py-4 shrink-0">
- <h2 class="text-[17px] font-medium text-gray-900">提示</h2>
- <button onclick="closeAlertModal()" class="text-gray-500 p-1 hover:bg-gray-100 rounded-full transition">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
- </button>
- </div>
- <div class="px-5 pb-6 pt-2 text-[15px] text-gray-700" id="alert-modal-msg">
- 您暂不符合报名条件
- </div>
- <div class="px-5 pb-5">
- <button onclick="closeAlertModal()" class="w-full py-2.5 border border-[#cccccc] rounded-[2px] text-[16px] text-gray-800 bg-white font-medium active:bg-gray-50">返回首页</button>
- </div>
- </div>
- <!-- 2. 报名确认弹窗 -->
- <div id="confirm-modal-backdrop" class="absolute inset-0 bg-black/50 z-[60] opacity-0 pointer-events-none transition-opacity duration-300" onclick="closeConfirmModal()"></div>
- <div id="confirm-modal" class="absolute bottom-0 left-0 w-full bg-white z-[70] rounded-t-xl transform translate-y-full transition-transform duration-300 flex flex-col pb-safe">
- <div class="flex justify-between items-center px-5 py-4 shrink-0 border-b border-gray-50">
- <h2 class="text-[17px] font-medium text-gray-900">报名确认</h2>
- <button onclick="closeConfirmModal()" class="text-gray-500 p-1 hover:bg-gray-100 rounded-full transition">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
- </button>
- </div>
- <div class="px-5 pb-8 pt-5 text-[15px] text-gray-700 leading-relaxed">
- 你确定报名参加此「2025 汇丰母亲节特别活动」?
- </div>
- <div class="flex px-5 pb-5 gap-3">
- <button onclick="closeConfirmModal()" class="flex-1 py-2.5 border border-[#cccccc] rounded-[2px] text-[16px] text-gray-800 bg-white font-medium active:bg-gray-50">取消</button>
- <button onclick="confirmEnrollment()" class="flex-1 py-2.5 rounded-[2px] text-[16px] text-white bg-[#d70014] font-medium active:opacity-90">确认</button>
- </div>
- </div>
- <!-- Toast 提示 (用于操作反馈) -->
- <div id="toast" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black/80 text-white px-5 py-2.5 rounded text-[14px] z-[100] opacity-0 pointer-events-none transition-opacity duration-300 text-center w-max max-w-[80%]"></div>
- </div>
- <script>
- // --- 状态变量 ---
- let currentBtnState = 'enroll'; // enroll | progress | benefits | more
- let currentEnrollCondition = 'success'; // success | not_eligible | full | exclusive
- let currentTier = 1;
- let isBtnPanelOpen = false;
- let isResultPanelOpen = false;
- // --- 初始化面板 UI ---
- document.addEventListener('DOMContentLoaded', () => {
- updateBtnPanelUI();
- updateResultPanelUI();
- });
- // --- 层级切换逻辑 (最多5层) ---
- function switchTier(tier) {
- currentTier = tier;
- const tabWidth = 72; // min-w-[72px]
-
- // 移动指示器
- document.getElementById('tier-indicator').style.left = `${(tier - 1) * tabWidth}px`;
-
- // 更新文字样式
- for (let i = 1; i <= 5; i++) {
- const tab = document.getElementById(`tab-tier-${i}`);
- if(i === tier) {
- tab.className = 'shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-900 text-center';
- } else {
- tab.className = 'shrink-0 min-w-[72px] py-3 text-[14px] font-medium text-gray-500 text-center';
- }
- }
- // 模拟更换数据 (这里简单通过 JS 替换奖励文案以示区别)
- const rewards = [
- "32万汇友荟积分(可兑换约等值¥500好礼)",
- "64万汇友荟积分(可兑换约等值¥1000好礼)",
- "128万汇友荟积分(可兑换约等值¥2000好礼)",
- "免费双人豪华酒店住宿一晚",
- "汇丰私行专属定制礼盒一份"
- ];
- document.getElementById('tier-content-area').innerHTML = `
- <h4 class="text-[15px] font-medium text-gray-900 mb-2">达标要求</h4>
- <p class="text-[14px] text-gray-600 leading-[1.6] mb-6 tracking-wide">
- 活动期间,首次升级为“合格卓越理财”客户,且保持3个月,3个自然月任一月末日终,较2025年3月末新增持有${tier}类以上资产大类。(此为层级${tier}的模拟数据)
- </p>
- <h4 class="text-[15px] font-medium text-gray-900 mb-2">达标奖励</h4>
- <p class="text-[14px] text-gray-600 leading-[1.6] tracking-wide mb-4">${rewards[tier-1]}</p>
- `;
- }
- // --- 底部主按钮逻辑 ---
- function handleMainAction() {
- if (currentBtnState === 'enroll') {
- if (currentEnrollCondition === 'success') {
- openConfirmModal();
- } else {
- let msg = '';
- if (currentEnrollCondition === 'not_eligible') msg = '您暂不符合报名条件';
- else if (currentEnrollCondition === 'full') msg = '很遗憾,该活动报名已满。';
- else if (currentEnrollCondition === 'exclusive') msg = '您已参与同类型活动,不可重复报名';
- openAlertModal(msg);
- }
- } else if (currentBtnState === 'progress') {
- showToast('正在为您拉取达标进度...');
- } else if (currentBtnState === 'benefits') {
- showToast('正在为您拉取权益信息...');
- } else if (currentBtnState === 'more') {
- showToast('即将跳转全部活动列表...');
- }
- }
- // --- 弹窗控制逻辑 ---
- function openAlertModal(msg) {
- document.getElementById('alert-modal-msg').innerText = msg;
- document.getElementById('alert-modal-backdrop').classList.remove('opacity-0', 'pointer-events-none');
- document.getElementById('alert-modal').classList.remove('translate-y-full');
- }
- function closeAlertModal() {
- document.getElementById('alert-modal-backdrop').classList.add('opacity-0', 'pointer-events-none');
- document.getElementById('alert-modal').classList.add('translate-y-full');
- }
- function openConfirmModal() {
- document.getElementById('confirm-modal-backdrop').classList.remove('opacity-0', 'pointer-events-none');
- document.getElementById('confirm-modal').classList.remove('translate-y-full');
- }
- function closeConfirmModal() {
- document.getElementById('confirm-modal-backdrop').classList.add('opacity-0', 'pointer-events-none');
- document.getElementById('confirm-modal').classList.add('translate-y-full');
- }
-
- function confirmEnrollment() {
- closeConfirmModal();
- // 报名成功后,可以自动切换为查看进度状态
- setTimeout(() => {
- showToast('报名成功!');
- setBtnState('progress');
- }, 300);
- }
- // --- Toast 提示 ---
- let toastTimeout;
- function showToast(msg) {
- const toast = document.getElementById('toast');
- toast.innerText = msg;
- toast.classList.remove('opacity-0');
- clearTimeout(toastTimeout);
- toastTimeout = setTimeout(() => { toast.classList.add('opacity-0'); }, 2000);
- }
- // --- 控制面板交互 (用于调试/演示) ---
- function toggleBtnPanel() {
- isBtnPanelOpen = !isBtnPanelOpen;
- const panel = document.getElementById('btn-panel');
- if (isBtnPanelOpen) {
- panel.classList.remove('scale-0', 'opacity-0', 'pointer-events-none');
- if (isResultPanelOpen) toggleResultPanel();
- } else {
- panel.classList.add('scale-0', 'opacity-0', 'pointer-events-none');
- }
- }
- function toggleResultPanel() {
- isResultPanelOpen = !isResultPanelOpen;
- const panel = document.getElementById('result-panel');
- if (isResultPanelOpen) {
- panel.classList.remove('scale-0', 'opacity-0', 'pointer-events-none');
- if (isBtnPanelOpen) toggleBtnPanel();
- } else {
- panel.classList.add('scale-0', 'opacity-0', 'pointer-events-none');
- }
- }
- function setBtnState(state) {
- currentBtnState = state;
- updateBtnPanelUI();
-
- const mainBtn = document.getElementById('main-action-btn');
- const resultWrapper = document.getElementById('result-control-wrapper');
-
- // 切换按钮文案和控制结果面板的显示/隐藏
- if (state === 'enroll') {
- mainBtn.innerText = '报名';
- mainBtn.className = 'w-full h-[44px] bg-[#d70014] text-white text-[16px] font-medium rounded-[2px] transition active:opacity-90';
- resultWrapper.style.display = 'block'; // 只有报名状态才需要校验结果控制
- } else {
- resultWrapper.style.display = 'none';
- if (isResultPanelOpen) toggleResultPanel();
-
- // 非报名状态:统一使用白底、灰框、深灰字的样式
- const secondaryBtnClass = 'w-full h-[44px] border border-[#999999] text-[#333333] bg-white text-[15px] font-medium rounded-[2px] transition active:bg-gray-50';
-
- if (state === 'progress') {
- mainBtn.innerText = '查看达标进度';
- mainBtn.className = secondaryBtnClass;
- } else if (state === 'benefits') {
- mainBtn.innerText = '查看权益';
- mainBtn.className = secondaryBtnClass;
- } else if (state === 'more') {
- mainBtn.innerText = '查看更多活动';
- mainBtn.className = secondaryBtnClass;
- }
- }
- if(isBtnPanelOpen) toggleBtnPanel();
- }
- function setEnrollCondition(cond) {
- currentEnrollCondition = cond;
- updateResultPanelUI();
- if(isResultPanelOpen) toggleResultPanel();
- }
- function updateBtnPanelUI() {
- const states = ['enroll', 'progress', 'benefits', 'more'];
- states.forEach(s => {
- document.getElementById(`ctrl-btn-${s}`).className = s === currentBtnState
- ? 'px-2 py-1.5 rounded bg-[#d70014] text-white transition font-medium'
- : 'px-2 py-1.5 rounded bg-gray-100 text-gray-700 hover:bg-gray-200 transition';
- });
- }
- function updateResultPanelUI() {
- const conditions = ['success', 'not_eligible', 'full', 'exclusive'];
- conditions.forEach(c => {
- document.getElementById(`ctrl-cond-${c}`).className = c === currentEnrollCondition
- ? 'px-2 py-1.5 rounded bg-[#d70014] text-white transition font-medium'
- : 'px-2 py-1.5 rounded bg-gray-100 text-gray-700 hover:bg-gray-200 transition';
- });
- }
- </script>
- </body>
- </html>
|