1111
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Button as VanButton, showToast } from 'vant'
|
||||
import AppTabBar from '../components/AppTabBar.vue'
|
||||
import { clearTokens } from '../services/auth'
|
||||
import {
|
||||
healthApi,
|
||||
@@ -278,6 +279,61 @@ onMounted(load)
|
||||
<section v-if="loading" class="section-card loading-card">正在读取今日健康方案…</section>
|
||||
|
||||
<template v-else>
|
||||
<!-- 未完成评估提示横幅 -->
|
||||
<section v-if="!dashboard?.hasCompletedAssessment" class="assessment-guide-banner" @click="router.push('/assessment')">
|
||||
<div class="guide-badge">重要提醒</div>
|
||||
<div class="guide-body">
|
||||
<div class="guide-text">
|
||||
<h3>先填写个人基本信息与身体评估</h3>
|
||||
<p>尚未进行身体及睡眠质量、运动情况、饮食情况三大维度评估。完成评估后将为您专属定制全套智能家居启动参数!</p>
|
||||
</div>
|
||||
<button class="guide-btn" type="button">去评估 ></button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 个性化智能家居启动参数概览 (已完成评估) -->
|
||||
<section v-else class="section-card personalized-startup-card">
|
||||
<div class="section-title">
|
||||
<span>专属舒睡启动参数</span>
|
||||
<span class="customized-tag">根据身体评估专属定制</span>
|
||||
</div>
|
||||
<p class="startup-card-desc">依据您的冷热偏好、入睡状态与骨骼肌肉承托需求,智能中枢已计算出全套设备预设:</p>
|
||||
|
||||
<div class="startup-params-tags">
|
||||
<div class="startup-param-badge">
|
||||
<span class="lbl">恒湿目标</span>
|
||||
<strong>{{ dashboard?.sceneConfig?.targetHumidity || 55 }}% · {{ dashboard?.sceneConfig?.fanLevel || '1挡' }}</strong>
|
||||
</div>
|
||||
<div class="startup-param-badge">
|
||||
<span class="lbl">助眠灯光</span>
|
||||
<strong>{{ dashboard?.sceneConfig?.lightBrightnessPercent || 20 }}% · {{ dashboard?.sceneConfig?.lightColorTemperatureKelvin || 2700 }}K</strong>
|
||||
</div>
|
||||
<div class="startup-param-badge">
|
||||
<span class="lbl">助眠音箱</span>
|
||||
<strong>{{ dashboard?.sceneConfig?.enableSpeakerSleepMode ? '开启睡眠模式' : '关闭睡眠模式' }} · {{ dashboard?.sceneConfig?.speakerVolumePercent || 15 }}%</strong>
|
||||
</div>
|
||||
<div class="startup-param-badge">
|
||||
<span class="lbl">8H 床垫</span>
|
||||
<strong>左右加热 {{ dashboard?.sceneConfig?.mattressHeatingLevel ?? 1 }} 档 · {{ dashboard?.sceneConfig?.mattressMode || '智能适配' }}</strong>
|
||||
</div>
|
||||
<div class="startup-param-badge" v-if="dashboard?.sceneConfig?.enableUv">
|
||||
<span class="lbl">除湿消杀</span>
|
||||
<strong style="color: #7b42b5;">UV 深度消杀已开启</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-entry-bar" @click="router.push('/device-control')">
|
||||
<div class="entry-left">
|
||||
<span class="icon">⚙️</span>
|
||||
<div>
|
||||
<strong>进入设备详情与独立参数调节</strong>
|
||||
<small>显示每个设备在线状态,可单独开关与精细滑块调节</small>
|
||||
</div>
|
||||
</div>
|
||||
<span class="arrow">></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="hero-card">
|
||||
<p class="eyebrow">今日健康建议</p>
|
||||
<h2>{{ dashboard?.currentPlan?.title || '尚未生成健康方案' }}</h2>
|
||||
@@ -633,10 +689,24 @@ onMounted(load)
|
||||
<div v-else style="padding: 16px; text-align: center; color: #82908c; font-size: 12px;">
|
||||
暂无已发现的设备
|
||||
</div>
|
||||
|
||||
<div class="all-control-banner" @click="router.push('/device-control')">
|
||||
<div class="ac-text">
|
||||
<span class="ac-icon">🎛️</span>
|
||||
<div>
|
||||
<strong>查看全部 {{ totalDeviceCount }} 台设备状态与独立参数控制</strong>
|
||||
<small>支持湿度、色温、左右加热档位与承托模式单独调节</small>
|
||||
</div>
|
||||
</div>
|
||||
<span class="ac-arrow">></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<p class="medical-note">健康建议仅用于日常管理演示,不构成医疗诊断或治疗意见。</p>
|
||||
</template>
|
||||
|
||||
<!-- 固定底部导航栏 -->
|
||||
<AppTabBar />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user