Browse Source

修改bug

master
zhaoruhui 9 hours ago
parent
commit
1f9b4ea3dd
  1. 371
      hkRegister.html
  2. 8
      hkRegisterSuccess.html
  3. 8
      hkhcdbqbDownload.html
  4. 16
      hkhcdbqbGuide.html
  5. 200
      hkhcdbqbManagement.html

371
hkRegister.html

@ -33,53 +33,49 @@
<style type="text/tailwindcss"> <style type="text/tailwindcss">
@layer utilities { @layer utilities {
.card-hover {
@apply transition-all duration-300 hover:shadow-xl;
}
.btn-effect {
@apply relative overflow-hidden transition-all duration-300;
}
.btn-effect::after {
content: '';
@apply absolute top-0 left-[-100%] w-full h-full bg-white/20 transform skew-x-12 transition-all duration-500;
}
.btn-effect:hover::after {
@apply left-[100%];
}
.input-focus {
@apply focus:border-primary focus:ring-2 focus:ring-primary/20 focus:outline-none;
}
/* 图标容器样式 - 确保绝对居中 */
.form-icon-container {
@apply absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none z-10;
}
.form-icon {
@apply text-gray-500 text-base;
}
.form-group {
@apply mb-5 relative;
}
.form-label {
@apply block text-gray-700 font-medium mb-2;
}
/* 统一输入框高度和内边距 */
.form-control {
@apply w-full pl-10 py-3 border border-gray-300 rounded-lg input-focus transition-colors;
height: 54px; /* 固定高度确保垂直对齐 */
}
/* 选择框样式统一 */
.form-select {
@apply form-control pr-8 appearance-none bg-white;
background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" fill=\"%23333\"/></svg>');
background-repeat: no-repeat;
background-position: right 0.5rem center;
background-size: 1em;
}
}
</style>
.card-hover {
@apply transition-all duration-300 hover:shadow-xl;
}
.btn-effect {
@apply relative overflow-hidden transition-all duration-300;
}
.btn-effect::after {
content: '';
@apply absolute top-0 left-[-100%] w-full h-full bg-white/20 transform skew-x-12 transition-all duration-500;
}
.btn-effect:hover::after {
@apply left-[100%];
}
.input-focus {
@apply focus:border-primary focus:ring-2 focus:ring-primary/20 focus:outline-none;
}
.form-icon-container {
@apply absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none z-10;
}
.form-icon {
@apply text-gray-500 text-base;
}
.form-group {
@apply mb-5 relative;
}
.form-label {
@apply block text-gray-700 font-medium mb-2;
}
.form-control {
@apply w-full pl-10 py-3 border border-gray-300 rounded-lg input-focus transition-colors;
height: 54px;
}
.form-select {
@apply form-control pr-8 appearance-none bg-white;
background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" fill=\"%23333\"/></svg>');
background-repeat: no-repeat;
background-position: right 0.5rem center;
background-size: 1em;
}
}
</style>
<style> <style>
/* 基础动画 */
@keyframes fadeIn { @keyframes fadeIn {
from { from {
opacity: 0; opacity: 0;
@ -108,19 +104,56 @@
animation-delay: 0.3s; animation-delay: 0.3s;
} }
/* 确保所有输入控件垂直对齐 */
input.form-control, input.form-control,
select.form-select { select.form-select {
box-sizing: border-box; box-sizing: border-box;
vertical-align: middle; vertical-align: middle;
} }
/* 解决不同浏览器下select元素的高度差异 */
select.form-select { select.form-select {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
} }
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
flex-direction: column;
}
.spinner {
width: 50px;
height: 50px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3B82F6;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.loading-text {
color: white;
margin-top: 15px;
font-size: 16px;
}
</style> </style>
</head> </head>
@ -138,51 +171,46 @@
class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary">夺宝奇兵免费体验</span> class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary">夺宝奇兵免费体验</span>
</div> </div>
<!-- 桌面导航 -->
<nav class="hidden md:flex items-center space-x-8"> <nav class="hidden md:flex items-center space-x-8">
<a href="hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a> <a href="hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a>
<a href="hkhcdbqbDownload.html" class="hover:text-primary transition-colors">下载中心</a> <a href="hkhcdbqbDownload.html" class="hover:text-primary transition-colors">下载中心</a>
<a href="hkhcdbqbGuide.html" class="text-primary font-medium">操作指南</a> <a href="hkhcdbqbGuide.html" class="text-primary font-medium">操作指南</a>
<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵" target="_blank"
<a href="https://wa.me/+6588792879?text=我要了解夺宝奇兵" target="_blank"
class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white hover:shadow-lg transition-all">联系我们</a> class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white hover:shadow-lg transition-all">联系我们</a>
</nav> </nav>
<!-- 移动端菜单 -->
<button id="mobileMenuBtn" class="md:hidden text-xl"> <button id="mobileMenuBtn" class="md:hidden text-xl">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</button> </button>
</div> </div>
<!-- 移动端菜单内容 -->
<div id="mobileMenu" class="md:hidden hidden bg-white border-t"> <div id="mobileMenu" class="md:hidden hidden bg-white border-t">
<div class="container mx-auto px-4 py-3 flex flex-col space-y-3"> <div class="container mx-auto px-4 py-3 flex flex-col space-y-3">
<a href="hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a> <a href="hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a>
<a href="hkhcdbqbDownload.html" class="py-2 hover:text-primary transition-colors">下载中心</a> <a href="hkhcdbqbDownload.html" class="py-2 hover:text-primary transition-colors">下载中心</a>
<a href="hkhcdbqbGuide.html" class="py-2 text-primary">操作指南</a> <a href="hkhcdbqbGuide.html" class="py-2 text-primary">操作指南</a>
<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵" target="_blank"
<a href="https://wa.me/+6588792879?text=我要了解夺宝奇兵" target="_blank"
class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white text-center">联系我们</a> class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white text-center">联系我们</a>
</div> </div>
</div> </div>
</header> </header>
<!-- 主要内容 --> <!-- 主要内容 -->
<main class="pt-28 pb-16 px-4"> <main class="pt-28 pb-16 px-4">
<div class="container mx-auto max-w-6xl"> <div class="container mx-auto max-w-6xl">
<!-- 页面标题 -->
<div class="text-center mb-12 fade-in"> <div class="text-center mb-12 fade-in">
<h1 class="text-[clamp(1.8rem,4vw,2.5rem)] font-bold mb-4">夺宝奇兵+内部班级课程<br />免费体验</h1> <h1 class="text-[clamp(1.8rem,4vw,2.5rem)] font-bold mb-4">夺宝奇兵+内部班级课程<br />免费体验</h1>
<p class="text-gray-600 max-w-2xl mx-auto">财富粉报名即可获得体验的机会!<br />超级云脑 夺宝利剑 AI预测大模型</p>
<p class="text-gray-600 max-w-2xl mx-auto">AD粉报名即可获得体验的机会!<br />超级云脑 夺宝利剑 AI预测大模型</p>
</div> </div>
<div class="grid grid-cols-1 lg:grid-cols-5 gap-8 max-w-5xl mx-auto"> <div class="grid grid-cols-1 lg:grid-cols-5 gap-8 max-w-5xl mx-auto">
<!-- 注册表单 --> <!-- 注册表单 -->
<div class="lg:col-span-3 fade-in delay-100"> <div class="lg:col-span-3 fade-in delay-100">
<div class="bg-white rounded-xl shadow-md p-6 md:p-8 card-hover"> <div class="bg-white rounded-xl shadow-md p-6 md:p-8 card-hover">
<form id="registrationForm" action="./hkRegisterTip.html" method="post">
<!-- 姓名 -->
<!-- 注意:移除了 action 和 method,由JS处理 -->
<form id="registrationForm">
<div class="form-group"> <div class="form-group">
<label for="fullname" class="form-label">姓名 <span class="text-red-500">*</span></label>
<label class="form-label">姓名 <span class="text-red-500">*</span></label>
<div class="relative"> <div class="relative">
<div class="form-icon-container"> <div class="form-icon-container">
<i class="form-icon fa fa-user"></i> <i class="form-icon fa fa-user"></i>
@ -190,92 +218,54 @@
<input type="text" id="unameinfo" name="unameinfo" class="form-control" <input type="text" id="unameinfo" name="unameinfo" class="form-control"
autocomplete="off" placeholder="请输入您的姓名"> autocomplete="off" placeholder="请输入您的姓名">
</div> </div>
<div id="nameError" class="text-red-500" style="display: none;">请输入您的姓名 [ Please enter
your name ] </div>
<div id="nameError" class="text-red-500 text-sm mt-1" style="display: none;">请输入您的姓名
</div>
</div> </div>
<!-- 手机号 - 图标垂直居中优化 -->
<div class="form-group"> <div class="form-group">
<label class="form-label">手机号码 <span class="text-red-500">*</span></label> <label class="form-label">手机号码 <span class="text-red-500">*</span></label>
<input type="hidden" name="zbtype" id="zbtype" value="2"> <input type="hidden" name="zbtype" id="zbtype" value="2">
<div class="flex gap-3"> <div class="flex gap-3">
<!-- 国家编号选择框 -->
<div class="w-30 relative"> <div class="w-30 relative">
<div class="form-icon-container"> <div class="form-icon-container">
<i class="form-icon fa fa-globe"></i> <i class="form-icon fa fa-globe"></i>
</div> </div>
<select name="countryinfo" id="countryinfo" class="form-select"> <select name="countryinfo" id="countryinfo" class="form-select">
<option value="+65">+65 新加坡</option> <option value="+65">+65 新加坡</option>
<option value="+60">+60 马来西亚</option> <option value="+60">+60 马来西亚</option>
<option value="+852">+852 香港</option> <option value="+852">+852 香港</option>
<option value="+1" selected='selected'>+1 美国</option>
<option value="+1" selected="selected">+1 美国</option>
<option value="+62">+62 印尼</option> <option value="+62">+62 印尼</option>
<option value="+1">+1 加拿大</option>
<option value="+61">+61 澳大利亚</option> <option value="+61">+61 澳大利亚</option>
<option value="+673">+673 文莱</option> <option value="+673">+673 文莱</option>
<option value="+886">+886 台湾</option> <option value="+886">+886 台湾</option>
<option value="+86">+86 中国</option> <option value="+86">+86 中国</option>
<option value="+0">+0 其他</option> <option value="+0">+0 其他</option>
<option value="+64">+64 新西兰</option> <option value="+64">+64 新西兰</option>
<option value="+44">+44 英国</option> <option value="+44">+44 英国</option>
<option value="+81">+81 日本</option> <option value="+81">+81 日本</option>
<option value="+49">+49 德国</option> <option value="+49">+49 德国</option>
<option value="+82">+82 韩国</option> <option value="+82">+82 韩国</option>
<option value="+84 ">+84 越南</option>
<option value="+84">+84 越南</option>
<option value="+971">+971 阿联酋</option> <option value="+971">+971 阿联酋</option>
<option value="+45">+45 丹麦</option> <option value="+45">+45 丹麦</option>
<option value="+853">+853 澳门</option> <option value="+853">+853 澳门</option>
<option value="+66">+66 泰国</option> <option value="+66">+66 泰国</option>
<option value="+91">+91 印度</option> <option value="+91">+91 印度</option>
<option value="+41">+41 瑞士</option> <option value="+41">+41 瑞士</option>
<option value="+358">+358 芬兰</option> <option value="+358">+358 芬兰</option>
<option value="+33">+33 法国</option> <option value="+33">+33 法国</option>
<option value="+63">+63 菲律宾</option> <option value="+63">+63 菲律宾</option>
<option value="+31">+31 荷兰</option> <option value="+31">+31 荷兰</option>
<option value="+46">+46 瑞典</option> <option value="+46">+46 瑞典</option>
<option value="+34">+34 西班牙</option> <option value="+34">+34 西班牙</option>
<option value="+54">+54 阿根廷</option> <option value="+54">+54 阿根廷</option>
<option value="+39">+39 意大利</option> <option value="+39">+39 意大利</option>
<option value="+7">+7 俄罗斯</option> <option value="+7">+7 俄罗斯</option>
<option value="+420">+420 捷克</option> <option value="+420">+420 捷克</option>
</select> </select>
</div> </div>
<!-- 手机号输入框 -->
<div class="flex-1 relative"> <div class="flex-1 relative">
<div class="form-icon-container"> <div class="form-icon-container">
<i class="form-icon fa fa-whatsapp"></i> <i class="form-icon fa fa-whatsapp"></i>
@ -285,26 +275,23 @@
autocomplete="off" placeholder="不带国家编号的纯机号"> autocomplete="off" placeholder="不带国家编号的纯机号">
</div> </div>
</div> </div>
<div id="phoneError" class="text-red-500" style="display: none;">请输入正确的手机号(纯手机号 不含国家编号 )
</div>
<div id="phoneError" class="text-red-500 text-sm mt-1" style="display: none;">
请输入正确的手机号(纯手机号,不含国家编号)</div>
</div> </div>
<!-- 微信ID -->
<div class="form-group"> <div class="form-group">
<label for="wechat" class="form-label">微信ID <span class="text-red-500"></span></label>
<label class="form-label">微信ID</label>
<div class="relative"> <div class="relative">
<div class="form-icon-container"> <div class="form-icon-container">
<i class="form-icon fa fa-weixin"></i> <i class="form-icon fa fa-weixin"></i>
</div> </div>
<input type="text" id="uwechat" name="uwechat" class="form-control" <input type="text" id="uwechat" name="uwechat" class="form-control"
placeholder="微信ID ( 如没有WhatsApp )" autocomplete="off">
placeholder="微信ID(如没有WhatsApp)" autocomplete="off">
</div> </div>
<div id="wechatError" class="text-red-500" style="display: none;">请输入微信ID</div>
</div> </div>
<!-- 邮箱地址 -->
<div class="form-group mb-6"> <div class="form-group mb-6">
<label for="email" class="form-label">邮箱地址 <span class="text-red-500">*</span></label>
<label class="form-label">邮箱地址 <span class="text-red-500">*</span></label>
<div class="relative"> <div class="relative">
<div class="form-icon-container"> <div class="form-icon-container">
<i class="form-icon fa fa-envelope"></i> <i class="form-icon fa fa-envelope"></i>
@ -312,11 +299,11 @@
<input type="email" id="uemail" name="uemail" class="form-control" <input type="email" id="uemail" name="uemail" class="form-control"
autocomplete="off" placeholder="请输入您的邮箱地址"> autocomplete="off" placeholder="请输入您的邮箱地址">
</div> </div>
<div id="emailError" class="text-red-500" style="display: none;">请输入您的有效邮箱地址</div>
<div id="emailError" class="text-red-500 text-sm mt-1" style="display: none;">
请输入您的有效邮箱地址</div>
</div> </div>
<!-- 提交按钮 -->
<button type="submit"
<button type="submit" id="submitBtn"
class="btn-effect w-full py-3 rounded-lg bg-gradient-to-r from-primary to-secondary text-white font-medium text-lg"> class="btn-effect w-full py-3 rounded-lg bg-gradient-to-r from-primary to-secondary text-white font-medium text-lg">
<i class="fa fa-check-circle mr-2"></i>提交注册 <i class="fa fa-check-circle mr-2"></i>提交注册
</button> </button>
@ -368,19 +355,19 @@
</div> </div>
<p>邮箱作为联系您的备用联系方式。</p> <p>邮箱作为联系您的备用联系方式。</p>
</div> </div>
<div class="mt-6 pt-5 border-t border-gray-100"> <div class="mt-6 pt-5 border-t border-gray-100">
<h4 class="font-semibold mb-3 text-gray-700">温馨提示</h4> <h4 class="font-semibold mb-3 text-gray-700">温馨提示</h4>
<p class="text-sm"> <p class="text-sm">
财富粉可以进入HomilyLink内部班级群<br />免费学习。<br />
AD粉可以进入HomilyLink内部班级群<br />免费学习。<br />
免费体验包括:夺宝奇兵三大模板<br /> 免费体验包括:夺宝奇兵三大模板<br />
铁粉可以体验部分DeepChart功能! 铁粉可以体验部分DeepChart功能!
</p> </p>
</div> </div>
<div class="mt-6 pt-5 border-t border-gray-100"> <div class="mt-6 pt-5 border-t border-gray-100">
<h4 class="font-semibold mb-3 text-gray-700">郑重声明</h4> <h4 class="font-semibold mb-3 text-gray-700">郑重声明</h4>
<p class="text-sm">
我们将严格保护您的个人信息安全,绝对不会向第三方泄露。<br />
</p>
<p class="text-sm">我们将严格保护您的个人信息安全,绝对不会向第三方泄露。</p>
</div> </div>
</div> </div>
</div> </div>
@ -405,13 +392,14 @@
</div> </div>
</footer> </footer>
<!-- 交互脚本 -->
<!-- 交互脚本 - 使用 type="module" 保留原有API导入 -->
<script type="module"> <script type="module">
// 从外部文件导入 registerMemberApi 函数
// 从外部文件导入 registerMemberApi 函数(保持原有方式)
import { registerMemberApi } from './src/api/hkmember.js'; import { registerMemberApi } from './src/api/hkmember.js';
// 获取表单元素 // 获取表单元素
const form = document.getElementById('registrationForm'); const form = document.getElementById('registrationForm');
const submitBtn = document.getElementById('submitBtn');
// 错误提示元素 // 错误提示元素
const nameError = document.getElementById('nameError'); const nameError = document.getElementById('nameError');
@ -420,13 +408,19 @@
// 隐藏所有错误提示 // 隐藏所有错误提示
function hideAllErrors() { function hideAllErrors() {
nameError.style.display = 'none';
phoneError.style.display = 'none';
emailError.style.display = 'none';
if (nameError) nameError.style.display = 'none';
if (phoneError) phoneError.style.display = 'none';
if (emailError) emailError.style.display = 'none';
}
// 显示错误
function showError(element) {
if (element) element.style.display = 'block';
} }
// 邮箱校验 // 邮箱校验
function isValidEmail(email) { function isValidEmail(email) {
if (!email || email.trim() === '') return false;
const emailRegex = /^[^\s@]+@([^\s@]+\.)+[^\s@]+$/; const emailRegex = /^[^\s@]+@([^\s@]+\.)+[^\s@]+$/;
if (!emailRegex.test(email)) return false; if (!emailRegex.test(email)) return false;
if (email.length > 254) return false; if (email.length > 254) return false;
@ -450,9 +444,53 @@
return cleaned; return cleaned;
} }
// 表单提交处理 - 先调用API保存数据,然后继续表单提交跳转
// 显示加载状态
function showLoading() {
const loadingDiv = document.createElement('div');
loadingDiv.id = 'loadingOverlay';
loadingDiv.className = 'loading-overlay';
loadingDiv.innerHTML = '<div class="spinner"></div><div class="loading-text">正在提交注册信息...</div>';
document.body.appendChild(loadingDiv);
if (submitBtn) {
submitBtn.disabled = true;
submitBtn.style.opacity = '0.6';
submitBtn.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i>提交中...';
}
}
// 隐藏加载状态
function hideLoading() {
const loadingDiv = document.getElementById('loadingOverlay');
if (loadingDiv) loadingDiv.remove();
if (submitBtn) {
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
submitBtn.innerHTML = '<i class="fa fa-check-circle mr-2"></i>提交注册';
}
}
// 使用 GET 方式跳转到提示页面(避免 Nginx 405 错误)
function redirectToSuccessPage(formData) {
const params = new URLSearchParams();
params.set('unameinfo', formData.name);
params.set('countryinfo', formData.countryCode);
params.set('umoblie', formData.phone);
params.set('uemail', formData.email);
if (formData.wechat) params.set('uwechat', formData.wechat);
params.set('zbtype', formData.zbtype);
// GET 方式跳转,不会出现 405 错误
window.location.href = `./hkRegisterTip.html?${params.toString()}`;
}
// 表单提交处理 - 先调用API保存数据,然后GET跳转
form.addEventListener('submit', async function (e) { form.addEventListener('submit', async function (e) {
// 先进行前端校验
// 阻止默认提交
e.preventDefault();
// 前端校验
hideAllErrors(); hideAllErrors();
const name = document.getElementById('unameinfo').value.trim(); const name = document.getElementById('unameinfo').value.trim();
@ -460,36 +498,33 @@
const phoneRaw = document.getElementById('umoblie').value.trim(); const phoneRaw = document.getElementById('umoblie').value.trim();
const wechat = document.getElementById('uwechat').value.trim(); const wechat = document.getElementById('uwechat').value.trim();
const email = document.getElementById('uemail').value.trim(); const email = document.getElementById('uemail').value.trim();
const zbtype = document.getElementById('zbtype').value;
let isValid = true; let isValid = true;
if (!name) { if (!name) {
nameError.style.display = 'block';
showError(nameError);
isValid = false; isValid = false;
} }
if (!phoneRaw || !isValidPhone(phoneRaw)) { if (!phoneRaw || !isValidPhone(phoneRaw)) {
phoneError.style.display = 'block';
showError(phoneError);
isValid = false; isValid = false;
} }
if (!email || !isValidEmail(email)) { if (!email || !isValidEmail(email)) {
emailError.style.display = 'block';
showError(emailError);
isValid = false; isValid = false;
} }
if (!isValid) { if (!isValid) {
e.preventDefault();
return; return;
} }
// 阻止默认提交,先调用API
e.preventDefault();
// 清理手机号 // 清理手机号
const cleanedPhone = cleanPhoneNumber(phoneRaw); const cleanedPhone = cleanPhoneNumber(phoneRaw);
// 组装请求参数
// 组装请求参数(与原来保持一致)
const requestData = { const requestData = {
name: name, name: name,
code: countryCode, code: countryCode,
@ -501,31 +536,58 @@
requestData.weChat = wechat; requestData.weChat = wechat;
} }
// 保存表单数据用于跳转
const formData = {
name: name,
countryCode: countryCode,
phone: cleanedPhone,
wechat: wechat,
email: email,
zbtype: zbtype
};
// 显示加载状态
showLoading();
try { try {
// 调用原有的 API 接口保存数据
const result = await registerMemberApi(requestData); const result = await registerMemberApi(requestData);
if (result.code === 200) { if (result.code === 200) {
// API调用成功,继续表单提交跳转
form.submit();
// API调用成功,GET方式跳转到提示页面
redirectToSuccessPage(formData);
} else { } else {
hideLoading();
alert('注册失败:' + (result.msg || '未知错误,请稍后重试')); alert('注册失败:' + (result.msg || '未知错误,请稍后重试'));
} }
} catch (error) { } catch (error) {
console.error('提交注册出错:', error); console.error('提交注册出错:', error);
alert('网络错误或接口异常,请稍后重试');
hideLoading();
// API失败时,询问是否继续(数据未保存到后端)
if (confirm('网络错误,注册失败。请检查网络后重试。\n\n是否返回表单重新提交?')) {
// 用户选择重试,停留在当前页面
return;
}
} }
}); });
// 移动端菜单切换 // 移动端菜单切换
document.getElementById('mobileMenuBtn').addEventListener('click', function () {
const menu = document.getElementById('mobileMenu');
menu.classList.toggle('hidden');
const icon = this.querySelector('i');
if (icon.classList.contains('fa-bars')) {
icon.classList.replace('fa-bars', 'fa-times');
} else {
icon.classList.replace('fa-times', 'fa-bars');
}
});
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
if (mobileMenuBtn) {
mobileMenuBtn.addEventListener('click', function () {
const menu = document.getElementById('mobileMenu');
if (menu) {
menu.classList.toggle('hidden');
const icon = this.querySelector('i');
if (icon.classList.contains('fa-bars')) {
icon.classList.replace('fa-bars', 'fa-times');
} else {
icon.classList.replace('fa-times', 'fa-bars');
}
}
});
}
// 页面加载动画 // 页面加载动画
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
@ -533,6 +595,29 @@
el.style.opacity = '1'; el.style.opacity = '1';
}); });
}); });
// 输入框实时验证
const nameInput = document.getElementById('unameinfo');
const phoneInput = document.getElementById('umoblie');
const emailInput = document.getElementById('uemail');
if (nameInput) {
nameInput.addEventListener('blur', function () {
if (this.value.trim()) nameError.style.display = 'none';
});
}
if (phoneInput) {
phoneInput.addEventListener('blur', function () {
if (this.value.trim() && isValidPhone(this.value.trim())) phoneError.style.display = 'none';
});
}
if (emailInput) {
emailInput.addEventListener('blur', function () {
if (this.value.trim() && isValidEmail(this.value.trim())) emailError.style.display = 'none';
});
}
</script> </script>
</body> </body>

