feat: 商户端登录/注册模块 - HTML原型+前端+后端

基于飞书 PRD《【登陆/注册】》实现:
- prototype/: 可交互 HTML 原型(内置 Mock,含三语切换)
- frontend/: 正式前端(原生 HTML/CSS/JS,调用后端 API)
- backend/: Node.js 零依赖后端(验证码冷却/静默注册/IP冻结)
- design/: 飞书白板设计图导出
This commit is contained in:
nancy
2026-10-17 23:22:10 +08:00
parent 1c5536210c
commit 22ce81387e
10 changed files with 1312 additions and 0 deletions
+129
View File
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>广汇通 GPX - 商户登录/注册</title>
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<div class="topbar">
<div class="lang-switcher" id="langSwitcher">
<div class="lang-current">
<span class="flag" id="langFlag">🇨🇳</span>
<span id="langName">中文(简体)</span>
<span class="arrow">▼</span>
</div>
<div class="lang-menu" id="langMenu"></div>
</div>
</div>
<div class="main">
<div class="login-panel">
<div class="qr-area" id="qrArea">
<svg class="qr-logo" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<path d="M8 8h32v32H8zm8 8v16h16V16z" fill="#b9bcc2"/>
<rect x="60" y="8" width="32" height="32" fill="none" stroke="#b9bcc2" stroke-width="8"/>
<rect x="8" y="60" width="32" height="32" fill="none" stroke="#b9bcc2" stroke-width="8"/>
<path d="M60 60h32v32H60zm8 8v16h16V68z" fill="#b9bcc2"/>
<rect x="44" y="12" width="8" height="26" fill="#b9bcc2"/>
<rect x="12" y="44" width="26" height="8" fill="#b9bcc2"/>
<rect x="46" y="46" width="8" height="8" fill="#b9bcc2"/>
<rect x="62" y="44" width="26" height="4" fill="#b9bcc2"/>
</svg>
<div class="qr-tip"><span data-i18n="qrOpen">打开</span> <span class="wx">💬微信</span> <span data-i18n="qrScan">扫码登录</span></div>
<div class="qr-badge">
<div class="phone-ico">📱</div>
<p><b data-i18n="wxTitle">微信扫码登录</b><br><span data-i18n="wxReserved">MVP 首期暂不支持,敬请期待</span></p>
</div>
</div>
<div class="form-area">
<div class="tabs">
<div class="tab active" data-view="phone" data-i18n="tabPhone">手机号</div>
<div class="tab" data-view="email" data-i18n="tabEmail">邮箱</div>
</div>
<div class="view active" id="view-phone">
<div class="field">
<span class="prefix">+86 <small>▲</small></span>
<input type="tel" id="phoneInput" data-i18n-ph="phPhone" placeholder="请输入手机号" maxlength="11">
</div>
<div class="field">
<input type="text" id="phoneCodeInput" data-i18n-ph="phCode" placeholder="输入验证码" maxlength="6">
<button class="suffix-btn" id="phoneSendBtn" data-i18n="getCode">获取验证码</button>
</div>
<div class="form-error" id="phoneError"></div>
<button class="btn-login" id="phoneLoginBtn" data-i18n="login">登录</button>
<div class="center-links">
<button class="link-btn" data-goto="account" data-i18n="toAccount">账号密码登录</button>
</div>
</div>
<div class="view" id="view-email">
<div class="field">
<input type="email" id="emailInput" data-i18n-ph="phEmail" placeholder="邮箱">
</div>
<div class="field">
<input type="text" id="emailCodeInput" data-i18n-ph="phCode" placeholder="输入验证码" maxlength="6">
<button class="suffix-btn" id="emailSendBtn" data-i18n="getCode">获取验证码</button>
</div>
<div class="form-error" id="emailError"></div>
<button class="btn-login" id="emailLoginBtn" data-i18n="login">登录</button>
<div class="center-links">
<button class="link-btn" data-goto="account" data-i18n="toAccount">账号密码登录</button>
</div>
</div>
<div class="view" id="view-account">
<div class="field">
<input type="text" id="accInput" data-i18n-ph="phAccount" placeholder="请输入账号" autocomplete="username">
</div>
<div class="field">
<input type="password" id="pwdInput" data-i18n-ph="phPwd" placeholder="输入密码" autocomplete="current-password">
</div>
<div class="row-links"><button class="link-btn" id="forgotBtn" data-i18n="forgotPwd">忘记密码</button></div>
<div class="form-error" id="accError"></div>
<button class="btn-login" id="accLoginBtn" data-i18n="login">登录</button>
<div class="center-links">
<button class="link-btn" data-goto="phone" data-i18n="toVerify">验证码登录</button>
</div>
</div>
<label class="agreement" id="agreementBox">
<input type="checkbox" id="agreeCheck">
<span>
<span data-i18n="agreeLine1">未注册手机号、邮箱验证后自动登录</span><br>
<span data-i18n="agreeLine2a">注册即代表我已阅读并同意</span>
<a href="javascript:void(0)" data-i18n="agreeTos">《服务条款》</a>
<a href="javascript:void(0)" data-i18n="agreePrivacy">《隐私政策》</a>
<span data-i18n="agreeAnd">和</span>
<a href="javascript:void(0)" data-i18n="agreePay">《支付服务协议》</a>
</span>
</label>
</div>
</div>
</div>
<div class="footer">
<div>© 2026 <a href="javascript:void(0)">www.gx.gxgcloud.cn</a> <span data-i18n="rights">All Rights Reserved.</span></div>
<div>
<a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备15026742号-4</a> &nbsp;
<a href="https://beian.mps.gov.cn/" target="_blank">粤公网安备 44011302000032号</a>
</div>
</div>
<div id="toast"></div>
<div id="successMask">
<div class="ok-ico">✓</div>
<h2 data-i18n="loginOk">登录成功</h2>
<p id="successDetail"></p>
</div>
<script src="js/i18n.js"></script>
<script src="js/api.js"></script>
<script src="js/login.js"></script>
</body>
</html>