Browse Source

港股完整功能初版

milestone-20260409-港股市场落地页
zhaoruhui 12 hours ago
parent
commit
21a9ce66d3
  1. 120
      hkRegister.html
  2. 300
      hkfeedback.html
  3. 206
      hkhcdbqb.html
  4. 2090
      hkhcdbqbDownload.html
  5. 800
      hkhcdbqbManagement.html
  6. 2
      src/api/hkmember.js
  7. 2
      src/api/member.js

120
hkRegister.html

@ -131,7 +131,8 @@
<div class="flex items-center space-x-2">
<div
class="w-10 h-10 rounded-lg bg-gradient-to-r from-primary to-secondary flex items-center justify-center">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png" style="width: 40px;height: 40px;">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png"
style="width: 40px;height: 40px;">
</div>
<span
class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary">夺宝奇兵免费体验</span>
@ -178,8 +179,7 @@
<!-- 注册表单 -->
<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">
<form id="registrationForm" action="./hkRegisterTip.html" method="post"
onsubmit="return validateForm()">
<form id="registrationForm" action="./hkRegisterTip.html" method="post">
<!-- 姓名 -->
<div class="form-group">
<label for="fullname" class="form-label">姓名 <span class="text-red-500">*</span></label>
@ -395,7 +395,8 @@
<div class="mb-6">
<div class="inline-flex items-center space-x-2">
<div class="w-10 h-10 rounded-lg gradient-bg flex items-center justify-center">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png" style="width: 40px;height: 40px;">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png"
style="width: 40px;height: 40px;">
</div>
<span class="font-bold">夺宝奇兵免费体验</span>
</div>
@ -405,7 +406,115 @@
</footer>
<!-- 交互脚本 -->
<script>
<script type="module">
// 从外部文件导入 registerMemberApi 函数
import { registerMemberApi } from './src/api/hkmember.js';
// 获取表单元素
const form = document.getElementById('registrationForm');
// 错误提示元素
const nameError = document.getElementById('nameError');
const phoneError = document.getElementById('phoneError');
const emailError = document.getElementById('emailError');
// 隐藏所有错误提示
function hideAllErrors() {
nameError.style.display = 'none';
phoneError.style.display = 'none';
emailError.style.display = 'none';
}
// 邮箱校验
function isValidEmail(email) {
const emailRegex = /^[^\s@]+@([^\s@]+\.)+[^\s@]+$/;
if (!emailRegex.test(email)) return false;
if (email.length > 254) return false;
if (email.includes('..')) return false;
return true;
}
// 手机号校验
function isValidPhone(phone) {
if (!phone || phone.trim() === '') return false;
const digitsOnly = phone.replace(/[^\d]/g, '');
if (digitsOnly.length < 4 || digitsOnly.length > 20) return false;
return true;
}
// 清理手机号
function cleanPhoneNumber(phone) {
if (!phone) return '';
let cleaned = phone.replace(/[^\d]/g, '');
cleaned = cleaned.replace(/^(00)/, '');
return cleaned;
}
// 表单提交处理 - 先调用API保存数据,然后继续表单提交跳转
form.addEventListener('submit', async function (e) {
// 先进行前端校验
hideAllErrors();
const name = document.getElementById('unameinfo').value.trim();
const countryCode = document.getElementById('countryinfo').value;
const phoneRaw = document.getElementById('umoblie').value.trim();
const wechat = document.getElementById('uwechat').value.trim();
const email = document.getElementById('uemail').value.trim();
let isValid = true;
if (!name) {
nameError.style.display = 'block';
isValid = false;
}
if (!phoneRaw || !isValidPhone(phoneRaw)) {
phoneError.style.display = 'block';
isValid = false;
}
if (!email || !isValidEmail(email)) {
emailError.style.display = 'block';
isValid = false;
}
if (!isValid) {
e.preventDefault();
return;
}
// 阻止默认提交,先调用API
e.preventDefault();
// 清理手机号
const cleanedPhone = cleanPhoneNumber(phoneRaw);
// 组装请求参数
const requestData = {
name: name,
code: countryCode,
tel: cleanedPhone,
email: email
};
if (wechat) {
requestData.weChat = wechat;
}
try {
const result = await registerMemberApi(requestData);
if (result.code === 200) {
// API调用成功,继续表单提交跳转
form.submit();
} else {
alert('注册失败:' + (result.msg || '未知错误,请稍后重试'));
}
} catch (error) {
console.error('提交注册出错:', error);
alert('网络错误或接口异常,请稍后重试');
}
});
// 移动端菜单切换
document.getElementById('mobileMenuBtn').addEventListener('click', function () {
const menu = document.getElementById('mobileMenu');
@ -425,7 +534,6 @@
});
});
</script>
<script type="text/javascript" src="210802/js/202510jg.js"></script>
</body>
</html>

