index.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  1. <template>
  2. <view class="container">
  3. <!-- Tabbar 切换过渡页 -->
  4. <tab-transition v-if="showTabTransition" dimCode="mind" />
  5. <!-- 品牌头部 -->
  6. <PageBanner theme="mind-wisdom"
  7. tagline="心智成长 · 智慧人生"
  8. quote="知己知彼,百战不殆" />
  9. <!-- ===== 心·心理 ===== -->
  10. <view class="section-title-bar">
  11. <text class="section-title-icon">&#x2764;</text>
  12. <text class="section-title-text">心·心理</text>
  13. </view>
  14. <!-- 游客登录引导卡 -->
  15. <template v-if="!isLoggedIn">
  16. <LoginGuideCard
  17. title="登录后查看心理成长报告"
  18. :items="[
  19. '查看EMI心理测评四维分析',
  20. '查看大五人格分析报告',
  21. '阅读专属文章、参与情绪打卡'
  22. ]" />
  23. </template>
  24. <!-- 登录后:五维能量条 -->
  25. <FamilyEnergyBar
  26. v-if="isLoggedIn"
  27. dimensionCode="mind"
  28. :sandboxData="sandboxData" />
  29. <!-- 关系图谱(登录后可见) -->
  30. <FamilyRelationGraph
  31. v-if="isLoggedIn && familyMembersVisible.length > 0"
  32. dimensionCode="mind"
  33. :selfId="activeChildId"
  34. :members="familyMembersVisible"
  35. :energyMap="energyMapForGraph"
  36. :intimacyMap="intimacyMapForGraph"
  37. :compatibilityMap="compatibilityMapForGraph"
  38. @memberTap="goMemberDetail" />
  39. <!-- 登录后:用户快捷入口 -->
  40. <UserQuickEntry
  41. v-if="isLoggedIn"
  42. :userName="userName"
  43. roleName="家长"
  44. :currentChildName="currentChildName"
  45. :children="children"
  46. @childChanged="onChildChanged"
  47. @scrollTo="scrollToSection" />
  48. <!-- ===== 心理能量概况 ===== -->
  49. <view class="energy-overview" v-if="emiData">
  50. <view class="energy-badge">
  51. <text class="badge-icon">&#x2764;</text>
  52. <text class="badge-value">{{ emiData.overallScore || 0 }}</text>
  53. <text class="badge-label">心能量</text>
  54. </view>
  55. <view class="energy-badge">
  56. <text class="badge-icon">&#x1F4AA;</text>
  57. <text class="badge-value">{{ emiData.resilienceScore || 0 }}</text>
  58. <text class="badge-label">韧性评分</text>
  59. </view>
  60. <view class="energy-badge">
  61. <text class="badge-icon">&#x1F64F;</text>
  62. <text class="badge-value">{{ emiData.emotionScore || 0 }}</text>
  63. <text class="badge-label">情绪评分</text>
  64. </view>
  65. </view>
  66. <!-- ===== 大五人格雷达图(始终显示) ===== -->
  67. <view class="emi-section">
  68. <view class="emi-card">
  69. <view class="personality-header">
  70. <text class="emi-card-title">大五人格</text>
  71. <view class="test-btn" @click="goAssessment">
  72. <text class="test-btn-text">测试</text>
  73. </view>
  74. </view>
  75. <template v-if="emiData">
  76. <RadarChart
  77. :dimensions="personalityDimensions"
  78. :scores="personalityScores"
  79. :childName="currentChildName || '孩子'"
  80. fillColor="#8B5CF6"
  81. gridColor="#EDE9FE"
  82. labelColor="#6D28D9" />
  83. <view class="emi-footer">
  84. <text class="emi-overall">综合EQ分: {{ emiData.overallScore || 0 }}</text>
  85. <view class="emi-link" @click="goEmotionReport">
  86. <text class="emi-link-text">查看完整报告</text>
  87. <text class="emi-link-arrow">&#x2192;</text>
  88. </view>
  89. </view>
  90. </template>
  91. <template v-else-if="!emiLoading">
  92. <view class="placeholder-content">
  93. <text class="placeholder-icon">&#x1F9E0;</text>
  94. <text class="placeholder-title">心理评估</text>
  95. <text class="placeholder-desc">完成 EMI 心理测评后,可在此查看大五人格雷达图</text>
  96. <view class="placeholder-btn" @click="goAssessment" v-if="isLoggedIn">预约测评</view>
  97. <view class="placeholder-btn" @click="goLogin" v-else>立即登录</view>
  98. </view>
  99. </template>
  100. </view>
  101. </view>
  102. <!-- 肠脑轴情绪卡片 -->
  103. <view class="section" v-if="gutIndicators && gutIndicators.length > 0">
  104. <view class="section-header">
  105. <text class="section-title">&#x1F9E0; 肠脑情绪关联</text>
  106. </view>
  107. <view class="gut-insight-text" v-if="gutInsight">
  108. <text>{{ gutInsight }}</text>
  109. </view>
  110. <view class="gut-indicator-list">
  111. <view class="gut-indicator-item" v-for="ind in gutIndicators" :key="ind.id">
  112. <view class="gut-indicator-left">
  113. <text class="gut-indicator-name">{{ ind.indicatorName || ind.name }}</text>
  114. </view>
  115. <view class="gut-indicator-bar-track">
  116. <view class="gut-indicator-bar-fill" :style="{ width: (ind.value || 0) + '%', background: indicatorColor(ind.status) }"></view>
  117. </view>
  118. <text class="gut-indicator-value">{{ ind.value }}{{ ind.unit || '%' }}</text>
  119. <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 推荐阅读 -->
  124. <DimensionArticles
  125. dimensionCode="mind"
  126. :articles="emotionArticles"
  127. :isLoggedIn="isLoggedIn"
  128. @articleClick="goArticleDetail"
  129. @moreArticles="goArticles" />
  130. <!-- ===== 传统文化(八字/五行/星座/灵数) ===== -->
  131. <view class="culture-section" v-if="isLoggedIn && traditionalData">
  132. <!-- 八字四柱 -->
  133. <view class="culture-card" v-if="traditionalData.eightCharacters">
  134. <view class="culture-card-header">
  135. <text class="culture-card-icon">&#x2637;</text>
  136. <text class="culture-card-title">八字四柱</text>
  137. </view>
  138. <view class="bazi-grid">
  139. <view class="bazi-column" v-for="(val, key) in traditionalData.eightCharacters" :key="key">
  140. <text class="bazi-pillar-label">{{ pillarLabels[key] || key }}</text>
  141. <text class="bazi-pillar-value">{{ val }}</text>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 五行能量 -->
  146. <view class="culture-card" v-if="traditionalData.wuxingElements">
  147. <view class="culture-card-header">
  148. <text class="culture-card-icon">&#x267E;</text>
  149. <text class="culture-card-title">五行能量</text>
  150. </view>
  151. <view class="wuxing-list">
  152. <view class="wuxing-item" v-for="wx in wuxingData" :key="wx.key">
  153. <text class="wuxing-label">{{ wx.label }}</text>
  154. <view class="wuxing-bar-track">
  155. <view class="wuxing-bar-fill" :style="{ width: wx.value + '%', background: wx.color }"></view>
  156. </view>
  157. <text class="wuxing-value">{{ wx.value }}%</text>
  158. </view>
  159. </view>
  160. <view class="wuxing-reading" v-if="traditionalData.wuxingReading">
  161. <text>{{ traditionalData.wuxingReading.personalTrait || '' }}</text>
  162. </view>
  163. </view>
  164. <!-- 太阳星座 + 生命灵数 双栏 -->
  165. <view class="culture-dual">
  166. <view class="culture-dual-item" v-if="traditionalData.zodiac">
  167. <text class="culture-dual-icon">&#x2600;</text>
  168. <text class="culture-dual-label">太阳星座</text>
  169. <text class="culture-dual-value">{{ traditionalData.zodiac }}</text>
  170. </view>
  171. <view class="culture-dual-item" v-if="traditionalData.numSoul">
  172. <text class="culture-dual-icon">&#x1F52E;</text>
  173. <text class="culture-dual-label">生命灵数</text>
  174. <text class="culture-dual-value">{{ traditionalData.lifeNumber || '' }}</text>
  175. </view>
  176. </view>
  177. <!-- 查看家庭天盘入口 -->
  178. <view class="culture-card" style="text-align:center; padding:16rpx;" @click="onFuncClick({needLogin:true, page:'/pages/mind-detail/family-dashboard'})">
  179. <text style="font-size:24rpx; color:#8B5CF6;">查看家庭天盘 &#x2192;</text>
  180. </view>
  181. </view>
  182. <!-- ===== 底部:维度任务/活动/商品 ===== -->
  183. <DimensionTasks
  184. v-if="isLoggedIn"
  185. :dimensionCode="currentDimensionCode"
  186. :tasks="dimensionTasks"
  187. @taskClick="onTaskClick"
  188. @moreTasks="goTasks" />
  189. <DimensionActivities
  190. :dimensionCode="currentDimensionCode"
  191. :activities="dimensionActivities"
  192. :isLoggedIn="isLoggedIn"
  193. @activityClick="goActivityDetail"
  194. @moreActivities="goMoreActivities" />
  195. <DimensionProducts
  196. :dimensionCode="currentDimensionCode"
  197. :products="dimensionProducts"
  198. @productClick="goProductDetail"
  199. @moreProducts="goMoreProducts" />
  200. <!-- ===== Phase 1.2: 心理告警横幅 ===== -->
  201. <PsychCrisisBanner v-if="isLoggedIn" :childId="currentChildId" source="screening" />
  202. <!-- ===== 底部:功能入口 Grid(通用,两行) ===== -->
  203. <view class="func-section" v-if="sectionVisible('func_entries')">
  204. <view class="func-grid">
  205. <view class="func-row">
  206. <view class="func-item" v-for="item in funcListRow1" :key="item.label" @click="onFuncClick(item)">
  207. <view class="func-icon-wrap">
  208. <text class="func-icon">{{ item.icon }}</text>
  209. </view>
  210. <text class="func-label">{{ item.label }}</text>
  211. </view>
  212. </view>
  213. <view class="func-row">
  214. <view class="func-item" v-for="item in funcListRow2" :key="item.label" @click="onFuncClick(item)">
  215. <view class="func-icon-wrap">
  216. <text class="func-icon">{{ item.icon }}</text>
  217. </view>
  218. <text class="func-label">{{ item.label }}</text>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. <!-- 底部占位 -->
  224. <view class="bottom-spacer"></view>
  225. <AIFloatingAvatar />
  226. </view>
  227. </template>
  228. <script>
  229. import TabTransition from '../../components/tab-transition.vue'
  230. import PageBanner from '../../components/PageBanner.vue'
  231. import LoginGuideCard from '../../components/LoginGuideCard.vue'
  232. import RadarChart from '../../components/RadarChart.vue'
  233. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  234. import UserQuickEntry from '../../components/UserQuickEntry.vue'
  235. import DimensionTasks from '../../components/DimensionTasks.vue'
  236. import DimensionActivities from '../../components/DimensionActivities.vue'
  237. import DimensionProducts from '../../components/DimensionProducts.vue'
  238. import DimensionArticles from '../../components/DimensionArticles.vue'
  239. import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
  240. import FamilyRelationshipSection from '../../components/FamilyRelationshipSection.vue'
  241. import PsychCrisisBanner from '../../components/PsychCrisisBanner.vue'
  242. import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
  243. import { getVisibleSections, getFeaturedArticles, getEmiReport, getFamilyEnergySandbox, getTodayTasksByCategory, getActivityList, getProductsByDomain, getChildren, getVisibleFamilyMembers, getEnergyOverview, getContactList, getHealthAlerts, getMilestones } from '../../utils/api.js'
  244. import config from '../../config.js'
  245. export default {
  246. components: { TabTransition, PageBanner, RadarChart, LoginGuideCard, FamilyEnergyBar, UserQuickEntry, DimensionTasks, DimensionActivities, DimensionProducts, DimensionArticles, FamilyRelationGraph, FamilyRelationshipSection, PsychCrisisBanner, AIFloatingAvatar },
  247. data() {
  248. return {
  249. isLoggedIn: false,
  250. role: null,
  251. showTabTransition: true,
  252. currentChildId: null,
  253. visibleSections: [],
  254. familyMembersVisible: [],
  255. // 心理 Tab 数据
  256. emiData: null,
  257. emiLoading: true,
  258. emiDimensions: [
  259. { key: 'emotionScore', label: '情绪商数', color: '#FF6B35' },
  260. { key: 'resilienceScore', label: '心理韧性', color: '#F97316' },
  261. { key: 'stressCopingScore', label: '压力应对', color: '#FB923C' },
  262. { key: 'selfAwarenessScore', label: '自我认知', color: '#FBBF24' }
  263. ],
  264. // 大五维度(用于雷达图)
  265. personalityDimensions: [
  266. { key: 'opennessScore', label: '开放性' },
  267. { key: 'conscientiousnessScore', label: '尽责性' },
  268. { key: 'extraversionScore', label: '外向性' },
  269. { key: 'agreeablenessScore', label: '宜人性' },
  270. { key: 'neuroticismScore', label: '神经质' }
  271. ],
  272. // 功能入口
  273. funcList: [
  274. { icon: '\u{1F4D6}', label: '阅读', needLogin: false, page: '/pages/mind/articles' },
  275. { icon: '\u{1F4CA}', label: '测评报告', needLogin: true, page: '/pages/mind/emotion-report' },
  276. { icon: '\u{1F4DD}', label: '成长档案', needLogin: true, page: '/pages/growth/index' },
  277. { icon: '\u{2728}', label: '情绪打卡', needLogin: true, page: '/pages/mind-detail/emotion-checkin' },
  278. { icon: '\u{1F4C8}', label: '情绪趋势', needLogin: true, page: '/pages/mind-detail/emotion-trend' },
  279. { icon: '\u{1F9E9}', label: '心理自评', needLogin: true, page: '/pages/mind-detail/screening' },
  280. { icon: '\u{1F3E0}', label: '家庭天盘', needLogin: true, page: '/pages/mind-detail/family-dashboard' },
  281. { icon: '\u{1F9D8}', label: '疏导工具', needLogin: true, page: '/pages/mind-detail/soothe-toolbox' }
  282. ],
  283. articles: [],
  284. // 肠脑轴数据
  285. gutIndicators: null,
  286. gutInsight: '',
  287. // 传统文化数据
  288. traditionalData: null,
  289. traditionalLoading: true,
  290. compatibilityData: null,
  291. wuxingConfig: {
  292. wood: { label: '木', color: '#10B981' },
  293. fire: { label: '火', color: '#FF6B9D' },
  294. earth: { label: '土', color: '#FF8C42' },
  295. metal: { label: '金', color: '#6366F1' },
  296. water: { label: '水', color: '#3B82F6' }
  297. },
  298. pillarLabels: { year: '年柱', month: '月柱', day: '日柱', hour: '时柱' },
  299. familyScore: 0,
  300. // 五维组件数据
  301. userName: '',
  302. children: [],
  303. sandboxData: null,
  304. dimensionTasks: [],
  305. dimensionActivities: [],
  306. dimensionProducts: [],
  307. contactList: [],
  308. healthAlerts: [],
  309. milestones: []
  310. }
  311. },
  312. computed: {
  313. personalityScores: function() {
  314. if (!this.emiData) return []
  315. return [
  316. this.emiData.opennessScore || 0,
  317. this.emiData.conscientiousnessScore || 0,
  318. this.emiData.extraversionScore || 0,
  319. this.emiData.agreeablenessScore || 0,
  320. this.emiData.neuroticismScore || 0
  321. ]
  322. },
  323. energyMapForGraph: function() {
  324. var map = {}
  325. if (this.sandboxData && this.sandboxData.members) {
  326. for (var i = 0; i < this.sandboxData.members.length; i++) {
  327. var m = this.sandboxData.members[i]
  328. map[m.memberId || m.id] = {
  329. bodyScore: m.bodyScore || 0,
  330. mindScore: m.mindScore || 0,
  331. actionScore: m.actionScore || 0
  332. }
  333. }
  334. }
  335. return map
  336. },
  337. intimacyMapForGraph: function() {
  338. return {}
  339. },
  340. compatibilityMapForGraph: function() {
  341. var map = {}
  342. if (this.compatibilityData && this.compatibilityData.relationships) {
  343. for (var i = 0; i < this.compatibilityData.relationships.length; i++) {
  344. var r = this.compatibilityData.relationships[i]
  345. var key = r.memberId1 < r.memberId2 ? r.memberId1 + '-' + r.memberId2 : r.memberId2 + '-' + r.memberId1
  346. map[key] = { overallScore: r.overallScore }
  347. }
  348. }
  349. return map
  350. },
  351. emotionArticles: function() {
  352. if (!this.articles || this.articles.length === 0) return []
  353. var result = []
  354. for (var i = 0; i < this.articles.length; i++) {
  355. var a = this.articles[i]
  356. if (a.relatedDimensions && a.relatedDimensions.indexOf('mind') !== -1) {
  357. result.push(a)
  358. }
  359. }
  360. if (result.length === 0) return this.articles.slice(0, 5)
  361. return result.slice(0, 5)
  362. },
  363. wuxingData: function() {
  364. if (!this.traditionalData || !this.traditionalData.wuxingElements) return []
  365. var elements = this.traditionalData.wuxingElements
  366. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  367. var result = []
  368. for (var i = 0; i < keys.length; i++) {
  369. var k = keys[i]
  370. if (elements[k] !== undefined) {
  371. result.push({
  372. key: k,
  373. label: this.wuxingConfig[k].label,
  374. color: this.wuxingConfig[k].color,
  375. value: elements[k]
  376. })
  377. }
  378. }
  379. return result.sort(function(a, b) { return b.value - a.value })
  380. },
  381. currentDimensionCode: function() {
  382. return 'mind'
  383. },
  384. funcListRow1: function() {
  385. return this.funcList.slice(0, 4)
  386. },
  387. funcListRow2: function() {
  388. return this.funcList.slice(4)
  389. }
  390. },
  391. onShow() {
  392. this.showTabTransition = true
  393. var token = uni.getStorageSync('token')
  394. this.isLoggedIn = !!token
  395. if (this.isLoggedIn) {
  396. this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  397. this.currentChildId = uni.getStorageSync('currentChildId') || null
  398. this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '家长'
  399. }
  400. this.loadSectionConfig()
  401. this.loadFeaturedArticles()
  402. if (this.isLoggedIn) {
  403. this.loadChildren()
  404. this.loadFamilyMembersVisible()
  405. this.loadSandboxData()
  406. this.loadEmiData()
  407. this.loadGutData()
  408. this.loadEnergyData()
  409. this.loadTraditionalCultureData()
  410. this.loadContacts()
  411. this.loadHealthAlerts()
  412. this.loadMilestones()
  413. }
  414. // 游客也能浏览活动和商品
  415. this.loadDimensionActivities()
  416. this.loadDimensionProducts()
  417. this._watchPageReady()
  418. },
  419. methods: {
  420. // ===== 区块可见性 =====
  421. loadSectionConfig: function() {
  422. var self = this
  423. var baseSections = ['func_entries', 'daily_tip', 'recommended_reading']
  424. if (!uni.getStorageSync('token')) {
  425. self.visibleSections = baseSections
  426. return
  427. }
  428. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  429. getVisibleSections({ pageKey: 'mind', role: role }).then(function(res) {
  430. if (res.code === 200 && res.data) {
  431. var keys = res.data.map(function(s) { return s.sectionKey })
  432. var merged = baseSections.slice()
  433. keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
  434. self.visibleSections = merged
  435. }
  436. }).catch(function() {
  437. self.visibleSections = ['func_entries', 'daily_tip', 'recommended_reading', 'mind_tasks', 'related_activities', 'purchased_courses']
  438. })
  439. },
  440. sectionVisible: function(key) {
  441. return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
  442. },
  443. // ===== 心理 Tab:EMI 数据 =====
  444. loadEmiData: function() {
  445. var self = this
  446. var childId = self.currentChildId
  447. if (!childId) {
  448. self.emiLoading = false
  449. return
  450. }
  451. self.emiLoading = true
  452. getEmiReport(childId).then(function(res) {
  453. if (res.code === 200 && res.data) {
  454. self.emiData = res.data
  455. }
  456. self.emiLoading = false
  457. }).catch(function() {
  458. self.emiLoading = false
  459. })
  460. },
  461. // ===== 肠脑轴情绪指标 =====
  462. loadGutData: function() {
  463. var self = this
  464. var childId = self.currentChildId
  465. if (!childId) return
  466. var token = uni.getStorageSync('token')
  467. // 获取神经递质指标
  468. uni.request({
  469. url: config.API_BASE_URL + '/api/mind/neurotransmitters',
  470. method: 'POST',
  471. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  472. data: { childId: childId },
  473. success: function(r) {
  474. if (r.statusCode === 200 && r.data && r.data.code === 200) {
  475. var list = r.data.data
  476. if (Array.isArray(list) && list.length > 0) {
  477. self.gutIndicators = list.slice(0, 4)
  478. }
  479. }
  480. }
  481. })
  482. // 获取情绪洞察摘要
  483. uni.request({
  484. url: config.API_BASE_URL + '/api/mind/gut-emotion-insight',
  485. method: 'POST',
  486. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  487. data: { childId: childId },
  488. success: function(r) {
  489. if (r.statusCode === 200 && r.data && r.data.code === 200 && r.data.data) {
  490. self.gutInsight = r.data.data.summary || ''
  491. }
  492. }
  493. })
  494. },
  495. indicatorColor: function(status) {
  496. if (status === 'abnormal' || status === '偏高' || status === '偏低') return '#EF4444'
  497. if (status === 'warning' || status === '偏高' || status === '偏低') return '#F59E0B'
  498. return '#10B981'
  499. },
  500. statusLabel: function(status) {
  501. if (status === 'normal') return '正常'
  502. if (status === 'abnormal') return '异常'
  503. if (status === 'warning') return '警讯'
  504. return status || '正常'
  505. },
  506. // ===== 文章 =====
  507. loadFeaturedArticles: function() {
  508. var self = this
  509. getFeaturedArticles({ size: 5 }).then(function(res) {
  510. if (res.code === 200 && res.data) {
  511. var gradientColors = [
  512. 'linear-gradient(135deg, #8B5CF6, #A78BFA)',
  513. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  514. 'linear-gradient(135deg, #10B981, #34D399)',
  515. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  516. 'linear-gradient(135deg, #F97316, #FB923C)'
  517. ]
  518. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  519. self.articles = list.map(function(item, index) {
  520. return {
  521. id: item.id,
  522. category: item.categoryName || '成长文章',
  523. categoryColor: gradientColors[index % gradientColors.length],
  524. title: item.title || '',
  525. summary: item.summary || '',
  526. views: item.viewCount ? String(item.viewCount) : '0',
  527. likes: '0',
  528. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  529. relatedDimensions: item.relatedDimensions || []
  530. }
  531. })
  532. }
  533. }).catch(function() {})
  534. },
  535. // ===== EMI 分数评级 =====
  536. getScoreLevel: function(score) {
  537. if (score >= 85) return 'excellent'
  538. if (score >= 70) return 'good'
  539. if (score >= 55) return 'average'
  540. return 'low'
  541. },
  542. getScoreLevelText: function(score) {
  543. if (score >= 85) return '优秀'
  544. if (score >= 70) return '良好'
  545. if (score >= 55) return '一般'
  546. return '需提升'
  547. },
  548. // ===== 导航 =====
  549. goEmotionReport: function() {
  550. var childId = this.currentChildId || ''
  551. uni.navigateTo({ url: '/pages/mind-detail/emotion-report?childId=' + childId })
  552. },
  553. goArticles: function() {
  554. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  555. },
  556. onFuncClick: function(item) {
  557. if (item.needLogin && !this.isLoggedIn) {
  558. uni.showModal({
  559. title: '提示',
  560. content: '请先登录后使用此功能',
  561. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  562. })
  563. return
  564. }
  565. if (item.page) uni.navigateTo({ url: item.page })
  566. },
  567. goArticleDetail: function(article) {
  568. var id = article.id || article
  569. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  570. },
  571. // ===== 孩子列表与维度数据 =====
  572. loadChildren: function() {
  573. var self = this
  574. getChildren().then(function(res) {
  575. if (res.code === 200 && res.data) {
  576. self.children = res.data
  577. var savedChildId = uni.getStorageSync('currentChildId')
  578. var found = false
  579. for (var i = 0; i < self.children.length; i++) {
  580. if (self.children[i].childId === savedChildId) {
  581. self.currentChildId = savedChildId
  582. found = true
  583. break
  584. }
  585. }
  586. if (!found && self.children.length > 0) {
  587. self.currentChildId = self.children[0].childId
  588. uni.setStorageSync('currentChildId', self.currentChildId)
  589. }
  590. if (self.currentChildId) {
  591. self.loadDimensionData()
  592. }
  593. }
  594. }).catch(function(e) {
  595. console.log('获取孩子列表失败', e)
  596. })
  597. },
  598. loadDimensionData: function() {
  599. this.loadDimensionTasks()
  600. this.loadDimensionActivities()
  601. this.loadDimensionProducts()
  602. if (this.familyMembersVisible.length > 0) {
  603. this.loadCompatibilityData()
  604. }
  605. },
  606. loadSandboxData: function() {
  607. var self = this
  608. getFamilyEnergySandbox().then(function(res) {
  609. if (res && res.data) {
  610. self.sandboxData = res.data
  611. }
  612. }).catch(function() {})
  613. },
  614. loadEnergyData: function() {
  615. var self = this
  616. if (!this.currentChildId) return
  617. getEnergyOverview(this.currentChildId).then(function(res) {
  618. if (res && res.data) {
  619. var dims = res.data.dimensions
  620. if (dims && dims.length > 0) {
  621. for (var i = 0; i < dims.length; i++) {
  622. if (dims[i] && dims[i].code === 'mind' && res.data.energyScores) {
  623. self.familyScore = res.data.energyScores.mindScore || 0
  624. }
  625. }
  626. }
  627. }
  628. }).catch(function(e) {
  629. console.log('获取能量概览失败', e)
  630. })
  631. },
  632. loadDimensionTasks: function() {
  633. var self = this
  634. if (!this.currentChildId) return
  635. getTodayTasksByCategory(this.currentChildId, 'mind').then(function(res) {
  636. if (res && res.data) {
  637. self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
  638. }
  639. }).catch(function() { self.dimensionTasks = [] })
  640. },
  641. loadDimensionActivities: function() {
  642. var self = this
  643. var dimCode = self.currentDimensionCode
  644. getActivityList({ dimensionCode: dimCode, page: 1, size: 3 }).then(function(res) {
  645. if (res && res.data) {
  646. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  647. self.dimensionActivities = list.slice(0, 3)
  648. }
  649. }).catch(function() { self.dimensionActivities = [] })
  650. },
  651. loadDimensionProducts: function() {
  652. var self = this
  653. var dimCode = self.currentDimensionCode
  654. getProductsByDomain(dimCode, 1, 4).then(function(res) {
  655. if (res && res.data) {
  656. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  657. self.dimensionProducts = list.slice(0, 4)
  658. }
  659. }).catch(function() { self.dimensionProducts = [] })
  660. },
  661. onChildChanged: function(child) {
  662. this.currentChildId = child.childId
  663. uni.setStorageSync('currentChildId', child.childId)
  664. this.loadDimensionData()
  665. this.loadEmiData()
  666. this.loadTraditionalCultureData()
  667. },
  668. loadFamilyMembersVisible: function() {
  669. var self = this
  670. getVisibleFamilyMembers().then(function(res) {
  671. self.familyMembersVisible = res.data || []
  672. }).catch(function(e) {
  673. console.log('获取可见家庭成员失败', e)
  674. self.familyMembersVisible = []
  675. })
  676. },
  677. loadCompatibilityData: function() {
  678. var self = this
  679. var familyId = uni.getStorageSync('currentFamilyId')
  680. if (!familyId) {
  681. var userInfo = uni.getStorageSync('userInfo')
  682. if (userInfo && userInfo.familyId) familyId = userInfo.familyId
  683. }
  684. if (!familyId) return
  685. var token = uni.getStorageSync('token')
  686. uni.request({
  687. url: config.API_BASE_URL + '/api/mind/traditional/family-dashboard',
  688. method: 'POST',
  689. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  690. data: { familyId: familyId },
  691. success: function(res) {
  692. if (res.data && res.data.code === 200 && res.data.data) {
  693. self.compatibilityData = res.data.data
  694. }
  695. },
  696. fail: function() {}
  697. })
  698. },
  699. scrollToSection: function(section) {
  700. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  701. },
  702. onTaskClick: function(task) {
  703. uni.navigateTo({ url: '/pages/tasks/tasks' })
  704. },
  705. goActivityDetail: function(act) {
  706. if (act && act.id) uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  707. },
  708. goMoreActivities: function() {
  709. uni.navigateTo({ url: '/pages/activity/index' })
  710. },
  711. goProductDetail: function(prod) {
  712. if (prod && prod.id) uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  713. },
  714. goMoreProducts: function() {
  715. uni.navigateTo({ url: '/pages/shop/index' })
  716. },
  717. goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
  718. goMemberDetail: function(member) {
  719. if (!member || !member.memberId) return
  720. var currentId = this.currentChildId
  721. uni.navigateTo({
  722. url: '/pages/mind-detail/duo-compatibility?memberId1=' + currentId + '&memberId2=' + member.memberId
  723. })
  724. },
  725. goAssessment: function() { uni.navigateTo({ url: '/pages/assessment/apply' }) },
  726. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  727. // ===== 传统文化数据 =====
  728. // ===== 联系人 / 关系健康 =====
  729. loadContacts: function() {
  730. var self = this
  731. getContactList({}).then(function(res) {
  732. if (res.code === 200) {
  733. self.contactList = Array.isArray(res.data) ? res.data : []
  734. } else {
  735. self.contactList = []
  736. }
  737. }).catch(function() {
  738. self.contactList = []
  739. })
  740. },
  741. loadHealthAlerts: function() {
  742. var self = this
  743. getHealthAlerts({}).then(function(res) {
  744. if (res.code === 200) {
  745. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  746. } else {
  747. self.healthAlerts = []
  748. }
  749. }).catch(function() {
  750. self.healthAlerts = []
  751. })
  752. },
  753. loadMilestones: function() {
  754. var self = this
  755. getMilestones({}, 30).then(function(res) {
  756. if (res.code === 200) {
  757. self.milestones = Array.isArray(res.data) ? res.data : []
  758. } else {
  759. self.milestones = []
  760. }
  761. }).catch(function() {
  762. self.milestones = []
  763. })
  764. },
  765. loadTraditionalCultureData: function() {
  766. var self = this
  767. var memberId = this.currentChildId
  768. if (!memberId) {
  769. self.traditionalLoading = false
  770. return
  771. }
  772. self.traditionalLoading = true
  773. uni.request({
  774. url: config.API_BASE_URL + '/api/mind/traditional/mirror',
  775. method: 'POST',
  776. data: { memberId: memberId, memberType: 'child' },
  777. success: function(res) {
  778. self.traditionalLoading = false
  779. if (res.data && res.data.code === 200 && res.data.data) {
  780. var d = res.data.data
  781. if (d.eightCharacters || d.wuxingElements || d.zodiac || d.numSoul) {
  782. self.traditionalData = d
  783. } else {
  784. self.traditionalData = null
  785. }
  786. } else {
  787. self.traditionalData = null
  788. }
  789. },
  790. fail: function() {
  791. self.traditionalLoading = false
  792. self.traditionalData = null
  793. }
  794. })
  795. },
  796. _watchPageReady() {
  797. var self = this
  798. var unwatch = this.$watch(function() {
  799. if (self.isLoggedIn) {
  800. return !!(self.emiData || self.energyOverview || (self.dimensionActivities && self.dimensionActivities.length > 0))
  801. }
  802. return !!(self.dimensionActivities && self.dimensionActivities.length > 0)
  803. }, function(val) {
  804. if (val) {
  805. if (unwatch) unwatch()
  806. self.showTabTransition = false
  807. }
  808. })
  809. setTimeout(function() {
  810. if (unwatch) unwatch()
  811. self.showTabTransition = false
  812. }, 5000)
  813. }
  814. }
  815. }
  816. </script>
  817. <style scoped>
  818. .container {
  819. min-height: 100vh;
  820. background: #f5f7fa;
  821. padding-bottom: 120rpx;
  822. }
  823. /* ===== 心·心理 标题栏 ===== */
  824. .section-title-bar {
  825. display: flex;
  826. flex-direction: row;
  827. align-items: center;
  828. margin: 20rpx 30rpx 10rpx;
  829. padding: 16rpx 24rpx;
  830. background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  831. border-radius: 20rpx;
  832. box-shadow: 0 4rpx 16rpx rgba(139,92,246,0.25);
  833. }
  834. .section-title-icon {
  835. font-size: 32rpx;
  836. color: #fff;
  837. margin-right: 12rpx;
  838. }
  839. .section-title-text {
  840. font-size: 32rpx;
  841. font-weight: bold;
  842. color: #fff;
  843. }
  844. /* ===== 心理能量概况 ===== */
  845. .energy-overview {
  846. display: flex;
  847. flex-direction: row;
  848. margin: 20rpx 30rpx;
  849. background: #fff;
  850. border-radius: 20rpx;
  851. padding: 24rpx 16rpx;
  852. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  853. justify-content: space-around;
  854. }
  855. .energy-badge {
  856. display: flex;
  857. flex-direction: column;
  858. align-items: center;
  859. flex: 1;
  860. }
  861. .badge-icon {
  862. font-size: 36rpx;
  863. margin-bottom: 8rpx;
  864. }
  865. .badge-value {
  866. font-size: 36rpx;
  867. font-weight: bold;
  868. color: #333;
  869. }
  870. .badge-label {
  871. font-size: 20rpx;
  872. color: #999;
  873. margin-top: 4rpx;
  874. }
  875. /* ===== EMI 四维条形图 ===== */
  876. .emi-section {
  877. margin: 20rpx 30rpx;
  878. }
  879. .emi-card {
  880. background: #fff;
  881. border-radius: 24rpx;
  882. padding: 30rpx;
  883. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  884. }
  885. .emi-card-title {
  886. font-size: 30rpx;
  887. font-weight: bold;
  888. color: #333;
  889. display: block;
  890. }
  891. .personality-header {
  892. display: flex;
  893. flex-direction: row;
  894. align-items: center;
  895. justify-content: space-between;
  896. margin-bottom: 24rpx;
  897. }
  898. .test-btn {
  899. background: #8B5CF6;
  900. padding: 8rpx 28rpx;
  901. border-radius: 30rpx;
  902. }
  903. .test-btn-text {
  904. font-size: 24rpx;
  905. color: #fff;
  906. font-weight: 500;
  907. }
  908. .emi-bar-item {
  909. display: flex;
  910. flex-direction: row;
  911. align-items: center;
  912. margin-bottom: 20rpx;
  913. }
  914. .emi-bar-label {
  915. font-size: 24rpx;
  916. color: #666;
  917. width: 120rpx;
  918. flex-shrink: 0;
  919. }
  920. .emi-bar-track {
  921. flex: 1;
  922. height: 20rpx;
  923. background: #f0f0f0;
  924. border-radius: 10rpx;
  925. overflow: hidden;
  926. margin: 0 16rpx;
  927. }
  928. .emi-bar-fill {
  929. height: 100%;
  930. border-radius: 10rpx;
  931. transition: width 0.5s;
  932. }
  933. .emi-bar-score {
  934. font-size: 26rpx;
  935. font-weight: bold;
  936. color: #333;
  937. width: 60rpx;
  938. text-align: right;
  939. flex-shrink: 0;
  940. }
  941. .emi-bar-level {
  942. font-size: 20rpx;
  943. width: 80rpx;
  944. text-align: right;
  945. flex-shrink: 0;
  946. }
  947. .level-excellent { color: #10B981; }
  948. .level-good { color: #3B82F6; }
  949. .level-average { color: #F97316; }
  950. .level-low { color: #EF4444; }
  951. .emi-footer {
  952. display: flex;
  953. flex-direction: row;
  954. justify-content: space-between;
  955. align-items: center;
  956. margin-top: 20rpx;
  957. padding-top: 20rpx;
  958. border-top: 1rpx solid #f0f0f0;
  959. }
  960. .emi-overall {
  961. font-size: 28rpx;
  962. font-weight: bold;
  963. color: #FF6B35;
  964. }
  965. .emi-link {
  966. display: flex;
  967. flex-direction: row;
  968. align-items: center;
  969. }
  970. .emi-link-text {
  971. font-size: 26rpx;
  972. color: #FF6B35;
  973. font-weight: 500;
  974. }
  975. .emi-link-arrow {
  976. font-size: 26rpx;
  977. color: #FF6B35;
  978. margin-left: 8rpx;
  979. }
  980. /* 雷达图内的空状态 */
  981. .placeholder-content {
  982. display: flex;
  983. flex-direction: column;
  984. align-items: center;
  985. padding: 40rpx 20rpx;
  986. }
  987. /* ===== 占位卡 ===== */
  988. .placeholder-card {
  989. margin: 30rpx;
  990. background: #fff;
  991. border-radius: 24rpx;
  992. padding: 60rpx 40rpx;
  993. display: flex;
  994. flex-direction: column;
  995. align-items: center;
  996. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  997. }
  998. .placeholder-icon {
  999. font-size: 80rpx;
  1000. margin-bottom: 20rpx;
  1001. }
  1002. .placeholder-title {
  1003. font-size: 32rpx;
  1004. font-weight: bold;
  1005. color: #333;
  1006. margin-bottom: 16rpx;
  1007. }
  1008. .placeholder-desc {
  1009. font-size: 26rpx;
  1010. color: #999;
  1011. text-align: center;
  1012. line-height: 1.6;
  1013. margin-bottom: 30rpx;
  1014. }
  1015. .placeholder-btn {
  1016. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1017. color: #fff;
  1018. font-size: 28rpx;
  1019. font-weight: bold;
  1020. padding: 16rpx 64rpx;
  1021. border-radius: 40rpx;
  1022. box-shadow: 0 4rpx 16rpx rgba(255,107,53,0.3);
  1023. }
  1024. /* ===== 传统文化卡片 ===== */
  1025. .culture-section {
  1026. margin: 20rpx 30rpx;
  1027. }
  1028. .culture-card {
  1029. background: #fff;
  1030. border-radius: 20rpx;
  1031. padding: 24rpx;
  1032. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1033. margin-bottom: 16rpx;
  1034. }
  1035. .culture-card-header {
  1036. display: flex;
  1037. align-items: center;
  1038. margin-bottom: 16rpx;
  1039. }
  1040. .culture-card-icon {
  1041. font-size: 32rpx;
  1042. margin-right: 10rpx;
  1043. }
  1044. .culture-card-title {
  1045. font-size: 28rpx;
  1046. font-weight: 600;
  1047. color: #333;
  1048. }
  1049. .culture-card-body {
  1050. font-size: 24rpx;
  1051. color: #666;
  1052. line-height: 1.6;
  1053. }
  1054. /* 八字四柱 */
  1055. .bazi-grid {
  1056. display: flex;
  1057. justify-content: space-around;
  1058. padding: 8rpx 0;
  1059. }
  1060. .bazi-column {
  1061. display: flex;
  1062. flex-direction: column;
  1063. align-items: center;
  1064. }
  1065. .bazi-pillar-label {
  1066. font-size: 22rpx;
  1067. color: #999;
  1068. margin-bottom: 6rpx;
  1069. }
  1070. .bazi-pillar-value {
  1071. font-size: 32rpx;
  1072. font-weight: 700;
  1073. color: #8B5CF6;
  1074. background: #F5F0FF;
  1075. padding: 10rpx 14rpx;
  1076. border-radius: 10rpx;
  1077. }
  1078. /* 五行能量 */
  1079. .wuxing-list {
  1080. display: flex;
  1081. flex-direction: column;
  1082. gap: 12rpx;
  1083. }
  1084. .wuxing-item {
  1085. display: flex;
  1086. align-items: center;
  1087. gap: 12rpx;
  1088. }
  1089. .wuxing-label {
  1090. font-size: 26rpx;
  1091. font-weight: 600;
  1092. width: 44rpx;
  1093. text-align: center;
  1094. }
  1095. .wuxing-bar-track {
  1096. flex: 1;
  1097. height: 20rpx;
  1098. background: #F0F0F0;
  1099. border-radius: 10rpx;
  1100. overflow: hidden;
  1101. }
  1102. .wuxing-bar-fill {
  1103. height: 100%;
  1104. border-radius: 10rpx;
  1105. }
  1106. .wuxing-value {
  1107. font-size: 22rpx;
  1108. color: #666;
  1109. width: 56rpx;
  1110. text-align: right;
  1111. }
  1112. .wuxing-reading {
  1113. margin-top: 12rpx;
  1114. padding: 12rpx 14rpx;
  1115. background: #F8F6F0;
  1116. border-radius: 12rpx;
  1117. font-size: 24rpx;
  1118. color: #666;
  1119. line-height: 1.5;
  1120. }
  1121. /* 星座+灵数双栏 */
  1122. .culture-dual {
  1123. display: flex;
  1124. gap: 16rpx;
  1125. }
  1126. .culture-dual-item {
  1127. flex: 1;
  1128. background: #fff;
  1129. border-radius: 20rpx;
  1130. padding: 20rpx;
  1131. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1132. display: flex;
  1133. flex-direction: column;
  1134. align-items: center;
  1135. }
  1136. .culture-dual-icon {
  1137. font-size: 36rpx;
  1138. margin-bottom: 8rpx;
  1139. }
  1140. .culture-dual-label {
  1141. font-size: 22rpx;
  1142. color: #999;
  1143. margin-bottom: 6rpx;
  1144. }
  1145. .culture-dual-value {
  1146. font-size: 28rpx;
  1147. font-weight: 700;
  1148. color: #8B5CF6;
  1149. }
  1150. .culture-empty {
  1151. text-align: center;
  1152. padding: 30rpx 0;
  1153. color: #bbb;
  1154. font-size: 24rpx;
  1155. }
  1156. /* ===== 每日心理 ===== */
  1157. .tip-card {
  1158. background: #fff;
  1159. border-radius: 20rpx;
  1160. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1161. display: flex;
  1162. flex-direction: row;
  1163. overflow: hidden;
  1164. }
  1165. .tip-left-bar {
  1166. width: 6rpx;
  1167. background: linear-gradient(180deg, #5B9BD5, #8FC5E8);
  1168. flex-shrink: 0;
  1169. }
  1170. .tip-body {
  1171. flex: 1;
  1172. padding: 28rpx 24rpx;
  1173. }
  1174. .tip-title {
  1175. font-size: 28rpx;
  1176. font-weight: bold;
  1177. color: #5B9BD5;
  1178. display: block;
  1179. margin-bottom: 12rpx;
  1180. }
  1181. .tip-content {
  1182. font-size: 24rpx;
  1183. color: #666;
  1184. line-height: 1.6;
  1185. display: block;
  1186. margin-bottom: 16rpx;
  1187. }
  1188. .tip-footer {
  1189. display: flex;
  1190. flex-direction: row;
  1191. justify-content: flex-end;
  1192. }
  1193. .tip-source {
  1194. font-size: 22rpx;
  1195. color: #bbb;
  1196. }
  1197. /* ===== 通用区块 ===== */
  1198. .section {
  1199. margin: 20rpx 30rpx;
  1200. }
  1201. .section-header {
  1202. margin-bottom: 20rpx;
  1203. }
  1204. .section-title {
  1205. font-size: 30rpx;
  1206. font-weight: bold;
  1207. color: #333;
  1208. }
  1209. /* ===== 推荐阅读 ===== */
  1210. .article-list {
  1211. display: flex;
  1212. flex-direction: column;
  1213. }
  1214. .article-card {
  1215. background: #fff;
  1216. border-radius: 20rpx;
  1217. padding: 28rpx 24rpx;
  1218. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1219. margin-bottom: 20rpx;
  1220. }
  1221. .article-category {
  1222. display: inline-block;
  1223. padding: 4rpx 18rpx;
  1224. border-radius: 20rpx;
  1225. margin-bottom: 14rpx;
  1226. }
  1227. .article-category-text {
  1228. font-size: 20rpx;
  1229. color: #fff;
  1230. font-weight: 500;
  1231. }
  1232. .article-title {
  1233. font-size: 28rpx;
  1234. font-weight: bold;
  1235. color: #333;
  1236. display: block;
  1237. margin-bottom: 10rpx;
  1238. }
  1239. .article-summary {
  1240. font-size: 24rpx;
  1241. color: #888;
  1242. line-height: 1.5;
  1243. display: block;
  1244. margin-bottom: 20rpx;
  1245. }
  1246. .article-meta {
  1247. display: flex;
  1248. flex-direction: row;
  1249. align-items: center;
  1250. justify-content: space-between;
  1251. }
  1252. .meta-item {
  1253. display: flex;
  1254. flex-direction: row;
  1255. align-items: center;
  1256. margin-right: 20rpx;
  1257. }
  1258. .meta-icon {
  1259. font-size: 22rpx;
  1260. margin-right: 4rpx;
  1261. }
  1262. .meta-text {
  1263. font-size: 22rpx;
  1264. color: #bbb;
  1265. }
  1266. .article-date {
  1267. font-size: 22rpx;
  1268. color: #bbb;
  1269. margin-left: auto;
  1270. }
  1271. /* ===== 功能区入口 ===== */
  1272. .func-section {
  1273. margin: 20rpx 30rpx;
  1274. }
  1275. .func-grid {
  1276. display: flex;
  1277. flex-direction: column;
  1278. gap: 16rpx;
  1279. background: #fff;
  1280. border-radius: 20rpx;
  1281. padding: 24rpx 16rpx;
  1282. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1283. }
  1284. .func-row {
  1285. display: flex;
  1286. flex-direction: row;
  1287. justify-content: space-between;
  1288. }
  1289. .func-item {
  1290. display: flex;
  1291. flex-direction: column;
  1292. align-items: center;
  1293. flex: 1;
  1294. }
  1295. .func-icon-wrap {
  1296. width: 80rpx;
  1297. height: 80rpx;
  1298. border-radius: 40rpx;
  1299. background: linear-gradient(135deg, #D6EAF8, #EBF2FA);
  1300. display: flex;
  1301. align-items: center;
  1302. justify-content: center;
  1303. margin-bottom: 10rpx;
  1304. }
  1305. .func-icon {
  1306. font-size: 40rpx;
  1307. }
  1308. .func-label {
  1309. font-size: 22rpx;
  1310. color: #666;
  1311. font-weight: 500;
  1312. }
  1313. .func-item:active {
  1314. opacity: 0.7;
  1315. }
  1316. /* ===== 底部 ===== */
  1317. .bottom-spacer {
  1318. height: 120rpx;
  1319. }
  1320. /* ===== 肠脑轴 ===== */
  1321. .gut-insight-text {
  1322. font-size: 24rpx;
  1323. color: #666;
  1324. margin-bottom: 16rpx;
  1325. padding: 12rpx 16rpx;
  1326. background: #F0FFF4;
  1327. border-radius: 12rpx;
  1328. line-height: 1.6;
  1329. }
  1330. .gut-indicator-list {
  1331. display: flex;
  1332. flex-direction: column;
  1333. gap: 12rpx;
  1334. }
  1335. .gut-indicator-item {
  1336. display: flex;
  1337. align-items: center;
  1338. gap: 12rpx;
  1339. }
  1340. .gut-indicator-left {
  1341. width: 80rpx;
  1342. flex-shrink: 0;
  1343. }
  1344. .gut-indicator-name {
  1345. font-size: 22rpx;
  1346. color: #666;
  1347. }
  1348. .gut-indicator-bar-track {
  1349. flex: 1;
  1350. height: 16rpx;
  1351. background: #F0F0F0;
  1352. border-radius: 8rpx;
  1353. overflow: hidden;
  1354. }
  1355. .gut-indicator-bar-fill {
  1356. height: 100%;
  1357. border-radius: 8rpx;
  1358. transition: width 0.3s;
  1359. }
  1360. .gut-indicator-value {
  1361. font-size: 22rpx;
  1362. color: #666;
  1363. width: 60rpx;
  1364. text-align: right;
  1365. }
  1366. .gut-indicator-status {
  1367. font-size: 20rpx;
  1368. padding: 2rpx 12rpx;
  1369. border-radius: 10rpx;
  1370. width: 60rpx;
  1371. text-align: center;
  1372. }
  1373. .status-normal {
  1374. background: #D1FAE5;
  1375. color: #059669;
  1376. }
  1377. .status-abnormal {
  1378. background: #FEE2E2;
  1379. color: #DC2626;
  1380. }
  1381. .status-warning {
  1382. background: #FEF3C7;
  1383. color: #D97706;
  1384. }
  1385. </style>