refactor(mp): CSS 变量主题 + 登录页改造 — UI 优化 Phase 0-2

Phase 0: 建立 design token 体系
- tokens.scss 新增 --tk-pri/--tk-pri-l/--tk-pri-d/--tk-shadow-btn/--tk-shadow-tab
- .doctor-mode 覆盖为靛蓝色系,.elder-mode 非线性放大字号
- variables.scss 新增医生端色彩 + 阴影变量

Phase 1: 组件库 + 页面全局替换
- 75 个页面 SCSS $pri → var(--tk-pri) 全量替换
- 11 个新 UI 组件(PrimaryButton/TabFilter/FormInput/ProgressRing 等)
- 8 个现有组件 SCSS 更新
- 18 个医生端页面 useElderClass → useDoctorClass
- PageHeader 匹配原型 NavBar 规格

Phase 2: 登录页重写
- Logo: 方形+ → 圆形渐变 H
- 登录方式: 纯微信 → 账号密码 + 微信一键登录
- 新增 credentialLogin API + store action
- 字号/间距严格匹配原型 mp-01-login.html
This commit is contained in:
iven
2026-05-16 21:29:13 +08:00
parent 1786f0d707
commit 95e219ad5a
124 changed files with 2306 additions and 1142 deletions

View File

@@ -2,27 +2,27 @@
@import '../../styles/mixins.scss';
.mall-page {
padding-bottom: calc(120px + env(safe-area-inset-bottom));
padding-bottom: calc(var(--tk-tabbar-space) + env(safe-area-inset-bottom));
}
/* ─── 积分余额卡片 ─── */
.mall-header {
background: linear-gradient(135deg, $pri 0%, $pri-d 100%);
padding: 48px 32px 36px;
background: linear-gradient(135deg, var(--tk-pri) 0%, var(--tk-pri-d) 100%);
padding: var(--tk-gap-2xl) var(--tk-gap-xl) var(--tk-gap-xl);
}
.points-card {
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: $r-lg;
padding: 32px;
padding: var(--tk-gap-xl);
}
.points-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
margin-bottom: var(--tk-gap-md);
}
.points-label {
@@ -33,12 +33,12 @@
.checkin-btn {
background: rgba(255, 255, 255, 0.25);
border: 1px solid rgba(255, 255, 255, 0.4);
padding: 10px 28px;
padding: var(--tk-gap-sm) var(--tk-card-padding-lg);
border-radius: $r-pill;
transition: all 0.2s;
&:active {
opacity: 0.8;
opacity: var(--tk-touch-feedback-opacity);
}
&.checked {
@@ -63,7 +63,7 @@
font-weight: bold;
color: $white;
display: block;
margin-bottom: 8px;
margin-bottom: var(--tk-gap-xs);
letter-spacing: 2px;
line-height: 1;
}
@@ -77,13 +77,13 @@
/* ─── 商品类型切换 ─── */
.type-tabs {
display: flex;
padding: 20px 24px 0;
padding: var(--tk-section-gap) var(--tk-page-padding) 0;
}
.type-tab {
flex: 1;
text-align: center;
padding: 16px 0;
padding: var(--tk-gap-md) 0;
position: relative;
min-height: 48px;
@@ -95,7 +95,7 @@
transform: translateX(-50%);
width: 48px;
height: 4px;
background: $pri;
background: var(--tk-pri);
border-radius: $r-xs;
}
}
@@ -105,7 +105,7 @@
color: $tx2;
&.active {
color: $pri;
color: var(--tk-pri);
font-weight: 600;
}
}
@@ -114,15 +114,15 @@
.product-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
padding: 20px 24px;
gap: var(--tk-gap-md);
padding: var(--tk-section-gap) var(--tk-page-padding);
}
.product-card {
overflow: hidden;
&:active {
opacity: 0.7;
opacity: var(--tk-touch-feedback-opacity);
}
}
@@ -131,7 +131,7 @@
height: 200px;
@include flex-center;
&.type-physical { background: $pri-l; }
&.type-physical { background: var(--tk-pri-l); }
&.type-service { background: $acc-l; }
&.type-privilege { background: $wrn-l; }
}
@@ -140,7 +140,7 @@
font-family: 'Georgia', 'Times New Roman', serif;
font-size: var(--tk-font-hero);
font-weight: bold;
color: $pri;
color: var(--tk-pri);
line-height: 1;
.type-service & { color: $acc; }
@@ -148,7 +148,7 @@
}
.product-info {
padding: 20px;
padding: var(--tk-section-gap);
}
.product-name {
@@ -156,7 +156,7 @@
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 12px;
margin-bottom: var(--tk-gap-sm);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -171,7 +171,7 @@
.product-points {
display: flex;
align-items: center;
gap: 4px;
gap: var(--tk-gap-2xs);
}
.product-points-char {
@@ -190,7 +190,7 @@
.product-stock {
font-size: var(--tk-font-body);
padding: 2px 10px;
padding: 2px var(--tk-gap-sm);
border-radius: $r-sm;
&.out {