300
hkfeedback.html

@ -151,7 +151,8 @@
<div class="flex items-center space-x-2">
<div
class="w-10 h-10 rounded-lg bg-gradient-to-r from-primary to-secondary flex items-center justify-center">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png" style="width: 40px;height: 40px;">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png"
style="width: 40px;height: 40px;">
</div>
<span
class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary">意见反馈</span>
@ -193,7 +194,7 @@
<!-- 反馈表单卡片 -->
<div class="bg-white rounded-xl p-6 md:p-8 mb-10 fade-in delay-100 card-shadow">
<form id="feedbackForm" action="feedbackinfo.asp" method="post" class="space-y-6">
<form id="feedbackForm" class="space-y-6">
<!-- 姓名输入 -->
<div class="form-group">
<label for="name" class="block text-gray-700 font-medium mb-2">姓名 <span
@ -363,18 +364,18 @@
</div>
</div>
<!-- 反馈内容 -->
<!-- 反馈内容(增加最大长度500字的实时限制与校验) -->
<div class="form-group">
<label for="feedbackContent" class="block text-gray-700 font-medium mb-2">反馈内容 <span
class="text-danger">*</span></label>
<div class="relative">
<textarea id="fcontent" name="fcontent" rows="5" required
<textarea id="fcontent" name="fcontent" rows="5" required maxlength="500"
class="w-full px-4 py-3 border border-gray-300 rounded-lg input-focus transition-colors resize-none"
placeholder="请详细描述您的意见或建议..."></textarea>
placeholder="请详细描述您的意见或建议...(最多500字)"></textarea>
<div class="absolute right-3 bottom-3 text-gray-400 text-sm">
<span id="charCount">0</span> / 500
</div>
<div class="error-message" id="feedbackContentError">请输入反馈内容(至少10个字符)</div>
<div class="error-message" id="feedbackContentError">请输入反馈内容(至少10个字符,最多500字</div>
</div>
</div>
@ -411,27 +412,29 @@
<i class="fa fa-check-circle text-success mt-1 mr-2 flex-shrink-0"></i>
<span>您的个人信息仅用于反馈跟进,我们将严格保密</span>
</li>
<li class="flex items-start">
<i class="fa fa-check-circle text-success mt-1 mr-2 flex-shrink-0"></i>
<span>反馈内容限500字以内,请合理控制字数</span>
</li>
</ul>
</div>
</div>
</main>
<!-- 通用弹窗 -->
<div id="statusModal" class="modal-backdrop" role="dialog" aria-modal="true">
<!-- 成功弹窗(与参考页面样式一致,点击确定按钮关闭) -->
<div id="successModal" class="modal-backdrop" role="dialog" aria-modal="true">
<div class="modal-content p-6">
<div class="text-center mb-6">
<div id="modalIconContainer"
class="w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
<i id="modalIcon" class="text-2xl"></i>
<div class="text-center">
<div class="w-16 h-16 rounded-full bg-success/20 flex items-center justify-center mx-auto mb-4">
<i class="fa fa-check-circle text-success text-3xl"></i>
</div>
<h3 id="modalTitle" class="text-xl font-bold"></h3>
<p id="modalMessage" class="text-gray-600 mt-3"></p>
<h3 class="text-xl font-bold mb-2">反馈成功!</h3>
<p class="text-gray-600 mb-6">感谢您的反馈,我们将持续优化更新</p>
<button id="closeModalBtn"
class="px-6 py-2 bg-gradient-to-r from-primary to-secondary text-white rounded-lg hover:shadow-lg transition-all">
确定
</button>
</div>
<button id="closeModal"
class="w-full py-3 rounded-lg bg-primary text-white font-medium hover:bg-primary/90 transition-colors">
确定
</button>
</div>
</div>
@ -450,7 +453,264 @@
<p class="text-gray-400 text-sm mb-4">Copyright 2026.Capitalmaster Pte Ltd All Rights Reserved.</p>
</div>
</footer>
<script type="text/javascript" src="250121/js/20251016.js"></script>
<script type="module">
// 从外部文件导入 registerMemberApi 函数
import { registerMemberApi } from './src/api/hkmember.js';
// DOM 元素
const form = document.getElementById('feedbackForm');
const submitBtn = document.getElementById('submitBtn');
const loadingIndicator = document.getElementById('loadingIndicator');
const successModal = document.getElementById('successModal');
const closeModalBtn = document.getElementById('closeModalBtn');
// 字符计数
const fcontent = document.getElementById('fcontent');
const charCount = document.getElementById('charCount');
// 错误提示元素
const nameError = document.getElementById('nameError');
const phoneError = document.getElementById('phoneError');
const emailError = document.getElementById('emailError');
const feedbackContentError = document.getElementById('feedbackContentError');
// 隐藏所有错误提示
function hideAllErrors() {
nameError.style.display = 'none';
phoneError.style.display = 'none';
emailError.style.display = 'none';
feedbackContentError.style.display = 'none';
}
// 显示错误提示
function showError(element, message) {
if (element) {
element.textContent = message;
element.style.display = 'block';
}
}
// 显示成功弹窗
function showSuccessModal() {
successModal.classList.add('active');
}
// 隐藏成功弹窗
function hideSuccessModal() {
successModal.classList.remove('active');
}
// 关闭弹窗事件
closeModalBtn.addEventListener('click', hideSuccessModal);
// 点击模态框背景关闭
successModal.addEventListener('click', function (e) {
if (e.target === successModal) {
hideSuccessModal();
}
});
// 邮箱校验
function isValidEmail(email) {
const emailRegex = /^[^\s@]+@([^\s@]+\.)+[^\s@]+$/;
if (!emailRegex.test(email)) return false;
if (email.length > 254) return false;
if (email.includes('..')) return false;
return true;
}
// 手机号校验
function isValidPhone(phone) {
if (!phone || phone.trim() === '') return false;
const digitsOnly = phone.replace(/[^\d]/g, '');
if (digitsOnly.length < 4 || digitsOnly.length > 20) return false;
return true;
}
// 清理手机号
function cleanPhoneNumber(phone) {
if (!phone) return '';
let cleaned = phone.replace(/[^\d]/g, '');
cleaned = cleaned.replace(/^(00)/, '');
return cleaned;
}
// 反馈类型映射
function getFeedbackTypeValue(typeText) {
const typeMap = {
'功能建议': '1',
'问题反馈': '2',
'体验优化': '3',
'其他建议': '4'
};
return typeMap[typeText] || '4';
}
// 字符计数 & 实时限制(确保不超过500字,与maxlength配合)
if (fcontent && charCount) {
// 初始化显示
charCount.textContent = fcontent.value.length;
fcontent.addEventListener('input', function () {
let len = this.value.length;
// 双重保险:如果超过500则截断
if (len > 500) {
this.value = this.value.substring(0, 500);
len = 500;
}
charCount.textContent = len;
// 实时移除字数超限的错误提示(如果之前是因为超限报错)
if (len <= 500 && feedbackContentError && feedbackContentError.style.display === 'block' && feedbackContentError.textContent.includes('最多500字')) {
// 但避免移除其他类型错误,通过文本内容判断
if (feedbackContentError.textContent.includes('最多500字')) {
feedbackContentError.style.display = 'none';
}
}
});
// 增加blur时再次校验,保证用户粘贴超长内容时提示
fcontent.addEventListener('blur', function () {
let len = this.value.length;
if (len > 500) {
this.value = this.value.substring(0, 500);
charCount.textContent = 500;
showError(feedbackContentError, '反馈内容不能超过500字');
}
});
}
// 移动端菜单切换
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
if (mobileMenuBtn) {
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');
}
});
}
// 表单提交处理 - 调用API保存数据,成功后显示弹窗,额外校验500字限制
form.addEventListener('submit', async function (e) {
e.preventDefault();
// 前端校验
hideAllErrors();
const name = document.getElementById('fusername').value.trim();
const countryCode = document.getElementById('countryinfo').value;
const phoneRaw = document.getElementById('umoblie').value.trim();
const wechat = document.getElementById('fwechat').value.trim();
const email = document.getElementById('femail').value.trim();
const feedbackTypeText = document.getElementById('ftype').value;
let feedbackContent = document.getElementById('fcontent').value.trim();
let isValid = true;
// 姓名校验
if (!name) {
showError(nameError, '请输入您的姓名');
isValid = false;
}
// 手机号校验
if (!phoneRaw || !isValidPhone(phoneRaw)) {
showError(phoneError, '请输入有效的手机号码');
isValid = false;
}
// 邮箱校验
if (!email || !isValidEmail(email)) {
showError(emailError, '请输入有效的邮箱地址');
isValid = false;
}
// 反馈内容校验: 不能为空且长度必须在10~500之间
if (!feedbackContent) {
showError(feedbackContentError, '请输入反馈内容(至少10个字符,最多500字)');
isValid = false;
} else {
// 重新获取实际内容(防止中间有特殊空格导致长度偏差)
const rawLen = feedbackContent.length;
if (rawLen < 10) {
showError(feedbackContentError, '反馈内容至少需要10个字符,请详细描述');
isValid = false;
} else if (rawLen > 500) {
// 如果因为某些意外情况(例如直接通过开发者工具修改)导致超长,再次截断并提示
feedbackContent = feedbackContent.substring(0, 500);
document.getElementById('fcontent').value = feedbackContent;
charCount.textContent = 500;
showError(feedbackContentError, '反馈内容不能超过500字,已自动截断');
isValid = false;
}
}
if (!isValid) {
return;
}
// 清理手机号
const cleanedPhone = cleanPhoneNumber(phoneRaw);
// 组装请求参数
const requestData = {
name: name,
code: countryCode,
tel: cleanedPhone,
email: email,
feedback_content: feedbackContent,
feedback_type: getFeedbackTypeValue(feedbackTypeText)
};
// 微信ID有值才传递
if (wechat) {
requestData.weChat = wechat;
}
// 显示加载状态
submitBtn.disabled = true;
loadingIndicator.classList.remove('hidden');
try {
const result = await registerMemberApi(requestData);
if (result.code === 200) {
// API调用成功,显示成功弹窗
showSuccessModal();
// 清空表单
form.reset();
// 重置字符计数
if (charCount) charCount.textContent = '0';
// 清空所有隐藏错误显示
hideAllErrors();
} else {
alert('提交失败:' + (result.msg || '请稍后重试'));
}
} catch (error) {
console.error('提交出错:', error);
alert('网络错误或接口异常,请稍后重试');
} finally {
submitBtn.disabled = false;
loadingIndicator.classList.add('hidden');
}
});
// 页面加载动画
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.fade-in').forEach(el => {
el.style.opacity = '1';
});
// 确保字符计数初始正确
if (fcontent && charCount) {
charCount.textContent = fcontent.value.length;
}
});
</script>
</body>
</html>