8
hkRegisterSuccess.html

@ -115,7 +115,7 @@
<a href="./hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a> <a href="./hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a>
<a href="./hkhcdbqbDownload.html" class="hover:text-primary transition-colors">下载中心</a> <a href="./hkhcdbqbDownload.html" class="hover:text-primary transition-colors">下载中心</a>
<a href="./hkhcdbqbGuide.html" class="text-primary font-medium">操作指南</a> <a href="./hkhcdbqbGuide.html" class="text-primary font-medium">操作指南</a>
<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵" target="_blank"
<a href="https://wa.me/85269518757?text=我要体验夺宝奇兵" target="_blank"
class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white hover:shadow-lg transition-all">联系我们</a> class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white hover:shadow-lg transition-all">联系我们</a>
</nav> </nav>
@ -131,7 +131,7 @@
<a href="./hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a> <a href="./hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a>
<a href="./hkhcdbqbDownload.html" class="py-2 hover:text-primary transition-colors">下载中心</a> <a href="./hkhcdbqbDownload.html" class="py-2 hover:text-primary transition-colors">下载中心</a>
<a href="./hkhcdbqbGuide.html" class="py-2 text-primary">操作指南</a> <a href="./hkhcdbqbGuide.html" class="py-2 text-primary">操作指南</a>
<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵" target="_blank"
<a href="https://wa.me/85269518757?text=我要体验夺宝奇兵" target="_blank"
class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white text-center">联系我们</a> class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-secondary text-white text-center">联系我们</a>
</div> </div>
</div> </div>
@ -209,7 +209,7 @@
class="btn-effect flex-1 py-3 rounded-lg bg-gradient-to-r from-primary to-secondary text-white font-medium text-center"> class="btn-effect flex-1 py-3 rounded-lg bg-gradient-to-r from-primary to-secondary text-white font-medium text-center">
<i class="fa fa-home mr-2"></i>查看操作指南 <i class="fa fa-home mr-2"></i>查看操作指南
</a> </a>
<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵"
<a href="https://wa.me/85269518757?text=我要体验夺宝奇兵"
class="btn-effect flex-1 py-3 rounded-lg border border-primary text-primary font-medium text-center hover:bg-primary/5 transition-colors"> class="btn-effect flex-1 py-3 rounded-lg border border-primary text-primary font-medium text-center hover:bg-primary/5 transition-colors">
<i class="fa fa-user mr-2"></i>需要联系帮助 <i class="fa fa-user mr-2"></i>需要联系帮助
</a> </a>
@ -218,7 +218,7 @@
<!-- 帮助信息 --> <!-- 帮助信息 -->
<div class="text-center mt-8 text-gray-500 text-sm max-w-xl mx-auto delay-500 fade-in"> <div class="text-center mt-8 text-gray-500 text-sm max-w-xl mx-auto delay-500 fade-in">
<p>如果您没有收到我们老师的消息,请及时<a href="https://wa.me/+6588792879?text=我要体验夺宝奇兵" target="_blank"
<p>如果您没有收到我们老师的消息,请及时<a href="https://wa.me/85269518757?text=我要体验夺宝奇兵" target="_blank"
class="text-primary hover:underline">联系我们</a></p> class="text-primary hover:underline">联系我们</a></p>
</div> </div>
</div> </div>

