| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871 |
- <template>
- <view class="body-container">
- <!-- Tabbar 切换过渡页 -->
- <tab-transition v-if="showTabTransition" dimCode="body" />
- <!-- 品牌头部 -->
- <PageBanner theme="body"
- tagline="科学管理全家健康"
- quote="身体健康是幸福的基础" />
- <!-- 家庭成员选择条 -->
- <FamilyMemberStrip
- v-if="isLoggedIn"
- :members="familyMembersVisible"
- :selectedMemberId="selectedMemberId"
- @select="onFamilyMemberSelect" />
- <!-- 游客专属区块 -->
- <template v-if="!isLoggedIn">
- <LoginGuideCard
- title="登录后查看全家健康数据"
- :items="[
- '查看全家身体能量数据和健康报告',
- '记录每日健康打卡,获取身体能量',
- '查看专属健康商品和活动价格'
- ]" />
- <HealthTips dimension="body" />
- </template>
- <!-- 登录后:五维能量条 -->
- <FamilyEnergyBar
- v-if="isLoggedIn"
- dimensionCode="body"
- :sandboxData="sandboxData"
- :dualDimension="dualDimension" />
- <!-- 关系图谱(登录后可见) -->
- <FamilyRelationGraph
- v-if="isLoggedIn && familyMembersVisible.length > 0"
- dimensionCode="body"
- :selfId="activeChildId"
- :members="familyMembersVisible"
- :energyMap="energyMapForGraph"
- :intimacyMap="intimacyMapForGraph"
- @memberTap="goMemberDetail" />
- <!-- 健康打卡卡片 -->
- <HealthCheckinCard
- v-if="isLoggedIn && activeChildId"
- :childId="activeChildId" />
- <!-- 家庭挑战任务 -->
- <view class="section challenge-section" v-if="isLoggedIn && activeChallenges.length > 0">
- <view class="section-header">
- <text class="section-title">🔥 家庭挑战</text>
- </view>
- <FamilyChallengeCard
- v-for="ch in activeChallenges"
- :key="ch.id"
- :challenge="ch" />
- </view>
- <!-- 雷达图 -->
- <view class="section" v-if="dimensionData">
- <view class="section-header" v-if="dimensionData.isAverage">
- <text class="section-title">七维健康图</text>
- <text class="avg-badge">同龄同性平均值 · 上传报告后显示个人数据</text>
- </view>
- <view class="section-header" v-else>
- <text class="section-title">七维健康图</text>
- </view>
- <RadarChart
- v-if="radarDimensions && radarDimensions.length >= 3"
- :dimensions="radarDimensions"
- :scores="radarScores"
- :avg-scores="radarAvgScores"
- fillColor="#FF8C42"
- gridColor="#FED7AA"
- labelColor="#9A3412"
- :width="580"
- :height="580"
- @dimensionClick="goDimensionDetail" />
- </view>
- <!-- 七维健康全景(嵌入卡片) -->
- <HealthDimensionsSection
- v-if="isLoggedIn && dimensionData"
- :healthData="dimensionData"
- :activeChildId="activeChildId" />
- <!-- 功能入口 -->
- <view class="func-section" v-if="sectionVisible('func_entries')">
- <view class="func-grid">
- <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
- <view class="func-icon-wrap">
- <text class="func-icon">{{ item.icon }}</text>
- </view>
- <text class="func-label">{{ item.label }}</text>
- </view>
- </view>
- </view>
- <!-- ===== 精准营养(上传报告+产品+文章) ===== -->
- <view class="section nutrition-section" v-if="isLoggedIn">
- <view class="section-header">
- <text class="section-title">🥗 精准营养</text>
- </view>
- <!-- 上传报告入口 -->
- <view class="nutrition-report-card" @click="goToUploadReport">
- <view class="nutrition-report-left">
- <text class="nutrition-icon-large">📋</text>
- </view>
- <view class="nutrition-report-right">
- <text class="nutrition-title">上传健康报告</text>
- <text class="nutrition-desc">上传体检报告或肠道检测报告,AI智能解读分析,获取个性化营养方案</text>
- <view class="nutrition-report-tags">
- <text class="tag">体检报告</text>
- <text class="tag">肠道检测</text>
- <text class="tag">AI解读</text>
- </view>
- </view>
- <text class="nutrition-arrow">›</text>
- </view>
- </view>
- <!-- 维度任务 -->
- <DimensionTasks
- v-if="isLoggedIn"
- dimensionCode="body"
- :tasks="dimensionTasks"
- @taskClick="onTaskClick"
- @moreTasks="goTasks" />
- <!-- 维度活动 -->
- <DimensionActivities
- dimensionCode="body"
- :activities="dimensionActivities"
- :isLoggedIn="isLoggedIn"
- @activityClick="goActivityDetail"
- @moreActivities="goMoreActivities" />
- <!-- 商品推荐 -->
- <DimensionProductList
- v-if="isLoggedIn"
- dimensionCode="body"
- :familyId="activeChildId"
- title="为你推荐" />
- <!-- 推荐阅读 -->
- <DimensionArticles
- dimensionCode="body"
- :articles="bodyArticles"
- :isLoggedIn="isLoggedIn"
- @articleClick="goArticleDetail"
- @moreArticles="goMoreArticles" />
-
- <!-- 底部占位 -->
- <view class="bottom-spacer"></view>
- <AIFloatingAvatar />
- </view>
- </template>
- <script>
- import TabTransition from '../../components/tab-transition.vue'
- import PageBanner from '../../components/PageBanner.vue'
- import LoginGuideCard from '../../components/LoginGuideCard.vue'
- import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
- import DimensionTasks from '../../components/DimensionTasks.vue'
- import DimensionActivities from '../../components/DimensionActivities.vue'
- import DimensionProducts from '../../components/DimensionProducts.vue'
- import DimensionProductList from '../../components/DimensionProductList.vue'
- import DimensionArticles from '../../components/DimensionArticles.vue'
- import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
- import RadarChart from '../../components/RadarChart.vue'
- import HealthDimensionsSection from '../../components/HealthDimensionsSection.vue'
- import HealthCheckinCard from '../../components/HealthCheckinCard.vue'
- import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
- import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
- import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
- import { getVisibleSections, getEnergyOverview, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getVisibleFamilyMembers, getDimensionOverview, getFeaturedArticles, getChallengeList } from '../../utils/api.js'
- export default {
- components: { TabTransition, PageBanner, LoginGuideCard, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, DimensionProductList, DimensionArticles, FamilyRelationGraph, RadarChart, HealthDimensionsSection, HealthCheckinCard, AIFloatingAvatar, FamilyMemberStrip, FamilyChallengeCard },
- data() {
- return {
- isLoggedIn: false,
- role: null,
- showTabTransition: true,
- activeChildId: null,
- selectedMemberId: null,
- activeChildName: '',
- userName: '',
- children: [],
- familyMembersVisible: [],
- sandboxData: null,
- dualDimension: null,
- visibleSections: [],
- dimensionTasks: [],
- dimensionActivities: [],
- dimensionProducts: [],
- bodyArticles: [],
- dimensionData: null,
- activeChallenges: [],
- /** Mock 平均值(7维):生长发育/睡眠质量/视力健康/免疫力/营养均衡/肠胃健康/运动活力 */
- radarAvgScores: [72, 68, 75, 70, 73, 69, 71],
- funcList: [
- { icon: '\u{1F3C3}', label: '运动', needLogin: true, page: '/pages/body/exercise-record' },
- { icon: '\u{1F957}', label: '饮食', needLogin: true, page: '/pages/body/meal-record' },
- { icon: '\u{1F634}', label: '作息', needLogin: true, page: '/pages/body/sleep-record' },
- { icon: '\u{1F9D8}', label: '冥想', needLogin: true, page: '/pages/health/meditation-index' },
- { icon: '\u{1F4CA}', label: '舌诊', needLogin: true, page: '/pages/health/report-upload?reportType=tongue' },
- { icon: '\u{1F3E5}', label: '健康管家', needLogin: true, page: '/pages/ai/chat?mode=butler&fromPage=pages/body/index' },
- { icon: '\u{1F9EC}', label: '健康维度', needLogin: true, page: 'health-dimensions' }
- ]
- }
- },
- computed: {
- energyMapForGraph: function() {
- var map = {}
- if (this.sandboxData && this.sandboxData.members) {
- for (var i = 0; i < this.sandboxData.members.length; i++) {
- var m = this.sandboxData.members[i]
- map[m.memberId || m.id] = {
- bodyScore: m.bodyScore || 0,
- mindScore: m.mindScore || 0,
- actionScore: m.actionScore || 0
- }
- }
- }
- return map
- },
- intimacyMapForGraph: function() {
- return {}
- },
- /** 七维雷达图:维度标签(遵守 AGENTS.md 禁止模板内方法调用,使用 computed 缓存) */
- radarDimensions: function() {
- var dims = this.dimensionData && this.dimensionData.dimensions
- if (!dims) return []
- var result = []
- for (var i = 0; i < dims.length; i++) {
- var d = dims[i]
- if (!d) continue
- result.push({ label: d.label || '', key: d.dimension || '' })
- }
- return result
- },
- /** 七维雷达图:分值(对 null/NaN 做归一化,避免 Canvas 计算 NaN 静默失败) */
- radarScores: function() {
- var dims = this.dimensionData && this.dimensionData.dimensions
- if (!dims) return []
- var result = []
- for (var i = 0; i < dims.length; i++) {
- var d = dims[i]
- if (!d) { result.push(0); continue }
- var s = d.score
- if (typeof s !== 'number' || isNaN(s) || s === null) s = 0
- result.push(s)
- }
- return result
- }
- },
- onShow() {
- this.showTabTransition = true
- var token = uni.getStorageSync('token')
- this.isLoggedIn = !!token
- if (this.isLoggedIn) {
- this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '家长'
- }
- this.loadSectionConfig()
- if (this.isLoggedIn) {
- this.loadChildren()
- this.loadFamilyMembersVisible()
- this.loadChallenges()
- }
- // 游客也能浏览活动和商品
- this.loadDimensionActivities()
- this.loadDimensionProducts()
- // 游客也能浏览文章
- this.loadFeaturedArticles()
- this._watchPageReady()
- },
- methods: {
- loadSectionConfig: function() {
- var baseSections = ['func_entries']
- if (!uni.getStorageSync('token')) {
- this.visibleSections = baseSections
- return
- }
- var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- var self = this
- getVisibleSections({ pageKey: 'body', role: role }).then(function(res) {
- if (res.code === 200 && res.data) {
- var keys = res.data.map(function(s) { return s.sectionKey })
- var merged = baseSections.slice()
- keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
- self.visibleSections = merged
- }
- }).catch(function(e) {
- self.visibleSections = ['func_entries']
- })
- },
- loadChildren: function() {
- var self = this
- getChildren().then(function(res) {
- if (res.code === 200 && res.data) {
- self.children = res.data
- var savedChildId = uni.getStorageSync('currentChildId')
- var found = false
- for (var i = 0; i < self.children.length; i++) {
- if (self.children[i].childId === savedChildId) {
- self.activeChildId = savedChildId
- self.activeChildName = self.children[i].name || self.children[i].nickname || '孩子'
- found = true
- break
- }
- }
- if (!found && self.children.length > 0) {
- self.activeChildId = self.children[0].childId
- self.activeChildName = self.children[0].name || self.children[0].nickname || '孩子'
- uni.setStorageSync('currentChildId', self.activeChildId)
- }
- if (self.activeChildId) {
- self.loadDashboardData()
- }
- }
- }).catch(function(e) {
- console.log('获取孩子列表失败', e)
- })
- },
- loadDashboardData: function() {
- if (!this.activeChildId) return
- this.loadEnergyData()
- this.loadDimensionTasks()
- this.loadDimensionActivities()
- this.loadDimensionProducts()
- this.loadSandboxData()
- this.loadHealthDimensions()
- },
- loadHealthDimensions: function() {
- var memberId = this.activeChildId || (this.userInfo && this.userInfo.userId)
- if (!memberId) {
- console.log('[body] loadHealthDimensions skipped: no memberId')
- return
- }
- var self = this
- getDimensionOverview({ memberId: memberId }).then(function(res) {
- if (res && res.data) {
- self.dimensionData = res.data
- console.log('[body] dimensionData loaded:', res.data.dimensions ? res.data.dimensions.length : 0, 'dimensions')
- } else if (res) {
- console.warn('[body] dimension API error:', res.message || res.code)
- }
- }).catch(function(e) {
- console.error('[body] loadHealthDimensions failed', e)
- })
- },
- loadSandboxData: function() {
- var self = this
- getFamilyEnergySandbox().then(function(res) {
- if (res && res.data) {
- self.sandboxData = res.data
- }
- }).catch(function(e) {
- console.log('获取沙盘数据失败', e)
- })
- },
- loadEnergyData: function() {
- var self = this
- getEnergyOverview(this.activeChildId).then(function(res) {
- if (res && res.data) {
- var dims = res.data.dimensions
- if (dims && dims.length > 0) {
- for (var i = 0; i < dims.length; i++) {
- if (dims[i].code === 'body') {
- self.dualDimension = dims[i]
- break
- }
- }
- }
- }
- }).catch(function(e) {
- console.log('获取能量概览失败', e)
- })
- },
- loadDimensionTasks: function() {
- var self = this
- if (!this.activeChildId) return
- getTodayTasksByCategory(this.activeChildId, 'body').then(function(res) {
- if (res && res.data) {
- self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
- }
- }).catch(function() { self.dimensionTasks = [] })
- },
- loadDimensionActivities: function() {
- var self = this
- getActivityList({ dimensionCode: 'body', page: 1, size: 3 }).then(function(res) {
- if (res && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.dimensionActivities = list.slice(0, 3)
- }
- }).catch(function() { self.dimensionActivities = [] })
- },
- loadDimensionProducts: function() {
- var self = this
- getProductsByDomain('body', 1, 4).then(function(res) {
- if (res && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.dimensionProducts = list.slice(0, 4)
- }
- }).catch(function() { self.dimensionProducts = [] })
- },
- loadFeaturedArticles: function() {
- var self = this
- getFeaturedArticles({ size: 5 }).then(function(res) {
- if (res.code === 200 && res.data) {
- var gradientColors = [
- 'linear-gradient(135deg, #FF8C42, #FFB074)',
- 'linear-gradient(135deg, #FF6B9D, #FF9DBD)',
- 'linear-gradient(135deg, #6366F1, #818CF8)',
- 'linear-gradient(135deg, #10B981, #34D399)',
- 'linear-gradient(135deg, #F59E0B, #FBBF24)'
- ]
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.bodyArticles = list.map(function(item, index) {
- return {
- id: item.id,
- category: item.categoryName || '身体健康',
- categoryColor: gradientColors[index % gradientColors.length],
- title: item.title || '',
- summary: item.summary || '',
- views: item.viewCount ? String(item.viewCount) : '0',
- date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
- }
- })
- }
- }.bind(this)).catch(function() {})
- },
- onFamilyMemberSelect: function(member) {
- this.selectedMemberId = member.id
- },
- onChildChanged: function(child) {
- this.activeChildId = child.childId
- this.activeChildName = child.name || child.nickname || '孩子'
- this.loadDashboardData()
- },
- loadFamilyMembersVisible: function() {
- var self = this
- getVisibleFamilyMembers().then(function(res) {
- self.familyMembersVisible = res.data || []
- }).catch(function(e) {
- console.log('获取可见家庭成员失败', e)
- self.familyMembersVisible = []
- })
- },
- loadChallenges: function() {
- var familyId = uni.getStorageSync('familyId')
- if (!familyId) return
- var self = this
- getChallengeList({ familyId: familyId }).then(function(res) {
- if (res.code === 200 && Array.isArray(res.data)) {
- self.activeChallenges = res.data
- }
- }).catch(function() {
- self.activeChallenges = []
- })
- },
- scrollToSection: function(section) {
- uni.pageScrollTo({ selector: '#' + section, duration: 300 })
- },
- onTaskClick: function(task) {
- uni.navigateTo({ url: '/pages/tasks/tasks' })
- },
- goActivityDetail: function(act) {
- if (!act || !act.id) return
- uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
- },
- goMoreActivities: function() {
- uni.navigateTo({ url: '/pages/activity/index' })
- },
- goProductDetail: function(prod) {
- uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
- },
- goMoreProducts: function() {
- uni.navigateTo({ url: '/pages/shop/index' })
- },
- goArticleDetail: function(article) {
- var id = article.id || article
- uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
- },
- goMoreArticles: function() {
- uni.navigateTo({ url: '/pages/article-center/index?dimension=body' })
- },
- goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
- goMemberDetail: function(member) {
- if (!member || !member.memberId) return
- uni.navigateTo({
- url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&memberType=' + (member.memberType || 'child') + '&entrySource=relation-graph&dimensionCode=body'
- })
- },
- goFamilyMembers: function() {
- uni.navigateTo({ url: '/pages/profile/family-members' })
- },
- sectionVisible: function(key) {
- return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
- },
- onFuncClick: function(item) {
- if (item.needLogin && !this.isLoggedIn) {
- uni.showModal({
- title: '提示',
- content: '请先登录后使用此功能',
- success: function(res) {
- if (res.confirm) uni.navigateTo({ url: '/pages/login/login' })
- }
- })
- return
- }
- if (item.page === 'health-dimensions') {
- if (!this.activeChildId) {
- uni.showToast({ title: '请先选择孩子', icon: 'none' })
- return
- }
- uni.navigateTo({ url: '/pages/body-detail/health-dimensions?childId=' + this.activeChildId })
- return
- }
- if (item.page) uni.navigateTo({ url: item.page })
- },
- goDimensionDetail: function(dimKey) {
- uni.navigateTo({ url: '/pages/body-detail/dimension-detail?dimension=' + dimKey + '&childId=' + this.activeChildId })
- },
- goToCheckin: function() {
- var id = this.activeChildId || uni.getStorageSync('currentChildId')
- if (!id) {
- uni.showToast({ title: '请先选择成员', icon: 'none' })
- return
- }
- uni.navigateTo({ url: '/pages/body-detail/checkin?childId=' + id })
- },
- goToNutritionProfile: function() {
- var id = this.activeChildId || uni.getStorageSync('currentChildId')
- if (!id) {
- uni.showToast({ title: '请先选择成员', icon: 'none' })
- return
- }
- uni.navigateTo({ url: '/pages/health/nutrition-profile?childId=' + id })
- },
- goToUploadReport: function() {
- var id = this.activeChildId || uni.getStorageSync('currentChildId') || ''
- uni.navigateTo({ url: '/pages/health/report-upload?childId=' + id + '&from=body' })
- },
- _watchPageReady() {
- var self = this
- var unwatch = this.$watch(function() {
- if (self.isLoggedIn) {
- return !!(self.dualDimension || self.sandboxData || (self.dimensionTasks && self.dimensionTasks.length > 0))
- }
- return !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
- !!(self.dimensionProducts && self.dimensionProducts.length > 0)
- }, function(val) {
- if (val) {
- if (unwatch) unwatch()
- self.showTabTransition = false
- }
- })
- setTimeout(function() {
- if (unwatch) unwatch()
- self.showTabTransition = false
- }, 5000)
- }
- }
- }
- </script>
- <style scoped>
- .body-container {
- min-height: 100vh;
- background: #f5f7fa;
- padding-bottom: 120rpx;
- }
- /* ===== 功能入口 ===== */
- .func-section {
- margin: 20rpx 30rpx;
- }
- .func-grid {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx 16rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .func-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- flex: 1;
- }
- .func-icon-wrap {
- width: 80rpx;
- height: 80rpx;
- border-radius: 40rpx;
- background: linear-gradient(135deg, #D6EAF8, #EBF2FA);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 10rpx;
- }
- .func-icon {
- font-size: 40rpx;
- }
- .func-label {
- font-size: 22rpx;
- color: #666;
- font-weight: 500;
- }
- /* ===== 通用区块 ===== */
- .section {
- margin: 20rpx 30rpx;
- }
- .section-header {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 16rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .avg-badge {
- font-size: 20rpx;
- color: #F97316;
- background: #FFF7ED;
- padding: 4rpx 12rpx;
- border-radius: 20rpx;
- margin-left: 12rpx;
- }
- /* ===== 快捷操作 ===== */
- .quick-actions {
- display: flex;
- flex-direction: row;
- margin-top: 30rpx;
- }
- .action-btn {
- flex: 1;
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-right: 20rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .action-btn:last-child {
- margin-right: 0;
- }
- .action-icon {
- font-size: 48rpx;
- margin-bottom: 8rpx;
- }
- .action-text {
- font-size: 26rpx;
- color: #666;
- }
- /* ===== 底部 ===== */
- .bottom-spacer {
- height: 120rpx;
- }
- .func-item:active, .action-btn:active {
- opacity: 0.7;
- }
- /* ===== 精准营养 ===== */
- .nutrition-section {
- margin-top: 20rpx;
- }
- .nutrition-report-card {
- display: flex;
- flex-direction: row;
- align-items: center;
- background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
- border-radius: 20rpx;
- padding: 28rpx 24rpx;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .nutrition-report-left {
- width: 100rpx;
- height: 100rpx;
- background: rgba(255,255,255,0.7);
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 20rpx;
- flex-shrink: 0;
- }
- .nutrition-icon-large {
- font-size: 52rpx;
- }
- .nutrition-report-right {
- flex: 1;
- }
- .nutrition-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #2E7D32;
- display: block;
- margin-bottom: 6rpx;
- }
- .nutrition-desc {
- font-size: 22rpx;
- color: #558B2F;
- line-height: 1.5;
- display: block;
- margin-bottom: 10rpx;
- }
- .nutrition-report-tags {
- display: flex;
- flex-direction: row;
- gap: 10rpx;
- }
- .nutrition-report-tags .tag {
- font-size: 20rpx;
- color: #33691E;
- background: rgba(255,255,255,0.6);
- padding: 4rpx 14rpx;
- border-radius: 20rpx;
- }
- .nutrition-arrow {
- font-size: 40rpx;
- color: #A5D6A7;
- margin-left: 12rpx;
- }
- .nutrition-links {
- margin-bottom: 20rpx;
- }
- .links-label {
- font-size: 26rpx;
- font-weight: bold;
- color: #333;
- display: block;
- margin-bottom: 12rpx;
- }
- .links-row {
- display: flex;
- flex-direction: row;
- gap: 16rpx;
- }
- .link-item {
- flex: 1;
- display: flex;
- flex-direction: row;
- align-items: center;
- background: #fff;
- border-radius: 16rpx;
- padding: 20rpx 18rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
- gap: 12rpx;
- }
- .link-item:active {
- opacity: 0.7;
- }
- .link-icon {
- font-size: 36rpx;
- flex-shrink: 0;
- }
- .link-texts {
- flex: 1;
- }
- .link-name {
- font-size: 24rpx;
- font-weight: 500;
- color: #333;
- display: block;
- margin-bottom: 4rpx;
- }
- .link-desc {
- font-size: 20rpx;
- color: #999;
- display: block;
- }
- .link-arrow {
- font-size: 32rpx;
- color: #CCC;
- flex-shrink: 0;
- }
- /* ===== 推荐阅读 ===== */
- .article-list {
- display: flex;
- flex-direction: column;
- gap: 16rpx;
- }
- .article-card {
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .article-card:active {
- opacity: 0.8;
- }
- .article-category {
- display: inline-block;
- padding: 4rpx 14rpx;
- border-radius: 8rpx;
- margin-bottom: 10rpx;
- }
- .article-category-text {
- font-size: 20rpx;
- color: #fff;
- }
- .article-title {
- display: block;
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 8rpx;
- line-height: 1.4;
- }
- .article-summary {
- display: block;
- font-size: 24rpx;
- color: #888;
- line-height: 1.5;
- margin-bottom: 12rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .article-meta {
- display: flex;
- align-items: center;
- gap: 16rpx;
- }
- .meta-item {
- display: flex;
- align-items: center;
- gap: 4rpx;
- }
- .meta-icon {
- font-size: 24rpx;
- }
- .meta-text {
- font-size: 22rpx;
- color: #999;
- }
- .article-date {
- font-size: 22rpx;
- color: #bbb;
- }
- </style>
|