index.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216
  1. <template>
  2. <view class="container">
  3. <!-- Tabbar 切换过渡页 -->
  4. <tab-transition v-if="showTabTransition" dimCode="mind" ref="tabTransition" @close="showTabTransition = false" />
  5. <!-- 品牌头部 -->
  6. <PageBanner theme="mind-wisdom"
  7. tagline="心智成长 · 智慧人生"
  8. quote="知己知彼,百战不殆" />
  9. <!-- 品牌定位语(登录前显示) -->
  10. <view class="brand-strap" v-if="!isLoggedIn">
  11. <text class="brand-strap-text">关注全家心理健康与情绪成长</text>
  12. </view>
  13. <!-- ===== 家庭天盘模块(今日运势 / 今日心情 / 吉位) ===== -->
  14. <FamilyTianpanCard
  15. v-if="isLoggedIn"
  16. :visible="isLoggedIn"
  17. :fortune="dailyFortuneSafe"
  18. :mood="todayMood"
  19. :dominantElement="dominantElementSafe"
  20. :weeklyTip="familyWeeklyInsight"
  21. :traditionalData="traditionalData" />
  22. <!-- 家庭成员选择条 -->
  23. <FamilyMemberStrip
  24. v-if="currentView === 'self' && isLoggedIn"
  25. :members="familyMembersVisible"
  26. :selectedMemberId="selectedMemberId"
  27. @select="onFamilyMemberSelect"
  28. @removed="loadFamilyMembersVisible" />
  29. <!-- 游客引导语 -->
  30. <view class="monthly-guidance" v-if="!isLoggedIn">
  31. <text class="guidance-icon">🔥</text>
  32. <text class="guidance-text">{{ monthlyGuidance }}</text>
  33. </view>
  34. <!-- 登录后:五维能量条 -->
  35. <FamilyEnergyBar
  36. v-if="isLoggedIn"
  37. dimensionCode="mind"
  38. :sandboxData="sandboxData" />
  39. <!-- 心理指标卡片 -->
  40. <view class="indicator-cards-section" v-if="isLoggedIn && mindIndicators.length > 0">
  41. <view class="section-header">
  42. <text class="section-title">🔥 心理指标</text>
  43. <text class="section-more" @click="goMindDetail">更多 ›</text>
  44. </view>
  45. <view class="indicator-cards">
  46. <view
  47. v-for="(ind, i) in mindIndicators"
  48. :key="ind.code"
  49. class="indicator-card"
  50. :class="{ 'no-data': !ind.value }"
  51. @click="goMindDetail()"
  52. >
  53. <view class="indicator-header">
  54. <text class="indicator-name">{{ ind.name }}</text>
  55. <text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
  56. </view>
  57. <view class="indicator-body">
  58. <text class="indicator-value" v-if="ind.value || ind.numericValue !== null">{{ ind.value || formatNumeric(ind.numericValue) }}</text>
  59. <text class="indicator-placeholder" v-else>暂无数据</text>
  60. </view>
  61. <view class="indicator-footer">
  62. <text class="indicator-range" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 心理报告卡片(登录后可见) -->
  68. <view class="emi-card" v-if="isLoggedIn && emiData">
  69. <view class="emi-header">
  70. <text class="emi-title">心理测评报告</text>
  71. <view class="emi-overall-wrap">
  72. <text class="emi-overall-label">综合EQ分</text>
  73. <text class="emi-overall-value">{{ emiData.overallScore || 0 }}</text>
  74. <text :class="['emi-overall-level', 'level-' + getScoreLevel(emiData.overallScore || 0)]">
  75. {{ getScoreLevelText(emiData.overallScore || 0) }}
  76. </text>
  77. </view>
  78. </view>
  79. <view class="emi-dimensions">
  80. <view class="emi-dimension" v-for="dim in emiDimensions" :key="dim.key">
  81. <view class="emi-dim-header">
  82. <text class="emi-dim-label">{{ dim.label }}</text>
  83. <view class="emi-dim-values">
  84. <text class="emi-dim-score">{{ emiData[dim.key] || 0 }}</text>
  85. <text :class="['emi-dim-level', 'level-' + getScoreLevel(emiData[dim.key] || 0)]">
  86. {{ getScoreLevelText(emiData[dim.key] || 0) }}
  87. </text>
  88. </view>
  89. </view>
  90. <view class="emi-dim-bar">
  91. <view class="emi-dim-bar-fill" :style="{ width: (emiData[dim.key] || 0) + '%', background: dim.color }"></view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="emi-footer" @click="goEmotionReport">
  96. <text class="emi-footer-text">查看详情</text>
  97. <text class="emi-footer-icon">&#x2192;</text>
  98. </view>
  99. </view>
  100. <!-- 肠脑轴情绪卡片 -->
  101. <view class="section" v-if="gutIndicators && gutIndicators.length > 0">
  102. <view class="section-header">
  103. <text class="section-title">🌱 情绪与肠胃</text>
  104. </view>
  105. <view class="gut-insight-text" v-if="gutInsight">
  106. <text>{{ gutInsight }}</text>
  107. </view>
  108. <view class="gut-indicator-list">
  109. <view class="gut-indicator-item" v-for="ind in gutIndicators" :key="ind.id">
  110. <view class="gut-indicator-left">
  111. <text class="gut-indicator-name">{{ ind.indicatorName || ind.name }}</text>
  112. </view>
  113. <view class="gut-indicator-bar-track">
  114. <view class="gut-indicator-bar-fill" :style="{ width: (ind.value || 0) + '%', background: indicatorColor(ind.status) }"></view>
  115. </view>
  116. <text class="gut-indicator-value">{{ ind.value }}{{ ind.unit || '%' }}</text>
  117. <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- ===== Phase 1.2: 心理告警横幅 ===== -->
  122. <PsychCrisisBanner v-if="isLoggedIn" :memberId="currentChildId" source="screening" />
  123. <!-- ===== 底部:功能入口 Grid(通用,两行) ===== -->
  124. <view class="func-section" v-if="sectionVisible('func_entries')">
  125. <view class="func-grid">
  126. <view class="func-row">
  127. <view class="func-item" v-for="item in funcListRow1" :key="item.label" @click="onFuncClick(item)">
  128. <view class="func-icon-wrap">
  129. <text class="func-icon">{{ item.icon }}</text>
  130. </view>
  131. <text class="func-label">{{ item.label }}</text>
  132. </view>
  133. </view>
  134. <view class="func-row">
  135. <view class="func-item" v-for="item in funcListRow2" :key="item.label" @click="onFuncClick(item)">
  136. <view class="func-icon-wrap">
  137. <text class="func-icon">{{ item.icon }}</text>
  138. </view>
  139. <text class="func-label">{{ item.label }}</text>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 心13维雷达图(分组展示,登录后且选中成员时) -->
  145. <view class="section" v-if="isLoggedIn && currentMemberEnergies">
  146. <view class="section-header">
  147. <text class="section-title">🧠 情绪与性格</text>
  148. </view>
  149. <view class="radar-group" v-for="(group, gIdx) in mindRadarGroups" :key="gIdx">
  150. <text class="radar-group-label">{{ group.label }}</text>
  151. <RadarChart
  152. :dimensions="group.dimensions"
  153. :scores="getMindGroupScores(group)"
  154. :avg-scores="getMindGroupFamilyScores(group)"
  155. :population-scores="getGroupPopulationScores(group)"
  156. fillColor="#FF6B9D"
  157. gridColor="#FCE7F3"
  158. labelColor="#9D174D"
  159. :width="540"
  160. :height="540" />
  161. </view>
  162. </view>
  163. <!-- 心维度介绍卡片(登录后显示) -->
  164. <DimensionIntroCard dimCode="mind" v-if="isLoggedIn" learn-more-url="/pages/mind-detail/dimension-intro" />
  165. <!-- 底部占位 -->
  166. <view class="bottom-spacer"></view>
  167. <FloatingAvatar />
  168. </view>
  169. </template>
  170. <script>
  171. import TabTransition from '../../components/tab-transition.vue'
  172. import PageBanner from '../../components/PageBanner.vue'
  173. import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
  174. import RadarChart from '../../components/RadarChart.vue'
  175. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  176. import PsychCrisisBanner from '../../components/PsychCrisisBanner.vue'
  177. import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
  178. import FamilyTianpanCard from '../../components/FamilyTianpanCard.vue'
  179. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  180. import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getEnergySandbox, getChildren, getFamilyMemberList, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune, getLatestIndicators, getRadarData } from '../../utils/api.js'
  181. import nav from '../../utils/nav.js'
  182. import config from '../../config.js'
  183. import { parseDate } from '../../utils/format.js'
  184. export default {
  185. components: { TabTransition, PageBanner, RadarChart, FamilyEnergyBar, PsychCrisisBanner, FloatingAvatar, FamilyTianpanCard, FamilyMemberStrip, DimensionIntroCard },
  186. data() {
  187. return {
  188. isLoggedIn: false,
  189. role: null,
  190. showTabTransition: true,
  191. currentChildId: null,
  192. selectedMemberId: null,
  193. visibleSections: [],
  194. familyMembersVisible: [],
  195. // 心理 Tab 数据
  196. emiData: null,
  197. emiLoading: true,
  198. emiDimensions: [
  199. { key: 'emotionStability', label: '情绪稳定性', color: '#FF6B35' }
  200. ],
  201. // 大五维度(用于雷达图)
  202. personalityDimensions: [
  203. { key: 'opennessScore', label: '开放性' },
  204. { key: 'conscientiousnessScore', label: '尽责性' },
  205. { key: 'extraversionScore', label: '外向性' },
  206. { key: 'agreeablenessScore', label: '宜人性' },
  207. { key: 'neuroticismScore', label: '神经质' }
  208. ],
  209. // 功能入口
  210. funcList: [
  211. { icon: '\u{1F4D6}', label: '阅读', needLogin: false, page: '/pages/article-center/index?dimension=mind' },
  212. { icon: '\u{1F4CA}', label: '测评报告', needLogin: true, page: '/pages/mind/emotion-report' },
  213. { icon: '\u{1F4DD}', label: '成长记录', needLogin: true, page: '/pages/growth-main/index' },
  214. { icon: '\u{2728}', label: '情绪打卡', needLogin: true, page: '/pages/mind-detail/emotion-checkin' },
  215. { icon: '\u{1F4C8}', label: '情绪趋势', needLogin: true, page: '/pages/mind-detail/emotion-trend' },
  216. { icon: '\u{1F9E9}', label: '心理自评', needLogin: true, page: '/pages/mind-detail/screening' },
  217. { icon: '\u{1F3E0}', label: '家庭天盘', needLogin: true, page: '/pages/mind-detail/family-dashboard' },
  218. { icon: '\u{1F9D8}', label: '疏导工具', needLogin: true, page: '/pages/mind-detail/soothe-toolbox' },
  219. { icon: '\u{1F31F}', label: '先天画像', needLogin: true, page: '/pages/mind-detail/innate-portrait' }
  220. ],
  221. articles: [],
  222. // 肠脑轴数据
  223. gutIndicators: null,
  224. gutInsight: '',
  225. // 传统文化数据
  226. traditionalData: null,
  227. traditionalLoading: true,
  228. compatibilityData: null,
  229. wuxingConfig: {
  230. wood: { label: '木', color: '#10B981' },
  231. fire: { label: '火', color: '#FF6B9D' },
  232. earth: { label: '土', color: '#FF8C42' },
  233. metal: { label: '金', color: '#6366F1' },
  234. water: { label: '水', color: '#3B82F6' }
  235. },
  236. pillarLabels: { year: '年柱', month: '月柱', day: '日柱', hour: '时柱' },
  237. familyScore: 0,
  238. // 五维组件数据
  239. userName: '',
  240. children: [],
  241. mindSubDims: [],
  242. mindIndicators: [],
  243. sandboxData: null,
  244. currentView: 'self', // 'self' | 'family'
  245. contactList: [],
  246. healthAlerts: [],
  247. milestones: [],
  248. danReports: [],
  249. // 心13维雷达图分组配置
  250. mindRadarGroups: [
  251. {
  252. label: '大五人格',
  253. dimensions: [
  254. { key: 'bigFiveOpenness', label: '开放性' },
  255. { key: 'bigFiveConscientiousness', label: '尽责性' },
  256. { key: 'bigFiveExtraversion', label: '外向性' },
  257. { key: 'bigFiveAgreeableness', label: '宜人性' },
  258. { key: 'bigFiveNeuroticism', label: '神经质' }
  259. ]
  260. },
  261. {
  262. label: '情绪稳定性',
  263. dimensions: [
  264. { key: 'emotionStability', label: '情绪稳定性' }
  265. ]
  266. },
  267. {
  268. label: '自驱力',
  269. dimensions: [
  270. { key: 'driveAutonomy', label: '自主性' },
  271. { key: 'driveCompetence', label: '胜任感' },
  272. { key: 'driveRelatedness', label: '归属感' }
  273. ]
  274. },
  275. {
  276. label: '自我概念',
  277. dimensions: [
  278. { key: 'selfConceptOverall', label: '综合自我概念' }
  279. ]
  280. }
  281. ],
  282. // 家庭天盘 - 今日心情(占位数据)
  283. todayMood: {
  284. emoji: '\u{1F60A}',
  285. text: '平静',
  286. score: 65
  287. },
  288. // 家庭天盘 - 每日运势数据
  289. dailyFortuneData: null,
  290. // 心维度雷达图人群位置分数 (dimensionKey -> score)
  291. mindPopulationScores: {}
  292. }
  293. },
  294. computed: {
  295. /** 每月引导语 */
  296. monthlyGuidance: function() {
  297. var month = new Date().getMonth()
  298. var messages = [
  299. '一月:新年新起点,从情绪觉察开始',
  300. '二月:春节团聚,关注家人心理联结',
  301. '三月:春意盎然,适合情绪释放',
  302. '四月:清明时节,整理内心情绪',
  303. '五月:劳动之余,关注心理健康',
  304. '六月:中考高考季,减压情绪管理',
  305. '七月:暑期到来,培养情绪调节能力',
  306. '八月:夏末秋初,回顾情绪成长',
  307. '九月:开学季,关注孩子心理适应',
  308. '十月:国庆假期,增进亲子沟通',
  309. '十一月:秋冬交替,预防情绪低落',
  310. '十二月:年终总结,规划心理成长'
  311. ]
  312. return messages[month] || messages[0]
  313. },
  314. personalityScores: function() {
  315. if (!this.emiData) return []
  316. return [
  317. this.emiData.opennessScore || 0,
  318. this.emiData.conscientiousnessScore || 0,
  319. this.emiData.extraversionScore || 0,
  320. this.emiData.agreeablenessScore || 0,
  321. this.emiData.neuroticismScore || 0
  322. ]
  323. },
  324. emotionArticles: function() {
  325. if (!this.articles || this.articles.length === 0) return []
  326. var result = []
  327. for (var i = 0; i < this.articles.length; i++) {
  328. var a = this.articles[i]
  329. if (a.relatedDimensions && a.relatedDimensions.indexOf('mind') !== -1) {
  330. result.push(a)
  331. }
  332. }
  333. if (result.length === 0) return this.articles.slice(0, 5)
  334. return result.slice(0, 5)
  335. },
  336. wuxingData: function() {
  337. if (!this.traditionalData || !this.traditionalData.wuxingElements) return []
  338. var elements = this.traditionalData.wuxingElements
  339. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  340. var result = []
  341. for (var i = 0; i < keys.length; i++) {
  342. var k = keys[i]
  343. if (elements[k] !== undefined) {
  344. result.push({
  345. key: k,
  346. label: this.wuxingConfig[k].label,
  347. color: this.wuxingConfig[k].color,
  348. value: elements[k]
  349. })
  350. }
  351. }
  352. return result.sort(function(a, b) { return b.value - a.value })
  353. },
  354. currentDimensionCode: function() {
  355. return 'mind'
  356. },
  357. funcListRow1: function() {
  358. return this.funcList.slice(0, 4)
  359. },
  360. funcListRow2: function() {
  361. return this.funcList.slice(4)
  362. },
  363. // ===== 关键信息 - 家庭 =====
  364. familyWuxingLabel: function() {
  365. if (!this.compatibilityData || !this.compatibilityData.familyWuxing || !this.compatibilityData.familyWuxing.aggregatePercentages) return null
  366. var pcts = this.compatibilityData.familyWuxing.aggregatePercentages
  367. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  368. var maxKey = null
  369. var maxVal = -1
  370. for (var i = 0; i < keys.length; i++) {
  371. if (pcts[keys[i]] !== undefined && pcts[keys[i]] > maxVal) {
  372. maxVal = pcts[keys[i]]
  373. maxKey = keys[i]
  374. }
  375. }
  376. if (!maxKey) return null
  377. return { key: maxKey, label: this.wuxingConfig[maxKey].label, color: this.wuxingConfig[maxKey].color, value: maxVal }
  378. },
  379. familyMemberCount: function() {
  380. if (!this.compatibilityData || !this.compatibilityData.members) return 0
  381. return this.compatibilityData.members.length
  382. },
  383. familyWeeklyInsight: function() {
  384. if (!this.compatibilityData || !this.compatibilityData.weeklyInsight) return ''
  385. return this.compatibilityData.weeklyInsight
  386. },
  387. // ===== 关键信息 - 个人 =====
  388. dominantElement: function() {
  389. if (!this.traditionalData || !this.traditionalData.wuxingElements) return null
  390. var elements = this.traditionalData.wuxingElements
  391. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  392. var maxKey = null
  393. var maxVal = -1
  394. for (var i = 0; i < keys.length; i++) {
  395. if (elements[keys[i]] !== undefined && elements[keys[i]] > maxVal) {
  396. maxVal = elements[keys[i]]
  397. maxKey = keys[i]
  398. }
  399. }
  400. return maxKey
  401. },
  402. luckyColorInfo: function() {
  403. var colorMap = {
  404. wood: { name: '绿', hex: '#10B981' },
  405. fire: { name: '红', hex: '#FF6B9D' },
  406. earth: { name: '黄', hex: '#FF8C42' },
  407. metal: { name: '白', hex: '#6366F1' },
  408. water: { name: '蓝', hex: '#3B82F6' }
  409. }
  410. var elem = this.dominantElement
  411. if (!elem) return null
  412. return colorMap[elem] || null
  413. },
  414. luckyNumber: function() {
  415. if (this.traditionalData && this.traditionalData.lifeNumber) {
  416. return this.traditionalData.lifeNumber
  417. }
  418. var numMap = { wood: 3, fire: 9, earth: 5, metal: 7, water: 1 }
  419. var elem = this.dominantElement
  420. return elem ? numMap[elem] : null
  421. },
  422. fortuneSeed: function() {
  423. if (this.traditionalData && this.traditionalData.lifeNumber) {
  424. return String(this.traditionalData.lifeNumber)
  425. }
  426. return '0'
  427. },
  428. // WXML 不支持模板内 || {} 字面量,需在 computed 中预先做 fallback
  429. dailyFortuneSafe: function() {
  430. return this.dailyFortune || {}
  431. },
  432. // WXML 不支持模板内 || '' 字面量,需在 computed 中预先做 fallback
  433. dominantElementSafe: function() {
  434. return this.dominantElement || ''
  435. },
  436. dailyFortune: function() {
  437. // 优先使用后端接口数据
  438. if (this.dailyFortuneData) {
  439. var levels = ['大吉', '吉', '平', '凶', '大凶']
  440. return {
  441. level: this.dailyFortuneData.level,
  442. text: levels[this.dailyFortuneData.level],
  443. description: this.dailyFortuneData.description
  444. }
  445. }
  446. // 兼容模式:没有接口数据时使用原算法
  447. if (!this.dominantElement) return null
  448. var today = new Date()
  449. var dateStr = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate()
  450. var seedStr = dateStr + (this.fortuneSeed || '')
  451. var hash = 0
  452. for (var i = 0; i < seedStr.length; i++) {
  453. hash = ((hash << 5) - hash) + seedStr.charCodeAt(i)
  454. hash = hash & hash
  455. }
  456. var level = Math.abs(hash) % 5
  457. var levels = ['大吉', '吉', '平', '凶', '大凶']
  458. var descMap = {
  459. wood: ['大吉:木气旺盛,宜规划', '吉:行动力强', '平:静心养性', '凶:谨言慎行', '大凶:忌冲动'],
  460. fire: ['大吉:热情高涨', '吉:精力充沛', '平:适当休息', '凶:注意情绪', '大凶:静心冥想'],
  461. earth: ['大吉:稳重踏实', '吉:贵人运佳', '平:按部就班', '凶:注意肠胃', '大凶:不宜投资'],
  462. metal: ['大吉:决策力强', '吉:思维清晰', '平:保持专注', '凶:注意言辞', '大凶:不宜强求'],
  463. water: ['大吉:灵感丰富', '吉:人际和谐', '平:安静内省', '凶:情绪波动', '大凶:宜藏不宜放']
  464. }
  465. var descList = descMap[this.dominantElement] || descMap.wood
  466. return { level: level, text: levels[level], description: descList[level] }
  467. },
  468. /** 当前选中成员的能量数据(从 sandboxData.members 中按 selectedMemberId 查找) */
  469. currentMemberEnergies: function() {
  470. if (!this.sandboxData || !this.sandboxData.members) return null
  471. var members = this.sandboxData.members
  472. var targetId = this.selectedMemberId || this.currentChildId
  473. for (var i = 0; i < members.length; i++) {
  474. var m = members[i]
  475. if (m && (m.memberId === targetId)) return m
  476. }
  477. return members[0] || null
  478. }
  479. },
  480. onShow() {
  481. this.showTabTransition = true
  482. var token = uni.getStorageSync('token')
  483. this.isLoggedIn = !!token
  484. if (this.isLoggedIn) {
  485. this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  486. // FIX: 从 Vuex store 读取 currentChildId,而非仅从 localStorage
  487. this.currentChildId = (this.$store.state && this.$store.state.currentChildId) || uni.getStorageSync('currentChildId') || null
  488. this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '家长'
  489. }
  490. this.loadSectionConfig()
  491. if (this.isLoggedIn) {
  492. this.loadChildren()
  493. this.loadFamilyMembersVisible()
  494. this.loadSandboxData()
  495. this.loadMindRadarPopulationData()
  496. this.loadEmiData()
  497. this.loadGutData()
  498. this.loadEnergyData()
  499. this.loadTraditionalCultureData()
  500. this.loadContacts()
  501. this.loadHealthAlerts()
  502. this.loadMilestones()
  503. this.loadDanReports()
  504. }
  505. // 游客也能浏览活动和商品
  506. this.loadFamilyFortune()
  507. this._watchPageReady()
  508. },
  509. methods: {
  510. /** 获取心维度分组雷达图的分值数组 */
  511. getMindGroupScores: function(group) {
  512. var member = this.currentMemberEnergies
  513. if (!member) return []
  514. var scores = []
  515. var dims = group.dimensions
  516. for (var i = 0; i < dims.length; i++) {
  517. scores.push(member[dims[i].key] || 0)
  518. }
  519. return scores
  520. },
  521. /** 获取心维度分组雷达图的家庭平均分(sandboxData.members 各维度均值) */
  522. getMindGroupFamilyScores: function(group) {
  523. if (!this.sandboxData || !this.sandboxData.members) return []
  524. var members = this.sandboxData.members
  525. var dims = group.dimensions
  526. var scores = []
  527. for (var i = 0; i < dims.length; i++) {
  528. var key = dims[i].key
  529. var sum = 0, count = 0
  530. for (var j = 0; j < members.length; j++) {
  531. var val = members[j][key]
  532. if (val !== undefined && val !== null && val > 0) { sum += val; count++ }
  533. }
  534. scores.push(count > 0 ? Math.round(sum / count) : 0)
  535. }
  536. return scores
  537. },
  538. /** 获取分组对应的人群位置分数 */
  539. getGroupPopulationScores: function(group) {
  540. if (!this.mindPopulationScores) return []
  541. var scores = []
  542. var dims = group.dimensions
  543. for (var i = 0; i < dims.length; i++) {
  544. scores.push(this.mindPopulationScores[dims[i].key] || 0)
  545. }
  546. return scores
  547. },
  548. // ===== 区块可见性 =====
  549. loadSectionConfig: function() {
  550. var self = this
  551. var baseSections = ['func_entries', 'daily_tip', 'recommended_reading']
  552. if (!uni.getStorageSync('token')) {
  553. self.visibleSections = baseSections
  554. return
  555. }
  556. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  557. getVisibleSections({ pageKey: 'mind', role: role }).then(function(res) {
  558. if (res.code === 200 && res.data) {
  559. var keys = res.data.map(function(s) { return s.sectionKey })
  560. var merged = baseSections.slice()
  561. keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
  562. self.visibleSections = merged
  563. }
  564. }).catch(function() {
  565. self.visibleSections = ['func_entries', 'daily_tip', 'recommended_reading', 'mind_tasks', 'related_activities', 'purchased_courses']
  566. })
  567. },
  568. // 加载家庭天盘数据
  569. loadFamilyFortune: function() {
  570. var self = this
  571. if (!self.isLoggedIn) return
  572. getFamilyFortune().then(function(res) {
  573. if (res.code === 200 && res.data) {
  574. // 更新 todayMood 占位数据为真实接口数据
  575. self.todayMood = {
  576. emoji: res.data.moodEmoji || '\u{1F60A}',
  577. text: res.data.moodText || '平静',
  578. score: res.data.moodScore || 65
  579. }
  580. // 更新 dailyFortune computed 函数依赖的数据
  581. self.dailyFortuneData = {
  582. level: res.data.fortuneLevel,
  583. text: res.data.fortuneLevelText,
  584. description: res.data.fortuneDescription
  585. }
  586. // 更新主导五行
  587. self.traditionalData = self.traditionalData || {}
  588. self.traditionalData.wuxingElements = {}
  589. if (res.data.dominantElement) {
  590. self.traditionalData.wuxingElements[res.data.dominantElement] = 100
  591. }
  592. // 更新周报提示
  593. self.compatibilityData = self.compatibilityData || {}
  594. self.compatibilityData.weeklyInsight = res.data.weeklyTip || self.compatibilityData.weeklyInsight
  595. }
  596. }).catch(function(err) {
  597. console.error('Failed to load family fortune:', err)
  598. })
  599. },
  600. viewReport: function(report) {
  601. if (report && report.fileUrl) {
  602. uni.downloadFile({
  603. url: report.fileUrl,
  604. success: function(res) {
  605. if (res.statusCode === 200) {
  606. uni.openDocument({
  607. filePath: res.tempFilePath,
  608. success: function() {
  609. console.log('打开报告成功')
  610. }
  611. })
  612. }
  613. }
  614. })
  615. }
  616. },
  617. formatDate: function(dateStr) {
  618. if (!dateStr) return ''
  619. var d = parseDate(dateStr)
  620. if (!d) return ''
  621. var month = d.getMonth() + 1
  622. var day = d.getDate()
  623. return month + '月' + day + '日'
  624. },
  625. sectionVisible: function(key) {
  626. return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
  627. },
  628. // ===== 心理 Tab:EMI 数据 =====
  629. loadEmiData: function() {
  630. var self = this
  631. var memberId = self.currentChildId
  632. if (!memberId) {
  633. self.emiLoading = false
  634. return
  635. }
  636. self.emiLoading = true
  637. getEmiReport(memberId).then(function(res) {
  638. if (res.code === 200 && res.data) {
  639. self.emiData = res.data
  640. self.mindSubDims = (function() { var e = self.emiData || {}; return [{label:'情绪稳定性', score:e.emotionStability||0, desc:'识别、理解和管理情绪的综合能力'}, {label:'开放性', score:e.opennessScore||0, desc:'对新事物的接受程度'}, {label:'尽责性', score:e.conscientiousnessScore||0, desc:'做事有条理的程度'}, {label:'外向性', score:e.extraversionScore||0, desc:'社交活跃度'}, {label:'宜人性', score:e.agreeablenessScore||0, desc:'与人相处的和谐度'}, {label:'神经质', score:e.neuroticismScore||0, desc:'情绪波动程度(反向)'}, {label:'自主性', score:e.driveAutonomy||0, desc:'内在驱动力'}, {label:'胜任感', score:e.driveCompetence||0, desc:'对自己能力的信心'}, {label:'归属感', score:e.driveRelatedness||0, desc:'感受被接纳'}]; })();
  641. self.loadMindIndicators(memberId)
  642. }
  643. self.emiLoading = false
  644. }).catch(function() {
  645. self.emiLoading = false
  646. })
  647. },
  648. // ===== 肠脑轴情绪指标 =====
  649. loadGutData: function() {
  650. var self = this
  651. var memberId = self.currentChildId
  652. if (!memberId) return
  653. var token = uni.getStorageSync('token')
  654. // 获取神经递质指标
  655. uni.request({
  656. url: config.API_BASE_URL + '/api/mind/neurotransmitters',
  657. method: 'POST',
  658. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  659. data: { memberId: memberId },
  660. success: function(r) {
  661. if (r.statusCode === 200 && r.data && r.data.code === 200) {
  662. var list = r.data.data
  663. if (Array.isArray(list) && list.length > 0) {
  664. self.gutIndicators = list.slice(0, 4)
  665. }
  666. }
  667. }
  668. })
  669. // 获取情绪洞察摘要
  670. uni.request({
  671. url: config.API_BASE_URL + '/api/mind/gut-emotion-insight',
  672. method: 'POST',
  673. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  674. data: { memberId: memberId },
  675. success: function(r) {
  676. if (r.statusCode === 200 && r.data && r.data.code === 200 && r.data.data) {
  677. self.gutInsight = r.data.data.summary || ''
  678. }
  679. }
  680. })
  681. },
  682. indicatorColor: function(status) {
  683. if (status === 'abnormal' || status === '偏高' || status === '偏低') return '#EF4444'
  684. if (status === 'warning' || status === '偏高' || status === '偏低') return '#F59E0B'
  685. return '#10B981'
  686. },
  687. statusLabel: function(status) {
  688. if (status === 'normal') return '正常'
  689. if (status === 'abnormal') return '异常'
  690. if (status === 'warning') return '警讯'
  691. return status || '正常'
  692. },
  693. // ===== EMI 分数评级 =====
  694. getScoreLevel: function(score) {
  695. if (score >= 85) return 'excellent'
  696. if (score >= 70) return 'good'
  697. if (score >= 55) return 'average'
  698. return 'low'
  699. },
  700. getScoreLevelText: function(score) {
  701. if (score >= 85) return '优秀'
  702. if (score >= 70) return '良好'
  703. if (score >= 55) return '一般'
  704. return '需提升'
  705. },
  706. // ===== 导航 =====
  707. goEmotionReport: function() {
  708. var memberId = this.currentChildId || ''
  709. uni.navigateTo({ url: '/pages/mind-detail/emotion-report?memberId=' + memberId })
  710. },
  711. goArticles: function() {
  712. uni.navigateTo({ url: '/pages/article-center/index?dimension=mind' })
  713. },
  714. onFuncClick: function(item) {
  715. if (item.needLogin && !this.isLoggedIn) {
  716. uni.showModal({
  717. title: '提示',
  718. content: '请先登录后使用此功能',
  719. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  720. })
  721. return
  722. }
  723. if (item.page) {
  724. var url = item.page
  725. if (item.page.indexOf('innate-portrait') !== -1 || item.page.indexOf('innate-trajectory') !== -1) {
  726. var memberId = this.currentChildId
  727. if (!memberId) {
  728. uni.showToast({ title: '请先选择家庭成员', icon: 'none' })
  729. return
  730. }
  731. var familyId = (this.$store.state && this.$store.state.familyId) || uni.getStorageSync('familyId') || ''
  732. url += '?memberId=' + memberId + '&memberType=child&familyId=' + familyId
  733. }
  734. nav.goPage(url)
  735. }
  736. },
  737. // ===== 孩子列表与维度数据 =====
  738. loadChildren: function() {
  739. var self = this
  740. getChildren().then(function(res) {
  741. if (res.code === 200 && res.data) {
  742. self.children = res.data
  743. var savedChildId = uni.getStorageSync('currentChildId')
  744. var found = false
  745. for (var i = 0; i < self.children.length; i++) {
  746. if (self.children[i].memberId === savedChildId) {
  747. self.currentChildId = savedChildId
  748. found = true
  749. break
  750. }
  751. }
  752. // FIX: 不再自动选择第一个孩子。仅在用户通过 UserQuickEntry 切换时设置 currentChildId
  753. if (found) {
  754. self.loadDimensionData()
  755. self.loadEmiData()
  756. }
  757. }
  758. }).catch(function(e) {
  759. console.log('获取孩子列表失败', e)
  760. })
  761. },
  762. loadDimensionData: function() {
  763. if (this.familyMembersVisible.length > 0) {
  764. this.loadCompatibilityData()
  765. }
  766. },
  767. loadSandboxData: function() {
  768. var self = this
  769. getFamilyEnergySandbox().then(function(res) {
  770. if (res && res.data) {
  771. self.sandboxData = res.data
  772. }
  773. }).catch(function() {})
  774. },
  775. loadMindRadarPopulationData: function() {
  776. var self = this
  777. if (!this.currentChildId && !this.selectedMemberId) return
  778. var memberId = this.selectedMemberId || this.currentChildId
  779. if (!memberId) return
  780. getRadarData({
  781. memberId: memberId,
  782. dimensions: ['bigFiveOpenness','bigFiveConscientiousness','bigFiveExtraversion','bigFiveAgreeableness','bigFiveNeuroticism','emotionStability','driveAutonomy','driveCompetence','driveRelatedness','selfConceptOverall']
  783. }).then(function(res) {
  784. if (res && res.data && res.data.populationScores) {
  785. var dims = res.data.dimensions || []
  786. var scores = res.data.populationScores
  787. var map = {}
  788. for (var i = 0; i < dims.length && i < scores.length; i++) {
  789. map[dims[i]] = scores[i]
  790. }
  791. self.mindPopulationScores = map
  792. }
  793. }).catch(function(e) { console.warn('[mind] radar-data failed', e) })
  794. },
  795. switchView: function(view) {
  796. this.currentView = view
  797. if (view === 'family') {
  798. this.selectedMemberId = null
  799. var self = this
  800. getEnergySandbox('family').then(function(res) {
  801. if (res && res.data && !res.data.locked) {
  802. self.sandboxData = res.data.familyData || res.data
  803. }
  804. }).catch(function(e) { console.log('获取家庭数据失败', e) })
  805. } else {
  806. this.loadSandboxData()
  807. }
  808. },
  809. },
  810. loadEnergyData: function() {
  811. var self = this
  812. if (!this.currentChildId) return
  813. getEnergyOverview(this.currentChildId).then(function(res) {
  814. if (res && res.data) {
  815. var dims = res.data.dimensions
  816. if (dims && dims.length > 0) {
  817. for (var i = 0; i < dims.length; i++) {
  818. if (dims[i] && dims[i].code === 'mind' && res.data.energyScores) {
  819. self.familyScore = res.data.energyScores.mindScore || 0
  820. }
  821. }
  822. }
  823. }
  824. }).catch(function(e) {
  825. console.log('获取能量概览失败', e)
  826. })
  827. },
  828. onFamilyMemberSelect: function(member) {
  829. this.selectedMemberId = member.id
  830. },
  831. onChildChanged: function(child) {
  832. this.currentChildId = child.memberId
  833. // FIX: 同步提交到 Vuex store
  834. this.$store.commit('switchToChild', child.memberId)
  835. this.loadDimensionData()
  836. this.loadEmiData()
  837. this.loadTraditionalCultureData()
  838. },
  839. loadMindIndicators: function(memberId) {
  840. var self = this
  841. getLatestIndicators({ memberId: memberId, domain: 'mind' }).then(function(res) {
  842. if (res.code === 200) self.mindIndicators = res.data || []
  843. }).catch(function(e) { console.log('[mind] loadMindIndicators failed', e) })
  844. },
  845. goMindDetail: function() {
  846. var id = this.activeChildId || uni.getStorageSync('currentChildId')
  847. if (!id) return
  848. uni.navigateTo({ url: '/pages/mind-detail/member-mind-detail?memberId=' + id })
  849. },
  850. formatNumeric: function(v) {
  851. if (v === null || v === undefined) return ''
  852. var n = parseFloat(v)
  853. if (isNaN(n)) return String(v)
  854. return n % 1 === 0 ? String(n) : n.toFixed(1)
  855. },
  856. loadFamilyMembersVisible: function() {
  857. var self = this
  858. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  859. self.familyMembersVisible = res.data || []
  860. }).catch(function(e) {
  861. console.log('获取可见家庭成员失败', e)
  862. self.familyMembersVisible = []
  863. })
  864. },
  865. loadCompatibilityData: function() {
  866. var self = this
  867. var token = uni.getStorageSync('token')
  868. uni.request({
  869. url: config.API_BASE_URL + '/api/mind/traditional/family-dashboard',
  870. method: 'POST',
  871. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  872. data: {},
  873. success: function(res) {
  874. if (res.data && res.data.code === 200 && res.data.data) {
  875. self.compatibilityData = res.data.data
  876. }
  877. },
  878. fail: function() {}
  879. })
  880. },
  881. scrollToSection: function(section) {
  882. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  883. },
  884. goAssessment: function() { uni.navigateTo({ url: '/pages/assessment/apply' }) },
  885. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  886. // ===== 传统文化数据 =====
  887. // ===== 联系人 / 关系健康 =====
  888. loadContacts: function() {
  889. var self = this
  890. getContactList({}).then(function(res) {
  891. if (res.code === 200) {
  892. self.contactList = Array.isArray(res.data) ? res.data : []
  893. } else {
  894. self.contactList = []
  895. }
  896. }).catch(function() {
  897. self.contactList = []
  898. })
  899. },
  900. loadHealthAlerts: function() {
  901. var self = this
  902. getHealthAlerts().then(function(res) {
  903. if (res.code === 200) {
  904. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  905. } else {
  906. self.healthAlerts = []
  907. }
  908. }).catch(function() {
  909. self.healthAlerts = []
  910. })
  911. },
  912. loadMilestones: function() {
  913. var self = this
  914. getMilestones(30).then(function(res) {
  915. if (res.code === 200) {
  916. self.milestones = Array.isArray(res.data) ? res.data : []
  917. } else {
  918. self.milestones = []
  919. }
  920. }).catch(function() {
  921. self.milestones = []
  922. })
  923. },
  924. loadTraditionalCultureData: function() {
  925. var self = this
  926. var memberId = this.currentChildId
  927. if (!memberId) {
  928. self.traditionalLoading = false
  929. return
  930. }
  931. self.traditionalLoading = true
  932. uni.request({
  933. url: config.API_BASE_URL + '/api/mind/traditional/mirror',
  934. method: 'POST',
  935. data: { memberId: memberId, memberType: 'child' },
  936. success: function(res) {
  937. self.traditionalLoading = false
  938. if (res.data && res.data.code === 200 && res.data.data) {
  939. var d = res.data.data
  940. if (d.eightCharacters || d.wuxingElements || d.zodiac || d.numSoul) {
  941. self.traditionalData = d
  942. } else {
  943. self.traditionalData = null
  944. }
  945. } else {
  946. self.traditionalData = null
  947. }
  948. },
  949. fail: function() {
  950. self.traditionalLoading = false
  951. self.traditionalData = null
  952. }
  953. })
  954. },
  955. _watchPageReady() {
  956. var self = this
  957. var unwatch = this.$watch(function() {
  958. if (self.isLoggedIn) {
  959. return !!(self.emiData || self.energyOverview)
  960. } }, function(val) {
  961. if (val) {
  962. if (unwatch) unwatch()
  963. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  964. }
  965. })
  966. },
  967. // ===== DAN 报告 =====
  968. loadDanReports: function() {
  969. var self = this
  970. var memberId = self.currentChildId
  971. if (!memberId) return
  972. getDanReportByChild(memberId, 'mind').then(function(res) {
  973. if (res.code === 200 && res.data) {
  974. self.danReports = res.data
  975. }
  976. }).catch(function() {})
  977. },
  978. goDanUpload: function(dimension) {
  979. uni.navigateTo({ url: '/pages/health/report-upload' })
  980. },
  981. viewDanReport: function(report) {
  982. var reportId = report.sourceReportId || report.id
  983. uni.navigateTo({ url: '/pages/health/report-detail?reportType=dan&reportId=' + reportId })
  984. },
  985. formatDate: function(dateStr) {
  986. if (!dateStr) return ''
  987. var d = parseDate(dateStr)
  988. if (!d) return ''
  989. return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
  990. }
  991. }
  992. </script>
  993. <style scoped>
  994. .container {
  995. min-height: 100vh;
  996. background: #f5f7fa;
  997. padding-bottom: 120rpx;
  998. }
  999. /* ===== 心·心理 标题栏 ===== */
  1000. .section-title-bar {
  1001. display: flex;
  1002. flex-direction: row;
  1003. align-items: center;
  1004. margin: 20rpx 30rpx 10rpx;
  1005. padding: 16rpx 24rpx;
  1006. background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  1007. border-radius: 20rpx;
  1008. box-shadow: 0 4rpx 16rpx rgba(139,92,246,0.25);
  1009. }
  1010. .section-title-icon {
  1011. font-size: 32rpx;
  1012. color: #fff;
  1013. margin-right: 12rpx;
  1014. }
  1015. .section-title-text {
  1016. font-size: 32rpx;
  1017. font-weight: bold;
  1018. color: #fff;
  1019. }
  1020. /* ===== 心理报告上传卡片 ===== */
  1021. .mind-report-section {
  1022. margin: 20rpx 30rpx;
  1023. }
  1024. .mind-report-card {
  1025. display: flex;
  1026. flex-direction: row;
  1027. align-items: center;
  1028. background: linear-gradient(135deg, #F3E8FF, #FCE4EC);
  1029. border-radius: 20rpx;
  1030. padding: 28rpx 24rpx;
  1031. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1032. }
  1033. .mind-report-left {
  1034. width: 100rpx;
  1035. height: 100rpx;
  1036. background: rgba(255,255,255,0.7);
  1037. border-radius: 20rpx;
  1038. display: flex;
  1039. align-items: center;
  1040. justify-content: center;
  1041. margin-right: 20rpx;
  1042. flex-shrink: 0;
  1043. }
  1044. .mind-report-icon {
  1045. font-size: 52rpx;
  1046. }
  1047. .mind-report-right {
  1048. flex: 1;
  1049. }
  1050. .mind-report-title {
  1051. font-size: 30rpx;
  1052. font-weight: bold;
  1053. color: #7C3AED;
  1054. display: block;
  1055. margin-bottom: 6rpx;
  1056. }
  1057. .mind-report-desc {
  1058. font-size: 22rpx;
  1059. color: #A855F7;
  1060. line-height: 1.5;
  1061. display: block;
  1062. margin-bottom: 10rpx;
  1063. }
  1064. .mind-report-tags {
  1065. display: flex;
  1066. flex-direction: row;
  1067. gap: 10rpx;
  1068. }
  1069. .mind-tag {
  1070. font-size: 20rpx;
  1071. color: #7C3AED;
  1072. background: rgba(255,255,255,0.6);
  1073. padding: 4rpx 14rpx;
  1074. border-radius: 20rpx;
  1075. }
  1076. .mind-report-arrow {
  1077. font-size: 36rpx;
  1078. color: #C084FC;
  1079. margin-left: 10rpx;
  1080. flex-shrink: 0;
  1081. }
  1082. .mind-report-card:active {
  1083. opacity: 0.7;
  1084. }
  1085. .mind-report-list {
  1086. margin-top: 12rpx;
  1087. }
  1088. .mind-report-item {
  1089. display: flex;
  1090. flex-direction: row;
  1091. align-items: center;
  1092. background: #fff;
  1093. border-radius: 14rpx;
  1094. padding: 20rpx 20rpx;
  1095. margin-bottom: 8rpx;
  1096. box-shadow: 0 1rpx 6rpx rgba(0,0,0,0.05);
  1097. }
  1098. .mind-report-item:active {
  1099. opacity: 0.7;
  1100. }
  1101. .mind-report-item-icon {
  1102. font-size: 28rpx;
  1103. margin-right: 14rpx;
  1104. }
  1105. .mind-report-item-name {
  1106. font-size: 26rpx;
  1107. color: #333;
  1108. flex: 1;
  1109. }
  1110. .mind-report-item-date {
  1111. font-size: 22rpx;
  1112. color: #999;
  1113. margin-right: 14rpx;
  1114. }
  1115. .mind-report-item-status {
  1116. font-size: 22rpx;
  1117. padding: 2rpx 12rpx;
  1118. border-radius: 20rpx;
  1119. }
  1120. .mind-report-item-status.parsed {
  1121. color: #7C3AED;
  1122. background: #F3E8FF;
  1123. }
  1124. .mind-report-item-status.pending {
  1125. color: #999;
  1126. background: #F5F5F5;
  1127. }
  1128. .mind-report-empty {
  1129. display: flex;
  1130. flex-direction: row;
  1131. align-items: center;
  1132. justify-content: center;
  1133. padding: 24rpx;
  1134. margin-top: 8rpx;
  1135. }
  1136. .mind-report-empty-icon {
  1137. font-size: 32rpx;
  1138. margin-right: 10rpx;
  1139. }
  1140. .mind-report-empty-text {
  1141. font-size: 24rpx;
  1142. color: #bbb;
  1143. }
  1144. /* ===== 心理能量概况 ===== */
  1145. .energy-overview {
  1146. display: flex;
  1147. flex-direction: row;
  1148. margin: 20rpx 30rpx;
  1149. background: #fff;
  1150. border-radius: 20rpx;
  1151. padding: 24rpx 16rpx;
  1152. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1153. justify-content: space-around;
  1154. }
  1155. .energy-badge {
  1156. display: flex;
  1157. flex-direction: column;
  1158. align-items: center;
  1159. flex: 1;
  1160. }
  1161. .badge-icon {
  1162. font-size: 36rpx;
  1163. margin-bottom: 8rpx;
  1164. }
  1165. .badge-value {
  1166. font-size: 36rpx;
  1167. font-weight: bold;
  1168. color: #333;
  1169. }
  1170. .badge-label {
  1171. font-size: 20rpx;
  1172. color: #999;
  1173. margin-top: 4rpx;
  1174. }
  1175. /* ===== EMI 四维条形图 ===== */
  1176. .emi-section {
  1177. margin: 20rpx 30rpx;
  1178. }
  1179. .emi-card {
  1180. background: #fff;
  1181. border-radius: 24rpx;
  1182. padding: 30rpx;
  1183. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1184. }
  1185. .emi-card-title {
  1186. font-size: 30rpx;
  1187. font-weight: bold;
  1188. color: #333;
  1189. display: block;
  1190. }
  1191. .personality-header {
  1192. display: flex;
  1193. flex-direction: row;
  1194. align-items: center;
  1195. justify-content: space-between;
  1196. margin-bottom: 24rpx;
  1197. }
  1198. .test-btn {
  1199. background: #8B5CF6;
  1200. padding: 8rpx 28rpx;
  1201. border-radius: 30rpx;
  1202. }
  1203. .test-btn-text {
  1204. font-size: 24rpx;
  1205. color: #fff;
  1206. font-weight: 500;
  1207. }
  1208. .emi-bar-item {
  1209. display: flex;
  1210. flex-direction: row;
  1211. align-items: center;
  1212. margin-bottom: 20rpx;
  1213. }
  1214. .emi-bar-label {
  1215. font-size: 24rpx;
  1216. color: #666;
  1217. width: 120rpx;
  1218. flex-shrink: 0;
  1219. }
  1220. .emi-bar-track {
  1221. flex: 1;
  1222. height: 20rpx;
  1223. background: #f0f0f0;
  1224. border-radius: 10rpx;
  1225. overflow: hidden;
  1226. margin: 0 16rpx;
  1227. }
  1228. .emi-bar-fill {
  1229. height: 100%;
  1230. border-radius: 10rpx;
  1231. transition: width 0.5s;
  1232. }
  1233. .emi-bar-score {
  1234. font-size: 26rpx;
  1235. font-weight: bold;
  1236. color: #333;
  1237. width: 60rpx;
  1238. text-align: right;
  1239. flex-shrink: 0;
  1240. }
  1241. .emi-bar-level {
  1242. font-size: 20rpx;
  1243. width: 80rpx;
  1244. text-align: right;
  1245. flex-shrink: 0;
  1246. }
  1247. .level-excellent { color: #10B981; }
  1248. .level-good { color: #3B82F6; }
  1249. .level-average { color: #F97316; }
  1250. .level-low { color: #EF4444; }
  1251. .emi-footer {
  1252. display: flex;
  1253. flex-direction: row;
  1254. justify-content: space-between;
  1255. align-items: center;
  1256. margin-top: 20rpx;
  1257. padding-top: 20rpx;
  1258. border-top: 1rpx solid #f0f0f0;
  1259. }
  1260. .emi-overall {
  1261. font-size: 28rpx;
  1262. font-weight: bold;
  1263. color: #FF6B35;
  1264. }
  1265. .emi-link {
  1266. display: flex;
  1267. flex-direction: row;
  1268. align-items: center;
  1269. }
  1270. .emi-link-text {
  1271. font-size: 26rpx;
  1272. color: #FF6B35;
  1273. font-weight: 500;
  1274. }
  1275. .emi-link-arrow {
  1276. font-size: 26rpx;
  1277. color: #FF6B35;
  1278. margin-left: 8rpx;
  1279. }
  1280. /* ===== EMI 心理报告卡片 ===== */
  1281. .emi-card {
  1282. margin: 30rpx;
  1283. background: #fff;
  1284. border-radius: 24rpx;
  1285. padding: 30rpx;
  1286. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1287. }
  1288. .emi-header {
  1289. margin-bottom: 24rpx;
  1290. }
  1291. .emi-title {
  1292. font-size: 30rpx;
  1293. font-weight: bold;
  1294. color: #333;
  1295. display: block;
  1296. }
  1297. .emi-overall-wrap {
  1298. display: flex;
  1299. flex-direction: column;
  1300. align-items: center;
  1301. padding: 32rpx 0;
  1302. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1303. border-radius: 16rpx;
  1304. margin: 20rpx 0;
  1305. color: #fff;
  1306. }
  1307. .emi-overall-label {
  1308. font-size: 26rpx;
  1309. margin-bottom: 6rpx;
  1310. }
  1311. .emi-overall-value {
  1312. font-size: 64rpx;
  1313. font-weight: bold;
  1314. margin-bottom: 6rpx;
  1315. }
  1316. .emi-overall-level {
  1317. font-size: 24rpx;
  1318. padding: 4rpx 16rpx;
  1319. border-radius: 12rpx;
  1320. background: rgba(255,255,255,0.2);
  1321. }
  1322. .emi-dimensions {
  1323. display: flex;
  1324. flex-direction: column;
  1325. gap: 20rpx;
  1326. }
  1327. .emi-dimension {
  1328. display: flex;
  1329. flex-direction: column;
  1330. }
  1331. .emi-dim-header {
  1332. display: flex;
  1333. flex-direction: row;
  1334. justify-content: space-between;
  1335. align-items: center;
  1336. margin-bottom: 8rpx;
  1337. }
  1338. .emi-dim-label {
  1339. font-size: 26rpx;
  1340. color: #666;
  1341. }
  1342. .emi-dim-values {
  1343. display: flex;
  1344. flex-direction: row;
  1345. align-items: center;
  1346. }
  1347. .emi-dim-score {
  1348. font-size: 28rpx;
  1349. font-weight: bold;
  1350. color: #FF6B35;
  1351. margin-right: 12rpx;
  1352. }
  1353. .emi-dim-level {
  1354. font-size: 20rpx;
  1355. padding: 2rpx 12rpx;
  1356. border-radius: 8rpx;
  1357. }
  1358. .emi-dim-bar {
  1359. height: 14rpx;
  1360. background: #f0f0f0;
  1361. border-radius: 7rpx;
  1362. overflow: hidden;
  1363. }
  1364. .emi-dim-bar-fill {
  1365. height: 100%;
  1366. border-radius: 7rpx;
  1367. transition: width 0.5s;
  1368. }
  1369. .emi-footer {
  1370. display: flex;
  1371. justify-content: flex-end;
  1372. align-items: center;
  1373. padding-top: 20rpx;
  1374. border-top: 1rpx solid #f0f0f0;
  1375. margin-top: 20rpx;
  1376. }
  1377. .emi-footer-text {
  1378. font-size: 24rpx;
  1379. color: #F97316;
  1380. font-weight: 500;
  1381. }
  1382. .emi-footer-icon {
  1383. font-size: 24rpx;
  1384. margin-left: 8rpx;
  1385. }
  1386. .level-excellent { color: #10B981; background: #ECFDF5; }
  1387. .level-good { color: #3B82F6; background: #EFF6FF; }
  1388. .level-average { color: #F97316; background: #FFF7ED; }
  1389. .level-low { color: #EF4444; background: #FEF2F2; }
  1390. /* 雷达图内的空状态 */
  1391. .placeholder-content {
  1392. display: flex;
  1393. flex-direction: column;
  1394. align-items: center;
  1395. padding: 40rpx 20rpx;
  1396. }
  1397. /* ===== 占位卡 ===== */
  1398. .placeholder-card {
  1399. margin: 30rpx;
  1400. background: #fff;
  1401. border-radius: 24rpx;
  1402. padding: 60rpx 40rpx;
  1403. display: flex;
  1404. flex-direction: column;
  1405. align-items: center;
  1406. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1407. }
  1408. .placeholder-icon {
  1409. font-size: 80rpx;
  1410. margin-bottom: 20rpx;
  1411. }
  1412. .placeholder-title {
  1413. font-size: 32rpx;
  1414. font-weight: bold;
  1415. color: #333;
  1416. margin-bottom: 16rpx;
  1417. }
  1418. .placeholder-desc {
  1419. font-size: 26rpx;
  1420. color: #999;
  1421. text-align: center;
  1422. line-height: 1.6;
  1423. margin-bottom: 30rpx;
  1424. }
  1425. .placeholder-btn {
  1426. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1427. color: #fff;
  1428. font-size: 28rpx;
  1429. font-weight: bold;
  1430. padding: 16rpx 64rpx;
  1431. border-radius: 40rpx;
  1432. box-shadow: 0 4rpx 16rpx rgba(255,107,53,0.3);
  1433. }
  1434. /* ===== 传统文化卡片 ===== */
  1435. .culture-section {
  1436. margin: 20rpx 30rpx;
  1437. }
  1438. .culture-card {
  1439. background: #fff;
  1440. border-radius: 20rpx;
  1441. padding: 24rpx;
  1442. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1443. margin-bottom: 16rpx;
  1444. }
  1445. .culture-card-header {
  1446. display: flex;
  1447. align-items: center;
  1448. margin-bottom: 16rpx;
  1449. }
  1450. .culture-card-icon {
  1451. font-size: 32rpx;
  1452. margin-right: 10rpx;
  1453. }
  1454. .culture-card-title {
  1455. font-size: 28rpx;
  1456. font-weight: 600;
  1457. color: #333;
  1458. }
  1459. .culture-card-body {
  1460. font-size: 24rpx;
  1461. color: #666;
  1462. line-height: 1.6;
  1463. }
  1464. /* 八字四柱 */
  1465. .bazi-grid {
  1466. display: flex;
  1467. justify-content: space-around;
  1468. padding: 8rpx 0;
  1469. }
  1470. .bazi-column {
  1471. display: flex;
  1472. flex-direction: column;
  1473. align-items: center;
  1474. }
  1475. .bazi-pillar-label {
  1476. font-size: 22rpx;
  1477. color: #999;
  1478. margin-bottom: 6rpx;
  1479. }
  1480. .bazi-pillar-value {
  1481. font-size: 32rpx;
  1482. font-weight: 700;
  1483. color: #8B5CF6;
  1484. background: #F5F0FF;
  1485. padding: 10rpx 14rpx;
  1486. border-radius: 10rpx;
  1487. }
  1488. /* 五行能量 */
  1489. .wuxing-list {
  1490. display: flex;
  1491. flex-direction: column;
  1492. gap: 12rpx;
  1493. }
  1494. .wuxing-item {
  1495. display: flex;
  1496. align-items: center;
  1497. gap: 12rpx;
  1498. }
  1499. .wuxing-label {
  1500. font-size: 26rpx;
  1501. font-weight: 600;
  1502. width: 44rpx;
  1503. text-align: center;
  1504. }
  1505. .wuxing-bar-track {
  1506. flex: 1;
  1507. height: 20rpx;
  1508. background: #F0F0F0;
  1509. border-radius: 10rpx;
  1510. overflow: hidden;
  1511. }
  1512. .wuxing-bar-fill {
  1513. height: 100%;
  1514. border-radius: 10rpx;
  1515. }
  1516. .wuxing-value {
  1517. font-size: 22rpx;
  1518. color: #666;
  1519. width: 56rpx;
  1520. text-align: right;
  1521. }
  1522. .energy-card {
  1523. margin-top: 20rpx;
  1524. padding: 24rpx 20rpx;
  1525. background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  1526. border-radius: 20rpx;
  1527. position: relative;
  1528. overflow: hidden;
  1529. }
  1530. .energy-card::before {
  1531. content: '';
  1532. position: absolute;
  1533. top: -60rpx;
  1534. right: -60rpx;
  1535. width: 200rpx;
  1536. height: 200rpx;
  1537. background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
  1538. border-radius: 50%;
  1539. }
  1540. .energy-card::after {
  1541. content: '';
  1542. position: absolute;
  1543. bottom: -40rpx;
  1544. left: -40rpx;
  1545. width: 160rpx;
  1546. height: 160rpx;
  1547. background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  1548. border-radius: 50%;
  1549. }
  1550. .energy-header {
  1551. display: flex;
  1552. align-items: center;
  1553. margin-bottom: 14rpx;
  1554. position: relative;
  1555. z-index: 1;
  1556. }
  1557. .energy-icon {
  1558. font-size: 32rpx;
  1559. margin-right: 10rpx;
  1560. }
  1561. .energy-label {
  1562. font-size: 28rpx;
  1563. font-weight: 700;
  1564. background: linear-gradient(135deg, #F59E0B, #FF6B9D);
  1565. -webkit-background-clip: text;
  1566. -webkit-text-fill-color: transparent;
  1567. background-clip: text;
  1568. }
  1569. .energy-divider {
  1570. height: 2rpx;
  1571. background: linear-gradient(90deg, rgba(255,215,0,0.5), rgba(255,107,157,0.3), transparent);
  1572. margin-bottom: 18rpx;
  1573. position: relative;
  1574. z-index: 1;
  1575. }
  1576. .energy-quote {
  1577. font-size: 26rpx;
  1578. color: #E2E8F0;
  1579. line-height: 1.8;
  1580. display: block;
  1581. margin-bottom: 14rpx;
  1582. position: relative;
  1583. z-index: 1;
  1584. padding-left: 20rpx;
  1585. letter-spacing: 1rpx;
  1586. }
  1587. .energy-quote::before {
  1588. content: '';
  1589. position: absolute;
  1590. left: 0;
  1591. top: 4rpx;
  1592. bottom: 4rpx;
  1593. width: 4rpx;
  1594. background: linear-gradient(180deg, #F59E0B, #FF6B9D);
  1595. border-radius: 2rpx;
  1596. }
  1597. .energy-advice {
  1598. font-size: 24rpx;
  1599. color: #94A3B8;
  1600. line-height: 1.7;
  1601. display: block;
  1602. position: relative;
  1603. z-index: 1;
  1604. padding: 14rpx 18rpx;
  1605. background: rgba(255,255,255,0.05);
  1606. border-radius: 12rpx;
  1607. border: 1rpx solid rgba(255,255,255,0.08);
  1608. }
  1609. .energy-footer {
  1610. display: flex;
  1611. justify-content: center;
  1612. gap: 12rpx;
  1613. margin-top: 18rpx;
  1614. position: relative;
  1615. z-index: 1;
  1616. }
  1617. .energy-footer-dot {
  1618. width: 8rpx;
  1619. height: 8rpx;
  1620. border-radius: 50%;
  1621. background: rgba(255,255,255,0.3);
  1622. }
  1623. .energy-footer-dot:nth-child(2) {
  1624. background: rgba(255,215,0,0.6);
  1625. width: 10rpx;
  1626. height: 10rpx;
  1627. }
  1628. /* 星座+灵数双栏 */
  1629. .culture-dual {
  1630. display: flex;
  1631. gap: 16rpx;
  1632. }
  1633. .culture-dual-item {
  1634. flex: 1;
  1635. background: #fff;
  1636. border-radius: 20rpx;
  1637. padding: 20rpx;
  1638. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1639. display: flex;
  1640. flex-direction: column;
  1641. align-items: center;
  1642. }
  1643. .culture-dual-icon {
  1644. font-size: 36rpx;
  1645. margin-bottom: 8rpx;
  1646. }
  1647. .culture-dual-label {
  1648. font-size: 22rpx;
  1649. color: #999;
  1650. margin-bottom: 6rpx;
  1651. }
  1652. .culture-dual-value {
  1653. font-size: 28rpx;
  1654. font-weight: 700;
  1655. color: #8B5CF6;
  1656. }
  1657. .culture-empty {
  1658. text-align: center;
  1659. padding: 30rpx 0;
  1660. color: #bbb;
  1661. font-size: 24rpx;
  1662. }
  1663. /* ===== 每日心理 ===== */
  1664. .tip-card {
  1665. background: #fff;
  1666. border-radius: 20rpx;
  1667. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1668. display: flex;
  1669. flex-direction: row;
  1670. overflow: hidden;
  1671. }
  1672. .tip-left-bar {
  1673. width: 6rpx;
  1674. background: linear-gradient(180deg, #5B9BD5, #8FC5E8);
  1675. flex-shrink: 0;
  1676. }
  1677. .tip-body {
  1678. flex: 1;
  1679. padding: 28rpx 24rpx;
  1680. }
  1681. .tip-title {
  1682. font-size: 28rpx;
  1683. font-weight: bold;
  1684. color: #5B9BD5;
  1685. display: block;
  1686. margin-bottom: 12rpx;
  1687. }
  1688. .tip-content {
  1689. font-size: 24rpx;
  1690. color: #666;
  1691. line-height: 1.6;
  1692. display: block;
  1693. margin-bottom: 16rpx;
  1694. }
  1695. .tip-footer {
  1696. display: flex;
  1697. flex-direction: row;
  1698. justify-content: flex-end;
  1699. }
  1700. .tip-source {
  1701. font-size: 22rpx;
  1702. color: #bbb;
  1703. }
  1704. /* ===== 通用区块 ===== */
  1705. .section {
  1706. margin: 20rpx 30rpx;
  1707. }
  1708. .section-header {
  1709. margin-bottom: 20rpx;
  1710. }
  1711. .section-title {
  1712. font-size: 30rpx;
  1713. font-weight: bold;
  1714. color: #333;
  1715. }
  1716. /* ===== 推荐阅读 ===== */
  1717. .article-list {
  1718. display: flex;
  1719. flex-direction: column;
  1720. }
  1721. .article-card {
  1722. background: #fff;
  1723. border-radius: 20rpx;
  1724. padding: 28rpx 24rpx;
  1725. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1726. margin-bottom: 20rpx;
  1727. }
  1728. .article-category {
  1729. display: inline-block;
  1730. padding: 4rpx 18rpx;
  1731. border-radius: 20rpx;
  1732. margin-bottom: 14rpx;
  1733. }
  1734. .article-category-text {
  1735. font-size: 20rpx;
  1736. color: #fff;
  1737. font-weight: 500;
  1738. }
  1739. .article-title {
  1740. font-size: 28rpx;
  1741. font-weight: bold;
  1742. color: #333;
  1743. display: block;
  1744. margin-bottom: 10rpx;
  1745. }
  1746. .article-summary {
  1747. font-size: 24rpx;
  1748. color: #888;
  1749. line-height: 1.5;
  1750. display: block;
  1751. margin-bottom: 20rpx;
  1752. }
  1753. .article-meta {
  1754. display: flex;
  1755. flex-direction: row;
  1756. align-items: center;
  1757. justify-content: space-between;
  1758. }
  1759. .meta-item {
  1760. display: flex;
  1761. flex-direction: row;
  1762. align-items: center;
  1763. margin-right: 20rpx;
  1764. }
  1765. .meta-icon {
  1766. font-size: 22rpx;
  1767. margin-right: 4rpx;
  1768. }
  1769. .meta-text {
  1770. font-size: 22rpx;
  1771. color: #bbb;
  1772. }
  1773. .article-date {
  1774. font-size: 22rpx;
  1775. color: #bbb;
  1776. margin-left: auto;
  1777. }
  1778. /* ===== 功能区入口 ===== */
  1779. .func-section {
  1780. margin: 20rpx 30rpx;
  1781. }
  1782. .func-grid {
  1783. display: flex;
  1784. flex-direction: column;
  1785. gap: 16rpx;
  1786. background: #fff;
  1787. border-radius: 20rpx;
  1788. padding: 24rpx 16rpx;
  1789. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1790. }
  1791. .func-row {
  1792. display: flex;
  1793. flex-direction: row;
  1794. justify-content: space-between;
  1795. }
  1796. .func-item {
  1797. display: flex;
  1798. flex-direction: column;
  1799. align-items: center;
  1800. flex: 1;
  1801. }
  1802. .func-icon-wrap {
  1803. width: 80rpx;
  1804. height: 80rpx;
  1805. border-radius: 40rpx;
  1806. background: linear-gradient(135deg, #D6EAF8, #EBF2FA);
  1807. display: flex;
  1808. align-items: center;
  1809. justify-content: center;
  1810. margin-bottom: 10rpx;
  1811. }
  1812. .func-icon {
  1813. font-size: 40rpx;
  1814. }
  1815. .func-label {
  1816. font-size: 22rpx;
  1817. color: #666;
  1818. font-weight: 500;
  1819. }
  1820. .func-item:active {
  1821. opacity: 0.7;
  1822. }
  1823. /* ===== 底部 ===== */
  1824. .indicator-cards-section { margin: 20rpx 30rpx; }
  1825. .indicator-cards { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16rpx; }
  1826. .indicator-card { width: calc(50% - 8rpx); background: #fff; border-radius: 20rpx; padding: 24rpx 20rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
  1827. .indicator-card.no-data { opacity: 0.5; }
  1828. .indicator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
  1829. .indicator-name { font-size: 26rpx; color: #666; font-weight: 500; }
  1830. .indicator-unit { font-size: 22rpx; color: #999; }
  1831. .indicator-body { margin-bottom: 8rpx; }
  1832. .indicator-value { font-size: 40rpx; font-weight: bold; color: #FF6B9D; }
  1833. .indicator-placeholder { font-size: 26rpx; color: #ccc; }
  1834. .indicator-range { font-size: 20rpx; color: #bbb; }
  1835. .bottom-spacer { height: 120rpx; }
  1836. /* ===== 肠脑轴 ===== */
  1837. .gut-insight-text {
  1838. font-size: 24rpx;
  1839. color: #666;
  1840. margin-bottom: 16rpx;
  1841. padding: 12rpx 16rpx;
  1842. background: #F0FFF4;
  1843. border-radius: 12rpx;
  1844. line-height: 1.6;
  1845. }
  1846. .gut-indicator-list {
  1847. display: flex;
  1848. flex-direction: column;
  1849. gap: 12rpx;
  1850. }
  1851. .gut-indicator-item {
  1852. display: flex;
  1853. align-items: center;
  1854. gap: 12rpx;
  1855. }
  1856. .gut-indicator-left {
  1857. width: 80rpx;
  1858. flex-shrink: 0;
  1859. }
  1860. .gut-indicator-name {
  1861. font-size: 22rpx;
  1862. color: #666;
  1863. }
  1864. .gut-indicator-bar-track {
  1865. flex: 1;
  1866. height: 16rpx;
  1867. background: #F0F0F0;
  1868. border-radius: 8rpx;
  1869. overflow: hidden;
  1870. }
  1871. .gut-indicator-bar-fill {
  1872. height: 100%;
  1873. border-radius: 8rpx;
  1874. transition: width 0.3s;
  1875. }
  1876. .gut-indicator-value {
  1877. font-size: 22rpx;
  1878. color: #666;
  1879. width: 60rpx;
  1880. text-align: right;
  1881. }
  1882. .gut-indicator-status {
  1883. font-size: 20rpx;
  1884. padding: 2rpx 12rpx;
  1885. border-radius: 10rpx;
  1886. width: 60rpx;
  1887. text-align: center;
  1888. }
  1889. .status-normal {
  1890. background: #D1FAE5;
  1891. color: #059669;
  1892. }
  1893. .status-abnormal {
  1894. background: #FEE2E2;
  1895. color: #DC2626;
  1896. }
  1897. .status-warning {
  1898. background: #FEF3C7;
  1899. color: #D97706;
  1900. }
  1901. /* ===== 关键信息(家庭+个人) ===== */
  1902. .key-info-card {
  1903. background: #fff;
  1904. border-radius: 20rpx;
  1905. padding: 24rpx;
  1906. margin-top: 20rpx;
  1907. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1908. }
  1909. .key-info-header {
  1910. display: flex;
  1911. align-items: center;
  1912. margin-bottom: 20rpx;
  1913. }
  1914. .key-info-icon {
  1915. font-size: 28rpx;
  1916. margin-right: 8rpx;
  1917. }
  1918. .key-info-title {
  1919. font-size: 28rpx;
  1920. font-weight: 600;
  1921. color: #333;
  1922. }
  1923. .key-info-body {
  1924. display: flex;
  1925. flex-direction: row;
  1926. gap: 20rpx;
  1927. }
  1928. .key-info-col {
  1929. flex: 1;
  1930. background: #F8F9FA;
  1931. border-radius: 14rpx;
  1932. padding: 16rpx;
  1933. min-width: 0;
  1934. }
  1935. .ki-subtitle {
  1936. font-size: 22rpx;
  1937. color: #999;
  1938. margin-bottom: 12rpx;
  1939. font-weight: 500;
  1940. }
  1941. .ki-row {
  1942. display: flex;
  1943. align-items: center;
  1944. margin-bottom: 10rpx;
  1945. flex-wrap: nowrap;
  1946. }
  1947. .ki-row:last-child {
  1948. margin-bottom: 0;
  1949. }
  1950. .ki-label {
  1951. font-size: 22rpx;
  1952. color: #888;
  1953. margin-right: 8rpx;
  1954. white-space: nowrap;
  1955. }
  1956. .ki-dot {
  1957. width: 16rpx;
  1958. height: 16rpx;
  1959. border-radius: 50%;
  1960. margin-right: 6rpx;
  1961. flex-shrink: 0;
  1962. }
  1963. .ki-valuel {
  1964. font-size: 24rpx;
  1965. color: #333;
  1966. font-weight: 500;
  1967. white-space: nowrap;
  1968. }
  1969. .ki-valued {
  1970. font-size: 24rpx;
  1971. color: #333;
  1972. font-weight: 500;
  1973. }
  1974. .ki-swatch {
  1975. width: 28rpx;
  1976. height: 28rpx;
  1977. border-radius: 50%;
  1978. margin-right: 6rpx;
  1979. border: 2rpx solid rgba(0,0,0,0.06);
  1980. flex-shrink: 0;
  1981. }
  1982. .ki-num {
  1983. font-size: 30rpx;
  1984. font-weight: 700;
  1985. color: #FF6B9D;
  1986. }
  1987. .ki-fortune {
  1988. font-size: 24rpx;
  1989. font-weight: 700;
  1990. padding: 2rpx 12rpx;
  1991. border-radius: 10rpx;
  1992. }
  1993. .ki-fortune-0 {
  1994. color: #D32F2F;
  1995. background: #FFEBEE;
  1996. }
  1997. .ki-fortune-1 {
  1998. color: #E65100;
  1999. background: #FFF3E0;
  2000. }
  2001. .ki-fortune-2 {
  2002. color: #F9A825;
  2003. background: #FFFDE7;
  2004. }
  2005. .ki-fortune-3 {
  2006. color: #7B1FA2;
  2007. background: #F3E5F5;
  2008. }
  2009. .ki-fortune-4 {
  2010. color: #B71C1C;
  2011. background: #FFCDD2;
  2012. }
  2013. .ki-insight {
  2014. display: flex;
  2015. align-items: flex-start;
  2016. margin-top: 16rpx;
  2017. padding: 16rpx;
  2018. background: #FFF8F0;
  2019. border-radius: 12rpx;
  2020. }
  2021. .ki-insight-icon {
  2022. font-size: 24rpx;
  2023. margin-right: 8rpx;
  2024. flex-shrink: 0;
  2025. }
  2026. .ki-insight-text {
  2027. font-size: 22rpx;
  2028. color: #8B6914;
  2029. line-height: 1.5;
  2030. }
  2031. .ki-footer {
  2032. margin-top: 16rpx;
  2033. text-align: center;
  2034. padding: 12rpx;
  2035. font-size: 24rpx;
  2036. color: #8B5CF6;
  2037. font-weight: 500;
  2038. background: #F5F3FF;
  2039. border-radius: 12rpx;
  2040. }
  2041. .ki-footer:active {
  2042. opacity: 0.7;
  2043. }
  2044. /* DAN 报告卡片 */
  2045. .dan-card {
  2046. background: #fff;
  2047. border-radius: 16rpx;
  2048. padding: 24rpx;
  2049. margin-bottom: 16rpx;
  2050. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  2051. }
  2052. .dan-card-header {
  2053. display: flex;
  2054. justify-content: space-between;
  2055. align-items: center;
  2056. margin-bottom: 12rpx;
  2057. }
  2058. .dan-report-date {
  2059. font-size: 26rpx;
  2060. color: #666;
  2061. }
  2062. .dan-status {
  2063. font-size: 22rpx;
  2064. padding: 4rpx 16rpx;
  2065. border-radius: 8rpx;
  2066. }
  2067. .dan-status.confirmed {
  2068. background: #D1FAE5;
  2069. color: #065F46;
  2070. }
  2071. .dan-status.pending {
  2072. background: #FEF3C7;
  2073. color: #92400E;
  2074. }
  2075. .dan-report-desc {
  2076. font-size: 28rpx;
  2077. color: #333;
  2078. font-weight: 500;
  2079. margin-bottom: 12rpx;
  2080. display: block;
  2081. }
  2082. .dan-card-footer {
  2083. text-align: right;
  2084. }
  2085. .dan-view-link {
  2086. font-size: 26rpx;
  2087. color: #6366F1;
  2088. }
  2089. .section-header {
  2090. display: flex;
  2091. justify-content: space-between;
  2092. align-items: center;
  2093. margin-bottom: 20rpx;
  2094. }
  2095. .section-title {
  2096. font-size: 32rpx;
  2097. font-weight: 700;
  2098. color: #333;
  2099. }
  2100. .section-more {
  2101. font-size: 26rpx;
  2102. color: #6366F1;
  2103. padding: 8rpx 16rpx;
  2104. }
  2105. /* 品牌定位语 */
  2106. .brand-strap {
  2107. margin: 16rpx 30rpx 0;
  2108. padding: 20rpx 28rpx;
  2109. background: linear-gradient(135deg, #FFF0F5, rgba(255,107,157,0.12));
  2110. border-radius: 16rpx;
  2111. border-left: 4rpx solid #FF6B9D;
  2112. }
  2113. .brand-strap-text {
  2114. font-size: 26rpx;
  2115. color: #9D174D;
  2116. font-weight: 500;
  2117. }
  2118. /* 每月引导语 */
  2119. .monthly-guidance {
  2120. margin: 16rpx 30rpx 0;
  2121. padding: 20rpx 28rpx;
  2122. background: linear-gradient(135deg, #FFF0F5, rgba(255,107,157,0.08));
  2123. border-radius: 16rpx;
  2124. border-left: 4rpx solid #FF6B9D;
  2125. display: flex;
  2126. align-items: center;
  2127. gap: 12rpx;
  2128. }
  2129. .guidance-icon { font-size: 32rpx; }
  2130. .guidance-text {
  2131. font-size: 26rpx;
  2132. color: #9D174D;
  2133. font-weight: 500;
  2134. }
  2135. /* 雷达图分组 */
  2136. .radar-group { margin-bottom: 30rpx; }
  2137. .radar-group-label {
  2138. font-size: 28rpx;
  2139. font-weight: bold;
  2140. color: #9D174D;
  2141. margin-bottom: 16rpx;
  2142. padding-left: 10rpx;
  2143. }
  2144. </style>