8
hkhcdbqbDownload.html

@ -1751,9 +1751,9 @@
<nav class="hidden md:flex items-center space-x-8"> <nav class="hidden md:flex items-center space-x-8">
<a href="hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a> <a href="hkhcdbqb.html" class="hover:text-primary transition-colors">首页</a>
<a href="hkhcdbqbDownload.html" class="text-primary font-medium">下载中心</a> <a href="hkhcdbqbDownload.html" class="text-primary font-medium">下载中心</a>
<a href="https://wa.me/85269518757?text=我需要帮助" target="_blank"
<a href="https://wa.me/85269518757?text=夺宝奇兵下载我需要帮助" target="_blank"
class="hover:text-primary transition-colors">帮助</a> class="hover:text-primary transition-colors">帮助</a>
<a href="https://wa.me/85269518757?text=我需要帮助" target="_blank"
<a href="https://wa.me/85269518757?text=夺宝奇兵下载我需要帮助" target="_blank"
class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-purple-600 text-white hover:shadow-lg transition-all">联系我们</a> class="px-5 py-2 rounded-full bg-gradient-to-r from-primary to-purple-600 text-white hover:shadow-lg transition-all">联系我们</a>
</nav> </nav>
@ -1768,9 +1768,9 @@
<div class="container mx-auto px-4 py-3 flex flex-col space-y-3"> <div class="container mx-auto px-4 py-3 flex flex-col space-y-3">
<a href="hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a> <a href="hkhcdbqb.html" class="py-2 hover:text-primary transition-colors">首页</a>
<a href="hkhcdbqbDownload.html" class="py-2 text-primary">下载中心</a> <a href="hkhcdbqbDownload.html" class="py-2 text-primary">下载中心</a>
<a href="https://wa.me/+6588792879?text=夺宝奇兵下载我需要帮助" target="_blank"
<a href="https://wa.me/85269518757?text=夺宝奇兵下载我需要帮助" target="_blank"
class="py-2 hover:text-primary transition-colors">帮助</a> class="py-2 hover:text-primary transition-colors">帮助</a>
<a href="https://wa.me/+6588792879?text=夺宝奇兵下载我需要帮助" target="_blank"
<a href="https://wa.me/85269518757?text=夺宝奇兵下载我需要帮助" target="_blank"
class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-purple-600 text-white text-center">联系我们</a> class="py-2 mt-2 rounded-full bg-gradient-to-r from-primary to-purple-600 text-white text-center">联系我们</a>
</div> </div>
</div> </div>