206
hkhcdbqb.html

@ -61,6 +61,7 @@
<style>
/* 加载字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
/* 全局动画定义 */
@keyframes fadeIn {
from {
@ -94,8 +95,6 @@
html {
scroll-behavior: smooth;
}
</style>
</head>
@ -105,7 +104,8 @@
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<a href="#" class="flex items-center space-x-2">
<div class="w-10 h-10 rounded-lg gradient-bg flex items-center justify-center">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png" style="width: 40px;height: 40px;">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png"
style="width: 40px;height: 40px;">
</div>
<span
class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent">夺宝奇兵</span>
@ -229,7 +229,8 @@
<!-- 宣传项 1 -->
<div class="bg-white rounded-3xl shadow-xl overflow-hidden mb-16 flex flex-col md:flex-row animate-fade-in">
<div class="md:w-1/2">
<img src="https://hc.homilychart.com/hc/250121/img/chaojiyunnaoimg.jpg" alt="智能数据分析平台" class="w-full h-full object-cover">
<img src="https://hc.homilychart.com/hc/250121/img/chaojiyunnaoimg.jpg" alt="智能数据分析平台"
class="w-full h-full object-cover">
</div>
<div class="md:w-1/2 p-8 md:p-12 flex flex-col justify-center">
<span
@ -263,7 +264,8 @@
<div
class="bg-white rounded-3xl shadow-xl overflow-hidden mb-16 flex flex-col md:flex-row-reverse animate-fade-in delay-100">
<div class="md:w-1/2">
<img src="https://hc.homilychart.com/hc/250121/img/aiyucedamoxing.jpg" alt="AI预测大模型" class="w-full h-full object-cover">
<img src="https://hc.homilychart.com/hc/250121/img/aiyucedamoxing.jpg" alt="AI预测大模型"
class="w-full h-full object-cover">
</div>
<div class="md:w-1/2 p-8 md:p-12 flex flex-col justify-center">
<span
@ -298,7 +300,8 @@
<div
class="bg-white rounded-3xl shadow-xl overflow-hidden mb-16 flex flex-col md:flex-row-reverse animate-fade-in delay-100">
<div class="md:w-1/2">
<img src="https://hc.homilychart.com/hc/250121/img/duobaolijianindex.jpg" alt="夺宝利剑" class="w-full h-full object-cover">
<img src="https://hc.homilychart.com/hc/250121/img/duobaolijianindex.jpg" alt="夺宝利剑"
class="w-full h-full object-cover">
</div>
<div class="md:w-1/2 p-8 md:p-12 flex flex-col justify-center">
<span
@ -498,8 +501,7 @@
</div>
<div>
<label for="umoblie" class="block text-sm font-medium text-gray-700 mb-1">电话号码</label>
<input type="tel" name="umoblie" id="umoblie" placeholder="纯手机号 ( 不含国家编号 )"
onkeyup="value=value.replace(/[^\d]/g,'').replace(/^0/g,'')"
<input type="tel" name="umoblie" id="umoblie" placeholder="请输入您的手机号码(可包含空格、连字符等)"
class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary focus:border-primary transition-all"
autocomplete="off" required>
</div>
@ -543,7 +545,8 @@
<div>
<div class="flex items-center space-x-2 mb-6">
<div class="w-10 h-10 rounded-lg gradient-bg flex items-center justify-center">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png" style="width: 40px;height: 40px;">
<img alt="夺宝奇兵" src="https://hc.homilychart.com/hc/250121/img/20230711171637.png"
style="width: 40px;height: 40px;">
</div>
<span class="text-xl font-bold">夺宝奇兵</span>
</div>
@ -602,7 +605,8 @@
<div>
<h4 class="text-lg font-semibold mb-6">支持</h4>
<ul class="space-y-3">
<li><a href="./hkhcdbqbGuide.html" class="text-gray-400 hover:text-white transition-colors">帮助中心</a>
<li><a href="./hkhcdbqbGuide.html"
class="text-gray-400 hover:text-white transition-colors">帮助中心</a>
</li>
<li><a href="https://api.whatsapp.com/send?phone=6588792879&text=我有问题" target="_blank"
class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
@ -637,8 +641,186 @@
</div>
</div>
<!-- JavaScript -->
<script type="text/javascript" src="250121/js/251015001.js"></script>
<!-- JavaScript - 从外部文件导入API,并包含表单提交与全球兼容的校验逻辑 -->
<script type="module">
// 从指定路径导入 registerMemberApi 函数
import { registerMemberApi } from './src/api/hkmember.js';
// 等待 DOM 加载完成
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('registrationForm');
const successModal = document.getElementById('successModal');
const closeModalBtn = document.getElementById('closeModal');
const submitBtn = form.querySelector('button[type="submit"]');
// 关闭模态框
function closeModal() {
successModal.classList.add('hidden');
}
closeModalBtn.addEventListener('click', closeModal);
successModal.addEventListener('click', function (e) {
if (e.target === successModal) closeModal();
});
// ============================================
// 全球兼容的校验函数
// ============================================
/**
* 邮箱校验 - 支持全球各种域名格式
* @param {string} email - 邮箱地址
* @returns {boolean} - 是否有效
*/
function isValidEmail(email) {
// 基础格式校验:必须包含@和点号,不能有空格
const emailRegex = /^[^\s@]+@([^\s@]+\.)+[^\s@]+$/;
if (!emailRegex.test(email)) return false;
// 长度限制(RFC 5322 标准:本地部分最长64,域名最长255,总长不超过254)
if (email.length > 254) return false;
// 检查是否包含连续的点号(如 user..name@example.com)
if (email.includes('..')) return false;
return true;
}
/**
* 手机号校验 - 全球宽松模式,不限制具体格式
* 只做最基本的检查:不能为空,清理后至少包含4位数字
* 注意:真正的号码有效性验证应在后端完成
* @param {string} phone - 原始手机号输入
* @returns {boolean} - 是否通过基础检查
*/
function isValidPhone(phone) {
if (!phone || phone.trim() === '') return false;
// 移除所有非数字字符(保留数字)
const digitsOnly = phone.replace(/[^\d]/g, '');
// 检查是否至少包含4位数字(全球最短手机号约为4-5位)
// 同时不超过20位数字(全球最长手机号约15位,20位留有足够余量)
if (digitsOnly.length < 4 || digitsOnly.length > 20) {
return false;
}
return true;
}
/**
* 清理手机号 - 提取纯数字部分,用于提交给后端
* 注意:国家代码已经通过下拉框单独传递,这里只提取用户输入的本地号码部分
* @param {string} phone - 原始手机号输入
* @returns {string} - 清理后的纯数字字符串
*/
function cleanPhoneNumber(phone) {
if (!phone) return '';
// 移除所有非数字字符,只保留数字
let cleaned = phone.replace(/[^\d]/g, '');
// 如果用户输入了国家代码(如开头有00或+86的情况),自动移除开头的00或+后面的数字
// 因为国家代码已经通过下拉框单独传递了
// 移除开头的00(国际长途前缀)
cleaned = cleaned.replace(/^(00)/, '');
return cleaned;
}
// 表单提交处理
form.addEventListener('submit', async function (e) {
e.preventDefault();
// 获取表单字段值
const name = document.getElementById('unameinfo').value.trim();
const countryCode = document.getElementById('countryinfo').value;
const phoneRaw = document.getElementById('umoblie').value.trim();
const wechat = document.getElementById('uwechat').value.trim();
const email = document.getElementById('uemail').value.trim();
const agreement = document.getElementById('agreement').checked;
// 姓名校验
if (!name) {
alert('请输入姓名');
document.getElementById('unameinfo').focus();
return;
}
if (name.length > 50) {
alert('姓名长度不能超过50个字符');
document.getElementById('unameinfo').focus();
return;
}
// 手机号校验(宽松模式,全球兼容)
if (!phoneRaw) {
alert('请输入电话号码');
document.getElementById('umoblie').focus();
return;
}
if (!isValidPhone(phoneRaw)) {
alert('请输入有效的电话号码(至少4位数字)\n\n示例:\n• 91234567\n• 09123456789\n• 123-4567\n• 1234 5678');
document.getElementById('umoblie').focus();
return;
}
// 邮箱校验
if (!email) {
alert('请输入电子邮箱');
document.getElementById('uemail').focus();
return;
}
if (!isValidEmail(email)) {
alert('请输入有效的电子邮箱地址\n\n示例:\n• username@example.com\n• name@company.co.uk');
document.getElementById('uemail').focus();
return;
}
// 协议确认
if (!agreement) {
alert('请同意接收相关产品和服务的资讯');
return;
}
// 清理手机号(提取纯数字)
const cleanedPhone = cleanPhoneNumber(phoneRaw);
// 组装接口参数(按照 registerMemberApi 要求的格式)
const requestData = {
name: name,
code: countryCode,
tel: cleanedPhone,
weChat: wechat || '',
email: email,
feedback_content: '',
feedback_type: '' // 4:其他建议
};
// 显示加载状态
const originalBtnText = submitBtn.innerHTML;
submitBtn.disabled = true;
submitBtn.innerHTML = '提交中...';
try {
// 调用导入的 registerMemberApi 函数
const result = await registerMemberApi(requestData);
// 根据返回结果判断是否成功
if (result.code === 200) {
successModal.classList.remove('hidden');
form.reset();
document.getElementById('agreement').checked = false;
} else {
alert('注册失败:' + (result.msg || '未知错误,请稍后重试'));
}
} catch (error) {
console.error('提交注册出错:', error);
alert('网络错误或接口异常,请稍后重试');
} finally {
submitBtn.disabled = false;
submitBtn.innerHTML = originalBtnText;
}
});
});
</script>
</body>
</html>

2090
hkhcdbqbDownload.html
File diff suppressed because it is too large
View File

800
hkhcdbqbManagement.html
File diff suppressed because it is too large
View File

2
src/api/hkmember.js

@ -7,7 +7,7 @@ const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
export function registerMemberApi(data) {
return request({
url: `${API_BASE_URL}/api/hk/member/insert`,
// url: `http://g8ec6e97.natappfree.cc/api/member/insert`,
// url: `http://192.168.1.103:8000/api/hk/member/insert`,
method: "post",
data: data,
});

2
src/api/member.js

@ -6,7 +6,7 @@ const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
export function registerMemberApi(data) {
return request({
url: `${API_BASE_URL}/api/member/insert`,
url: `${API_BASE_URL}/api/hk/member/insert`,
// url: `http://g8ec6e97.natappfree.cc/api/member/insert`,
method: "post",
data: data,

Loading…
Cancel
Save