Compare commits

..
1 Commits
Author SHA1 Message Date
Your Name de990a921b 更新 2026-08-11 10:02:40 +08:00
20071 changed files with 134389 additions and 3835500 deletions
+33 -34
View File
@@ -1,34 +1,33 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/
# Other files and folders
.settings/
# Executables
*.swf
*.air
*.ipa
*.apk
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
# 测试临时目录
app/.test-tmp-stream/
/.idea
/.codex-tasks
/.trellis
/.claude
/.agent
/.shared
/.cursor
/.codex
/.agents
/server/.spool
/server/.claude
/.spool
TUICallKit-Vue3/.env
/.codegraph
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/
# Other files and folders
.settings/
# Executables
*.swf
*.air
*.ipa
*.apk
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
/.idea
/.codex-tasks
/.trellis
/.claude
/.agent
/.shared
/.cursor
/.codex
/.agents
/server/.spool
/server/.claude
/.spool
TUICallKit-Vue3/.env
/.codegraph
-90
View File
@@ -1,90 +0,0 @@
# 2026-08-20 — 医生工作站 AI 问诊对话框布局优化
## 改动
- 文件: `app/src/doctor_workstation/ui/dialogs/ai_consult.py`
- 模块: `AiConsultDialog` 右侧「智能分析」卡片 + 问诊对话卡片密度优化
- 新增 helpers: `_InsightItem`, `_split_insight_segments`, `_split_numbered_list`, `_split_plain_paragraph`, `_split_label_or_sentence`, `_escape_html`
- `_set_insights` 改成将稠密段落拆成 lead / list / plain 三类, 每类单独 QLabel 显示
- CSS 新增 `AiConsultInsightMarker` / `AiConsultInsightText` / `AiConsultInsightPlaceholder`
- 卡片 padding `10,8,10,8``14,12,14,14`; 卡间距 `8``10`
- 聊天气泡垂直 margin `4``6`, chat_layout spacing `10``12`
## 拆分策略
- 文本以 `1./2、/3)/4` 起头 → 视为完整编号列表
- 文本中嵌入 `…:1.…2.…` → 拆出序言 + 编号列表
- 短中文标签 `XXYY` 开头 → 视为 lead, 标签部分加粗
- 其余按 `。//;/` 分句 → 单独成行
## 测试
- 现有 `tests/test_ai_consult_ui.py` 通过 `widget.objectName() == "AiConsultRecordTitle"` 校验标题仍在, 未受影响
- 暂未运行 UI 测试 (开发环境未装 PySide6); 解析逻辑单独脚本验证通过
## 注意
- PySide6 QSS 对 `QLabel``line-height` 支持有限; 主要靠 item 间距 `8px``padding:1px 0` 提供节奏
- 如果后续接入 `AiConsultInsightText` 还嫌密集, 可再调 `body_host.setSpacing`
---
# 接诊台 AI 智能分析详情对话框 (`ReceptionAiAnalysisDialog`) 优化
用户截图(`clipboard-2026-08-20T08-42-40`...)反馈: 「问诊详情 → AI 智能分析」卡片里的诊断建议 / 风险评估 / 治疗建议三段文字太稠密, 不利于阅读。
## 关键差异
这次的目标文件和上次不同 — 用户截图里出现 "诊断建议 / 风险评估 / 治疗建议" 标题, 而 `ai_consult.py` 用的是 "血糖控制评估 / 并发症风险评估 / 用药合理性评估"。实际是 `app/src/doctor_workstation/ui/pages/reception.py` 中的 `_ReceptionAiAnalysisDialog` 类。
## 改动
- 文件: `app/src/doctor_workstation/ui/pages/reception.py`
- 新增 helpers (与 ai_consult.py 类似但导出名加 `_ai_` 前缀):
- `_ai_split_into_segments` / `_ai_split_numbered_list` / `_ai_split_plain_paragraph`
- `_ai_segments_to_html` / `_ai_narrative_structured_html`
- `_ai_split_label_or_sentence` / `_ai_escape_html`
- 正则: `_AI_INSIGHT_LIST_RE`, `_AI_INSIGHT_LIST_LOOKAHEAD_RE`, `_AI_INSIGHT_LABEL_RE`
- `add_text_section` 闭包内多挂一个 RichText `_structured_labels[name]` 标签 (`.setObjectName(name + "Structured")`, `property="dialogAiStructured"`)
- 原 PlainText `value_label` 仍存在 (`hide()` + `setMaximumHeight(0)`) 用于兼容既有 findChild 测试
- `_render_model` 同步刷新两个结构化标签; 空 HTML 时回退显示原 label 文本
- 风险评估 FlowLayout spacing `7×7``9×9`
- `body_layout.setSpacing` `12``14`
- 卡片 contentsMargins `14,13,16,15``16,14,18,16`
- QSS: `dialogAiBody``line-height: 1.85`, 新增 `dialogAiStructured` 选择器 (line-height 175%); 风险 pill `min-height` `28``30`, padding `4 10``5 12`, font 12 → 12.5, border-radius `7``8`
## 兼容约束
- `tests/test_reception_parity_ui.py` 严格校验:
- `findChild(QLabel, "ReceptionAiAnalysisDialogDiagnosisText")` 必须能找到
- `.text()` 必须等于 `_ai_narrative_text` 归一化结果
- `.textFormat() == Qt.TextFormat.PlainText`
- 因此 PlainText 标签必须原样保留, 仅做 `.hide()` + `setMaximumHeight(0)` (避免 QSS `>` 子选择器不被 Qt 支持)
## 验证
- `py_compile` 通过, 无 `SyntaxWarning`
- 单独脚本跑过 4 组样本文本 (稠密段落 / 嵌入式编号列表 / 短句 / 纯编号列表), 拆分结果符合预期
- 未在本机跑 UI 测试 (缺 PySide6)
---
# 患者列表 AI 分析: 发送完整患者资料给 AI
用户需求: 患者列表 AI 分析时, 每日血糖报告、舌苔、AI 报告、视频录制回放的文字对话都要发给 AI。
## 改动
- `app/src/doctor_workstation/ui/dialogs/ai_consult.py`
- `_load_workspace` 新增 `list_call_records` section (视频问诊记录, 含 `transcript_text`)
- 模块级纯函数 (无 Qt 依赖, 便于测试):
- `AI_CONTEXT_MAX_CHARS=320`, `AI_PROMPT_LIMIT=500`, `AI_CONTEXT_SEPARATOR="\n\n— 医生提问 —\n"`
- `_truncate_for_context` / `_patient_context_blood_sugar` / `_patient_context_tongue` / `_patient_context_reports` / `_patient_context_prescriptions` / `_patient_context_videos` / `build_patient_ai_context` / `_compose_ai_prompt`
- `build_patient_ai_context` 返回 `(text, labels)`, 按 每日血糖→舌苔/脉象→视频问诊文字→历史AI报告→处方记录 顺序装入 320 字预算的信封
- `_patient_context_videos``diagnosis_id` 过滤归属 (`_exact_positive_id`), 只取最近一条有文字的
- `_compose_ai_prompt` 本地强制 500 字上限: 上下文 + "— 医生提问 —" + 问题, 超长时截断问题加 `…` (服务端 `tcm.diagnosis/aiAssistant` prompt 上限 500)
- `_ChatBubble.attach_extra()` 支持气泡下方挂载控件
- `_render_patient_context`: 聊天区系统气泡 "AI 已加载本诊单上下文(N 项…)", `_attach_context_detail` 挂 "查看本次发送给 AI 的资料全文" 展开按钮 (QSS: `AiConsultContextToggle`/`AiConsultContextReveal`)
- `_ask``_compose_ai_prompt(text, self._patient_ai_context)` 组装后传给 `_AiStreamWorker`; 医生气泡仍显示原始问题
- `open_for` / `_clear_chat` 重置 `_patient_ai_context*` 三个状态, 防止跨患者残留
## 测试
- `app/tests/test_ai_consult_ui.py` 新增 5 个测试 (总 15 个全通过):
纯函数: 全 section 信封+视频按诊单过滤 / 仅基本病历返回空 / 长问题截断≤500
UI: 上下文气泡+展开按钮+视频记录计数 / `_ask` 注入上下文 (FakeWorker 捕获 prompt, monkeypatch `QThreadPool`)
- `app/scripts/check_ai_context.py`: AST 提取纯函数的冒烟脚本 (无需 Qt)
- `tests/test_ai_consult_workspace_ui.py` 18 个测试无回归
## 环境要点 (重要)
- **PySide6 + pytest 在 `app/.venv` 里可用**: 用 `D:/web/zyt/app/.venv/Scripts/python.exe -m pytest` 跑 UI 测试 (QT_QPA_PLATFORM=offscreen)。之前"本机缺 PySide6"的结论只对系统 Python 成立。
- 测试 FakeWorker 需实现 `signals.event/error/finished.connect()``cancel()` (closeEvent 会调 cancel)
File diff suppressed because it is too large Load Diff
+243 -243
View File
@@ -1,243 +1,243 @@
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "甄养堂",
"backgroundColor": "#F8F8F8",
"backgroundColorTop": "#F8F8F8"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "视频问诊"
}
},
{
"path": "pages/user/userinfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "pages/index/video",
"style": {
"navigationBarTitleText": "甄养堂"
}
},
{
"path": "pages/order/monad/monad",
"style": {
"navigationBarTitleText": "诊单确认",
"navigationBarHidden": true,
"navigationStyle": "custom"
}
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的",
"backgroundColor": "#e8eaed",
"backgroundColorTop": "#e8eaed"
}
},
{
"path": "pages/Card/Card",
"style": {
"navigationBarTitleText": "就诊卡"
}
},
{
"path": "pages/Card/edit_card",
"style": {
"navigationBarTitleText": "修改就诊卡"
}
},
{
"path": "pages/Card/contact",
"style": {
"navigationBarTitleText": "服务"
}
},
{
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "付款"
}
}
],
"subPackages": [
{
"root": "TUICallKit/src/Components",
"pages": [
{
"path": "TUICallKit",
"style": {
"navigationBarTitleText": "视频问诊",
"navigationBarHidden": true,
"navigationStyle": "custom"
}
}
]
},
{
"root": "TUIKit",
"pages": [
{
"path": "pages/chat/chat",
"style": {
"navigationBarTitleText": "问诊"
}
}
]
},
{
"root": "doctor",
"pages": [
{
"path": "pages/doctor/doctor",
"style": {
"navigationBarTitleText": "医生信息"
}
},
{
"path": "pages/doctor/list/list",
"style": {
"navigationBarTitleText": "执业医生列表"
}
},
{
"path": "pages/article/article",
"style": {
"navigationBarTitleText": "健康百科"
}
}
]
},
{
"root": "training",
"pages": [
{
"path": "pages/grip-ring",
"style": {
"navigationBarTitleText": "握力环训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/pilates-ring",
"style": {
"navigationBarTitleText": "瑜伽环训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/foot-pedal",
"style": {
"navigationBarTitleText": "脚蹬器训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/dumbbell",
"style": {
"navigationBarTitleText": "哑铃训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/metronome",
"style": {
"navigationBarTitleText": "耗糖节拍器",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
}
]
},
{
"root": "tongji",
"pages": [
{
"path": "pages/index",
"style": {
"navigationBarTitleText": "血糖记录",
"navigationBarBackgroundColor": "#204e2b",
"navigationBarTextStyle": "white",
"backgroundColor": "#faf9f5",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "pages/weekly",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "血糖管理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "pages/more",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "日常护理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "endless-game/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "识糖小课堂",
"backgroundColor": "#eefbf4",
"disableScroll": false,
"enableShareAppMessage": true,
"enableShareTimeline": true
}
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "甄养堂互联网医院",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "甄养堂",
"backgroundColor": "#F8F8F8",
"backgroundColorTop": "#F8F8F8"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "视频问诊"
}
},
{
"path": "pages/user/userinfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "pages/index/video",
"style": {
"navigationBarTitleText": "甄养堂"
}
},
{
"path": "pages/order/monad/monad",
"style": {
"navigationBarTitleText": "诊单确认",
"navigationBarHidden": true,
"navigationStyle": "custom"
}
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的",
"backgroundColor": "#e8eaed",
"backgroundColorTop": "#e8eaed"
}
},
{
"path": "pages/Card/Card",
"style": {
"navigationBarTitleText": "就诊卡"
}
},
{
"path": "pages/Card/edit_card",
"style": {
"navigationBarTitleText": "修改就诊卡"
}
},
{
"path": "pages/Card/contact",
"style": {
"navigationBarTitleText": "服务"
}
},
{
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "付款"
}
}
],
"subPackages": [
{
"root": "TUICallKit/src/Components",
"pages": [
{
"path": "TUICallKit",
"style": {
"navigationBarTitleText": "视频问诊",
"navigationBarHidden": true,
"navigationStyle": "custom"
}
}
]
},
{
"root": "TUIKit",
"pages": [
{
"path": "pages/chat/chat",
"style": {
"navigationBarTitleText": "问诊"
}
}
]
},
{
"root": "doctor",
"pages": [
{
"path": "pages/doctor/doctor",
"style": {
"navigationBarTitleText": "医生信息"
}
},
{
"path": "pages/doctor/list/list",
"style": {
"navigationBarTitleText": "执业医生列表"
}
},
{
"path": "pages/article/article",
"style": {
"navigationBarTitleText": "健康百科"
}
}
]
},
{
"root": "training",
"pages": [
{
"path": "pages/grip-ring",
"style": {
"navigationBarTitleText": "握力环训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/pilates-ring",
"style": {
"navigationBarTitleText": "瑜伽环训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/foot-pedal",
"style": {
"navigationBarTitleText": "脚蹬器训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/dumbbell",
"style": {
"navigationBarTitleText": "哑铃训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
},
{
"path": "pages/metronome",
"style": {
"navigationBarTitleText": "耗糖节拍器",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc"
}
}
]
},
{
"root": "tongji",
"pages": [
{
"path": "pages/index",
"style": {
"navigationBarTitleText": "血糖记录",
"navigationBarBackgroundColor": "#204e2b",
"navigationBarTextStyle": "white",
"backgroundColor": "#faf9f5",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "pages/weekly",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "血糖管理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "pages/more",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "日常护理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"mp-weixin": {
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
}
},
{
"path": "endless-game/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "识糖小课堂",
"backgroundColor": "#eefbf4",
"disableScroll": false,
"enableShareAppMessage": true,
"enableShareTimeline": true
}
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "甄养堂互联网医院",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
+317 -317
View File
@@ -1,317 +1,317 @@
import { ref, computed } from 'vue'
import { requestAiStream, parsePartialDietPlainText } from '../utils/aiStreamRequest.js'
const DIET_AI_PREFILL_KEY = 'tongji_diet_ai_prefill'
const emptyDietAiRecommend = () => ({
breakfast: '',
drinks: '',
lunch: '',
dinner: '',
tips: '',
avoid: [],
analysis: [],
exercise: null,
disclaimer: '',
rules_summary: '',
source: '',
date: ''
})
/** AI 饮食助手(今日推荐 + 能不能吃) */
export function useDietAi(proxy, { diagnosisId, showUserToast, formatUserMessage }) {
const dietAiRecommend = ref(emptyDietAiRecommend())
const dietAiLoading = ref(false)
const dietAiStreaming = ref(false)
const dietAiReplacing = ref(false)
const dietAiStreamField = ref('')
let dietStreamBuffer = ''
const dietAiAskText = ref('')
const dietAiAsking = ref(false)
const dietAiAskResult = ref({ advice: '', level: '', level_label: '', portion: '', food: '' })
const hasDietAiMealContent = computed(() => {
const r = dietAiRecommend.value
return !!(r.breakfast || r.drinks || r.lunch || r.dinner || r.tips)
})
function detectDietStreamField(text) {
const tail = String(text || '').match(/(?:^|\n)(早餐|喝的|午餐|晚餐|提示|少碰)[:]\s*([^\n]*)$/)
if (!tail) return 'breakfast'
const map = { '早餐': 'breakfast', '喝的': 'drinks', '午餐': 'lunch', '晚餐': 'dinner', '提示': 'tips', '少碰': 'tips' }
return map[tail[1]] || 'breakfast'
}
function mergePartialDietFromStream() {
const partial = parsePartialDietPlainText(dietStreamBuffer)
const next = { ...dietAiRecommend.value }
for (const key of ['breakfast', 'drinks', 'lunch', 'dinner', 'tips']) {
if (partial[key] != null) next[key] = partial[key]
}
if (Array.isArray(partial.avoid)) next.avoid = partial.avoid
dietAiRecommend.value = next
dietAiStreamField.value = detectDietStreamField(dietStreamBuffer)
}
function applyDietRecommendPayload(payload) {
if (!payload) return
const prevAnalysis = dietAiRecommend.value.analysis
const prevExercise = dietAiRecommend.value.exercise
dietAiRecommend.value = {
...emptyDietAiRecommend(),
...payload,
avoid: Array.isArray(payload.avoid) ? payload.avoid : [],
analysis: Array.isArray(payload.analysis) && payload.analysis.length
? payload.analysis
: (Array.isArray(prevAnalysis) ? prevAnalysis : []),
exercise: (payload.exercise && typeof payload.exercise === 'object')
? payload.exercise
: (prevExercise || null)
}
}
function resolveDietDonePayload(payload) {
if (!payload) return payload
if (payload.source !== 'rule' || !dietStreamBuffer) return payload
const streamed = parsePartialDietPlainText(dietStreamBuffer)
if (!streamed.breakfast) return payload
return {
...emptyDietAiRecommend(),
...payload,
breakfast: streamed.breakfast,
drinks: streamed.drinks || payload.drinks || '',
lunch: streamed.lunch || payload.lunch || '',
dinner: streamed.dinner || payload.dinner || '',
tips: streamed.tips || payload.tips || '',
avoid: (Array.isArray(streamed.avoid) && streamed.avoid.length) ? streamed.avoid : (payload.avoid || []),
source: 'ai',
disclaimer: 'AI 建议供参考,仍请结合医嘱与血糖监测。'
}
}
function onDietAiStreamEvent(event, payload) {
if (event === 'analysis') {
if (Array.isArray(payload?.analysis)) {
dietAiRecommend.value = { ...dietAiRecommend.value, analysis: payload.analysis }
}
} else if (event === 'exercise') {
if (payload?.exercise && typeof payload.exercise === 'object') {
dietAiRecommend.value = { ...dietAiRecommend.value, exercise: payload.exercise }
}
} else if (event === 'delta') {
dietAiStreaming.value = true
if (payload.buffer != null) {
dietStreamBuffer = payload.buffer
} else {
dietStreamBuffer += payload.text || ''
}
mergePartialDietFromStream()
} else if (event === 'done') {
applyDietRecommendPayload(resolveDietDonePayload(payload))
dietStreamBuffer = ''
dietAiStreamField.value = ''
} else if (event === 'error') {
showUserToast(formatUserMessage(payload?.message, '饮食建议加载失败'))
}
}
async function fetchDietAiRecommendFallback(refresh) {
const res = await proxy.apiUrl({
url: '/api/tcm/dailyDietAiRecommend',
method: 'GET',
timeout: 35000,
data: {
diagnosis_id: diagnosisId.value,
refresh: refresh ? 1 : 0,
...(refresh ? { _t: Date.now() } : {})
}
}, false)
if (res?.code === 1 && res.data) {
applyDietRecommendPayload(res.data)
} else if (res?.msg) {
showUserToast(res.msg)
}
}
async function fetchDietAiRecommend(refresh = false) {
if (!diagnosisId.value || dietAiLoading.value) return
dietAiLoading.value = true
dietAiStreaming.value = false
dietAiReplacing.value = !!refresh
dietStreamBuffer = ''
dietAiStreamField.value = ''
if (refresh) {
applyDietRecommendPayload(emptyDietAiRecommend())
}
try {
await requestAiStream({
baseUrl: proxy.$url,
url: '/api/tcm/dailyDietAiRecommendStream',
method: 'GET',
data: {
diagnosis_id: diagnosisId.value,
refresh: refresh ? 1 : 0,
...(refresh ? { _t: Date.now() } : {})
},
onEvent: onDietAiStreamEvent,
fallback: () => fetchDietAiRecommendFallback(refresh)
})
} catch (e) {
try {
await fetchDietAiRecommendFallback(refresh)
} catch (e2) {
showUserToast('饮食建议加载失败')
}
} finally {
dietAiLoading.value = false
dietAiStreaming.value = false
dietAiReplacing.value = false
dietAiStreamField.value = ''
}
}
function refreshDietAiRecommend() {
if (dietAiLoading.value) return
fetchDietAiRecommend(true)
}
async function askDietAiFoodFallback(q) {
const res = await proxy.apiUrl({
url: '/api/tcm/dailyDietAiAsk',
method: 'POST',
timeout: 35000,
data: {
diagnosis_id: diagnosisId.value,
question: q
}
}, false)
if (res?.code === 1 && res.data) {
dietAiAskResult.value = {
advice: res.data.advice || '',
level: res.data.level || '',
level_label: res.data.level_label || '',
portion: res.data.portion || '',
food: res.data.food || q
}
} else {
showUserToast(formatUserMessage(res?.msg, '咨询失败'))
}
}
async function askDietAiFood() {
const q = String(dietAiAskText.value || '').trim()
if (!q) {
showUserToast('请输入想咨询的食物')
return
}
if (!diagnosisId.value) return
// 发送后立即清空输入框
dietAiAskText.value = ''
dietAiAsking.value = true
dietAiAskResult.value = { advice: '', level: '', level_label: '', portion: '', food: '' }
try {
await requestAiStream({
baseUrl: proxy.$url,
url: '/api/tcm/dailyDietAiAskStream',
method: 'POST',
data: {
diagnosis_id: diagnosisId.value,
question: q
},
onEvent: (event, payload) => {
if (event === 'start' && !dietAiAskResult.value.advice) {
dietAiAskResult.value = { ...dietAiAskResult.value, advice: payload.message || '正在想…' }
} else if (event === 'delta') {
dietAiAskResult.value = {
...dietAiAskResult.value,
advice: payload.advice || dietAiAskResult.value.advice
}
} else if (event === 'done') {
dietAiAskResult.value = {
advice: payload.advice || '',
level: payload.level || '',
level_label: payload.level_label || '',
portion: payload.portion || '',
food: payload.food || q
}
} else if (event === 'error') {
showUserToast(formatUserMessage(payload?.message, '咨询失败'))
}
},
fallback: () => askDietAiFoodFallback(q)
})
} catch (e) {
try {
await askDietAiFoodFallback(q)
} catch (e2) {
showUserToast('网络异常,请稍后再试')
}
} finally {
dietAiAsking.value = false
}
}
function onDietAiAskInput(e) {
dietAiAskText.value = e?.detail?.value ?? ''
}
function saveDietPrefillToStorage() {
const r = dietAiRecommend.value
if (!r.breakfast) return
try {
uni.setStorageSync(DIET_AI_PREFILL_KEY, {
breakfast: r.breakfast,
drinks: r.drinks || '',
lunch: r.lunch,
dinner: r.dinner,
tips: r.tips || ''
})
} catch (e) {}
}
function goMoreDietForm(withPrefill = false) {
if (withPrefill) saveDietPrefillToStorage()
uni.navigateTo({ url: '/tongji/pages/more?openDiet=1' })
}
async function applyDietAiToForm() {
if (!dietAiRecommend.value.breakfast) {
await fetchDietAiRecommend(false)
}
goMoreDietForm(true)
}
function openDietForm() {
goMoreDietForm(false)
}
return {
dietAiRecommend,
dietAiLoading,
dietAiStreaming,
dietAiReplacing,
dietAiStreamField,
dietAiAskText,
dietAiAsking,
dietAiAskResult,
hasDietAiMealContent,
fetchDietAiRecommend,
refreshDietAiRecommend,
askDietAiFood,
onDietAiAskInput,
applyDietAiToForm,
openDietForm
}
}
/** more 页打开饮食表单时读取并清除预填 */
export function consumeDietAiPrefill() {
try {
const data = uni.getStorageSync(DIET_AI_PREFILL_KEY)
uni.removeStorageSync(DIET_AI_PREFILL_KEY)
if (data && typeof data === 'object' && data.breakfast) return data
} catch (e) {}
return null
}
import { ref, computed } from 'vue'
import { requestAiStream, parsePartialDietPlainText } from '../utils/aiStreamRequest.js'
const DIET_AI_PREFILL_KEY = 'tongji_diet_ai_prefill'
const emptyDietAiRecommend = () => ({
breakfast: '',
drinks: '',
lunch: '',
dinner: '',
tips: '',
avoid: [],
analysis: [],
exercise: null,
disclaimer: '',
rules_summary: '',
source: '',
date: ''
})
/** AI 饮食助手(今日推荐 + 能不能吃) */
export function useDietAi(proxy, { diagnosisId, showUserToast, formatUserMessage }) {
const dietAiRecommend = ref(emptyDietAiRecommend())
const dietAiLoading = ref(false)
const dietAiStreaming = ref(false)
const dietAiReplacing = ref(false)
const dietAiStreamField = ref('')
let dietStreamBuffer = ''
const dietAiAskText = ref('')
const dietAiAsking = ref(false)
const dietAiAskResult = ref({ advice: '', level: '', level_label: '', portion: '', food: '' })
const hasDietAiMealContent = computed(() => {
const r = dietAiRecommend.value
return !!(r.breakfast || r.drinks || r.lunch || r.dinner || r.tips)
})
function detectDietStreamField(text) {
const tail = String(text || '').match(/(?:^|\n)(早餐|喝的|午餐|晚餐|提示|少碰)[:]\s*([^\n]*)$/)
if (!tail) return 'breakfast'
const map = { '早餐': 'breakfast', '喝的': 'drinks', '午餐': 'lunch', '晚餐': 'dinner', '提示': 'tips', '少碰': 'tips' }
return map[tail[1]] || 'breakfast'
}
function mergePartialDietFromStream() {
const partial = parsePartialDietPlainText(dietStreamBuffer)
const next = { ...dietAiRecommend.value }
for (const key of ['breakfast', 'drinks', 'lunch', 'dinner', 'tips']) {
if (partial[key] != null) next[key] = partial[key]
}
if (Array.isArray(partial.avoid)) next.avoid = partial.avoid
dietAiRecommend.value = next
dietAiStreamField.value = detectDietStreamField(dietStreamBuffer)
}
function applyDietRecommendPayload(payload) {
if (!payload) return
const prevAnalysis = dietAiRecommend.value.analysis
const prevExercise = dietAiRecommend.value.exercise
dietAiRecommend.value = {
...emptyDietAiRecommend(),
...payload,
avoid: Array.isArray(payload.avoid) ? payload.avoid : [],
analysis: Array.isArray(payload.analysis) && payload.analysis.length
? payload.analysis
: (Array.isArray(prevAnalysis) ? prevAnalysis : []),
exercise: (payload.exercise && typeof payload.exercise === 'object')
? payload.exercise
: (prevExercise || null)
}
}
function resolveDietDonePayload(payload) {
if (!payload) return payload
if (payload.source !== 'rule' || !dietStreamBuffer) return payload
const streamed = parsePartialDietPlainText(dietStreamBuffer)
if (!streamed.breakfast) return payload
return {
...emptyDietAiRecommend(),
...payload,
breakfast: streamed.breakfast,
drinks: streamed.drinks || payload.drinks || '',
lunch: streamed.lunch || payload.lunch || '',
dinner: streamed.dinner || payload.dinner || '',
tips: streamed.tips || payload.tips || '',
avoid: (Array.isArray(streamed.avoid) && streamed.avoid.length) ? streamed.avoid : (payload.avoid || []),
source: 'ai',
disclaimer: 'AI 建议供参考,仍请结合医嘱与血糖监测。'
}
}
function onDietAiStreamEvent(event, payload) {
if (event === 'analysis') {
if (Array.isArray(payload?.analysis)) {
dietAiRecommend.value = { ...dietAiRecommend.value, analysis: payload.analysis }
}
} else if (event === 'exercise') {
if (payload?.exercise && typeof payload.exercise === 'object') {
dietAiRecommend.value = { ...dietAiRecommend.value, exercise: payload.exercise }
}
} else if (event === 'delta') {
dietAiStreaming.value = true
if (payload.buffer != null) {
dietStreamBuffer = payload.buffer
} else {
dietStreamBuffer += payload.text || ''
}
mergePartialDietFromStream()
} else if (event === 'done') {
applyDietRecommendPayload(resolveDietDonePayload(payload))
dietStreamBuffer = ''
dietAiStreamField.value = ''
} else if (event === 'error') {
showUserToast(formatUserMessage(payload?.message, '饮食建议加载失败'))
}
}
async function fetchDietAiRecommendFallback(refresh) {
const res = await proxy.apiUrl({
url: '/api/tcm/dailyDietAiRecommend',
method: 'GET',
timeout: 35000,
data: {
diagnosis_id: diagnosisId.value,
refresh: refresh ? 1 : 0,
...(refresh ? { _t: Date.now() } : {})
}
}, false)
if (res?.code === 1 && res.data) {
applyDietRecommendPayload(res.data)
} else if (res?.msg) {
showUserToast(res.msg)
}
}
async function fetchDietAiRecommend(refresh = false) {
if (!diagnosisId.value || dietAiLoading.value) return
dietAiLoading.value = true
dietAiStreaming.value = false
dietAiReplacing.value = !!refresh
dietStreamBuffer = ''
dietAiStreamField.value = ''
if (refresh) {
applyDietRecommendPayload(emptyDietAiRecommend())
}
try {
await requestAiStream({
baseUrl: proxy.$url,
url: '/api/tcm/dailyDietAiRecommendStream',
method: 'GET',
data: {
diagnosis_id: diagnosisId.value,
refresh: refresh ? 1 : 0,
...(refresh ? { _t: Date.now() } : {})
},
onEvent: onDietAiStreamEvent,
fallback: () => fetchDietAiRecommendFallback(refresh)
})
} catch (e) {
try {
await fetchDietAiRecommendFallback(refresh)
} catch (e2) {
showUserToast('饮食建议加载失败')
}
} finally {
dietAiLoading.value = false
dietAiStreaming.value = false
dietAiReplacing.value = false
dietAiStreamField.value = ''
}
}
function refreshDietAiRecommend() {
if (dietAiLoading.value) return
fetchDietAiRecommend(true)
}
async function askDietAiFoodFallback(q) {
const res = await proxy.apiUrl({
url: '/api/tcm/dailyDietAiAsk',
method: 'POST',
timeout: 35000,
data: {
diagnosis_id: diagnosisId.value,
question: q
}
}, false)
if (res?.code === 1 && res.data) {
dietAiAskResult.value = {
advice: res.data.advice || '',
level: res.data.level || '',
level_label: res.data.level_label || '',
portion: res.data.portion || '',
food: res.data.food || q
}
} else {
showUserToast(formatUserMessage(res?.msg, '咨询失败'))
}
}
async function askDietAiFood() {
const q = String(dietAiAskText.value || '').trim()
if (!q) {
showUserToast('请输入想咨询的食物')
return
}
if (!diagnosisId.value) return
// 发送后立即清空输入框
dietAiAskText.value = ''
dietAiAsking.value = true
dietAiAskResult.value = { advice: '', level: '', level_label: '', portion: '', food: '' }
try {
await requestAiStream({
baseUrl: proxy.$url,
url: '/api/tcm/dailyDietAiAskStream',
method: 'POST',
data: {
diagnosis_id: diagnosisId.value,
question: q
},
onEvent: (event, payload) => {
if (event === 'start' && !dietAiAskResult.value.advice) {
dietAiAskResult.value = { ...dietAiAskResult.value, advice: payload.message || '正在想…' }
} else if (event === 'delta') {
dietAiAskResult.value = {
...dietAiAskResult.value,
advice: payload.advice || dietAiAskResult.value.advice
}
} else if (event === 'done') {
dietAiAskResult.value = {
advice: payload.advice || '',
level: payload.level || '',
level_label: payload.level_label || '',
portion: payload.portion || '',
food: payload.food || q
}
} else if (event === 'error') {
showUserToast(formatUserMessage(payload?.message, '咨询失败'))
}
},
fallback: () => askDietAiFoodFallback(q)
})
} catch (e) {
try {
await askDietAiFoodFallback(q)
} catch (e2) {
showUserToast('网络异常,请稍后再试')
}
} finally {
dietAiAsking.value = false
}
}
function onDietAiAskInput(e) {
dietAiAskText.value = e?.detail?.value ?? ''
}
function saveDietPrefillToStorage() {
const r = dietAiRecommend.value
if (!r.breakfast) return
try {
uni.setStorageSync(DIET_AI_PREFILL_KEY, {
breakfast: r.breakfast,
drinks: r.drinks || '',
lunch: r.lunch,
dinner: r.dinner,
tips: r.tips || ''
})
} catch (e) {}
}
function goMoreDietForm(withPrefill = false) {
if (withPrefill) saveDietPrefillToStorage()
uni.navigateTo({ url: '/tongji/pages/more?openDiet=1' })
}
async function applyDietAiToForm() {
if (!dietAiRecommend.value.breakfast) {
await fetchDietAiRecommend(false)
}
goMoreDietForm(true)
}
function openDietForm() {
goMoreDietForm(false)
}
return {
dietAiRecommend,
dietAiLoading,
dietAiStreaming,
dietAiReplacing,
dietAiStreamField,
dietAiAskText,
dietAiAsking,
dietAiAskResult,
hasDietAiMealContent,
fetchDietAiRecommend,
refreshDietAiRecommend,
askDietAiFood,
onDietAiAskInput,
applyDietAiToForm,
openDietForm
}
}
/** more 页打开饮食表单时读取并清除预填 */
export function consumeDietAiPrefill() {
try {
const data = uni.getStorageSync(DIET_AI_PREFILL_KEY)
uni.removeStorageSync(DIET_AI_PREFILL_KEY)
if (data && typeof data === 'object' && data.breakfast) return data
} catch (e) {}
return null
}
@@ -1,115 +1,115 @@
import { ref } from 'vue'
import { formatUserMessage } from '../utils/tongjiHelpers.js'
/** 登录 / 就诊卡门禁(index 与 more 共用) */
export function useTongjiAuth(proxy) {
const authChecking = ref(false)
let gateRedirected = false
let authSessionPromise = null
function hasAuthToken() {
return !!String(uni.getStorageSync('token') || '').trim()
}
function clearAuthStorage() {
uni.removeStorageSync('token')
authSessionPromise = null
}
function wxLoginGetCode() {
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin',
success: (res) => {
if (res && res.code) resolve(res.code)
else reject(new Error('微信登录未返回 code'))
},
fail: reject
})
})
}
async function mnpLoginWithCode(code) {
const res = await proxy.apiUrl({
url: '/api/login/mnpLogin',
method: 'POST',
data: { code }
}, false)
if (res && res.code === 1 && res.data && res.data.token) {
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('userData', res.data)
return res.data
}
clearAuthStorage()
throw new Error(formatUserMessage(res?.msg, '登录失败'))
}
async function doWxLogin() {
const code = await wxLoginGetCode()
await mnpLoginWithCode(code)
return hasAuthToken()
}
async function verifyOrLogin() {
if (!hasAuthToken()) {
return doWxLogin()
}
try {
const res = await proxy.apiUrl({ url: '/api/user/info', method: 'POST' }, false)
if (res && res.code === 1 && res.data) {
uni.setStorageSync('userData', res.data)
return true
}
} catch (e) {
/* 网络异常走重新登录 */
}
clearAuthStorage()
try {
return await doWxLogin()
} catch (e2) {
return false
}
}
async function ensureLoggedIn() {
if (authSessionPromise) {
return authSessionPromise
}
authSessionPromise = verifyOrLogin()
.then((ok) => {
if (!ok) authSessionPromise = null
return !!ok
})
.catch(() => {
authSessionPromise = null
return false
})
return authSessionPromise
}
function redirectToCardEntry(returnPath) {
if (gateRedirected) return
gateRedirected = true
const returnUrl = encodeURIComponent(returnPath || '/tongji/pages/index')
uni.redirectTo({
url: `/pages/Card/edit_card?add=1&returnUrl=${returnUrl}`
})
}
function resetGateRedirect() {
gateRedirected = false
}
function isGateRedirected() {
return gateRedirected
}
return {
authChecking,
hasAuthToken,
ensureLoggedIn,
redirectToCardEntry,
resetGateRedirect,
isGateRedirected
}
}
import { ref } from 'vue'
import { formatUserMessage } from '../utils/tongjiHelpers.js'
/** 登录 / 就诊卡门禁(index 与 more 共用) */
export function useTongjiAuth(proxy) {
const authChecking = ref(false)
let gateRedirected = false
let authSessionPromise = null
function hasAuthToken() {
return !!String(uni.getStorageSync('token') || '').trim()
}
function clearAuthStorage() {
uni.removeStorageSync('token')
authSessionPromise = null
}
function wxLoginGetCode() {
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin',
success: (res) => {
if (res && res.code) resolve(res.code)
else reject(new Error('微信登录未返回 code'))
},
fail: reject
})
})
}
async function mnpLoginWithCode(code) {
const res = await proxy.apiUrl({
url: '/api/login/mnpLogin',
method: 'POST',
data: { code }
}, false)
if (res && res.code === 1 && res.data && res.data.token) {
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('userData', res.data)
return res.data
}
clearAuthStorage()
throw new Error(formatUserMessage(res?.msg, '登录失败'))
}
async function doWxLogin() {
const code = await wxLoginGetCode()
await mnpLoginWithCode(code)
return hasAuthToken()
}
async function verifyOrLogin() {
if (!hasAuthToken()) {
return doWxLogin()
}
try {
const res = await proxy.apiUrl({ url: '/api/user/info', method: 'POST' }, false)
if (res && res.code === 1 && res.data) {
uni.setStorageSync('userData', res.data)
return true
}
} catch (e) {
/* 网络异常走重新登录 */
}
clearAuthStorage()
try {
return await doWxLogin()
} catch (e2) {
return false
}
}
async function ensureLoggedIn() {
if (authSessionPromise) {
return authSessionPromise
}
authSessionPromise = verifyOrLogin()
.then((ok) => {
if (!ok) authSessionPromise = null
return !!ok
})
.catch(() => {
authSessionPromise = null
return false
})
return authSessionPromise
}
function redirectToCardEntry(returnPath) {
if (gateRedirected) return
gateRedirected = true
const returnUrl = encodeURIComponent(returnPath || '/tongji/pages/index')
uni.redirectTo({
url: `/pages/Card/edit_card?add=1&returnUrl=${returnUrl}`
})
}
function resetGateRedirect() {
gateRedirected = false
}
function isGateRedirected() {
return gateRedirected
}
return {
authChecking,
hasAuthToken,
ensureLoggedIn,
redirectToCardEntry,
resetGateRedirect,
isGateRedirected
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,51 +1,51 @@
/**
* Google Stitch MCP · VitalMint Health
* 设计 token 与 stitch-weekly.html tailwind.config 一一对应
*/
.stitch-vitalmint {
--primary: #006c49;
--on-primary: #ffffff;
--on-primary-fixed-variant: #005236;
--primary-container: #10b981;
--on-primary-container: #00422b;
--inverse-primary: #4edea3;
--surface: #f4fbf4;
--on-surface: #161d19;
--on-surface-variant: #3c4a42;
--surface-container-lowest: #ffffff;
--surface-container-low: #eef6ee;
--surface-container: #e8f0e9;
--surface-container-high: #e3eae3;
--surface-container-highest: #dde4dd;
--surface-variant: #dde4dd;
--outline: #6c7a71;
--outline-variant: #bbcabf;
--error: #ba1a1a;
--on-error-container: #93000a;
--error-container: #ffdad6;
--tertiary: #a43a3a;
--tertiary-container: #fc7c78;
--on-tertiary: #ffffff;
--on-tertiary-container: #711419;
--st-container-margin: 40rpx;
--st-section-gap: 64rpx;
--st-card-padding: 40rpx;
--st-stack-gap: 32rpx;
--st-inline-gap: 24rpx;
--st-radius-2xl: 48rpx;
--st-radius-xl: 24rpx;
--st-radius-lg: 16rpx;
--st-shadow-ambient: 0 20rpx 60rpx -20rpx rgba(0, 108, 73, 0.08);
}
.weekly-page.stitch-vitalmint {
min-height: 100vh;
background: var(--surface);
color: var(--on-surface);
padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
}
/**
* Google Stitch MCP · VitalMint Health
* 设计 token 与 stitch-weekly.html tailwind.config 一一对应
*/
.stitch-vitalmint {
--primary: #006c49;
--on-primary: #ffffff;
--on-primary-fixed-variant: #005236;
--primary-container: #10b981;
--on-primary-container: #00422b;
--inverse-primary: #4edea3;
--surface: #f4fbf4;
--on-surface: #161d19;
--on-surface-variant: #3c4a42;
--surface-container-lowest: #ffffff;
--surface-container-low: #eef6ee;
--surface-container: #e8f0e9;
--surface-container-high: #e3eae3;
--surface-container-highest: #dde4dd;
--surface-variant: #dde4dd;
--outline: #6c7a71;
--outline-variant: #bbcabf;
--error: #ba1a1a;
--on-error-container: #93000a;
--error-container: #ffdad6;
--tertiary: #a43a3a;
--tertiary-container: #fc7c78;
--on-tertiary: #ffffff;
--on-tertiary-container: #711419;
--st-container-margin: 40rpx;
--st-section-gap: 64rpx;
--st-card-padding: 40rpx;
--st-stack-gap: 32rpx;
--st-inline-gap: 24rpx;
--st-radius-2xl: 48rpx;
--st-radius-xl: 24rpx;
--st-radius-lg: 16rpx;
--st-shadow-ambient: 0 20rpx 60rpx -20rpx rgba(0, 108, 73, 0.08);
}
.weekly-page.stitch-vitalmint {
min-height: 100vh;
background: var(--surface);
color: var(--on-surface);
padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
}
File diff suppressed because it is too large Load Diff
+56 -56
View File
@@ -1,56 +1,56 @@
/** 将接口 msg / 异常对象转为可展示的字符串,避免 [object Object] */
export function formatUserMessage(msg, fallback = '') {
if (msg == null || msg === '') return fallback
if (typeof msg === 'string') return msg
if (typeof msg === 'number' || typeof msg === 'boolean') return String(msg)
if (Array.isArray(msg)) {
const parts = msg.map((item) => {
if (item == null) return ''
if (typeof item === 'string') return item
if (typeof item === 'number' || typeof item === 'boolean') return String(item)
if (typeof item === 'object') {
return item.msg || item.message || item.error || item.title || item.label || ''
}
return String(item)
}).filter(Boolean)
return parts.length ? parts.join('') : fallback
}
if (typeof msg === 'object') {
return msg.msg || msg.message || msg.error || msg.title || msg.label || fallback
}
return String(msg)
}
export function showUserToast(title, options = {}) {
const text = formatUserMessage(title, '')
if (!text) return
uni.showToast({
title: text,
icon: options.icon || 'none',
duration: options.duration
})
}
export function formatDate(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const d = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${d}`
}
export function parseDate(str) {
if (!str) return new Date()
const [y, m, d] = str.split('-').map(Number)
return new Date(y, (m || 1) - 1, d || 1)
}
export function toNumber(v) {
if (v === null || v === undefined || v === '') return null
const n = Number(v)
return Number.isFinite(n) && n !== 0 ? n : null
}
export function getWeekday(dateStr) {
const w = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
return w[parseDate(dateStr).getDay()]
}
/** 将接口 msg / 异常对象转为可展示的字符串,避免 [object Object] */
export function formatUserMessage(msg, fallback = '') {
if (msg == null || msg === '') return fallback
if (typeof msg === 'string') return msg
if (typeof msg === 'number' || typeof msg === 'boolean') return String(msg)
if (Array.isArray(msg)) {
const parts = msg.map((item) => {
if (item == null) return ''
if (typeof item === 'string') return item
if (typeof item === 'number' || typeof item === 'boolean') return String(item)
if (typeof item === 'object') {
return item.msg || item.message || item.error || item.title || item.label || ''
}
return String(item)
}).filter(Boolean)
return parts.length ? parts.join('') : fallback
}
if (typeof msg === 'object') {
return msg.msg || msg.message || msg.error || msg.title || msg.label || fallback
}
return String(msg)
}
export function showUserToast(title, options = {}) {
const text = formatUserMessage(title, '')
if (!text) return
uni.showToast({
title: text,
icon: options.icon || 'none',
duration: options.duration
})
}
export function formatDate(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const d = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${d}`
}
export function parseDate(str) {
if (!str) return new Date()
const [y, m, d] = str.split('-').map(Number)
return new Date(y, (m || 1) - 1, d || 1)
}
export function toNumber(v) {
if (v === null || v === undefined || v === '') return null
const n = Number(v)
return Number.isFinite(n) && n !== 0 ? n : null
}
export function getWeekday(dateStr) {
const w = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
return w[parseDate(dateStr).getDay()]
}
-8
View File
@@ -1,8 +0,0 @@
node_modules/
dist/
unpackage/
.DS_Store
*.log
.idea/
.vscode/
.hbuilderx/
-78
View File
@@ -1,78 +0,0 @@
<script setup>
import { onLaunch } from '@dcloudio/uni-app'
import { getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()
onLaunch(() => {
// iOS 静音键模式下 InnerAudioContext 默认不发声
// #ifdef MP-WEIXIN
try {
uni.setInnerAudioOption({
obeyMuteSwitch: false,
mixWithOther: true,
})
} catch (e) {
console.warn('setInnerAudioOption failed:', e)
}
// #endif
uni.login({
provider: 'weixin',
success: function (loginRes) {
if (uni.getStorageSync('token')) {
userinfo(loginRes.code)
} else {
wxcode(loginRes.code)
}
},
})
})
const wxcode = async (code) => {
try {
const res = await proxy.apiUrl(
{
url: '/api/login/mnpLogin',
method: 'POST',
data: {
code: code,
},
},
false
)
if (res && res.data && res.data.token) {
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('userData', res.data)
}
} catch (err) {}
}
const userinfo = async (code) => {
try {
const res = await proxy.apiUrl(
{
url: '/api/user/info',
method: 'POST',
},
false
)
if (res.code == -1) {
wxcode(code)
return
}
if (res && res.data) {
uni.setStorageSync('userData', res.data)
}
} catch (err) {}
}
</script>
<style>
/* 全局基础 */
page {
background-color: #f4fbf4;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
sans-serif;
}
</style>
-33
View File
@@ -1,33 +0,0 @@
# TongjiUniApp
`TUICallKit-Vue3` 抽出的独立 uni-app,保留血糖管理与「我的」相关能力。
## 包含功能
| 模块 | 说明 |
|------|------|
| 血糖管理 | `tongji/pages/weekly`(首页) |
| 日常护理 | `tongji/pages/more` |
| 血糖记录 | `tongji/pages/index` |
| 识糖小课堂 | `tongji/endless-game` |
| 我的 | 个人资料、就诊卡 |
| 居家耗糖训练 | `training` 分包(哑铃/脚蹬/瑜伽环/握力环/节拍器) |
底部导航:血糖 · 我的(已去掉原首页/视频问诊)。
## 开发
```bash
npm install
npm run dev:mp-weixin # 微信小程序 → dist/dev/mp-weixin
npm run build:mp-weixin
npm run dev:h5
```
- API`main.js``https://admin.zhenyangtang.com.cn/`
- 微信语音插件 WechatSI 已配置(`manifest.json` / `pages.json`
- 微信小程序 appid 沿用原工程:`wx79b9a0bfbfe7cbcd`(可在 `manifest.json` 修改)
## 说明
未移植:视频问诊(TUICallKit)、医生站、订单支付等。就诊卡未登录时回跳血糖首页,由 App 静默 `mnpLogin` 完成鉴权。
@@ -1,123 +0,0 @@
<template>
<view class="tab-dock">
<view class="tab-dock__inner">
<view class="tab-dock__item tab-dock__item--center" @click="goWeekly">
<view class="tab-dock__fab" :class="{ 'tab-dock__fab--active': active === 0 }">
<text class="tab-dock__fab-text"></text>
</view>
<text class="tab-dock__label tab-dock__label--center" :style="{ color: active === 0 ? activeColor : color }">血糖</text>
</view>
<view class="tab-dock__item" @click="goUser">
<image
class="tab-dock__icon"
:src="active === 1 ? '/static/user/user_no.png' : '/static/user/user.png'"
mode="aspectFit"
/>
<text class="tab-dock__label" :style="{ color: active === 1 ? activeColor : color }">我的</text>
</view>
</view>
<view class="tab-dock__safe" />
</view>
</template>
<script setup>
const props = defineProps({
/** 0 血糖 1 我的 */
active: {
type: Number,
default: 0
}
})
const color = '#8a8a8a'
const activeColor = '#204e2b'
function goUser() {
if (props.active === 1) return
uni.redirectTo({ url: '/pages/user/user' })
}
function goWeekly() {
if (props.active === 0) return
uni.redirectTo({ url: '/tongji/pages/weekly' })
}
</script>
<style scoped lang="scss">
.tab-dock {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
background: #ffffff;
border-top: 1rpx solid rgba(0, 0, 0, 0.06);
box-shadow: 0 -6rpx 20rpx rgba(0, 0, 0, 0.04);
}
.tab-dock__inner {
display: flex;
align-items: flex-end;
height: 100rpx;
}
.tab-dock__item {
flex: 1;
height: 100rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.tab-dock__item--center {
justify-content: flex-end;
padding-bottom: 6rpx;
}
.tab-dock__icon {
width: 46rpx;
height: 46rpx;
}
.tab-dock__label {
margin-top: 6rpx;
font-size: 22rpx;
line-height: 1.2;
}
.tab-dock__label--center {
margin-top: 8rpx;
}
.tab-dock__fab {
width: 96rpx;
height: 96rpx;
margin-top: -48rpx;
border-radius: 50%;
background: linear-gradient(180deg, #2d7340 0%, #204e2b 100%);
border: 6rpx solid #ffffff;
box-shadow: 0 10rpx 24rpx rgba(32, 78, 43, 0.35);
display: flex;
align-items: center;
justify-content: center;
}
.tab-dock__fab--active {
transform: scale(1.04);
box-shadow: 0 12rpx 28rpx rgba(32, 78, 43, 0.42);
}
.tab-dock__fab-text {
color: #ffffff;
font-size: 38rpx;
font-weight: 700;
line-height: 1;
}
.tab-dock__safe {
height: env(safe-area-inset-bottom);
background: #ffffff;
}
</style>
@@ -1,729 +0,0 @@
<template>
<!-- 页面内嵌模块 weekly 统计页主内容区 -->
<view
v-if="visible && props.inline"
class="dev-entry-inline"
:class="{ 'dev-entry-inline--weekly': props.tone === 'weekly' }"
>
<view class="inline-hero">
<view class="inline-hero-icon" aria-hidden="true">
<view class="inline-hero-wave" />
</view>
<view class="inline-hero-text">
<view class="inline-hero-title-row">
<text class="inline-title">居家耗糖训练</text>
<text v-if="props.tone === 'weekly'" class="inline-pill">体验</text>
</view>
<text class="inline-sub">低强度动起来帮助身体消耗糖分</text>
</view>
</view>
<scroll-view
scroll-x
class="inline-scroll"
:show-scrollbar="false"
:enable-flex="true"
>
<view class="inline-scroll-track">
<view
v-for="item in inlineItems"
:key="item.url"
class="inline-card"
@click="goto(item.url)"
>
<view v-if="item.featured" class="inline-card-badge">
<text>推荐</text>
</view>
<view class="menu-icon" :class="item.iconClass">
<view v-if="item.icon === 'dumbbell'" class="dumbbell-shape">
<view class="dumbbell-plate dumbbell-plate-left" />
<view class="dumbbell-bar" />
<view class="dumbbell-plate dumbbell-plate-right" />
</view>
<view v-else-if="item.icon === 'pedal'" class="foot-pedal-shape">
<view class="pedal-bar pedal-bar-left" />
<view class="pedal-bar pedal-bar-right" />
</view>
<view v-else-if="item.icon === 'pilates'" class="pilates-ring-shape" />
<view v-else-if="item.icon === 'grip'" class="grip-ring-shape" />
<view v-else-if="item.icon === 'metro'" class="menu-icon--metro-inner">
<view class="metro-bar metro-bar-1" />
<view class="metro-bar metro-bar-2" />
<view class="metro-bar metro-bar-3" />
</view>
</view>
<text class="inline-card-title">{{ item.title }}</text>
<text class="inline-card-sub">{{ item.sub }}</text>
<text class="inline-card-go" aria-hidden="true">进入</text>
</view>
</view>
</scroll-view>
<text v-if="props.tone === 'weekly'" class="inline-scroll-hint">左右滑动选择适合您的训练</text>
</view>
<view v-else-if="visible" class="dev-entry-wrap" :style="{ bottom: props.bottom + 'rpx' }">
<!-- 展开后的菜单卡片(从下往上动画) -->
<view v-if="expanded" class="menu-list" @click.stop>
<view class="menu-item" @click="goto('/training/pages/dumbbell')">
<view class="menu-icon menu-icon--dumbbell">
<view class="dumbbell-shape">
<view class="dumbbell-plate dumbbell-plate-left" />
<view class="dumbbell-bar" />
<view class="dumbbell-plate dumbbell-plate-right" />
</view>
</view>
<view class="menu-info">
<text class="menu-title">哑铃</text>
<text class="menu-sub">力量塑形</text>
</view>
<view class="menu-arrow"></view>
</view>
<view class="menu-item" @click="goto('/training/pages/foot-pedal')">
<view class="menu-icon menu-icon--pedal">
<view class="foot-pedal-shape">
<view class="pedal-bar pedal-bar-left" />
<view class="pedal-bar pedal-bar-right" />
</view>
</view>
<view class="menu-info">
<text class="menu-title">脚蹬器</text>
<text class="menu-sub">下肢有氧</text>
</view>
<view class="menu-arrow"></view>
</view>
<view class="menu-item" @click="goto('/training/pages/pilates-ring')">
<view class="menu-icon menu-icon--pilates">
<view class="pilates-ring-shape" />
</view>
<view class="menu-info">
<text class="menu-title">瑜伽环</text>
<text class="menu-sub">核心塑形</text>
</view>
<view class="menu-arrow"></view>
</view>
<view class="menu-item" @click="goto('/training/pages/grip-ring')">
<view class="menu-icon menu-icon--grip">
<view class="grip-ring-shape" />
</view>
<view class="menu-info">
<text class="menu-title">握力环</text>
<text class="menu-sub">握力训练</text>
</view>
<view class="menu-arrow"></view>
</view>
<view class="menu-item" @click="goto('/training/pages/metronome')">
<view class="menu-icon menu-icon--metro">
<view class="metro-bar metro-bar-1" />
<view class="metro-bar metro-bar-2" />
<view class="metro-bar metro-bar-3" />
</view>
<view class="menu-info">
<text class="menu-title">耗糖节拍器</text>
<text class="menu-sub">健走配速</text>
</view>
<view class="menu-arrow"></view>
</view>
</view>
<!-- 主浮动按钮(单字"练" + 呼吸光环) -->
<view class="fab-container">
<view v-if="!expanded" class="fab-pulse" />
<view v-if="!expanded" class="fab-pulse fab-pulse-2" />
<view class="entry-fab" :class="{ expanded }" @click="toggle">
<view v-if="expanded" class="icon-close">
<view class="cross-bar bar-1" />
<view class="cross-bar bar-2" />
</view>
<!-- 心跳波形 icon: 健康主题,SVG 折线 -->
<view v-else class="fab-icon" />
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
type TrainingItem = {
url: string
title: string
sub: string
icon: 'dumbbell' | 'pedal' | 'pilates' | 'grip' | 'metro'
iconClass: string
featured?: boolean
}
const trainingItems: TrainingItem[] = [
{ url: '/training/pages/dumbbell', title: '哑铃', sub: '力量塑形', icon: 'dumbbell', iconClass: 'menu-icon--dumbbell' },
{ url: '/training/pages/foot-pedal', title: '脚蹬器', sub: '下肢有氧', icon: 'pedal', iconClass: 'menu-icon--pedal' },
{ url: '/training/pages/pilates-ring', title: '瑜伽环', sub: '核心塑形', icon: 'pilates', iconClass: 'menu-icon--pilates' },
{ url: '/training/pages/grip-ring', title: '握力环', sub: '握力训练', icon: 'grip', iconClass: 'menu-icon--grip' },
{ url: '/training/pages/metronome', title: '耗糖节拍器', sub: '健走配速', icon: 'metro', iconClass: 'menu-icon--metro', featured: true },
]
const props = withDefaults(
defineProps<{
/** 悬浮按钮距底部 rpx(仅非 inline */
bottom?: number
/** 内嵌到页面主内容区,非 fixed 悬浮 */
inline?: boolean
/** weekly 页:与统计页 Vital Mint 视觉一致 */
tone?: 'default' | 'weekly'
}>(),
{ bottom: 200, inline: false, tone: 'default' },
)
/** weekly 将健走节拍器置前并标推荐 */
const inlineItems = computed(() => {
if (props.tone !== 'weekly') return trainingItems
const metro = trainingItems.find((i) => i.icon === 'metro')
const rest = trainingItems.filter((i) => i.icon !== 'metro')
return metro ? [metro, ...rest] : trainingItems
})
// 居家耗糖训练是正式功能,开发版和发行版都需要展示。
const visible = ref(true)
const expanded = ref(false)
const toggle = () => {
expanded.value = !expanded.value
}
const goto = (url: string) => {
expanded.value = false
uni.navigateTo({ url })
}
</script>
<style lang="scss" scoped>
$brand: #10b981;
$brand-deep: #047857;
$brand-light: #34d399;
.dev-entry-wrap {
position: fixed;
right: 24rpx;
z-index: 999;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 18rpx;
}
/* ============================================================
* 主浮动按钮
* ============================================================ */
.fab-container {
position: relative;
width: 108rpx;
height: 108rpx;
}
.entry-fab {
position: absolute;
inset: 0;
border-radius: 50%;
background: linear-gradient(140deg, $brand-light 0%, $brand-deep 100%);
box-shadow:
0 8rpx 20rpx rgba(16, 185, 129, 0.42),
0 2rpx 6rpx rgba(15, 23, 42, 0.12),
inset 0 -8rpx 16rpx rgba(0, 0, 0, 0.12),
inset 0 8rpx 16rpx rgba(255, 255, 255, 0.18);
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
&:active {
transform: scale(0.92);
}
&.expanded {
background: linear-gradient(140deg, #94a3b8 0%, #475569 100%);
transform: rotate(135deg);
box-shadow:
0 6rpx 16rpx rgba(15, 23, 42, 0.2),
inset 0 -6rpx 14rpx rgba(0, 0, 0, 0.12),
inset 0 6rpx 14rpx rgba(255, 255, 255, 0.12);
}
.fab-icon {
width: 60rpx;
height: 60rpx;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='2,12 7,12 9.5,7 12,17 14.5,9 16.5,12 22,12'/></svg>");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
filter: drop-shadow(0 2rpx 6rpx rgba(0, 0, 0, 0.22));
animation: fab-icon-beat 1.6s ease-in-out infinite;
}
}
@keyframes fab-icon-beat {
0%, 60%, 100% {
transform: scale(1);
}
20% {
transform: scale(1.12);
}
40% {
transform: scale(1);
}
}
/* 关闭态 X 图标 (CSS 几何) */
.icon-close {
position: relative;
width: 36rpx;
height: 36rpx;
.cross-bar {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 5rpx;
background: #fff;
border-radius: 3rpx;
transform-origin: center;
}
.bar-1 {
transform: translateY(-50%) rotate(45deg);
}
.bar-2 {
transform: translateY(-50%) rotate(-45deg);
}
}
/* 呼吸光环(2 圈错相位扩散) */
.fab-pulse {
position: absolute;
inset: 0;
border-radius: 50%;
background: rgba(16, 185, 129, 0.25);
animation: fab-ring 2.4s ease-out infinite;
pointer-events: none;
}
.fab-pulse-2 {
animation-delay: 1.2s;
}
@keyframes fab-ring {
0% {
transform: scale(0.95);
opacity: 0.7;
}
100% {
transform: scale(1.55);
opacity: 0;
}
}
/* ============================================================
* 展开菜单
* ============================================================ */
.menu-list {
display: flex;
flex-direction: column;
gap: 14rpx;
animation: slide-up 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slide-up {
from {
opacity: 0;
transform: translateY(20rpx) scale(0.92);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.menu-item {
display: flex;
align-items: center;
gap: 16rpx;
background: rgba(255, 255, 255, 0.96);
padding: 14rpx 20rpx 14rpx 14rpx;
border-radius: 999rpx;
box-shadow:
0 8rpx 24rpx rgba(15, 23, 42, 0.1),
0 1rpx 2rpx rgba(15, 23, 42, 0.06);
min-width: 280rpx;
transition: transform 0.15s;
backdrop-filter: blur(12rpx);
&:active {
transform: scale(0.97);
background: #f0fdf4;
}
}
.menu-icon {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 2rpx 8rpx rgba(16, 185, 129, 0.32);
&--train {
background: linear-gradient(140deg, $brand-light, $brand-deep);
}
&--dumbbell {
background: linear-gradient(140deg, #93c5fd, #3b82f6);
box-shadow: 0 2rpx 8rpx rgba(59, 130, 246, 0.36);
}
&--pedal {
background: linear-gradient(140deg, #fdba74, #f97316);
box-shadow: 0 2rpx 8rpx rgba(249, 115, 22, 0.36);
}
&--pilates {
background: linear-gradient(140deg, #c4b5fd, #8b5cf6);
box-shadow: 0 2rpx 8rpx rgba(139, 92, 246, 0.36);
}
&--grip {
background: linear-gradient(140deg, #5eead4, #14b8a6);
box-shadow: 0 2rpx 8rpx rgba(20, 184, 166, 0.36);
}
&--metro {
background: linear-gradient(140deg, #fbbf24, #d97706);
box-shadow: 0 2rpx 8rpx rgba(245, 158, 11, 0.36);
gap: 4rpx;
}
}
.menu-icon-text {
font-size: 32rpx;
line-height: 1;
}
/* 哑铃小 icon */
.dumbbell-shape {
width: 40rpx;
height: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.dumbbell-plate {
width: 10rpx;
height: 18rpx;
background: #fff;
border-radius: 3rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.18);
}
.dumbbell-bar {
width: 16rpx;
height: 5rpx;
background: #fff;
border-radius: 2rpx;
margin: 0 2rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.18);
}
/* 脚蹬器小 icon: 左右踏板 */
.foot-pedal-shape {
width: 40rpx;
height: 28rpx;
display: flex;
align-items: flex-end;
justify-content: center;
gap: 6rpx;
}
.pedal-bar {
width: 14rpx;
background: #fff;
border-radius: 4rpx 4rpx 2rpx 2rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.18);
}
.pedal-bar-left {
height: 18rpx;
transform: rotate(-12deg);
}
.pedal-bar-right {
height: 22rpx;
transform: rotate(12deg);
}
/* 瑜伽环小 icon: 双弧阻力环 */
.pilates-ring-shape {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
border: 5rpx solid #fff;
position: relative;
box-shadow:
0 1rpx 2rpx rgba(0, 0, 0, 0.18),
inset 0 1rpx 2rpx rgba(255, 255, 255, 0.6);
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 18rpx;
height: 18rpx;
transform: translate(-50%, -50%);
border-radius: 50%;
border: 3rpx solid rgba(255, 255, 255, 0.85);
}
}
/* 握力环小 icon: 白色描边的环(甜甜圈) */
.grip-ring-shape {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 7rpx solid #fff;
box-shadow:
0 1rpx 2rpx rgba(0, 0, 0, 0.18),
inset 0 1rpx 2rpx rgba(255, 255, 255, 0.6);
}
/* 节拍器小 icon: 3 根高低柱模拟均衡器/节拍 */
.metro-bar {
width: 4rpx;
background: #fff;
border-radius: 2rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.18);
}
.metro-bar-1 {
height: 16rpx;
}
.metro-bar-2 {
height: 28rpx;
}
.metro-bar-3 {
height: 22rpx;
}
.menu-info {
display: flex;
flex-direction: column;
gap: 2rpx;
flex: 1;
}
.menu-title {
font-size: 28rpx;
color: #0f172a;
font-weight: 700;
letter-spacing: 1rpx;
}
.menu-sub {
font-size: 20rpx;
color: #94a3b8;
letter-spacing: 0.5rpx;
}
.menu-arrow {
font-size: 32rpx;
color: #cbd5e1;
font-weight: 300;
line-height: 1;
margin-left: 4rpx;
}
.menu-icon--metro-inner {
display: flex;
align-items: flex-end;
justify-content: center;
gap: 4rpx;
width: 100%;
height: 100%;
}
/* ============================================================
* 内嵌模块(weekly 等)
* ============================================================ */
.dev-entry-inline {
width: 100%;
box-sizing: border-box;
}
.dev-entry-inline--weekly {
padding: 32rpx 28rpx 24rpx;
border-radius: 48rpx;
background: var(--surface-container-lowest, #fff);
border: 1rpx solid rgba(0, 108, 73, 0.12);
box-shadow:
0 24rpx 60rpx -20rpx rgba(0, 108, 73, 0.08),
0 8rpx 20rpx -8rpx rgba(0, 0, 0, 0.03);
}
.inline-hero {
display: flex;
align-items: center;
gap: 20rpx;
margin-bottom: 24rpx;
}
.inline-hero-icon {
width: 88rpx;
height: 88rpx;
border-radius: 24rpx;
background: rgba(0, 108, 73, 0.1);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.inline-hero-wave {
width: 52rpx;
height: 52rpx;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006c49' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='2,12 7,12 9.5,7 12,17 14.5,9 16.5,12 22,12'/></svg>");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.inline-hero-text {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6rpx;
}
.inline-hero-title-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10rpx;
}
.inline-title {
font-size: 32rpx;
font-weight: 700;
color: #0f172a;
line-height: 1.25;
}
.inline-pill {
font-size: 20rpx;
font-weight: 700;
color: #006c49;
padding: 4rpx 12rpx;
border-radius: 999rpx;
background: rgba(0, 108, 73, 0.1);
line-height: 1.2;
}
.inline-sub {
font-size: 26rpx;
font-weight: 500;
color: #475569;
line-height: 1.4;
}
.inline-scroll {
width: 100%;
white-space: nowrap;
}
.inline-scroll-track {
display: inline-flex;
flex-direction: row;
align-items: stretch;
gap: 16rpx;
padding: 4rpx 2rpx 8rpx;
}
.inline-card {
position: relative;
display: inline-flex;
flex-direction: column;
align-items: flex-start;
width: 212rpx;
min-height: 220rpx;
padding: 20rpx 18rpx 18rpx;
border-radius: 28rpx;
background: #f4f7f5;
border: 1rpx solid rgba(0, 108, 73, 0.1);
box-sizing: border-box;
flex-shrink: 0;
transition: transform 0.2s ease, background 0.2s ease;
&:active {
transform: scale(0.98);
background: #e8f3ee;
}
.menu-icon {
width: 72rpx;
height: 72rpx;
margin-bottom: 14rpx;
flex-shrink: 0;
}
}
.inline-card-badge {
position: absolute;
top: 12rpx;
right: 12rpx;
padding: 4rpx 10rpx;
border-radius: 8rpx;
background: #006c49;
text {
font-size: 18rpx;
font-weight: 700;
color: #fff;
line-height: 1.2;
}
}
.inline-card-title {
font-size: 28rpx;
font-weight: 700;
color: #0f172a;
line-height: 1.25;
width: 100%;
}
.inline-card-sub {
margin-top: 6rpx;
font-size: 22rpx;
font-weight: 500;
color: #64748b;
line-height: 1.35;
width: 100%;
}
.inline-card-go {
margin-top: auto;
padding-top: 12rpx;
font-size: 22rpx;
font-weight: 700;
color: #006c49;
line-height: 1.2;
}
.inline-scroll-hint {
display: block;
margin-top: 14rpx;
font-size: 22rpx;
font-weight: 600;
color: #94a3b8;
text-align: center;
line-height: 1.35;
}
@media (prefers-reduced-motion: reduce) {
.inline-card:active {
transform: none;
}
}
</style>
-1
View File
@@ -1 +0,0 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./common/vendor.js");exports.createApp=e.createApp;
-42
View File
@@ -1,42 +0,0 @@
{
"pages": [
"tongji/pages/weekly",
"pages/user/user",
"pages/user/userinfo",
"pages/Card/Card",
"pages/Card/edit_card",
"pages/Card/contact",
"tongji/pages/index",
"tongji/pages/more",
"tongji/endless-game/index"
],
"subPackages": [
{
"root": "training",
"pages": [
"pages/grip-ring",
"pages/pilates-ring",
"pages/foot-pedal",
"pages/dumbbell",
"pages/metronome"
]
}
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "甄养堂血糖管理",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"lazyCodeLoading": "requiredComponents",
"requiredBackgroundModes": [
"audio"
],
"plugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
},
"usingComponents": {}
}
-2
View File
@@ -1,2 +0,0 @@
page{background-color:#f4fbf4;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}
page::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(https://cdn1.dcloud.net.cn/5645394f5230704a4d44456c4a5864344e7a6c694f574577596d5a695a6d553359324a6a5a413d3d/img/shadow-grey.png)}100%{background-image:url(https://cdn1.dcloud.net.cn/5645394f5230704a4d44456c4a5864344e7a6c694f574577596d5a695a6d553359324a6a5a413d3d/img/shadow-grey.png)}}@keyframes shadow-preload{0%{background-image:url(https://cdn1.dcloud.net.cn/5645394f5230704a4d44456c4a5864344e7a6c694f574577596d5a695a6d553359324a6a5a413d3d/img/shadow-grey.png)}100%{background-image:url(https://cdn1.dcloud.net.cn/5645394f5230704a4d44456c4a5864344e7a6c694f574577596d5a695a6d553359324a6a5a413d3d/img/shadow-grey.png)}}page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),t="#8a8a8a",c="#204e2b",r={__name:"tab-bar-dock",props:{active:{type:Number,default:0}},setup(r){const a=r;function o(){1!==a.active&&e.index.redirectTo({url:"/pages/user/user"})}function s(){0!==a.active&&e.index.redirectTo({url:"/tongji/pages/weekly"})}return(a,i)=>({a:0===r.active?1:"",b:0===r.active?c:t,c:e.o(s),d:1===r.active?"/static/user/user_no.png":"/static/user/user.png",e:1===r.active?c:t,f:e.o(o)})}},a=e._export_sfc(r,[["__scopeId","data-v-6c5d8930"]]);wx.createComponent(a);
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="tab-dock data-v-6c5d8930"><view class="tab-dock__inner data-v-6c5d8930"><view class="tab-dock__item tab-dock__item--center data-v-6c5d8930" bindtap="{{c}}"><view class="{{['tab-dock__fab', 'data-v-6c5d8930', a && 'tab-dock__fab--active']}}"><text class="tab-dock__fab-text data-v-6c5d8930">糖</text></view><text class="tab-dock__label tab-dock__label--center data-v-6c5d8930" style="{{'color:' + b}}">血糖</text></view><view class="tab-dock__item data-v-6c5d8930" bindtap="{{f}}"><image class="tab-dock__icon data-v-6c5d8930" src="{{d}}" mode="aspectFit"/><text class="tab-dock__label data-v-6c5d8930" style="{{'color:' + e}}">我的</text></view></view><view class="tab-dock__safe data-v-6c5d8930"/></view>
@@ -1 +0,0 @@
.tab-dock.data-v-6c5d8930{position:fixed;left:0;right:0;bottom:0;z-index:999;background:#fff;border-top:1rpx solid rgba(0,0,0,.06);box-shadow:0 -6rpx 20rpx rgba(0,0,0,.04)}.tab-dock__inner.data-v-6c5d8930{display:flex;align-items:flex-end;height:100rpx}.tab-dock__item.data-v-6c5d8930{flex:1;height:100rpx;display:flex;flex-direction:column;align-items:center;justify-content:center}.tab-dock__item--center.data-v-6c5d8930{justify-content:flex-end;padding-bottom:6rpx}.tab-dock__icon.data-v-6c5d8930{width:46rpx;height:46rpx}.tab-dock__label.data-v-6c5d8930{margin-top:6rpx;font-size:22rpx;line-height:1.2}.tab-dock__label--center.data-v-6c5d8930{margin-top:8rpx}.tab-dock__fab.data-v-6c5d8930{width:96rpx;height:96rpx;margin-top:-48rpx;border-radius:50%;background:linear-gradient(180deg,#2d7340,#204e2b);border:6rpx solid #ffffff;box-shadow:0 10rpx 24rpx rgba(32,78,43,.35);display:flex;align-items:center;justify-content:center}.tab-dock__fab--active.data-v-6c5d8930{transform:scale(1.04);box-shadow:0 12rpx 28rpx rgba(32,78,43,.42)}.tab-dock__fab-text.data-v-6c5d8930{color:#fff;font-size:38rpx;font-weight:700;line-height:1}.tab-dock__safe.data-v-6c5d8930{height:env(safe-area-inset-bottom);background:#fff}
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),n=e.defineComponent({__name:"index",props:{bottom:{default:200},inline:{type:Boolean,default:!1},tone:{default:"default"}},setup(n){const i=[{url:"/training/pages/dumbbell",title:"哑铃",sub:"力量塑形",icon:"dumbbell",iconClass:"menu-icon--dumbbell"},{url:"/training/pages/foot-pedal",title:"脚蹬器",sub:"下肢有氧",icon:"pedal",iconClass:"menu-icon--pedal"},{url:"/training/pages/pilates-ring",title:"瑜伽环",sub:"核心塑形",icon:"pilates",iconClass:"menu-icon--pilates"},{url:"/training/pages/grip-ring",title:"握力环",sub:"握力训练",icon:"grip",iconClass:"menu-icon--grip"},{url:"/training/pages/metronome",title:"耗糖节拍器",sub:"健走配速",icon:"metro",iconClass:"menu-icon--metro",featured:!0}],o=n,l=e.computed(()=>{if("weekly"!==o.tone)return i;const e=i.find(e=>"metro"===e.icon),n=i.filter(e=>"metro"!==e.icon);return e?[e,...n]:i}),t=e.ref(!0),a=e.ref(!1),r=()=>{a.value=!a.value},u=n=>{a.value=!1,e.index.navigateTo({url:n})};return(n,i)=>e.e({a:t.value&&o.inline},t.value&&o.inline?e.e({b:"weekly"===o.tone},(o.tone,{}),{c:e.f(l.value,(n,i,o)=>e.e({a:n.featured},(n.featured,{}),{b:"dumbbell"===n.icon},("dumbbell"===n.icon||"pedal"===n.icon||"pilates"===n.icon||"grip"===n.icon||n.icon,{}),{c:"pedal"===n.icon,d:"pilates"===n.icon,e:"grip"===n.icon,f:"metro"===n.icon,g:e.n(n.iconClass),h:e.t(n.title),i:e.t(n.sub),j:n.url,k:e.o(e=>u(n.url),n.url)})),d:"weekly"===o.tone},(o.tone,{}),{e:"weekly"===o.tone?1:""}):t.value?e.e({g:a.value},a.value?{h:e.o(e=>u("/training/pages/dumbbell")),i:e.o(e=>u("/training/pages/foot-pedal")),j:e.o(e=>u("/training/pages/pilates-ring")),k:e.o(e=>u("/training/pages/grip-ring")),l:e.o(e=>u("/training/pages/metronome")),m:e.o(()=>{})}:{},{n:!a.value},(a.value,{}),{o:!a.value},(a.value,{}),{p:a.value},(a.value,{}),{q:a.value?1:"",r:e.o(r),s:o.bottom+"rpx"}):{},{f:t.value})}}),i=e._export_sfc(n,[["__scopeId","data-v-2ae07c93"]]);wx.createComponent(i);
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js");if(!Array){e.resolveComponent("uni-icons")()}Math;const t={__name:"Card",setup(t){const{proxy:n}=e.getCurrentInstance(),a=e.ref([]),i=e.ref(!1);e.onMounted(()=>{o()}),e.onShow(()=>{o()});const o=async()=>{var t;i.value=!0;try{if(!e.index.getStorageSync("token"))return void e.index.showToast({title:"请先登录",icon:"none"});const i=e.index.getStorageSync("userData"),o=null==(t=null==i?void 0:i.diagnosis)?void 0:t.patient_id;if(!o)return;const d=await n.apiUrl({url:"/api/tcm/getCardList",method:"GET",data:{patient_id:o}});1===d.code?a.value=d.data||[]:e.index.showToast({title:d.msg||"获取失败",icon:"none"})}catch(o){console.error("加载就诊卡列表失败:",o)}finally{i.value=!1}},d=t=>{e.index.navigateTo({url:`/pages/Card/edit_card?id=${t.id}`})},s=()=>{e.index.getStorageSync("token")?e.index.navigateTo({url:"/pages/Card/edit_card?add=1"}):e.index.showToast({title:"请先登录",icon:"none"})},r=e=>1===e?"status-confirmed":"status-pending",c={first_visit:"初诊",follow_up:"复诊",consultation:"会诊"},l={qi_deficiency:"气虚",blood_deficiency:"血虚",yin_deficiency:"阴虚",yang_deficiency:"阳虚",qi_stagnation:"气滞",blood_stasis:"血瘀",phlegm_dampness:"痰湿",damp_heat:"湿热",cold_dampness:"寒湿",wind_cold:"风寒",wind_heat:"风热"},g=e=>l[e]||e||"-",_=e=>{if(!e)return"-";const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`};return(t,n)=>e.e({a:e.f(a.value,(t,n,a)=>{return{a:e.t(t.id),b:e.t(t.status_desc||(o=t.status,1===o?"启用":"禁用")),c:e.n(r(t.status)),d:e.t(t.patient_name||"-"),e:e.t(t.gender_desc||"-"),f:e.t(t.age),g:e.t((i=t.diagnosis_type,c[i]||i||"-")),h:e.t(g(t.syndrome_type)),i:e.t(t.diagnosis_date_text||_(t.diagnosis_date)),j:e.t(t.create_time||"-"),k:e.o(n=>(t=>{const n=`/tongji/pages/index?diagnosis_id=${t.id}&patient_id=${t.patient_id||""}&patient_name=${encodeURIComponent(t.patient_name||"")}&age=${t.age||""}&gender=${t.gender||""}`;e.index.navigateTo({url:n})})(t),t.id),l:e.o(e=>d(t),t.id),m:t.id,n:e.o(e=>d(t),t.id)};var i,o}),b:!i.value&&0===a.value.length},i.value||0!==a.value.length?{}:{c:e.p({type:"wallet",size:"80",color:"#1890ff"}),d:e.o(s)},{e:i.value},(i.value,{}))}},n=e._export_sfc(t,[["__scopeId","data-v-341940bb"]]);t.__runtimeHooks=2,wx.createPage(n);
@@ -1,6 +0,0 @@
{
"navigationBarTitleText": "就诊卡",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}
@@ -1 +0,0 @@
<view class="card-container data-v-341940bb"><view class="card-list data-v-341940bb"><view wx:for="{{a}}" wx:for-item="card" wx:key="m" class="card-item data-v-341940bb" bindtap="{{card.n}}"><view class="card-header data-v-341940bb"><view class="card-id data-v-341940bb"><text class="label data-v-341940bb">诊单编号:</text><text class="value data-v-341940bb">{{card.a}}</text></view><view class="{{['data-v-341940bb', 'status-badge', card.c]}}">{{card.b}}</view></view><view class="card-info data-v-341940bb"><view class="info-row data-v-341940bb"><text class="info-label data-v-341940bb">患者姓名:</text><text class="info-value data-v-341940bb">{{card.d}}</text></view><view class="info-row data-v-341940bb"><text class="info-label data-v-341940bb">性别年龄:</text><text class="info-value data-v-341940bb">{{card.e}} / {{card.f}}岁</text></view><view class="info-row data-v-341940bb"><text class="info-label data-v-341940bb">诊断类型:</text><text class="info-value data-v-341940bb">{{card.g}}</text></view><view class="info-row data-v-341940bb"><text class="info-label data-v-341940bb">证型:</text><text class="info-value data-v-341940bb">{{card.h}}</text></view></view><view class="card-footer data-v-341940bb"><view class="time-info data-v-341940bb"><text class="time-label data-v-341940bb">诊断日期:</text><text class="time-value data-v-341940bb">{{card.i}}</text></view><view class="time-info data-v-341940bb"><text class="time-label data-v-341940bb">创建时间:</text><text class="time-value data-v-341940bb">{{card.j}}</text></view></view><view class="card-actions data-v-341940bb"><view class="card-action-btn primary data-v-341940bb" catchtap="{{card.k}}"><text class="card-action-icon data-v-341940bb">📈</text><text class="card-action-text data-v-341940bb">日常记录</text></view><view class="card-action-btn data-v-341940bb" catchtap="{{card.l}}"><text class="card-action-icon data-v-341940bb">📝</text><text class="card-action-text data-v-341940bb">查看 / 编辑</text></view></view></view><view wx:if="{{b}}" class="empty-state data-v-341940bb"><uni-icons wx:if="{{c}}" class="data-v-341940bb" u-i="341940bb-0" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="empty-text data-v-341940bb">暂无就诊卡</text><view class="add-card-btn data-v-341940bb" bindtap="{{d}}">新建就诊卡</view></view><view wx:if="{{e}}" class="loading-state data-v-341940bb"><text class="loading-text data-v-341940bb">加载中...</text></view></view></view>
@@ -1 +0,0 @@
.card-container.data-v-341940bb{min-height:100vh;background:linear-gradient(180deg,#e8f0fa,#fff);padding-bottom:56rpx}.header.data-v-341940bb{background:#fff;padding:48rpx 40rpx;box-shadow:0 2rpx 12rpx rgba(0,0,0,.06)}.header .header-title.data-v-341940bb{font-size:48rpx;font-weight:700;color:#1890ff}.card-list.data-v-341940bb{padding:40rpx}.card-item.data-v-341940bb{background:#fff;border-radius:28rpx;padding:44rpx;margin-bottom:36rpx;box-shadow:0 4rpx 20rpx rgba(0,0,0,.08);transition:all .3s;min-height:200rpx}.card-item.data-v-341940bb:active{transform:scale(.98);box-shadow:0 2rpx 12rpx rgba(0,0,0,.1)}.card-header.data-v-341940bb{display:flex;justify-content:space-between;align-items:center;margin-bottom:32rpx;padding-bottom:28rpx;border-bottom:4rpx solid #e8eaed}.card-id .label.data-v-341940bb{font-size:34rpx;color:#555}.card-id .value.data-v-341940bb{font-size:40rpx;font-weight:700;color:#1a1a1a}.status-badge.data-v-341940bb{padding:12rpx 28rpx;border-radius:28rpx;font-size:32rpx;font-weight:500}.status-badge.status-confirmed.data-v-341940bb{background:#f6ffed;color:#204e2b;border:4rpx solid #204e2b}.status-badge.status-pending.data-v-341940bb{background:#fff7e6;color:#fa8c16;border:4rpx solid #ffd591}.card-info.data-v-341940bb{margin-bottom:28rpx}.info-row.data-v-341940bb{display:flex;align-items:center;margin-bottom:24rpx}.info-row .info-label.data-v-341940bb{font-size:34rpx;color:#555;min-width:200rpx}.info-row .info-value.data-v-341940bb{font-size:36rpx;color:#1a1a1a;font-weight:500}.card-footer.data-v-341940bb{padding-top:28rpx;border-top:4rpx solid #e8eaed}.card-actions.data-v-341940bb{display:flex;gap:20rpx;margin-top:28rpx;padding-top:28rpx;border-top:4rpx solid #e8eaed}.card-action-btn.data-v-341940bb{flex:1;display:flex;align-items:center;justify-content:center;gap:12rpx;padding:24rpx 12rpx;background:#f6faff;border-radius:20rpx;border:2rpx solid #d6e6fb;min-height:80rpx;transition:all .2s}.card-action-btn.data-v-341940bb:active{transform:scale(.98);opacity:.85}.card-action-btn.primary.data-v-341940bb{background:linear-gradient(135deg,#1890ff,#0ea5a4);border-color:transparent}.card-action-btn.primary .card-action-icon.data-v-341940bb,.card-action-btn.primary .card-action-text.data-v-341940bb{color:#fff}.card-action-icon.data-v-341940bb{font-size:36rpx;color:#1890ff}.card-action-text.data-v-341940bb{font-size:30rpx;color:#1890ff;font-weight:500}.time-info.data-v-341940bb{display:flex;align-items:center;margin-bottom:20rpx}.time-info .time-label.data-v-341940bb{font-size:30rpx;color:#555;min-width:180rpx}.time-info .time-value.data-v-341940bb{font-size:32rpx;color:#555}.view-count.data-v-341940bb{display:flex;align-items:center;margin-top:12rpx}.view-count .count-icon.data-v-341940bb{font-size:34rpx;margin-right:12rpx}.view-count .count-text.data-v-341940bb{font-size:30rpx;color:#555}.empty-state.data-v-341940bb{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:160rpx 0}.empty-state .empty-icon.data-v-341940bb{font-size:140rpx;margin-bottom:40rpx}.empty-state .empty-text.data-v-341940bb{font-size:40rpx;color:#555;margin-bottom:56rpx}.add-card-btn.data-v-341940bb{padding:36rpx 88rpx;background:#1890ff;color:#fff;font-size:40rpx;font-weight:500;border-radius:56rpx;min-height:100rpx}.loading-state.data-v-341940bb{display:flex;justify-content:center;padding:120rpx 0}.loading-state .loading-text.data-v-341940bb{font-size:36rpx;color:#555}
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),t={__name:"contact",setup(t){const{proxy:a}=e.getCurrentInstance(),n=e.ref({}),o=e.ref(!1),r=e.ref("");e.onMounted(()=>{c()});const c=async()=>{o.value=!0;try{const t=getCurrentPages(),o=t[t.length-1];r.value=o.options.type;const c=await a.apiUrl({url:"/api/index/policy",method:"GET",data:{type:r.value}});n.value=c.data,e.index.setNavigationBarTitle({title:c.data.title})}catch(t){console.error("加载就诊卡列表失败:",t)}finally{o.value=!1}};return(t,a)=>({a:e.t(n.value.title),b:n.value.content})}},a=e._export_sfc(t,[["__scopeId","data-v-5e5077b6"]]);wx.createPage(a);
@@ -1,4 +0,0 @@
{
"navigationBarTitleText": "服务",
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="card-container data-v-5e5077b6"><view class="header data-v-5e5077b6"><text class="header-title data-v-5e5077b6">{{a}}</text></view><view class="card-list data-v-5e5077b6"><rich-text class="data-v-5e5077b6" nodes="{{b}}"/></view></view>
@@ -1 +0,0 @@
.card-container.data-v-5e5077b6{min-height:100vh;background:linear-gradient(180deg,#f0f7ff,#fff);padding-bottom:40rpx}.header.data-v-5e5077b6{background:#fff;padding:40rpx 30rpx;box-shadow:0 2rpx 8rpx rgba(0,0,0,.05)}.header .header-title.data-v-5e5077b6{font-size:40rpx;font-weight:700;color:#1890ff}.card-list.data-v-5e5077b6{padding:30rpx}.card-item.data-v-5e5077b6{background:#fff;border-radius:20rpx;padding:30rpx;margin-bottom:24rpx;box-shadow:0 4rpx 12rpx rgba(0,0,0,.08);transition:all .3s}.card-item.data-v-5e5077b6:active{transform:scale(.98);box-shadow:0 2rpx 8rpx rgba(0,0,0,.1)}.card-header.data-v-5e5077b6{display:flex;justify-content:space-between;align-items:center;margin-bottom:24rpx;padding-bottom:20rpx;border-bottom:2rpx solid #f0f0f0}.card-id .label.data-v-5e5077b6{font-size:28rpx;color:#666}.card-id .value.data-v-5e5077b6{font-size:32rpx;font-weight:700;color:#333}.status-badge.data-v-5e5077b6{padding:8rpx 20rpx;border-radius:20rpx;font-size:24rpx;font-weight:500}.status-badge.status-confirmed.data-v-5e5077b6{background:#f6ffed;color:#52c41a;border:2rpx solid #b7eb8f}.status-badge.status-pending.data-v-5e5077b6{background:#fff7e6;color:#fa8c16;border:2rpx solid #ffd591}.card-info.data-v-5e5077b6{margin-bottom:20rpx}.info-row.data-v-5e5077b6{display:flex;align-items:center;margin-bottom:16rpx}.info-row .info-label.data-v-5e5077b6{font-size:28rpx;color:#666;min-width:160rpx}.info-row .info-value.data-v-5e5077b6{font-size:30rpx;color:#333;font-weight:500}.card-footer.data-v-5e5077b6{padding-top:20rpx;border-top:2rpx solid #f0f0f0}.time-info.data-v-5e5077b6{display:flex;align-items:center;margin-bottom:12rpx}.time-info .time-label.data-v-5e5077b6{font-size:24rpx;color:#999;min-width:140rpx}.time-info .time-value.data-v-5e5077b6{font-size:26rpx;color:#666}.view-count.data-v-5e5077b6{display:flex;align-items:center;margin-top:8rpx}.view-count .count-icon.data-v-5e5077b6{font-size:28rpx;margin-right:8rpx}.view-count .count-text.data-v-5e5077b6{font-size:24rpx;color:#999}.empty-state.data-v-5e5077b6{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:120rpx 0}.empty-state .empty-icon.data-v-5e5077b6{font-size:120rpx;margin-bottom:30rpx}.empty-state .empty-text.data-v-5e5077b6{font-size:32rpx;color:#999}.loading-state.data-v-5e5077b6{display:flex;justify-content:center;padding:80rpx 0}.loading-state .loading-text.data-v-5e5077b6{font-size:28rpx;color:#999}
File diff suppressed because one or more lines are too long
@@ -1,6 +0,0 @@
{
"navigationBarTitleText": "修改就诊卡",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),a={name:"profileB",components:{DevTrainingEntry:()=>"../../components/dev-training-entry/index.js",TabBarDock:()=>"../../components/app-tab-bar/tab-bar-dock.js"},data:()=>({userInfo:{avatar:"",nickname:"",userId:"",balance:"0",points:"0",coupons:"5"},orderTypes:[{name:"待付款",image:"/static/images/my/payment.png",path:"/pages/order/list?type=1",count:2},{name:"待发货",image:"/static/images/my/delivery.png",path:"/pages/order/list?type=2",count:1},{name:"待收货",image:"/static/images/my/shipping.png",path:"/pages/order/list?type=3",count:0},{name:"待评价",image:"/static/images/my/review.png",path:"/pages/order/list?type=4",count:3},{name:"退换/售后",image:"/static/images/my/after-sale.png",path:"/pages/order/list?type=5",count:0}],allServices:[{name:"就诊卡",icon:"folder-add",path:"/pages/Card/Card",class:"bg-cyan"},{name:"设置",icon:"gear",path:"/pages/user/userinfo",class:"bg-gray"}]}),onShow(){this.userInfo=e.index.getStorageSync("userData")},methods:{navigateTo(a){e.index.navigateTo({url:a})},showQRCode(){}}};if(!Array){(e.resolveComponent("uni-icons")+e.resolveComponent("dev-training-entry")+e.resolveComponent("TabBarDock"))()}Math;const n=e._export_sfc(a,[["render",function(a,n,t,o,s,r){return{a:s.userInfo.avatar,b:e.t(s.userInfo.nickname||"未登录"),c:e.t(s.userInfo.balance||0),d:e.t(s.userInfo.points||0),e:e.t(s.userInfo.coupons||0),f:e.o(e=>r.navigateTo("/pages/user/userinfo")),g:e.f(s.allServices,(a,n,t)=>e.e({a:"285a6397-0-"+t,b:e.p({type:a.icon,size:"28",color:"#fff"}),c:e.n(a.class),d:e.t(a.name),e:a.desc},a.desc?{f:e.t(a.desc)}:{},{g:"285a6397-1-"+t,h:n,i:e.o(e=>r.navigateTo(a.path),n)})),h:e.p({type:"right",size:"20",color:"#666"}),i:e.p({bottom:360}),j:e.p({active:1})}}],["__scopeId","data-v-285a6397"]]);a.__runtimeHooks=2,wx.createPage(n);
-10
View File
@@ -1,10 +0,0 @@
{
"navigationBarTitleText": "我的",
"backgroundColor": "#e8eaed",
"backgroundColorTop": "#e8eaed",
"usingComponents": {
"dev-training-entry": "../../components/dev-training-entry/index",
"tab-bar-dock": "../../components/app-tab-bar/tab-bar-dock",
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}
@@ -1 +0,0 @@
<view class="mine-page data-v-285a6397"><view class="user-card data-v-285a6397" bindtap="{{f}}"><view class="user-header data-v-285a6397"><image class="avatar data-v-285a6397" src="{{a}}" mode="aspectFill"/><view class="user-info data-v-285a6397"><text class="nickname data-v-285a6397">{{b}}</text></view></view><view class="stat-row data-v-285a6397"><view class="stat-item data-v-285a6397"><text class="value data-v-285a6397">{{c}}</text><text class="label data-v-285a6397">钱包(元)</text></view><view class="stat-item data-v-285a6397"><text class="value data-v-285a6397">{{d}}</text><text class="label data-v-285a6397">积分</text></view><view class="stat-item data-v-285a6397"><text class="value data-v-285a6397">{{e}}</text><text class="label data-v-285a6397">优惠券</text></view></view></view><view class="service-list data-v-285a6397"><view wx:for="{{g}}" wx:for-item="item" wx:key="h" class="service-item data-v-285a6397" bindtap="{{item.i}}"><view class="left data-v-285a6397"><view class="{{['service-icon', 'data-v-285a6397', item.c]}}"><uni-icons wx:if="{{item.b}}" class="data-v-285a6397" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></uni-icons></view><text class="service-name data-v-285a6397">{{item.d}}</text></view><view class="right data-v-285a6397"><text wx:if="{{item.e}}" class="desc data-v-285a6397">{{item.f}}</text><uni-icons wx:if="{{h}}" class="data-v-285a6397" u-i="{{item.g}}" bind:__l="__l" u-p="{{h}}"></uni-icons></view></view></view><dev-training-entry wx:if="{{i}}" class="data-v-285a6397" u-i="285a6397-2" bind:__l="__l" u-p="{{i}}"/><tab-bar-dock wx:if="{{j}}" class="data-v-285a6397" u-i="285a6397-3" bind:__l="__l" u-p="{{j}}"/></view>
@@ -1 +0,0 @@
.mine-page.data-v-285a6397{min-height:100vh;background:#e8eaed;padding:40rpx;padding-bottom:calc(240rpx + env(safe-area-inset-bottom))}.user-card.data-v-285a6397{background:#fff;border-radius:28rpx;padding:48rpx;margin-bottom:40rpx;box-shadow:0 4rpx 20rpx rgba(0,0,0,.06)}.user-card .user-header.data-v-285a6397{display:flex;align-items:center;margin-bottom:48rpx}.user-card .user-header .avatar.data-v-285a6397{width:160rpx;height:160rpx;border-radius:80rpx;margin-right:36rpx;border:4rpx solid #e0e0e0}.user-card .user-header .user-info.data-v-285a6397{flex:1}.user-card .user-header .user-info .nickname.data-v-285a6397{font-size:48rpx;font-weight:600;color:#1a1a1a;margin-bottom:16rpx;display:block;letter-spacing:1rpx}.user-card .user-header .user-info .vip-tag.data-v-285a6397{background:linear-gradient(90deg,gold,orange);color:#fff;font-size:28rpx;padding:6rpx 20rpx;border-radius:24rpx;display:inline-block}.user-card .user-header .qr-code.data-v-285a6397{width:88rpx;height:88rpx;border-radius:44rpx;background:#f5f6fa;display:flex;align-items:center;justify-content:center}.user-card .stat-row.data-v-285a6397{display:flex;padding-top:40rpx;border-top:4rpx solid #e8eaed}.user-card .stat-row .stat-item.data-v-285a6397{flex:1;text-align:center;min-height:120rpx}.user-card .stat-row .stat-item .value.data-v-285a6397{font-size:52rpx;font-weight:600;color:#1a1a1a;margin-bottom:12rpx;display:block}.user-card .stat-row .stat-item .label.data-v-285a6397{font-size:32rpx;color:#555;font-weight:500}.order-card.data-v-285a6397{background:#fff;border-radius:24rpx;padding:40rpx;margin-bottom:30rpx;box-shadow:0 4rpx 16rpx rgba(0,0,0,.04)}.order-card .card-header.data-v-285a6397{display:flex;justify-content:space-between;align-items:center;margin-bottom:40rpx}.order-card .card-header .title.data-v-285a6397{font-size:32rpx;font-weight:600;color:#333}.order-card .card-header .more.data-v-285a6397{display:flex;align-items:center}.order-card .card-header .more text.data-v-285a6397{font-size:26rpx;color:#999;margin-right:8rpx}.order-card .order-list.data-v-285a6397{display:flex;justify-content:space-between}.order-card .order-list .order-item.data-v-285a6397{flex:1;text-align:center}.order-card .order-list .order-item .icon-wrapper.data-v-285a6397{width:100rpx;height:100rpx;margin:0 auto;position:relative;display:flex;align-items:center;justify-content:center}.order-card .order-list .order-item .icon-wrapper .count-badge.data-v-285a6397{position:absolute;top:-10rpx;right:-10rpx;background:#ff4d4f;color:#fff;font-size:20rpx;min-width:32rpx;height:32rpx;line-height:32rpx;text-align:center;border-radius:16rpx;padding:0 8rpx}.order-card .order-list .order-item .icon-wrapper .order-icon.data-v-285a6397{width:56rpx;height:56rpx}.order-card .order-list .order-item .order-name.data-v-285a6397{font-size:26rpx;color:#666}.quick-actions.data-v-285a6397{display:grid;grid-template-columns:repeat(4,1fr);gap:30rpx;margin-bottom:30rpx}.quick-actions .action-item.data-v-285a6397{background:#fff;border-radius:24rpx;padding:30rpx 20rpx;text-align:center;box-shadow:0 4rpx 16rpx rgba(0,0,0,.04)}.quick-actions .action-item .action-icon.data-v-285a6397{width:80rpx;height:80rpx;border-radius:40rpx;margin:0 auto 16rpx;display:flex;align-items:center;justify-content:center}.quick-actions .action-item .action-name.data-v-285a6397{font-size:26rpx;color:#666}.service-list.data-v-285a6397{background:#fff;border-radius:28rpx;padding:20rpx 40rpx;box-shadow:0 4rpx 20rpx rgba(0,0,0,.06)}.service-list .service-item.data-v-285a6397{display:flex;align-items:center;justify-content:space-between;padding:44rpx 0;border-bottom:4rpx solid #e8eaed;min-height:120rpx}.service-list .service-item.data-v-285a6397:last-child{border-bottom:none}.service-list .service-item .left.data-v-285a6397{display:flex;align-items:center}.service-list .service-item .left .service-icon.data-v-285a6397{width:88rpx;height:88rpx;border-radius:44rpx;margin-right:32rpx;display:flex;align-items:center;justify-content:center}.service-list .service-item .left .service-name.data-v-285a6397{font-size:38rpx;color:#1a1a1a;font-weight:500}.service-list .service-item .right.data-v-285a6397{display:flex;align-items:center}.service-list .service-item .right .desc.data-v-285a6397{font-size:30rpx;color:#555;margin-right:20rpx}.bg-red.data-v-285a6397{background:#ff4d4f}.bg-blue.data-v-285a6397{background:#1890ff}.bg-green.data-v-285a6397{background:#52c41a}.bg-purple.data-v-285a6397{background:#722ed1}.bg-orange.data-v-285a6397{background:#fa8c16}.bg-cyan.data-v-285a6397{background:#13c2c2}.bg-pink.data-v-285a6397{background:#eb2f96}.bg-gray.data-v-285a6397{background:#666}
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js");if(!Array){e.resolveComponent("uni-icons")()}Math;const a={__name:"userinfo",setup(a){const{proxy:n}=e.getCurrentInstance(),t=e.getCurrentInstance().appContext.config.globalProperties.$url,o=e.ref(!1),i=e.ref(!1),s=e.ref({avatar:"",patient_name:"",phone:"",nickname:"",sex:1,age:""});e.onMounted(()=>{l()});const l=async()=>{o.value=!0;try{const a=await n.apiUrl({url:"/api/user/info",method:"GET",data:{}});if(1===a.code){const e=a.data;s.value={avatar:e.avatar||"",patient_name:e.patient_name||e.nickname||"",phone:e.phone||"",nickname:e.nickname||"",sex:"男"==e.sex?1:2,age:e.age||""}}else e.index.showToast({title:a.msg||"加载失败",icon:"none"})}catch(a){console.error("加载用户信息失败:",a),e.index.showToast({title:"加载失败",icon:"none"})}finally{o.value=!1}},c=()=>{e.index.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:async a=>{const n=a.tempFilePaths[0];try{e.index.showLoading({title:"上传中..."});const a=e.index.getStorageSync("token"),o=await new Promise((o,i)=>{e.index.uploadFile({url:t+"/api/upload/image",filePath:n,name:"file",header:{token:a,"content-type":"multipart/form-data"},success:e=>{const a=JSON.parse(e.data);o(a)},fail:e=>{i(e)}})});e.index.hideLoading(),1===o.code?(s.value.avatar=o.data.uri||o.data,e.index.showToast({title:"头像上传成功",icon:"success"})):e.index.showToast({title:o.msg||"上传失败",icon:"none"})}catch(o){e.index.hideLoading(),console.error("上传头像失败:",o),e.index.showToast({title:"上传失败",icon:"none"})}},fail:a=>{console.error("选择图片失败:",a),e.index.showToast({title:"选择图片失败",icon:"none"})}})},r=async()=>{if(s.value.patient_name)if(s.value.phone&&((a=s.value.phone)&&!/^1[3-9]\d{9}$/.test(a)))e.index.showToast({title:"手机号格式不正确",icon:"none"});else{var a;i.value=!0;try{const a=await n.apiUrl({url:"/api/user/setInfo",method:"POST",data:{avatar:s.value.avatar,phone:s.value.phone,nickname:s.value.nickname,sex:s.value.sex,age:s.value.age,patient_name:s.value.patient_name}});if(1===a.code){const a=e.index.getStorageSync("userData"),n={...a,avatar:s.value.avatar,phone:s.value.phone,nickname:s.value.nickname,sex:s.value.sex,age:s.value.age,patient_name:s.value.patient_name,diagnosis:{...a.diagnosis,patient_name:s.value.patient_name}};e.index.setStorageSync("userData",n),e.index.showToast({title:"保存成功",icon:"success"}),setTimeout(()=>{e.index.navigateBack()},1500)}else e.index.showToast({title:a.msg||"保存失败",icon:"none"})}catch(t){console.error("保存失败:",t),e.index.showToast({title:"保存失败",icon:"none"})}finally{i.value=!1}}else e.index.showToast({title:"姓名不能为空",icon:"none"})};return(a,n)=>e.e({a:o.value},o.value?{}:{b:s.value.avatar,c:e.p({type:"upload-filled",size:"24",color:"#FFA500"}),d:e.o(c),e:s.value.nickname,f:e.o(e=>s.value.nickname=e.detail.value),g:1===s.value.sex?1:"",h:e.o(e=>s.value.sex=1),i:2===s.value.sex?1:"",j:e.o(e=>s.value.sex=2),k:s.value.age,l:e.o(e.m(e=>s.value.age=e.detail.value,{number:!0})),m:e.t(i.value?"保存中...":"保存修改"),n:e.o(r),o:i.value})}},n=e._export_sfc(a,[["__scopeId","data-v-c609dd4e"]]);wx.createPage(n);
@@ -1,6 +0,0 @@
{
"navigationBarTitleText": "个人资料",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}
@@ -1 +0,0 @@
<view class="userinfo-container data-v-c609dd4e"><view wx:if="{{a}}" class="loading-state data-v-c609dd4e"><text class="data-v-c609dd4e">加载中...</text></view><view wx:else class="form-wrapper data-v-c609dd4e"><view class="form-section data-v-c609dd4e"><view class="form-group data-v-c609dd4e"><text class="form-label data-v-c609dd4e">头像</text><view class="avatar-container data-v-c609dd4e"><image src="{{b}}" class="avatar-image data-v-c609dd4e" mode="aspectFill"/><view class="avatar-upload data-v-c609dd4e" bindtap="{{d}}"><uni-icons wx:if="{{c}}" class="upload-icon data-v-c609dd4e" u-i="c609dd4e-0" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="upload-text data-v-c609dd4e">更换头像</text></view></view></view></view><view class="form-section data-v-c609dd4e"><text class="section-title data-v-c609dd4e">基本信息</text><view class="form-group data-v-c609dd4e"><text class="form-label data-v-c609dd4e">昵称</text><input class="form-input data-v-c609dd4e" placeholder="请输入昵称" maxlength="50" value="{{e}}" bindinput="{{f}}"/></view><view class="form-group data-v-c609dd4e"><text class="form-label data-v-c609dd4e">性别</text><view class="sex-group data-v-c609dd4e"><view class="{{['sex-btn', 'data-v-c609dd4e', g && 'active']}}" bindtap="{{h}}"> 男 </view><view class="{{['sex-btn', 'data-v-c609dd4e', i && 'active']}}" bindtap="{{j}}"> 女 </view></view></view><view class="form-group data-v-c609dd4e"><text class="form-label data-v-c609dd4e">年龄</text><input class="form-input data-v-c609dd4e" type="number" placeholder="请输入年龄" min="0" max="150" value="{{k}}" bindinput="{{l}}"/></view></view><view class="button-group data-v-c609dd4e"><button class="btn btn-submit data-v-c609dd4e" bindtap="{{n}}" disabled="{{o}}">{{m}}</button></view></view></view>
@@ -1 +0,0 @@
.userinfo-container.data-v-c609dd4e{min-height:100vh;background:#e8eaed}.header.data-v-c609dd4e{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:24rpx 40rpx;box-shadow:0 2rpx 12rpx rgba(0,0,0,.06)}.header-back.data-v-c609dd4e{font-size:48rpx;color:orange;width:88rpx;height:88rpx;display:flex;align-items:center;justify-content:center}.header-title.data-v-c609dd4e{font-size:44rpx;font-weight:700;color:#1a1a1a;flex:1;text-align:center}.header-placeholder.data-v-c609dd4e{width:88rpx}.loading-state.data-v-c609dd4e{display:flex;justify-content:center;align-items:center;height:100vh;font-size:36rpx;color:#555}.form-wrapper.data-v-c609dd4e{padding:40rpx}.form-section.data-v-c609dd4e{background:#fff;border-radius:24rpx;padding:40rpx;margin-bottom:36rpx;box-shadow:0 4rpx 16rpx rgba(0,0,0,.06)}.section-title.data-v-c609dd4e{font-size:40rpx;font-weight:700;color:orange;margin-bottom:32rpx;display:block;padding-bottom:24rpx;border-bottom:4rpx solid #f0f0f0}.form-group.data-v-c609dd4e{margin-bottom:36rpx}.form-group.data-v-c609dd4e:last-child{margin-bottom:0}.form-label.data-v-c609dd4e{display:block;font-size:36rpx;color:#1a1a1a;font-weight:500;margin-bottom:20rpx;line-height:1.6}.form-input.data-v-c609dd4e{width:100%;padding:28rpx;border:4rpx solid #e0e0e0;border-radius:16rpx;font-size:36rpx;line-height:1.6;color:#1a1a1a;background:#fff;box-sizing:border-box;display:block;height:auto;min-height:96rpx}.form-input.data-v-c609dd4e::-moz-placeholder{color:#999;font-size:34rpx}.form-input.data-v-c609dd4e::placeholder{color:#999;font-size:34rpx}.avatar-container.data-v-c609dd4e{display:flex;align-items:center;gap:32rpx}.avatar-image.data-v-c609dd4e{width:160rpx;height:160rpx;border-radius:80rpx;background:#f0f0f0;border:4rpx solid #e0e0e0}.avatar-upload.data-v-c609dd4e{flex:1;padding:36rpx;border:4rpx dashed #FFA500;border-radius:20rpx;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16rpx;min-height:120rpx}.upload-icon.data-v-c609dd4e{font-size:56rpx}.upload-text.data-v-c609dd4e{font-size:34rpx;color:orange;font-weight:500}.sex-group.data-v-c609dd4e{display:flex;gap:28rpx}.sex-btn.data-v-c609dd4e{flex:1;padding:32rpx;border:4rpx solid #e0e0e0;border-radius:16rpx;text-align:center;font-size:38rpx;line-height:1.5;color:#555;background:#fff;transition:all .3s;display:flex;align-items:center;justify-content:center;min-height:96rpx}.sex-btn.active.data-v-c609dd4e{border-color:orange;background:#fff7e6;color:orange;font-weight:700}.button-group.data-v-c609dd4e{display:flex;gap:28rpx;margin-top:56rpx;margin-bottom:56rpx}.btn.data-v-c609dd4e{flex:1;padding:36rpx;border-radius:20rpx;font-size:40rpx;font-weight:700;border:none;cursor:pointer;transition:all .3s;min-height:100rpx}.btn.data-v-c609dd4e:active{transform:scale(.98)}.btn.data-v-c609dd4e:disabled{opacity:.6;cursor:not-allowed}.btn-cancel.data-v-c609dd4e{background:#f0f0f0;color:#555}.btn-submit.data-v-c609dd4e{background:orange;color:#fff}.btn-submit.data-v-c609dd4e:active:not(:disabled){background:#e69500}
-36
View File
@@ -1,36 +0,0 @@
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": true,
"newFeature": true,
"bigPackageSizeSupport": true
},
"compileType": "miniprogram",
"libVersion": "",
"appid": "wx79b9a0bfbfe7cbcd",
"projectname": "tongji-uniapp",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
@@ -1 +0,0 @@
"use strict";const t=require("../../common/vendor.js");Math||e();const e=()=>"./TongjiIcon.js",a={__name:"CelebrateBurst",props:{show:{type:Boolean,default:!1},title:{type:String,default:""},subtitle:{type:String,default:""}},setup(e){const a=e,o=t.ref([]),s=t.ref(!1),l=["#204E2B","#386641","#AFE2B3","#FBBF24","#727970","#DC2626"];return t.watch(()=>a.show,t=>{t?(o.value=function(){const t=[];for(let e=0;e<18;e++){const a=8+84*Math.random(),o=.35*Math.random(),s=l[e%l.length],n=10+Math.floor(14*Math.random());t.push({id:`${Date.now()}_${e}`,style:{left:`${a}%`,width:`${n}rpx`,height:`${n}rpx`,background:s,animationDelay:`${o}s`}})}return t}(),s.value=!1,setTimeout(()=>{s.value=!0},30)):(o.value=[],s.value=!1)}),(a,l)=>t.e({a:e.show},e.show?t.e({b:t.f(o.value,(e,a,o)=>({a:e.id,b:t.s(e.style)})),c:e.title},e.title?t.e({d:t.p({name:"sparkles",size:"lg",color:"#204E2B"}),e:t.t(e.title),f:e.subtitle},e.subtitle?{g:t.t(e.subtitle)}:{},{h:s.value?1:""}):{},{i:t.o(()=>{})}):{})}},o=t._export_sfc(a,[["__scopeId","data-v-333a1623"]]);wx.createComponent(o);
@@ -1,6 +0,0 @@
{
"component": true,
"usingComponents": {
"tongji-icon": "./TongjiIcon"
}
}
@@ -1 +0,0 @@
<view wx:if="{{a}}" class="celebrate-root data-v-333a1623" catchtouchmove="{{i}}"><view wx:for="{{b}}" wx:for-item="p" wx:key="a" class="celebrate-particle data-v-333a1623" style="{{p.b}}"/><view wx:if="{{c}}" class="{{['celebrate-card', 'data-v-333a1623', h && 'pop']}}"><view class="celebrate-card-glow data-v-333a1623"/><tongji-icon wx:if="{{d}}" class="data-v-333a1623" u-i="333a1623-0" bind:__l="__l" u-p="{{d}}"/><text class="celebrate-card-title data-v-333a1623">{{e}}</text><text wx:if="{{f}}" class="celebrate-card-sub data-v-333a1623">{{g}}</text></view></view>
@@ -1 +0,0 @@
.celebrate-root.data-v-333a1623{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;pointer-events:none;overflow:hidden}.celebrate-particle.data-v-333a1623{position:absolute;top:-20rpx;border-radius:4rpx;opacity:.9;animation:celebrate-fall-333a1623 1.6s ease-in forwards}@keyframes celebrate-fall-333a1623{0%{transform:translateY(0) rotate(0) scale(1);opacity:1}to{transform:translateY(110vh) rotate(540deg) scale(.4);opacity:0}}.celebrate-card.data-v-333a1623{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%) scale(.82);width:78%;max-width:560rpx;padding:36rpx 32rpx 32rpx;background:rgba(255,255,255,.96);border-radius:28rpx;box-shadow:0 20rpx 60rpx rgba(8,145,178,.22);border:2rpx solid rgba(8,145,178,.12);display:flex;flex-direction:column;align-items:center;text-align:center;opacity:0;transition:transform .35s cubic-bezier(.34,1.56,.64,1),opacity .25s ease}.celebrate-card.pop.data-v-333a1623{opacity:1;transform:translate(-50%,-50%) scale(1)}.celebrate-card-glow.data-v-333a1623{position:absolute;top:-20rpx;right:-20rpx;bottom:-20rpx;left:-20rpx;border-radius:36rpx;background:radial-gradient(circle,rgba(34,211,238,.2),transparent 70%);pointer-events:none}.celebrate-card-title.data-v-333a1623{position:relative;z-index:1;margin-top:16rpx;font-size:36rpx;font-weight:800;color:#1b1c1a}.celebrate-card-sub.data-v-333a1623{position:relative;z-index:1;margin-top:10rpx;font-size:26rpx;color:#475569;line-height:1.45}
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),l={__name:"SugarTreeGraphic",props:{level:{type:Number,default:0},size:{type:String,default:"md"},watering:{type:Boolean,default:!1}},setup(l){const t=e.TREE_MAX_LEVEL,c=e.ref(!0),a=l,r=e.computed(()=>Math.min(t,Math.max(0,Number(a.level)||0))),i=e.computed(()=>{const e=r.value;return e<=0?0:e<=2?1:e<=4?2:e<=6?3:e<=8?4:5}),n=e.computed(()=>(e.TREE_LEVELS[r.value]||e.TREE_LEVELS[0]).emoji);const o=e.computed(()=>e.svgToDataUrl(function(e){const l='\n <ellipse cx="24" cy="50" rx="15" ry="3" fill="#204e2b" opacity="0.12"/>\n <path d="M11 46h26c1.2 0 2 1 2 2.2v3.8c0 1-.8 1.8-1.8 1.8H10.8c-1 0-1.8-.8-1.8-1.8v-3.8c0-1.2.8-2.2 2-2.2z" fill="#E7E5E4"/>\n <path d="M12.5 46h23c.8 0 1.5.7 1.5 1.5v2.2c0 .6-.5 1.1-1.1 1.1H12.1c-.6 0-1.1-.5-1.1-1.1v-2.2c0-.8.7-1.5 1.5-1.5z" fill="#D6D3D1"/>\n <ellipse cx="24" cy="46.5" rx="9" ry="1.6" fill="#A8A29E" opacity="0.35"/>\n ',t='<ellipse cx="24" cy="44.5" rx="8" ry="2.2" fill="#386641" opacity="0.18"/>';if(e<=0)return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 56" fill="none">\n ${l}${t}\n <circle cx="24" cy="41.5" r="2.2" fill="#a8a29e" opacity="0.7"/>\n <path d="M24 41.5v3.5" stroke="#78716c" stroke-width="1" stroke-linecap="round"/>\n </svg>`;const c=e>=6?16:e>=3?14:10,a=46-c,r=`<rect x="22.2" y="${a}" width="3.6" height="${c}" rx="1.8" fill="#78716C"/>\n <rect x="22.6" y="${a+1}" width="2.8" height="${c-1}" rx="1.4" fill="#A8A29E" opacity="0.35"/>`,i=(e,l,t,c,a=1)=>`<circle cx="${e}" cy="${l}" r="${t}" fill="${c}" opacity="${a}"/>\n <circle cx="${e-.25*t}" cy="${l-.2*t}" r="${.35*t}" fill="#eef6ef" opacity="0.55"/>`,n=e>=7?i(17,18,3,"#fda4af",.95)+i(31,17,2.8,"#f9a8d4",.9)+i(24,13,3.2,"#fb7185",.95)+'<circle cx="24" cy="12" r="1.3" fill="#fef3c7"/>':"",o=e>=9?i(12,22,6,"#34d399",.9)+i(36,22,6,"#34d399",.9)+i(24,10,7,"#386641",.95)+n:n;let u="";return u=1===e?i(24,38,4,"#afe2b3")+'<path d="M24 38v-5" stroke="#386641" stroke-width="1.2" stroke-linecap="round"/>':2===e?i(24,32,5.5,"#34d399")+i(20,34,3.5,"#6ee7b7",.9):e<=4?i(24,28,7,"#34d399")+i(17,30,5,"#6ee7b7",.9)+i(31,30,5,"#6ee7b7",.9):e<=6?i(24,24,9,"#22c55e")+i(14,26,7,"#4ade80",.92)+i(34,26,7,"#4ade80",.92)+i(24,16,6,"#386641",.88):i(24,20,10,"#204e2b")+i(13,24,8,"#34d399",.95)+i(35,24,8,"#34d399",.95)+o,`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 56" fill="none">${l}${t}${r}${u}</svg>`}(r.value)));return(a,u)=>e.e({a:r.value>=7},(r.value,{}),{b:!c.value},c.value?{e:e.t(n.value)}:{c:o.value,d:e.o(e=>c.value=!0)},{f:r.value>=7},(r.value,{}),{g:r.value>=8},(r.value,{}),{h:r.value>=e.unref(t)},(r.value,e.unref(t),{}),{i:e.n(`lv-${r.value}`),j:e.n(`tier-${i.value}`),k:e.n(`size-${l.size}`),l:e.n({watering:l.watering,"is-max":r.value>=e.unref(t)})})}},t=e._export_sfc(l,[["__scopeId","data-v-86839929"]]);wx.createComponent(t);
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="{{['sugar-tree-graphic', 'data-v-86839929', i, j, k, l]}}"><view class="stg-glow data-v-86839929"/><view wx:if="{{a}}" class="stg-aura data-v-86839929"/><image wx:if="{{b}}" class="stg-image data-v-86839929" src="{{c}}" mode="aspectFit" binderror="{{d}}"/><text wx:else class="stg-emoji data-v-86839929">{{e}}</text><view wx:if="{{f}}" class="stg-sparkle stg-sparkle-a data-v-86839929"/><view wx:if="{{g}}" class="stg-sparkle stg-sparkle-b data-v-86839929"/><view wx:if="{{h}}" class="stg-sparkle stg-sparkle-c data-v-86839929"/></view>
@@ -1 +0,0 @@
.sugar-tree-graphic.data-v-86839929{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.size-sm.data-v-86839929{width:64rpx;height:72rpx}.size-md.data-v-86839929{width:80rpx;height:88rpx}.size-lg.data-v-86839929{width:112rpx;height:124rpx}.stg-glow.data-v-86839929{position:absolute;top:6%;right:6%;bottom:6%;left:6%;border-radius:50%;background:radial-gradient(circle,rgba(32,78,43,.22) 0%,transparent 68%);pointer-events:none}.lv-0 .stg-glow.data-v-86839929{background:radial-gradient(circle,rgba(148,163,184,.25) 0%,transparent 70%)}.tier-4 .stg-glow.data-v-86839929,.tier-5 .stg-glow.data-v-86839929,.is-max .stg-glow.data-v-86839929{background:radial-gradient(circle,rgba(251,191,36,.3) 0%,rgba(32,78,43,.15) 55%,transparent 72%)}.stg-aura.data-v-86839929{position:absolute;top:-8%;right:-8%;bottom:-8%;left:-8%;border-radius:50%;border:2rpx solid rgba(253,224,71,.35);animation:stg-aura-pulse-86839929 2.4s ease-in-out infinite;pointer-events:none}@keyframes stg-aura-pulse-86839929{0%,to{transform:scale(.92);opacity:.5}50%{transform:scale(1.05);opacity:1}}.stg-image.data-v-86839929{position:relative;z-index:1;width:100%;height:100%;transition:transform .35s ease}.sugar-tree-graphic.watering .stg-image.data-v-86839929,.sugar-tree-graphic.watering .stg-emoji.data-v-86839929{animation:stg-water-bounce-86839929 .65s ease}.stg-emoji.data-v-86839929{position:relative;z-index:1;line-height:1;font-size:72rpx}.size-sm .stg-emoji.data-v-86839929{font-size:48rpx}.size-md .stg-emoji.data-v-86839929{font-size:60rpx}.size-lg .stg-emoji.data-v-86839929{font-size:88rpx}@keyframes stg-water-bounce-86839929{0%,to{transform:scale(1)}35%{transform:scale(1.1) translateY(-6rpx)}60%{transform:scale(.96) translateY(2rpx)}}.stg-sparkle.data-v-86839929{position:absolute;z-index:2;width:8rpx;height:8rpx;border-radius:50%;background:#fde68a;box-shadow:0 0 6rpx rgba(253,224,71,.8);pointer-events:none;animation:stg-sparkle-twinkle-86839929 1.8s ease-in-out infinite}.stg-sparkle-a.data-v-86839929{top:4%;right:16%}.stg-sparkle-b.data-v-86839929{top:12%;left:10%;width:6rpx;height:6rpx;animation-delay:.4s}.stg-sparkle-c.data-v-86839929{top:22%;right:28%;width:10rpx;height:10rpx;animation-delay:.8s}@keyframes stg-sparkle-twinkle-86839929{0%,to{opacity:.4;transform:scale(.8)}50%{opacity:1;transform:scale(1.2)}}
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="{{['tj-icon-wrap', 'data-v-d92a1022', f]}}"><image wx:if="{{a}}" class="{{['tj-icon', 'data-v-d92a1022', b, c]}}" src="{{d}}" mode="aspectFit" binderror="{{e}}"/></view>
@@ -1 +0,0 @@
.tj-icon-wrap.data-v-d92a1022{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tj-icon-wrap--sm.data-v-d92a1022{width:32rpx;height:32rpx}.tj-icon-wrap--md.data-v-d92a1022{width:40rpx;height:40rpx}.tj-icon-wrap--lg.data-v-d92a1022{width:48rpx;height:48rpx}.tj-icon-wrap--xl.data-v-d92a1022{width:56rpx;height:56rpx}.tj-icon.data-v-d92a1022{display:block;width:100%;height:100%}.tj-icon--send.data-v-d92a1022{transform:translate(-10%,10%)}.tj-icon-fallback.data-v-d92a1022{display:block;line-height:1;font-weight:700;text-align:center}.tj-icon-fallback--sm.data-v-d92a1022{font-size:24rpx}.tj-icon-fallback--md.data-v-d92a1022{font-size:30rpx}.tj-icon-fallback--lg.data-v-d92a1022{font-size:36rpx}.tj-icon-fallback--xl.data-v-d92a1022{font-size:42rpx}
@@ -1 +0,0 @@
"use strict";const e=require("../../common/vendor.js"),t={__name:"VoiceSpeakMascot",props:{active:{type:Boolean,default:!1},onDark:{type:Boolean,default:!1},size:{type:String,default:"md"}},setup:t=>(a,o)=>e.e({a:t.active},(t.active,{}),{b:e.n(`vsm--${t.size}`),c:e.n({"vsm--active":t.active,"vsm--on-dark":t.onDark})})},a=e._export_sfc(t,[["__scopeId","data-v-c347644e"]]);wx.createComponent(a);
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="{{['vsm', 'data-v-c347644e', b, c]}}"><view class="vsm-body data-v-c347644e"><view class="vsm-leaf data-v-c347644e" aria-hidden="true"/><view class="vsm-face data-v-c347644e"><view class="vsm-eye vsm-eye--l data-v-c347644e"/><view class="vsm-eye vsm-eye--r data-v-c347644e"/><view class="vsm-blush vsm-blush--l data-v-c347644e"/><view class="vsm-blush vsm-blush--r data-v-c347644e"/><view class="vsm-mouth data-v-c347644e"/></view><view wx:if="{{a}}" class="vsm-waves data-v-c347644e" aria-hidden="true"><view class="vsm-wave vsm-wave--1 data-v-c347644e"/><view class="vsm-wave vsm-wave--2 data-v-c347644e"/><view class="vsm-wave vsm-wave--3 data-v-c347644e"/></view></view></view>
@@ -1 +0,0 @@
.vsm.data-v-c347644e{display:flex;align-items:center;justify-content:center;flex-shrink:0}.vsm--md.data-v-c347644e{width:72rpx;height:72rpx}.vsm--sm.data-v-c347644e{width:64rpx;height:64rpx}.vsm-body.data-v-c347644e{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.vsm-leaf.data-v-c347644e{position:absolute;top:2rpx;left:50%;width:16rpx;height:16rpx;margin-left:-8rpx;border-radius:0 100%;background:#34d399;transform:rotate(-18deg);z-index:2}.vsm--on-dark .vsm-leaf.data-v-c347644e{background:#a7f3d0}.vsm-face.data-v-c347644e{position:relative;width:52rpx;height:52rpx;border-radius:50%;background:#fef9c3;border:3rpx solid #047857;box-shadow:0 4rpx 10rpx rgba(4,120,87,.18);z-index:1}.vsm--sm .vsm-face.data-v-c347644e{width:46rpx;height:46rpx}.vsm--on-dark .vsm-face.data-v-c347644e{background:#fffbeb;border-color:rgba(255,255,255,.85);box-shadow:0 4rpx 12rpx rgba(0,0,0,.12)}.vsm-eye.data-v-c347644e{position:absolute;top:16rpx;width:6rpx;height:8rpx;border-radius:50%;background:#064e3b}.vsm--sm .vsm-eye.data-v-c347644e{top:14rpx;width:5rpx;height:7rpx}.vsm--on-dark .vsm-eye.data-v-c347644e{background:#134e4a}.vsm-eye--l.data-v-c347644e{left:12rpx}.vsm-eye--r.data-v-c347644e{right:12rpx}.vsm--sm .vsm-eye--l.data-v-c347644e{left:10rpx}.vsm--sm .vsm-eye--r.data-v-c347644e{right:10rpx}.vsm-blush.data-v-c347644e{position:absolute;top:24rpx;width:10rpx;height:6rpx;border-radius:50%;background:rgba(251,113,133,.45);opacity:.85}.vsm--sm .vsm-blush.data-v-c347644e{top:21rpx;width:8rpx;height:5rpx}.vsm-blush--l.data-v-c347644e{left:6rpx}.vsm-blush--r.data-v-c347644e{right:6rpx}.vsm--on-dark .vsm-blush.data-v-c347644e{background:rgba(255,255,255,.35)}.vsm-mouth.data-v-c347644e{position:absolute;left:50%;bottom:10rpx;width:18rpx;height:8rpx;margin-left:-9rpx;border-radius:0 0 18rpx 18rpx;background:#047857;transform-origin:center top}.vsm--sm .vsm-mouth.data-v-c347644e{bottom:9rpx;width:16rpx;height:7rpx;margin-left:-8rpx}.vsm--on-dark .vsm-mouth.data-v-c347644e{background:#ecfdf5}.vsm-waves.data-v-c347644e{position:absolute;right:-2rpx;top:50%;display:flex;align-items:flex-end;gap:4rpx;height:28rpx;margin-top:-14rpx;z-index:0}.vsm-wave.data-v-c347644e{width:5rpx;border-radius:4rpx;background:#047857;animation:vsm-wave-jump-c347644e .72s ease-in-out infinite}.vsm--on-dark .vsm-wave.data-v-c347644e{background:rgba(255,255,255,.9)}.vsm-wave--1.data-v-c347644e{height:10rpx;animation-delay:0s}.vsm-wave--2.data-v-c347644e{height:18rpx;animation-delay:.12s}.vsm-wave--3.data-v-c347644e{height:12rpx;animation-delay:.24s}.vsm--active .vsm-body.data-v-c347644e{animation:vsm-bob-c347644e .9s ease-in-out infinite}.vsm--active .vsm-mouth.data-v-c347644e{animation:vsm-talk-c347644e .32s ease-in-out infinite alternate}.vsm--active .vsm-eye.data-v-c347644e{animation:vsm-blink-c347644e 2.4s ease-in-out infinite}@keyframes vsm-bob-c347644e{0%,to{transform:translateY(0)}50%{transform:translateY(-4rpx)}}@keyframes vsm-talk-c347644e{0%{transform:scaleY(.45);border-radius:0 0 18rpx 18rpx}to{transform:scaleY(1.15);height:12rpx;border-radius:50%}}@keyframes vsm-blink-c347644e{0%,42%,46%,to{transform:scaleY(1)}44%{transform:scaleY(.15)}}@keyframes vsm-wave-jump-c347644e{0%,to{transform:scaleY(.45);opacity:.55}50%{transform:scaleY(1);opacity:1}}
File diff suppressed because one or more lines are too long
@@ -1,11 +0,0 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "识糖小课堂",
"backgroundColor": "#eefbf4",
"disableScroll": false,
"enableShareAppMessage": true,
"enableShareTimeline": true,
"usingComponents": {
"tongji-icon": "../components/TongjiIcon"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,17 +0,0 @@
{
"navigationBarTitleText": "血糖记录",
"navigationBarBackgroundColor": "#204e2b",
"navigationBarTextStyle": "white",
"backgroundColor": "#faf9f5",
"enablePullDownRefresh": true,
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
},
"usingComponents": {
"sugar-tree-graphic": "../components/SugarTreeGraphic",
"tongji-icon": "../components/TongjiIcon"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "日常护理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
},
"usingComponents": {
"sugar-tree-graphic": "../components/SugarTreeGraphic",
"tongji-icon": "../components/TongjiIcon",
"celebrate-burst": "../components/CelebrateBurst",
"voice-speak-mascot": "../components/VoiceSpeakMascot"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,17 +0,0 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "血糖管理",
"backgroundColor": "#f4fbf4",
"enablePullDownRefresh": true,
"usingPlugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
},
"usingComponents": {
"tongji-icon": "../components/TongjiIcon",
"tab-bar-dock": "../../components/app-tab-bar/tab-bar-dock",
"dev-training-entry": "../../components/dev-training-entry/index"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="crush-canvas-container data-v-ecab95cd"><canvas type="2d" id="crush" class="crush-canvas data-v-ecab95cd"></canvas></view>
@@ -1 +0,0 @@
.crush-canvas-container.data-v-ecab95cd{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:10}.crush-canvas.data-v-ecab95cd{display:block;width:100%;height:100%;background:transparent}
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}
@@ -1 +0,0 @@
<view class="walker-canvas-container data-v-06b6a3c2"><block wx:if="{{r0}}"><canvas canvas-id="walker" id="walker" class="walker-canvas data-v-06b6a3c2" style="{{'width:' + a + ';' + ('height:' + b)}}" bindtouchstart="{{c}}" bindtouchmove="{{d}}" bindtouchend="{{e}}" bindtouchcancel="{{f}}"></canvas></block></view>
@@ -1 +0,0 @@
.walker-canvas-container.data-v-06b6a3c2{width:100%;height:100%;position:absolute;top:0;left:0;right:0;bottom:0}.walker-canvas.data-v-06b6a3c2{display:block;width:100%;height:100%;background:transparent}
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
{
"navigationBarTitleText": "哑铃训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc",
"usingComponents": {}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
{
"navigationBarTitleText": "脚蹬器训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc",
"usingComponents": {}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
{
"navigationBarTitleText": "握力环训练",
"navigationBarBackgroundColor": "#f8fafc",
"navigationBarTextStyle": "black",
"backgroundColor": "#f8fafc",
"usingComponents": {
"crush-canvas": "./components/crush-canvas"
}
}
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More