16
hkhcdbqbGuide.html

@ -236,7 +236,7 @@
<!-- 桌面导航 --> <!-- 桌面导航 -->
<nav class="hidden md:flex items-center space-x-6"> <nav class="hidden md:flex items-center space-x-6">
<a href="#video-guide" class="font-medium hover:text-primary transition-colors">视频指南</a> <a href="#video-guide" class="font-medium hover:text-primary transition-colors">视频指南</a>
<a href="#image-guide" class="font-medium hover:text-primary transition-colors">图片说明</a>
<!-- <a href="#image-guide" class="font-medium hover:text-primary transition-colors">图片说明</a> -->
<a href="./hkhcdbqbDownload.html" class="font-medium hover:text-primary transition-colors">软件下载</a> <a href="./hkhcdbqbDownload.html" class="font-medium hover:text-primary transition-colors">软件下载</a>
<a href="https://wa.me/85269518757?text=夺宝奇兵指南我需要帮助" target="_blank" <a href="https://wa.me/85269518757?text=夺宝奇兵指南我需要帮助" target="_blank"
class="px-5 py-2 rounded-full gradient-bg text-white font-medium hover:shadow-lg transition-all">联系支持</a> class="px-5 py-2 rounded-full gradient-bg text-white font-medium hover:shadow-lg transition-all">联系支持</a>
@ -252,8 +252,8 @@
<div id="mobileMenu" class="md:hidden hidden bg-white border-t animate-fade-in"> <div id="mobileMenu" class="md:hidden hidden bg-white border-t animate-fade-in">
<div class="container mx-auto px-4 py-3 flex flex-col space-y-4"> <div class="container mx-auto px-4 py-3 flex flex-col space-y-4">
<a href="#video-guide" class="font-medium py-2 hover:text-primary transition-colors">视频指南</a> <a href="#video-guide" class="font-medium py-2 hover:text-primary transition-colors">视频指南</a>
<a href="#image-guide" class="font-medium py-2 hover:text-primary transition-colors">图片说明</a>
<a href="hcdbqb-download.asp" class="font-medium py-2 hover:text-primary transition-colors">图片说明</a>
<!-- <a href="#image-guide" class="font-medium py-2 hover:text-primary transition-colors">图片说明</a> -->
<a href="./hkhcdbqbDownload.html" class="font-medium py-2 hover:text-primary transition-colors">软件下载</a>
<a href="https://wa.me/85269518757?text=夺宝奇兵指南我需要帮助" target="_blank" <a href="https://wa.me/85269518757?text=夺宝奇兵指南我需要帮助" target="_blank"
class="py-2 rounded-full gradient-bg text-white font-medium text-center hover:shadow-lg transition-all">联系支持</a> class="py-2 rounded-full gradient-bg text-white font-medium text-center hover:shadow-lg transition-all">联系支持</a>
</div> </div>
@ -267,10 +267,10 @@
<h1 class="text-[clamp(2rem,5vw,3rem)] font-bold leading-tight text-shadow mb-6"> <h1 class="text-[clamp(2rem,5vw,3rem)] font-bold leading-tight text-shadow mb-6">
操作指南中心 操作指南中心
</h1> </h1>
<p class="text-lg text-gray-600 mb-8 max-w-2xl mx-auto">
通过视频以及图文说明,教你如何使用夺宝奇兵软件以及如何观看直播和观看重播!
<p class="text-lg text-gray-600 max-w-2xl mx-auto">
通过视频教你如何使用夺宝奇兵软件以及如何观看直播和观看重播!
</p> </p>
<div class="flex flex-col sm:flex-row justify-center gap-4">
<!-- <div class="flex flex-col sm:flex-row justify-center gap-4">
<a href="#video-guide" <a href="#video-guide"
class="px-8 py-3 rounded-full gradient-bg text-white font-medium text-center hover:shadow-lg hover:shadow-primary/20 transition-all transform hover:-translate-y-0.5"> class="px-8 py-3 rounded-full gradient-bg text-white font-medium text-center hover:shadow-lg hover:shadow-primary/20 transition-all transform hover:-translate-y-0.5">
观看视频教程 观看视频教程
@ -279,13 +279,13 @@
class="px-8 py-3 rounded-full border-2 border-primary text-primary font-medium text-center hover:bg-primary/5 transition-all"> class="px-8 py-3 rounded-full border-2 border-primary text-primary font-medium text-center hover:bg-primary/5 transition-all">
查看图文说明 查看图文说明
</a> </a>
</div>
</div> -->
</div> </div>
</div> </div>
</section> </section>
<!-- 视频指南区域 --> <!-- 视频指南区域 -->
<section id="video-guide" class="py-20 px-4 bg-white">
<section id="video-guide" class="px-4 bg-white">
<div class="container mx-auto max-w-5xl"> <div class="container mx-auto max-w-5xl">
<div class="text-center mb-12 animate-fade-in"> <div class="text-center mb-12 animate-fade-in">
<h2 class="text-[clamp(1.5rem,3vw,2.5rem)] font-bold mb-4">HomilyLink指南视频</h2> <h2 class="text-[clamp(1.5rem,3vw,2.5rem)] font-bold mb-4">HomilyLink指南视频</h2>

