feat(miniprogram): 访客模式 + 长辈模式 + MCP 自动化脚本
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

访客模式:
- 未登录用户可见首页(轮播图+健康资讯+登录引导)和"我的"页面
- 健康和消息 tab 显示 GuestGuard 登录拦截
- 登录页增加"暂不登录,先看看"跳过入口
- 401 拦截器增加 hasToken 检查,避免访客被重定向到登录页
- 退出登录后 reLaunch 到首页而非登录页

长辈模式:
- 新增 stores/ui.ts 管理显示模式(标准/长辈)
- 长辈模式放大字体 ×1.3、间距 ×1.2、按钮加大
- "我的 → 账号 → 长辈模式"切换页
- 设置持久化到 Storage

修复:
- Health/Messages 页面 Hooks 顺序违规(条件 return 在 hooks 之间)
  导致访客模式下页面白屏,所有 hooks 移到条件判断之前

工程:
- scripts/mpsync.sh/ps1 自动清理残留 DevTools 进程
- project.config.json 默认关闭域名校验
This commit is contained in:
iven
2026-05-09 11:42:44 +08:00
parent 0c28969c3b
commit 085163ec7a
23 changed files with 1385 additions and 312 deletions

View File

@@ -1,6 +1,10 @@
@import '../../styles/variables.scss';
@import '../../styles/mixins.scss';
/* ═══════════════════════════════════════
登录后首页
═══════════════════════════════════════ */
.home-page {
min-height: 100vh;
background: $bg;
@@ -8,12 +12,12 @@
padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
/* ─── 区域 1问候 + 日期 + 铃铛 ─── */
/* ─── 问候区 ─── */
.greeting-section {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
margin-bottom: 24px;
}
.greeting-left {
@@ -21,7 +25,8 @@
}
.greeting-text {
font-size: 24px;
@include serif-number;
font-size: 26px;
font-weight: 700;
color: $tx;
display: block;
@@ -35,8 +40,10 @@
.greeting-bell {
position: relative;
width: 40px;
height: 40px;
width: 44px;
height: 44px;
border-radius: 22px;
background: $pri-l;
@include flex-center;
flex-shrink: 0;
@@ -46,16 +53,27 @@
}
.greeting-bell-icon {
font-size: 22px;
font-size: 18px;
color: $pri-d;
}
/* ─── 区域 2今日体征完成度 ─── */
.greeting-bell-dot {
position: absolute;
top: 6px;
right: 6px;
width: 8px;
height: 8px;
border-radius: 4px;
background: $dan;
}
/* ─── 今日体征进度 ─── */
.checkin-card {
background: $card;
border-radius: $r;
box-shadow: $shadow-sm;
padding: 16px;
margin-bottom: 12px;
box-shadow: $shadow-md;
padding: 20px;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 16px;
@@ -106,9 +124,9 @@
}
}
/* ─── 区域 3今日体征 2x2 ─── */
/* ─── 今日体征 2x2 ─── */
.vitals-section {
margin-bottom: 12px;
margin-bottom: 16px;
}
.section-title {
@@ -136,37 +154,36 @@
font-size: 13px;
color: $tx2;
display: block;
margin-bottom: 4px;
margin-bottom: 6px;
}
.vital-value-row {
display: flex;
align-items: baseline;
margin-bottom: 4px;
margin-bottom: 6px;
}
.vital-value {
@include serif-number;
font-size: 32px;
font-size: 30px;
font-weight: 700;
color: $tx;
line-height: 1.1;
line-height: 1;
}
.vital-unit {
font-size: 12px;
color: $tx3;
margin-left: 2px;
margin-left: 3px;
}
.vital-bottom {
display: flex;
align-items: center;
gap: 0;
}
.vital-tag {
font-size: 12px;
font-size: 11px;
font-weight: 500;
padding: 2px 8px;
border-radius: $r-pill;
@@ -189,103 +206,85 @@
}
}
/* ─── 区域 4今日待办 ─── */
.todo-section {
margin-bottom: 12px;
}
.todo-empty {
background: $card;
/* ─── 智能提醒卡片 ─── */
.reminder-card {
background: linear-gradient(135deg, $pri 0%, $pri-d 100%);
border-radius: $r;
padding: 24px;
text-align: center;
box-shadow: $shadow-sm;
padding: 18px;
margin-bottom: 16px;
color: #fff;
}
.todo-empty-text {
font-size: 14px;
color: $tx2;
.reminder-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.todo-list {
background: $card;
border-radius: $r;
overflow: hidden;
box-shadow: $shadow-sm;
.reminder-title {
font-size: 15px;
font-weight: 600;
color: #fff;
}
.todo-item {
.reminder-count {
font-size: 12px;
opacity: 0.7;
color: #fff;
}
.reminder-item {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 16px;
border-bottom: 1px solid $bd;
&:last-child {
border-bottom: none;
}
gap: 8px;
padding: 8px 0;
&:active {
background: $bd-l;
opacity: 0.8;
}
}
.todo-icon-wrap {
width: 36px;
height: 36px;
border-radius: 10px;
background: $pri-l;
@include flex-center;
.reminder-item-border {
border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.reminder-tag {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.2);
font-weight: 500;
color: #fff;
flex-shrink: 0;
}
.todo-icon-char {
font-size: 18px;
font-weight: bold;
color: $pri;
}
.todo-info {
flex: 1;
min-width: 0;
}
.todo-title {
font-size: 15px;
color: $tx;
font-weight: 500;
display: block;
margin-bottom: 2px;
}
.todo-sub {
.reminder-text {
font-size: 13px;
color: $tx3;
display: block;
flex: 1;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.todo-arrow {
font-size: 14px;
color: $tx3;
.reminder-arrow {
opacity: 0.5;
color: #fff;
flex-shrink: 0;
}
/* ─── 区域 5快捷操作 ─── */
/* ─── 快捷操作 ─── */
.action-section {
display: flex;
gap: 10px;
margin-top: 16px;
margin-top: 8px;
}
.action-btn {
flex: 1;
height: 52px;
border-radius: 14px;
font-size: 17px;
font-weight: 600;
@include flex-center;
&:active {
@@ -296,6 +295,7 @@
.action-primary {
background: $pri;
color: #fff;
box-shadow: 0 2px 8px rgba(196, 98, 58, 0.25);
}
.action-outline {
@@ -308,3 +308,166 @@
font-size: 17px;
font-weight: 600;
}
/* ═══════════════════════════════════════
访客首页
═══════════════════════════════════════ */
.guest-page {
min-height: 100vh;
background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
/* ─── 轮播图 ─── */
.guest-swiper {
width: 100%;
height: 360px;
}
.guest-slide {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.guest-slide-bg {
position: absolute;
inset: 0;
&--1 {
background: linear-gradient(135deg, $pri-d 0%, $pri 60%, $pri-l 100%);
}
}
.guest-slide:nth-child(2) .guest-slide-bg {
background: linear-gradient(135deg, $acc 0%, #3D5A40 60%, $acc-l 100%);
}
.guest-slide:nth-child(3) .guest-slide-bg {
background: linear-gradient(135deg, #8B6F4E 0%, $wrn 60%, $wrn-l 100%);
}
.guest-slide-content {
position: relative;
z-index: 1;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
padding: 40px 32px;
}
.guest-slide-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 26px;
font-weight: 700;
color: #FFFFFF;
display: block;
margin-bottom: 8px;
}
.guest-slide-desc {
font-size: 16px;
color: rgba(255, 255, 255, 0.85);
display: block;
}
/* ─── 健康资讯 ─── */
.guest-section {
padding: 24px 24px 0;
}
.guest-section-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 22px;
font-weight: bold;
color: $tx;
display: block;
margin-bottom: 16px;
}
.guest-articles {
display: flex;
flex-direction: column;
gap: 12px;
}
.guest-article-card {
background: $card;
border-radius: $r;
padding: 16px 18px;
box-shadow: $shadow-sm;
&:active {
opacity: 0.85;
}
}
.guest-article-title {
font-size: 16px;
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.guest-article-summary {
font-size: 13px;
color: $tx3;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.guest-empty {
padding: 40px 0;
text-align: center;
}
.guest-empty-text {
font-size: 14px;
color: $tx3;
}
/* ─── 底部登录引导 ─── */
.guest-login-prompt {
margin: 24px 24px 0;
background: $card;
border-radius: $r;
padding: 20px;
box-shadow: $shadow-md;
display: flex;
align-items: center;
gap: 16px;
}
.guest-login-text {
flex: 1;
font-size: 13px;
color: $tx2;
}
.guest-login-btn {
height: 56px;
padding: 0 28px;
background: $pri;
border-radius: $r-pill;
@include flex-center;
flex-shrink: 0;
&:active {
opacity: 0.85;
}
}
.guest-login-btn-text {
font-size: 20px;
font-weight: 600;
color: #fff;
}