feat: 优化营养模块净菜联动与小程序登录
This commit is contained in:
@@ -112,7 +112,7 @@
|
||||
<a class="tab-item" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item active" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# 营养管理小程序 CHANGELOG
|
||||
|
||||
## [1.2.1] - 2026-06-17
|
||||
|
||||
### 变更
|
||||
|
||||
**我模块**
|
||||
- `me-login.html` — 新增独立微信授权登录页,按“微信登录 → 手机号授权 → 进入个人中心”的主流小程序流程承接“我”入口
|
||||
- `me-home.html` — 恢复个人中心原有样式与内容,仅保留登录成功后的目标页面职责
|
||||
- `ask-home.html`、`eat-home.html`、`eat-nutrition.html`、`eat-recipe.html`、`eat-recipe-today.html`、`make-home.html`、`make-popular.html`、`make-ranking.html`、`index.html` — 将“我”入口与导航页条目切换为先进入 `me-login.html`
|
||||
|
||||
## [1.0.0] - 2026-05-13
|
||||
|
||||
### 新增
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
<a class="tab-item active" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<!-- Home Indicator -->
|
||||
<div class="home-indicator"></div>
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
<a class="tab-item active" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
<a class="tab-item active" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<a class="tab-item active" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<a class="tab-item" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item active" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
<a class="tab-item" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item active" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
<a class="tab-item" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item active" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
@@ -138,9 +138,9 @@
|
||||
<a class="tab-item" href="eat-home.html"><span class="tab-icon">🍽️</span>吃</a>
|
||||
<a class="tab-item" href="ask-home.html"><span class="tab-icon">💬</span>问</a>
|
||||
<a class="tab-item" href="make-home.html"><span class="tab-icon">🍳</span>做</a>
|
||||
<a class="tab-item active" href="me-home.html"><span class="tab-icon">👤</span>我</a>
|
||||
<a class="tab-item active" href="me-login.html"><span class="tab-icon">👤</span>我</a>
|
||||
</div>
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,651 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录 | 智能营养小程序</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
|
||||
:root {
|
||||
--primary: #07c160;
|
||||
--primary-dark: #129451;
|
||||
--text-primary: #1f2937;
|
||||
--text-secondary: #6b7280;
|
||||
--text-placeholder: #9ca3af;
|
||||
--border: #e5e7eb;
|
||||
--background: #f6f8fb;
|
||||
--white: #ffffff;
|
||||
--danger: #ef4444;
|
||||
--shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
padding: 24px 0 40px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
background: #2a2a2a;
|
||||
color: var(--text-primary);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
.phone-shell {
|
||||
position: relative;
|
||||
width: 375px;
|
||||
height: 812px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--white);
|
||||
border-radius: 44px;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 0 0 2px #e0e0e0;
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
height: 44px;
|
||||
padding: 0 24px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #111827;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
.status-bar__time {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-bar__icons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.status-bar__signal,
|
||||
.status-bar__wifi,
|
||||
.status-bar__battery {
|
||||
display: block;
|
||||
background: #111827;
|
||||
}
|
||||
|
||||
.status-bar__signal {
|
||||
width: 18px;
|
||||
height: 10px;
|
||||
clip-path: polygon(0 100%, 18% 64%, 18% 100%, 36% 42%, 36% 100%, 54% 24%, 54% 100%, 72% 8%, 72% 100%, 100% 0, 100% 100%);
|
||||
}
|
||||
|
||||
.status-bar__wifi {
|
||||
width: 16px;
|
||||
height: 12px;
|
||||
border-radius: 12px 12px 2px 2px;
|
||||
clip-path: polygon(0 28%, 50% 0, 100% 28%, 88% 46%, 50% 26%, 12% 46%);
|
||||
}
|
||||
|
||||
.status-bar__battery {
|
||||
position: relative;
|
||||
width: 22px;
|
||||
height: 10px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.status-bar__battery::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: -3px;
|
||||
top: 3px;
|
||||
width: 2px;
|
||||
height: 4px;
|
||||
border-radius: 0 2px 2px 0;
|
||||
background: #111827;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
height: 44px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--background);
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(circle at 16% 8%, rgba(7, 193, 96, 0.16), transparent 30%),
|
||||
linear-gradient(180deg, #f6fbf8 0%, #f7f8fb 54%, #ffffff 100%);
|
||||
}
|
||||
|
||||
.login-page {
|
||||
min-height: 100%;
|
||||
padding: 58px 24px 22px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.login-page__brand {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-page__logo {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin: 0 auto 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(135deg, #07c160 0%, #12b981 54%, #1f9d64 100%);
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
box-shadow: 0 14px 28px rgba(7, 193, 96, 0.24);
|
||||
}
|
||||
|
||||
.login-page__title {
|
||||
font-size: 24px;
|
||||
line-height: 1.3;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.login-page__subtitle {
|
||||
margin-top: 8px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.login-page__main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px 0 18px;
|
||||
}
|
||||
|
||||
.login-choice,
|
||||
.account-login {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-choice__stack {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
border: 0;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
transition: transform 0.18s ease, box-shadow 0.18s ease;
|
||||
}
|
||||
|
||||
.login-btn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.login-btn--primary {
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
||||
box-shadow: 0 12px 24px rgba(7, 193, 96, 0.24);
|
||||
}
|
||||
|
||||
.login-btn--secondary {
|
||||
color: var(--text-primary);
|
||||
background: #fff;
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.login-btn__icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.login-btn--primary .login-btn__icon {
|
||||
color: var(--primary);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.login-btn--secondary .login-btn__icon {
|
||||
color: #fff;
|
||||
background: #111827;
|
||||
}
|
||||
|
||||
.account-login {
|
||||
display: none;
|
||||
animation: fadeIn 0.2s ease;
|
||||
}
|
||||
|
||||
.account-login.is-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.account-login__title {
|
||||
margin-bottom: 18px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.account-login__form {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.form-field__label {
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.form-field__input {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
outline: none;
|
||||
color: var(--text-primary);
|
||||
background: #fff;
|
||||
font-size: 15px;
|
||||
box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
|
||||
.form-field__input::placeholder {
|
||||
color: var(--text-placeholder);
|
||||
}
|
||||
|
||||
.form-field__input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
|
||||
}
|
||||
|
||||
.account-login__actions {
|
||||
margin-top: 6px;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.text-btn {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.agreement {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 9px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.agreement__checkbox {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-top: 2px;
|
||||
flex-shrink: 0;
|
||||
accent-color: var(--primary);
|
||||
}
|
||||
|
||||
.agreement__link {
|
||||
color: var(--primary-dark);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.auth-toast {
|
||||
position: absolute;
|
||||
top: 58px;
|
||||
left: 50%;
|
||||
z-index: 5;
|
||||
max-width: 300px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 999px;
|
||||
color: #fff;
|
||||
background: rgba(17, 24, 39, 0.88);
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transform: translateX(-50%) translateY(-10px);
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.auth-toast.is-visible {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.phone-auth {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 4;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 34px;
|
||||
background: rgba(0, 0, 0, 0.48);
|
||||
}
|
||||
|
||||
.phone-auth.is-visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.phone-auth__dialog {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
box-shadow: var(--shadow-md);
|
||||
animation: popIn 0.2s ease;
|
||||
}
|
||||
|
||||
.phone-auth__title {
|
||||
height: 45px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.phone-auth__body {
|
||||
padding: 13px 18px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.phone-auth__app-icon {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
margin: 0 auto 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #0f766e, #16a34a);
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.phone-auth__app-name {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.phone-auth__divider {
|
||||
margin: 13px 0 11px;
|
||||
height: 1px;
|
||||
background: #e5e7eb;
|
||||
}
|
||||
|
||||
.phone-auth__desc {
|
||||
color: #666666;
|
||||
font-size: 13px;
|
||||
line-height: 1.7;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.phone-auth__number {
|
||||
margin-top: 4px;
|
||||
color: #1f2937;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.phone-auth__actions {
|
||||
height: 48px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
border-top: 1px solid #dcdcdc;
|
||||
}
|
||||
|
||||
.phone-auth__btn {
|
||||
border: 0;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.phone-auth__btn + .phone-auth__btn {
|
||||
border-left: 1px solid #dcdcdc;
|
||||
}
|
||||
|
||||
.phone-auth__btn--cancel {
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.phone-auth__btn--confirm {
|
||||
color: var(--primary-dark);
|
||||
}
|
||||
|
||||
.home-indicator {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 8px;
|
||||
width: 134px;
|
||||
height: 5px;
|
||||
border-radius: 999px;
|
||||
background: rgba(17, 24, 39, 0.24);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.is-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(8px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes popIn {
|
||||
from { opacity: 0; transform: scale(0.96); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="phone-shell">
|
||||
<div class="status-bar">
|
||||
<span class="status-bar__time">09:41</span>
|
||||
<div class="status-bar__icons">
|
||||
<span class="status-bar__signal"></span>
|
||||
<span class="status-bar__wifi"></span>
|
||||
<span class="status-bar__battery"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-bar">登录</div>
|
||||
|
||||
<main class="page-content">
|
||||
<div class="auth-toast" id="authToast">请先勾选协议后再继续</div>
|
||||
|
||||
<section class="login-page">
|
||||
<div class="login-page__brand">
|
||||
<div class="login-page__logo">营</div>
|
||||
<h1 class="login-page__title">智能营养服务</h1>
|
||||
<p class="login-page__subtitle">登录后查看个人营养档案、就餐记录与健康建议</p>
|
||||
</div>
|
||||
|
||||
<div class="login-page__main">
|
||||
<div class="login-choice" id="loginChoice">
|
||||
<div class="login-choice__stack">
|
||||
<!-- [交互] 点击打开手机号授权弹窗,确认后跳转至个人中心 -->
|
||||
<button class="login-btn login-btn--primary" id="phoneQuickBtn" type="button">
|
||||
<span class="login-btn__icon">号</span>
|
||||
<span>手机号快捷登录</span>
|
||||
</button>
|
||||
<!-- [交互] 点击切换为账号密码登录表单 -->
|
||||
<button class="login-btn login-btn--secondary" id="accountModeBtn" type="button">
|
||||
<span class="login-btn__icon">密</span>
|
||||
<span>账号密码登录</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="account-login" id="accountLogin">
|
||||
<h2 class="account-login__title">账号密码登录</h2>
|
||||
<div class="account-login__form">
|
||||
<label class="form-field">
|
||||
<span class="form-field__label">账号</span>
|
||||
<input class="form-field__input" id="accountInput" type="text" placeholder="请输入工号或手机号">
|
||||
</label>
|
||||
<label class="form-field">
|
||||
<span class="form-field__label">密码</span>
|
||||
<input class="form-field__input" id="passwordInput" type="password" placeholder="请输入登录密码">
|
||||
</label>
|
||||
<div class="account-login__actions">
|
||||
<!-- [交互] 点击模拟账号密码登录成功并跳转至个人中心 -->
|
||||
<button class="login-btn login-btn--primary" id="accountLoginBtn" type="button">登录</button>
|
||||
<button class="text-btn" id="backChoiceBtn" type="button">返回登录方式</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="agreement">
|
||||
<input class="agreement__checkbox" id="agreementCheck" type="checkbox">
|
||||
<span>我已阅读并同意<span class="agreement__link">《用户服务协议》</span>和<span class="agreement__link">《隐私保护说明》</span></span>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<div class="phone-auth" id="phoneAuth">
|
||||
<div class="phone-auth__dialog">
|
||||
<div class="phone-auth__title">微信手机号授权</div>
|
||||
<div class="phone-auth__body">
|
||||
<div class="phone-auth__app-icon">营</div>
|
||||
<div class="phone-auth__app-name">营养管理服务</div>
|
||||
<div class="phone-auth__divider"></div>
|
||||
<p class="phone-auth__desc">申请获取你微信绑定的手机号:</p>
|
||||
<p class="phone-auth__number">131****8827</p>
|
||||
</div>
|
||||
<div class="phone-auth__actions">
|
||||
<button class="phone-auth__btn phone-auth__btn--cancel" id="phoneCancelBtn" type="button">取消</button>
|
||||
<!-- [交互] 点击确认授权后跳转至个人中心: ./me-home.html -->
|
||||
<button class="phone-auth__btn phone-auth__btn--confirm" id="phoneConfirmBtn" type="button">确认授权</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="home-indicator"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const agreementCheck = document.getElementById("agreementCheck");
|
||||
const authToast = document.getElementById("authToast");
|
||||
const phoneQuickBtn = document.getElementById("phoneQuickBtn");
|
||||
const accountModeBtn = document.getElementById("accountModeBtn");
|
||||
const accountLoginBtn = document.getElementById("accountLoginBtn");
|
||||
const backChoiceBtn = document.getElementById("backChoiceBtn");
|
||||
const loginChoice = document.getElementById("loginChoice");
|
||||
const accountLogin = document.getElementById("accountLogin");
|
||||
const accountInput = document.getElementById("accountInput");
|
||||
const passwordInput = document.getElementById("passwordInput");
|
||||
const phoneAuth = document.getElementById("phoneAuth");
|
||||
const phoneCancelBtn = document.getElementById("phoneCancelBtn");
|
||||
const phoneConfirmBtn = document.getElementById("phoneConfirmBtn");
|
||||
let toastTimer = null;
|
||||
|
||||
function showToast(message) {
|
||||
authToast.textContent = message;
|
||||
authToast.classList.add("is-visible");
|
||||
clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(() => {
|
||||
authToast.classList.remove("is-visible");
|
||||
}, 1800);
|
||||
}
|
||||
|
||||
function ensureAgreement() {
|
||||
if (!agreementCheck.checked) {
|
||||
showToast("请先勾选协议后再继续");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function goProfile() {
|
||||
window.location.href = "me-home.html";
|
||||
}
|
||||
|
||||
phoneQuickBtn.addEventListener("click", () => {
|
||||
if (!ensureAgreement()) return;
|
||||
phoneAuth.classList.add("is-visible");
|
||||
});
|
||||
|
||||
accountModeBtn.addEventListener("click", () => {
|
||||
if (!ensureAgreement()) return;
|
||||
loginChoice.classList.add("is-hidden");
|
||||
accountLogin.classList.add("is-active");
|
||||
setTimeout(() => accountInput.focus(), 80);
|
||||
});
|
||||
|
||||
backChoiceBtn.addEventListener("click", () => {
|
||||
accountLogin.classList.remove("is-active");
|
||||
loginChoice.classList.remove("is-hidden");
|
||||
});
|
||||
|
||||
accountLoginBtn.addEventListener("click", () => {
|
||||
if (!ensureAgreement()) return;
|
||||
if (!accountInput.value.trim()) {
|
||||
showToast("请输入工号或手机号");
|
||||
return;
|
||||
}
|
||||
if (!passwordInput.value.trim()) {
|
||||
showToast("请输入登录密码");
|
||||
return;
|
||||
}
|
||||
showToast("登录成功,正在进入个人中心");
|
||||
setTimeout(goProfile, 500);
|
||||
});
|
||||
|
||||
phoneCancelBtn.addEventListener("click", () => {
|
||||
phoneAuth.classList.remove("is-visible");
|
||||
});
|
||||
|
||||
phoneConfirmBtn.addEventListener("click", () => {
|
||||
phoneAuth.classList.remove("is-visible");
|
||||
showToast("授权成功,正在进入个人中心");
|
||||
setTimeout(goProfile, 500);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user