200
hkhcdbqbManagement.html

@ -43,6 +43,7 @@
color: #0E4322; color: #0E4322;
box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3); box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3);
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -64,7 +65,6 @@
overflow-x: auto; overflow-x: auto;
} }
/* 表格容器实现横向滚动(移动端友好),同时保证单元格内容溢出省略 */
.table-wrapper { .table-wrapper {
overflow-x: auto; overflow-x: auto;
border-radius: 14px; border-radius: 14px;
@ -84,11 +84,8 @@
border-bottom: 1px solid #e9edf2; border-bottom: 1px solid #e9edf2;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
max-width: 0;
/* 辅助溢出省略 */
} }
/* 表头固定宽度 + 允许文字折行但优先省略 */
th { th {
background: #f8fafc; background: #f8fafc;
font-weight: 600; font-weight: 600;
@ -97,85 +94,69 @@
white-space: nowrap; white-space: nowrap;
} }
/* 单元格内容超出宽度后隐藏文字,鼠标悬浮显示完整内容 */
td { td {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 180px; max-width: 180px;
transition: background 0.1s;
} }
/* 针对特定列单独控制最大宽度,确保不超出表头宽度 */
td:nth-child(1) { td:nth-child(1) {
max-width: 55px; max-width: 55px;
} }
/* 姓名 */
td:nth-child(2) { td:nth-child(2) {
max-width: 100px; max-width: 100px;
} }
/* WhatsApp按钮列 */
td:nth-child(3) { td:nth-child(3) {
max-width: 100px; max-width: 100px;
overflow: visible; overflow: visible;
white-space: normal; white-space: normal;
} }
/* 国家代码 */
td:nth-child(4) { td:nth-child(4) {
max-width: 90px; max-width: 90px;
} }
/* 电话号码 */
td:nth-child(5) { td:nth-child(5) {
max-width: 120px; max-width: 120px;
} }
/* 微信ID */
td:nth-child(6) { td:nth-child(6) {
max-width: 120px; max-width: 120px;
} }
/* 邮箱 */
td:nth-child(7) { td:nth-child(7) {
max-width: 150px; max-width: 150px;
} }
/* 反馈内容 */
td:nth-child(8) { td:nth-child(8) {
max-width: 120px; max-width: 120px;
} }
/* 反馈类型 */
td:nth-child(9) { td:nth-child(9) {
max-width: 100px; max-width: 100px;
} }
/* 添加时间 */
td:nth-child(10) { td:nth-child(10) {
max-width: 160px; max-width: 160px;
} }
/* 是否联系 */
td:nth-child(11) { td:nth-child(11) {
max-width: 100px; max-width: 100px;
white-space: normal; white-space: normal;
} }
/* 备注 */
td:nth-child(12) { td:nth-child(12) {
max-width: 160px; max-width: 160px;
} }
/* 操作 */
td:nth-child(13) { td:nth-child(13) {
max-width: 100px; max-width: 100px;
white-space: normal; white-space: normal;
} }
/* 悬浮显示完整内容(自定义title特性,但使用全局title亦可,增强体验)*/
td[title] { td[title] {
cursor: help; cursor: help;
} }
@ -293,7 +274,6 @@
} }
} }
/* 备注模态框 */
#noteModal { #noteModal {
display: none; display: none;
position: fixed; position: fixed;
@ -348,7 +328,6 @@
transform: translateX(-50%) translateY(0); transform: translateX(-50%) translateY(0);
} }
/* 登录遮罩 */
#loginCheckModal { #loginCheckModal {
display: none; display: none;
position: fixed; position: fixed;
@ -372,6 +351,13 @@
margin: 0 0 12px; margin: 0 0 12px;
color: #e11d48; color: #e11d48;
} }
.dialog-buttons {
margin-top: 20px;
display: flex;
justify-content: flex-end;
gap: 12px;
}
</style> </style>
</head> </head>
@ -384,11 +370,13 @@
<button class="btn primary" id="goToLoginBtn">前往登录页面</button> <button class="btn primary" id="goToLoginBtn">前往登录页面</button>
</div> </div>
</div> </div>
<div class="tab-container"> <div class="tab-container">
<div class="tabs"> <div class="tabs">
<button class="tab active" data-tab="win-us-stock">Adam说港股导流</button>
<button class="tab active" data-tab="hk-stock">Adam说港股导流</button>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<div class="table-wrapper"> <div class="table-wrapper">
<table aria-describedby="成员反馈列表"> <table aria-describedby="成员反馈列表">
@ -433,18 +421,19 @@
<div class="dialog"> <div class="dialog">
<h3 style="margin-top: 0;">✏️ 编辑备注</h3> <h3 style="margin-top: 0;">✏️ 编辑备注</h3>
<textarea id="noteTextarea" rows="4" placeholder="输入备注信息..."></textarea> <textarea id="noteTextarea" rows="4" placeholder="输入备注信息..."></textarea>
<div style="margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px;">
<div class="dialog-buttons">
<button class="btn" id="noteCancelBtn">取消</button> <button class="btn" id="noteCancelBtn">取消</button>
<button class="btn primary" id="noteSaveBtn">保存</button> <button class="btn primary" id="noteSaveBtn">保存</button>
</div> </div>
</div> </div>
</div> </div>
<div id="toast" class="toast"></div> <div id="toast" class="toast"></div>
<script type="module"> <script type="module">
import { getMemberListApi, updateMemberStateApi, editMemberNoteApi } from './src/api/hkmember.js' import { getMemberListApi, updateMemberStateApi, editMemberNoteApi } from './src/api/hkmember.js'
// ---------- 登录验证 ----------
// ========== 登录验证 ==========
function checkLoginStatus() { function checkLoginStatus() {
const isLoggedIn = localStorage.getItem('isLoggedIn') === 'true'; const isLoggedIn = localStorage.getItem('isLoggedIn') === 'true';
const loginTime = parseInt(localStorage.getItem('loginTime'), 10); const loginTime = parseInt(localStorage.getItem('loginTime'), 10);
@ -457,15 +446,16 @@
const modal = document.getElementById('loginCheckModal'); const modal = document.getElementById('loginCheckModal');
if (modal) modal.style.display = 'flex'; if (modal) modal.style.display = 'flex';
} }
function hideLoginCheckModal() { function hideLoginCheckModal() {
const modal = document.getElementById('loginCheckModal'); const modal = document.getElementById('loginCheckModal');
if (modal) modal.style.display = 'none'; if (modal) modal.style.display = 'none';
} }
function redirectToLogin() { function redirectToLogin() {
window.location.href = 'hkLogiManagement.html'; window.location.href = 'hkLogiManagement.html';
} }
// 全局前置守卫:如果未登录则显示弹窗,返回false
function requireAuth() { function requireAuth() {
if (!checkLoginStatus()) { if (!checkLoginStatus()) {
showLoginCheckModal(); showLoginCheckModal();
@ -476,9 +466,8 @@
document.getElementById('goToLoginBtn')?.addEventListener('click', redirectToLogin); document.getElementById('goToLoginBtn')?.addEventListener('click', redirectToLogin);
// ---------- 映射反馈类型文字 ----------
// ========== 映射反馈类型文字 ==========
function formatFeedbackType(typeValue) { function formatFeedbackType(typeValue) {
// 后端返回可能是字符串或数字 "1", 2, 3, 4
const val = parseInt(typeValue, 10); const val = parseInt(typeValue, 10);
switch (val) { switch (val) {
case 1: return '功能建议'; case 1: return '功能建议';
@ -489,6 +478,7 @@
} }
} }
// ========== 状态管理 ==========
let state = { let state = {
pageSize: 20, pageSize: 20,
currentPage: 1, currentPage: 1,
@ -519,7 +509,7 @@
}, 1800); }, 1800);
} }
// 获取数据
// ========== 获取数据 ==========
async function fetchPage(page, pageSize) { async function fetchPage(page, pageSize) {
if (!requireAuth()) return { items: [], total: 0 }; if (!requireAuth()) return { items: [], total: 0 };
@ -544,33 +534,25 @@
} }
} }
// 辅助函数:给td增加title悬浮完整内容(自动处理每个单元格)
function applyTitleToCells() {
const rows = tableBody.querySelectorAll('tr');
rows.forEach(row => {
const cells = row.querySelectorAll('td');
cells.forEach(cell => {
// 跳过按钮列(第三列WhatsApp按钮,第11列状态按钮,第13列操作按钮)避免title干扰
const isButtonCell = cell.querySelector('button') &&
(cell.previousElementSibling?.innerText?.includes('WhatsApp') ||
cell.querySelector('.status-btn') ||
cell.querySelector('[data-action="editNote"]'));
if (!isButtonCell && cell.innerText && cell.innerText.trim() !== '') {
const rawText = cell.innerText;
if (!cell.hasAttribute('data-has-title')) {
cell.setAttribute('title', rawText);
cell.setAttribute('data-has-title', 'true');
} else if (cell.getAttribute('title') !== rawText) {
cell.setAttribute('title', rawText);
}
} else if (!isButtonCell && cell.innerText === '') {
cell.removeAttribute('title');
}
});
});
// ========== WhatsApp 跳转(与美股页面完全一致的逻辑) ==========
function handleWhatsApp(id) {
const item = state.items.find((it) => String(it.id) === String(id));
if (!item) return;
// 移除国家代码中的+号
const cleanCode = (item.code || '').replace(/\+/g, '');
const whatsappPhone = cleanCode + (item.telephone || '');
if (!whatsappPhone) {
showToast("电话号码无效,无法跳转", true);
return;
}
const whatsappUrl = `https://api.whatsapp.com/send?phone=${encodeURIComponent(whatsappPhone)}&text=${encodeURIComponent('hello欢迎来到Adam说港股')}`;
window.open(whatsappUrl, '_blank');
} }
// 渲染表格(带溢出省略 + 悬浮显示完整内容)
// ========== 渲染表格 ==========
function renderTable() { function renderTable() {
const startIndex = (state.currentPage - 1) * state.pageSize; const startIndex = (state.currentPage - 1) * state.pageSize;
const items = state.items || []; const items = state.items || [];
@ -579,14 +561,8 @@
const serial = startIndex + idx + 1; const serial = startIndex + idx + 1;
const statusClass = item.isRelated ? "status-1" : "status-0"; const statusClass = item.isRelated ? "status-1" : "status-0";
const statusText = item.isRelated ? "已联系" : "未联系"; const statusText = item.isRelated ? "已联系" : "未联系";
// 反馈类型文字转换
const feedbackTypeText = formatFeedbackType(item.feedback_type); const feedbackTypeText = formatFeedbackType(item.feedback_type);
// 构建WhatsApp链接 (清理+号)
const cleanCode = (item.code || '').replace(/\+/g, '');
const whatsappPhone = cleanCode + (item.telephone || '');
const whatsappUrl = `https://wa.me/85269518757?phone=${encodeURIComponent(whatsappPhone)}&text=${encodeURIComponent('hello欢迎来到Adam说港股')}`;
// 安全转义 // 安全转义
const name = escapeHtml(item.name || ""); const name = escapeHtml(item.name || "");
const code = escapeHtml(item.code || ""); const code = escapeHtml(item.code || "");
@ -597,7 +573,6 @@
const createdAt = escapeHtml(item.createdAt || ""); const createdAt = escapeHtml(item.createdAt || "");
const note = escapeHtml(item.note || ""); const note = escapeHtml(item.note || "");
// 注意:表格结构保持13列,反馈类型用转换后的文字
return ` return `
<tr> <tr>
<td title="${serial}">${serial}</td> <td title="${serial}">${serial}</td>
@ -623,82 +598,22 @@
`; `;
}).join(""); }).join("");
// 为所有普通单元格添加完整文本悬浮(动态渲染后)
const rows = tableBody.querySelectorAll('tr');
rows.forEach(row => {
const cells = row.querySelectorAll('td');
cells.forEach(cell => {
// 跳过按钮占位列(第三列、操作列以及状态列,这些列已经有点击元素,不干扰title)
const hasImportantBtn = cell.querySelector('[data-action="whatsapp"]') ||
cell.querySelector('[data-action="toggle"]') ||
cell.querySelector('[data-action="editNote"]');
if (!hasImportantBtn) {
const txt = cell.innerText.trim();
if (txt) cell.setAttribute('title', txt);
else cell.removeAttribute('title');
} else if (cell.querySelector('[data-action="toggle"]')) {
// 状态按钮列保留其自身文字悬浮展示状态文字
const statusBtn = cell.querySelector('.status-btn');
if (statusBtn) cell.setAttribute('title', statusBtn.innerText);
} else if (cell.querySelector('[data-action="editNote"]')) {
// 操作列一般不需要悬浮,但为了统一,展示当前按钮文字
const btnText = cell.innerText.trim();
if (btnText) cell.setAttribute('title', btnText);
}
});
});
totalCountEl.textContent = state.total; totalCountEl.textContent = state.total;
} }
// 事件监听(委托)
tableBody.addEventListener("click", async (e) => {
if (!requireAuth()) return;
const whatsappBtn = e.target.closest('[data-action="whatsapp"]');
if (whatsappBtn) {
const id = whatsappBtn.getAttribute("data-id");
handleWhatsApp(id);
return;
}
const toggler = e.target.closest('[data-action="toggle"]');
if (toggler) {
const id = toggler.getAttribute("data-id");
await handleToggle(id, toggler);
return;
}
const editBtn = e.target.closest('[data-action="editNote"]');
if (editBtn) {
const id = editBtn.getAttribute("data-id");
openNoteModal(id);
return;
}
});
function handleWhatsApp(id) {
const item = state.items.find((it) => String(it.id) === String(id));
if (!item) return;
const cleanCode = (item.code || '').replace(/\+/g, '');
const whatsappPhone = cleanCode + (item.telephone || '');
if (!whatsappPhone) {
showToast("电话号码无效", true);
return;
}
const whatsappUrl = `https://wa.me/85269518757?phone=${encodeURIComponent(whatsappPhone)}&text=${encodeURIComponent('hello欢迎来到Adam说港股')}`;
window.open(whatsappUrl, '_blank');
}
// ========== 切换联系状态 ==========
async function handleToggle(id, btnEl) { async function handleToggle(id, btnEl) {
const item = state.items.find((it) => String(it.id) === String(id)); const item = state.items.find((it) => String(it.id) === String(id));
if (!item) return; if (!item) return;
const prev = item.isRelated; const prev = item.isRelated;
const newVal = prev ? 0 : 1; const newVal = prev ? 0 : 1;
// 乐观更新UI // 乐观更新UI
item.isRelated = newVal; item.isRelated = newVal;
btnEl.textContent = newVal ? "已联系" : "未联系"; btnEl.textContent = newVal ? "已联系" : "未联系";
btnEl.classList.toggle("status-1", !!newVal); btnEl.classList.toggle("status-1", !!newVal);
btnEl.classList.toggle("status-0", !newVal); btnEl.classList.toggle("status-0", !newVal);
try { try {
const res = await updateMemberStateApi({ id: item.id, state: newVal }); const res = await updateMemberStateApi({ id: item.id, state: newVal });
if (res && typeof res.code !== "undefined" && res.code !== 200) { if (res && typeof res.code !== "undefined" && res.code !== 200) {
@ -715,6 +630,7 @@
} }
} }
// ========== 备注编辑 ==========
function openNoteModal(id) { function openNoteModal(id) {
if (!requireAuth()) return; if (!requireAuth()) return;
const item = state.items.find((it) => String(it.id) === String(id)); const item = state.items.find((it) => String(it.id) === String(id));
@ -732,6 +648,7 @@
} }
noteCancelBtn.addEventListener("click", closeNoteModal); noteCancelBtn.addEventListener("click", closeNoteModal);
noteSaveBtn.addEventListener("click", async () => { noteSaveBtn.addEventListener("click", async () => {
if (!requireAuth()) return; if (!requireAuth()) return;
if (!editingRowId) return closeNoteModal(); if (!editingRowId) return closeNoteModal();
@ -741,8 +658,8 @@
const oldNote = item.note; const oldNote = item.note;
item.note = newNote; item.note = newNote;
// 乐观刷新当前行备注显示 (可局部更新但简单重新渲染)
renderTable(); renderTable();
try { try {
const res = await editMemberNoteApi({ id: item.id, note: newNote }); const res = await editMemberNoteApi({ id: item.id, note: newNote });
if (res && typeof res.code !== "undefined" && res.code !== 200) { if (res && typeof res.code !== "undefined" && res.code !== 200) {
@ -758,7 +675,33 @@
} }
}); });
// 分页渲染
// ========== 事件监听 ==========
tableBody.addEventListener("click", async (e) => {
if (!requireAuth()) return;
const whatsappBtn = e.target.closest('[data-action="whatsapp"]');
if (whatsappBtn) {
const id = whatsappBtn.getAttribute("data-id");
handleWhatsApp(id);
return;
}
const toggler = e.target.closest('[data-action="toggle"]');
if (toggler) {
const id = toggler.getAttribute("data-id");
await handleToggle(id, toggler);
return;
}
const editBtn = e.target.closest('[data-action="editNote"]');
if (editBtn) {
const id = editBtn.getAttribute("data-id");
openNoteModal(id);
return;
}
});
// ========== 分页 ==========
function renderPagination() { function renderPagination() {
const totalPages = Math.max(1, Math.ceil(state.total / state.pageSize)); const totalPages = Math.max(1, Math.ceil(state.total / state.pageSize));
let current = Math.min(Math.max(1, state.currentPage), totalPages); let current = Math.min(Math.max(1, state.currentPage), totalPages);
@ -833,19 +776,16 @@
if (m === '<') return '&lt;'; if (m === '<') return '&lt;';
if (m === '>') return '&gt;'; if (m === '>') return '&gt;';
return m; return m;
}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, function (c) {
return c;
}); });
} }
// 初始化:如果已登录则加载,否则展示登录遮罩
// ========== 初始化 ==========
if (checkLoginStatus()) { if (checkLoginStatus()) {
update(); update();
} else { } else {
showLoginCheckModal(); showLoginCheckModal();
} }
// 监听localStorage变化或者其他页面可能登录跳转后刷新(简单处理)
window.addEventListener('focus', () => { window.addEventListener('focus', () => {
if (checkLoginStatus() && document.getElementById('loginCheckModal')?.style.display === 'flex') { if (checkLoginStatus() && document.getElementById('loginCheckModal')?.style.display === 'flex') {
hideLoginCheckModal(); hideLoginCheckModal();

Loading…
Cancel
Save