index.vue 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221
  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. var memberId = this.selectedMemberId || this.currentChildId
  980. var url = '/pages/health/report-upload?type=a2'
  981. if (memberId) {
  982. url += '&memberId=' + memberId
  983. }
  984. uni.navigateTo({ url: url })
  985. },
  986. viewDanReport: function(report) {
  987. var reportId = report.sourceReportId || report.id
  988. uni.navigateTo({ url: '/pages/health/report-detail?reportType=dan&reportId=' + reportId })
  989. },
  990. formatDate: function(dateStr) {
  991. if (!dateStr) return ''
  992. var d = parseDate(dateStr)
  993. if (!d) return ''
  994. return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
  995. }
  996. }
  997. </script>
  998. <style scoped>
  999. .container {
  1000. min-height: 100vh;
  1001. background: #f5f7fa;
  1002. padding-bottom: 120rpx;
  1003. }
  1004. /* ===== 心·心理 标题栏 ===== */
  1005. .section-title-bar {
  1006. display: flex;
  1007. flex-direction: row;
  1008. align-items: center;
  1009. margin: 20rpx 30rpx 10rpx;
  1010. padding: 16rpx 24rpx;
  1011. background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  1012. border-radius: 20rpx;
  1013. box-shadow: 0 4rpx 16rpx rgba(139,92,246,0.25);
  1014. }
  1015. .section-title-icon {
  1016. font-size: 32rpx;
  1017. color: #fff;
  1018. margin-right: 12rpx;
  1019. }
  1020. .section-title-text {
  1021. font-size: 32rpx;
  1022. font-weight: bold;
  1023. color: #fff;
  1024. }
  1025. /* ===== 心理报告上传卡片 ===== */
  1026. .mind-report-section {
  1027. margin: 20rpx 30rpx;
  1028. }
  1029. .mind-report-card {
  1030. display: flex;
  1031. flex-direction: row;
  1032. align-items: center;
  1033. background: linear-gradient(135deg, #F3E8FF, #FCE4EC);
  1034. border-radius: 20rpx;
  1035. padding: 28rpx 24rpx;
  1036. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1037. }
  1038. .mind-report-left {
  1039. width: 100rpx;
  1040. height: 100rpx;
  1041. background: rgba(255,255,255,0.7);
  1042. border-radius: 20rpx;
  1043. display: flex;
  1044. align-items: center;
  1045. justify-content: center;
  1046. margin-right: 20rpx;
  1047. flex-shrink: 0;
  1048. }
  1049. .mind-report-icon {
  1050. font-size: 52rpx;
  1051. }
  1052. .mind-report-right {
  1053. flex: 1;
  1054. }
  1055. .mind-report-title {
  1056. font-size: 30rpx;
  1057. font-weight: bold;
  1058. color: #7C3AED;
  1059. display: block;
  1060. margin-bottom: 6rpx;
  1061. }
  1062. .mind-report-desc {
  1063. font-size: 22rpx;
  1064. color: #A855F7;
  1065. line-height: 1.5;
  1066. display: block;
  1067. margin-bottom: 10rpx;
  1068. }
  1069. .mind-report-tags {
  1070. display: flex;
  1071. flex-direction: row;
  1072. gap: 10rpx;
  1073. }
  1074. .mind-tag {
  1075. font-size: 20rpx;
  1076. color: #7C3AED;
  1077. background: rgba(255,255,255,0.6);
  1078. padding: 4rpx 14rpx;
  1079. border-radius: 20rpx;
  1080. }
  1081. .mind-report-arrow {
  1082. font-size: 36rpx;
  1083. color: #C084FC;
  1084. margin-left: 10rpx;
  1085. flex-shrink: 0;
  1086. }
  1087. .mind-report-card:active {
  1088. opacity: 0.7;
  1089. }
  1090. .mind-report-list {
  1091. margin-top: 12rpx;
  1092. }
  1093. .mind-report-item {
  1094. display: flex;
  1095. flex-direction: row;
  1096. align-items: center;
  1097. background: #fff;
  1098. border-radius: 14rpx;
  1099. padding: 20rpx 20rpx;
  1100. margin-bottom: 8rpx;
  1101. box-shadow: 0 1rpx 6rpx rgba(0,0,0,0.05);
  1102. }
  1103. .mind-report-item:active {
  1104. opacity: 0.7;
  1105. }
  1106. .mind-report-item-icon {
  1107. font-size: 28rpx;
  1108. margin-right: 14rpx;
  1109. }
  1110. .mind-report-item-name {
  1111. font-size: 26rpx;
  1112. color: #333;
  1113. flex: 1;
  1114. }
  1115. .mind-report-item-date {
  1116. font-size: 22rpx;
  1117. color: #999;
  1118. margin-right: 14rpx;
  1119. }
  1120. .mind-report-item-status {
  1121. font-size: 22rpx;
  1122. padding: 2rpx 12rpx;
  1123. border-radius: 20rpx;
  1124. }
  1125. .mind-report-item-status.parsed {
  1126. color: #7C3AED;
  1127. background: #F3E8FF;
  1128. }
  1129. .mind-report-item-status.pending {
  1130. color: #999;
  1131. background: #F5F5F5;
  1132. }
  1133. .mind-report-empty {
  1134. display: flex;
  1135. flex-direction: row;
  1136. align-items: center;
  1137. justify-content: center;
  1138. padding: 24rpx;
  1139. margin-top: 8rpx;
  1140. }
  1141. .mind-report-empty-icon {
  1142. font-size: 32rpx;
  1143. margin-right: 10rpx;
  1144. }
  1145. .mind-report-empty-text {
  1146. font-size: 24rpx;
  1147. color: #bbb;
  1148. }
  1149. /* ===== 心理能量概况 ===== */
  1150. .energy-overview {
  1151. display: flex;
  1152. flex-direction: row;
  1153. margin: 20rpx 30rpx;
  1154. background: #fff;
  1155. border-radius: 20rpx;
  1156. padding: 24rpx 16rpx;
  1157. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1158. justify-content: space-around;
  1159. }
  1160. .energy-badge {
  1161. display: flex;
  1162. flex-direction: column;
  1163. align-items: center;
  1164. flex: 1;
  1165. }
  1166. .badge-icon {
  1167. font-size: 36rpx;
  1168. margin-bottom: 8rpx;
  1169. }
  1170. .badge-value {
  1171. font-size: 36rpx;
  1172. font-weight: bold;
  1173. color: #333;
  1174. }
  1175. .badge-label {
  1176. font-size: 20rpx;
  1177. color: #999;
  1178. margin-top: 4rpx;
  1179. }
  1180. /* ===== EMI 四维条形图 ===== */
  1181. .emi-section {
  1182. margin: 20rpx 30rpx;
  1183. }
  1184. .emi-card {
  1185. background: #fff;
  1186. border-radius: 24rpx;
  1187. padding: 30rpx;
  1188. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1189. }
  1190. .emi-card-title {
  1191. font-size: 30rpx;
  1192. font-weight: bold;
  1193. color: #333;
  1194. display: block;
  1195. }
  1196. .personality-header {
  1197. display: flex;
  1198. flex-direction: row;
  1199. align-items: center;
  1200. justify-content: space-between;
  1201. margin-bottom: 24rpx;
  1202. }
  1203. .test-btn {
  1204. background: #8B5CF6;
  1205. padding: 8rpx 28rpx;
  1206. border-radius: 30rpx;
  1207. }
  1208. .test-btn-text {
  1209. font-size: 24rpx;
  1210. color: #fff;
  1211. font-weight: 500;
  1212. }
  1213. .emi-bar-item {
  1214. display: flex;
  1215. flex-direction: row;
  1216. align-items: center;
  1217. margin-bottom: 20rpx;
  1218. }
  1219. .emi-bar-label {
  1220. font-size: 24rpx;
  1221. color: #666;
  1222. width: 120rpx;
  1223. flex-shrink: 0;
  1224. }
  1225. .emi-bar-track {
  1226. flex: 1;
  1227. height: 20rpx;
  1228. background: #f0f0f0;
  1229. border-radius: 10rpx;
  1230. overflow: hidden;
  1231. margin: 0 16rpx;
  1232. }
  1233. .emi-bar-fill {
  1234. height: 100%;
  1235. border-radius: 10rpx;
  1236. transition: width 0.5s;
  1237. }
  1238. .emi-bar-score {
  1239. font-size: 26rpx;
  1240. font-weight: bold;
  1241. color: #333;
  1242. width: 60rpx;
  1243. text-align: right;
  1244. flex-shrink: 0;
  1245. }
  1246. .emi-bar-level {
  1247. font-size: 20rpx;
  1248. width: 80rpx;
  1249. text-align: right;
  1250. flex-shrink: 0;
  1251. }
  1252. .level-excellent { color: #10B981; }
  1253. .level-good { color: #3B82F6; }
  1254. .level-average { color: #F97316; }
  1255. .level-low { color: #EF4444; }
  1256. .emi-footer {
  1257. display: flex;
  1258. flex-direction: row;
  1259. justify-content: space-between;
  1260. align-items: center;
  1261. margin-top: 20rpx;
  1262. padding-top: 20rpx;
  1263. border-top: 1rpx solid #f0f0f0;
  1264. }
  1265. .emi-overall {
  1266. font-size: 28rpx;
  1267. font-weight: bold;
  1268. color: #FF6B35;
  1269. }
  1270. .emi-link {
  1271. display: flex;
  1272. flex-direction: row;
  1273. align-items: center;
  1274. }
  1275. .emi-link-text {
  1276. font-size: 26rpx;
  1277. color: #FF6B35;
  1278. font-weight: 500;
  1279. }
  1280. .emi-link-arrow {
  1281. font-size: 26rpx;
  1282. color: #FF6B35;
  1283. margin-left: 8rpx;
  1284. }
  1285. /* ===== EMI 心理报告卡片 ===== */
  1286. .emi-card {
  1287. margin: 30rpx;
  1288. background: #fff;
  1289. border-radius: 24rpx;
  1290. padding: 30rpx;
  1291. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1292. }
  1293. .emi-header {
  1294. margin-bottom: 24rpx;
  1295. }
  1296. .emi-title {
  1297. font-size: 30rpx;
  1298. font-weight: bold;
  1299. color: #333;
  1300. display: block;
  1301. }
  1302. .emi-overall-wrap {
  1303. display: flex;
  1304. flex-direction: column;
  1305. align-items: center;
  1306. padding: 32rpx 0;
  1307. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1308. border-radius: 16rpx;
  1309. margin: 20rpx 0;
  1310. color: #fff;
  1311. }
  1312. .emi-overall-label {
  1313. font-size: 26rpx;
  1314. margin-bottom: 6rpx;
  1315. }
  1316. .emi-overall-value {
  1317. font-size: 64rpx;
  1318. font-weight: bold;
  1319. margin-bottom: 6rpx;
  1320. }
  1321. .emi-overall-level {
  1322. font-size: 24rpx;
  1323. padding: 4rpx 16rpx;
  1324. border-radius: 12rpx;
  1325. background: rgba(255,255,255,0.2);
  1326. }
  1327. .emi-dimensions {
  1328. display: flex;
  1329. flex-direction: column;
  1330. gap: 20rpx;
  1331. }
  1332. .emi-dimension {
  1333. display: flex;
  1334. flex-direction: column;
  1335. }
  1336. .emi-dim-header {
  1337. display: flex;
  1338. flex-direction: row;
  1339. justify-content: space-between;
  1340. align-items: center;
  1341. margin-bottom: 8rpx;
  1342. }
  1343. .emi-dim-label {
  1344. font-size: 26rpx;
  1345. color: #666;
  1346. }
  1347. .emi-dim-values {
  1348. display: flex;
  1349. flex-direction: row;
  1350. align-items: center;
  1351. }
  1352. .emi-dim-score {
  1353. font-size: 28rpx;
  1354. font-weight: bold;
  1355. color: #FF6B35;
  1356. margin-right: 12rpx;
  1357. }
  1358. .emi-dim-level {
  1359. font-size: 20rpx;
  1360. padding: 2rpx 12rpx;
  1361. border-radius: 8rpx;
  1362. }
  1363. .emi-dim-bar {
  1364. height: 14rpx;
  1365. background: #f0f0f0;
  1366. border-radius: 7rpx;
  1367. overflow: hidden;
  1368. }
  1369. .emi-dim-bar-fill {
  1370. height: 100%;
  1371. border-radius: 7rpx;
  1372. transition: width 0.5s;
  1373. }
  1374. .emi-footer {
  1375. display: flex;
  1376. justify-content: flex-end;
  1377. align-items: center;
  1378. padding-top: 20rpx;
  1379. border-top: 1rpx solid #f0f0f0;
  1380. margin-top: 20rpx;
  1381. }
  1382. .emi-footer-text {
  1383. font-size: 24rpx;
  1384. color: #F97316;
  1385. font-weight: 500;
  1386. }
  1387. .emi-footer-icon {
  1388. font-size: 24rpx;
  1389. margin-left: 8rpx;
  1390. }
  1391. .level-excellent { color: #10B981; background: #ECFDF5; }
  1392. .level-good { color: #3B82F6; background: #EFF6FF; }
  1393. .level-average { color: #F97316; background: #FFF7ED; }
  1394. .level-low { color: #EF4444; background: #FEF2F2; }
  1395. /* 雷达图内的空状态 */
  1396. .placeholder-content {
  1397. display: flex;
  1398. flex-direction: column;
  1399. align-items: center;
  1400. padding: 40rpx 20rpx;
  1401. }
  1402. /* ===== 占位卡 ===== */
  1403. .placeholder-card {
  1404. margin: 30rpx;
  1405. background: #fff;
  1406. border-radius: 24rpx;
  1407. padding: 60rpx 40rpx;
  1408. display: flex;
  1409. flex-direction: column;
  1410. align-items: center;
  1411. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1412. }
  1413. .placeholder-icon {
  1414. font-size: 80rpx;
  1415. margin-bottom: 20rpx;
  1416. }
  1417. .placeholder-title {
  1418. font-size: 32rpx;
  1419. font-weight: bold;
  1420. color: #333;
  1421. margin-bottom: 16rpx;
  1422. }
  1423. .placeholder-desc {
  1424. font-size: 26rpx;
  1425. color: #999;
  1426. text-align: center;
  1427. line-height: 1.6;
  1428. margin-bottom: 30rpx;
  1429. }
  1430. .placeholder-btn {
  1431. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1432. color: #fff;
  1433. font-size: 28rpx;
  1434. font-weight: bold;
  1435. padding: 16rpx 64rpx;
  1436. border-radius: 40rpx;
  1437. box-shadow: 0 4rpx 16rpx rgba(255,107,53,0.3);
  1438. }
  1439. /* ===== 传统文化卡片 ===== */
  1440. .culture-section {
  1441. margin: 20rpx 30rpx;
  1442. }
  1443. .culture-card {
  1444. background: #fff;
  1445. border-radius: 20rpx;
  1446. padding: 24rpx;
  1447. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1448. margin-bottom: 16rpx;
  1449. }
  1450. .culture-card-header {
  1451. display: flex;
  1452. align-items: center;
  1453. margin-bottom: 16rpx;
  1454. }
  1455. .culture-card-icon {
  1456. font-size: 32rpx;
  1457. margin-right: 10rpx;
  1458. }
  1459. .culture-card-title {
  1460. font-size: 28rpx;
  1461. font-weight: 600;
  1462. color: #333;
  1463. }
  1464. .culture-card-body {
  1465. font-size: 24rpx;
  1466. color: #666;
  1467. line-height: 1.6;
  1468. }
  1469. /* 八字四柱 */
  1470. .bazi-grid {
  1471. display: flex;
  1472. justify-content: space-around;
  1473. padding: 8rpx 0;
  1474. }
  1475. .bazi-column {
  1476. display: flex;
  1477. flex-direction: column;
  1478. align-items: center;
  1479. }
  1480. .bazi-pillar-label {
  1481. font-size: 22rpx;
  1482. color: #999;
  1483. margin-bottom: 6rpx;
  1484. }
  1485. .bazi-pillar-value {
  1486. font-size: 32rpx;
  1487. font-weight: 700;
  1488. color: #8B5CF6;
  1489. background: #F5F0FF;
  1490. padding: 10rpx 14rpx;
  1491. border-radius: 10rpx;
  1492. }
  1493. /* 五行能量 */
  1494. .wuxing-list {
  1495. display: flex;
  1496. flex-direction: column;
  1497. gap: 12rpx;
  1498. }
  1499. .wuxing-item {
  1500. display: flex;
  1501. align-items: center;
  1502. gap: 12rpx;
  1503. }
  1504. .wuxing-label {
  1505. font-size: 26rpx;
  1506. font-weight: 600;
  1507. width: 44rpx;
  1508. text-align: center;
  1509. }
  1510. .wuxing-bar-track {
  1511. flex: 1;
  1512. height: 20rpx;
  1513. background: #F0F0F0;
  1514. border-radius: 10rpx;
  1515. overflow: hidden;
  1516. }
  1517. .wuxing-bar-fill {
  1518. height: 100%;
  1519. border-radius: 10rpx;
  1520. }
  1521. .wuxing-value {
  1522. font-size: 22rpx;
  1523. color: #666;
  1524. width: 56rpx;
  1525. text-align: right;
  1526. }
  1527. .energy-card {
  1528. margin-top: 20rpx;
  1529. padding: 24rpx 20rpx;
  1530. background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  1531. border-radius: 20rpx;
  1532. position: relative;
  1533. overflow: hidden;
  1534. }
  1535. .energy-card::before {
  1536. content: '';
  1537. position: absolute;
  1538. top: -60rpx;
  1539. right: -60rpx;
  1540. width: 200rpx;
  1541. height: 200rpx;
  1542. background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
  1543. border-radius: 50%;
  1544. }
  1545. .energy-card::after {
  1546. content: '';
  1547. position: absolute;
  1548. bottom: -40rpx;
  1549. left: -40rpx;
  1550. width: 160rpx;
  1551. height: 160rpx;
  1552. background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  1553. border-radius: 50%;
  1554. }
  1555. .energy-header {
  1556. display: flex;
  1557. align-items: center;
  1558. margin-bottom: 14rpx;
  1559. position: relative;
  1560. z-index: 1;
  1561. }
  1562. .energy-icon {
  1563. font-size: 32rpx;
  1564. margin-right: 10rpx;
  1565. }
  1566. .energy-label {
  1567. font-size: 28rpx;
  1568. font-weight: 700;
  1569. background: linear-gradient(135deg, #F59E0B, #FF6B9D);
  1570. -webkit-background-clip: text;
  1571. -webkit-text-fill-color: transparent;
  1572. background-clip: text;
  1573. }
  1574. .energy-divider {
  1575. height: 2rpx;
  1576. background: linear-gradient(90deg, rgba(255,215,0,0.5), rgba(255,107,157,0.3), transparent);
  1577. margin-bottom: 18rpx;
  1578. position: relative;
  1579. z-index: 1;
  1580. }
  1581. .energy-quote {
  1582. font-size: 26rpx;
  1583. color: #E2E8F0;
  1584. line-height: 1.8;
  1585. display: block;
  1586. margin-bottom: 14rpx;
  1587. position: relative;
  1588. z-index: 1;
  1589. padding-left: 20rpx;
  1590. letter-spacing: 1rpx;
  1591. }
  1592. .energy-quote::before {
  1593. content: '';
  1594. position: absolute;
  1595. left: 0;
  1596. top: 4rpx;
  1597. bottom: 4rpx;
  1598. width: 4rpx;
  1599. background: linear-gradient(180deg, #F59E0B, #FF6B9D);
  1600. border-radius: 2rpx;
  1601. }
  1602. .energy-advice {
  1603. font-size: 24rpx;
  1604. color: #94A3B8;
  1605. line-height: 1.7;
  1606. display: block;
  1607. position: relative;
  1608. z-index: 1;
  1609. padding: 14rpx 18rpx;
  1610. background: rgba(255,255,255,0.05);
  1611. border-radius: 12rpx;
  1612. border: 1rpx solid rgba(255,255,255,0.08);
  1613. }
  1614. .energy-footer {
  1615. display: flex;
  1616. justify-content: center;
  1617. gap: 12rpx;
  1618. margin-top: 18rpx;
  1619. position: relative;
  1620. z-index: 1;
  1621. }
  1622. .energy-footer-dot {
  1623. width: 8rpx;
  1624. height: 8rpx;
  1625. border-radius: 50%;
  1626. background: rgba(255,255,255,0.3);
  1627. }
  1628. .energy-footer-dot:nth-child(2) {
  1629. background: rgba(255,215,0,0.6);
  1630. width: 10rpx;
  1631. height: 10rpx;
  1632. }
  1633. /* 星座+灵数双栏 */
  1634. .culture-dual {
  1635. display: flex;
  1636. gap: 16rpx;
  1637. }
  1638. .culture-dual-item {
  1639. flex: 1;
  1640. background: #fff;
  1641. border-radius: 20rpx;
  1642. padding: 20rpx;
  1643. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1644. display: flex;
  1645. flex-direction: column;
  1646. align-items: center;
  1647. }
  1648. .culture-dual-icon {
  1649. font-size: 36rpx;
  1650. margin-bottom: 8rpx;
  1651. }
  1652. .culture-dual-label {
  1653. font-size: 22rpx;
  1654. color: #999;
  1655. margin-bottom: 6rpx;
  1656. }
  1657. .culture-dual-value {
  1658. font-size: 28rpx;
  1659. font-weight: 700;
  1660. color: #8B5CF6;
  1661. }
  1662. .culture-empty {
  1663. text-align: center;
  1664. padding: 30rpx 0;
  1665. color: #bbb;
  1666. font-size: 24rpx;
  1667. }
  1668. /* ===== 每日心理 ===== */
  1669. .tip-card {
  1670. background: #fff;
  1671. border-radius: 20rpx;
  1672. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1673. display: flex;
  1674. flex-direction: row;
  1675. overflow: hidden;
  1676. }
  1677. .tip-left-bar {
  1678. width: 6rpx;
  1679. background: linear-gradient(180deg, #5B9BD5, #8FC5E8);
  1680. flex-shrink: 0;
  1681. }
  1682. .tip-body {
  1683. flex: 1;
  1684. padding: 28rpx 24rpx;
  1685. }
  1686. .tip-title {
  1687. font-size: 28rpx;
  1688. font-weight: bold;
  1689. color: #5B9BD5;
  1690. display: block;
  1691. margin-bottom: 12rpx;
  1692. }
  1693. .tip-content {
  1694. font-size: 24rpx;
  1695. color: #666;
  1696. line-height: 1.6;
  1697. display: block;
  1698. margin-bottom: 16rpx;
  1699. }
  1700. .tip-footer {
  1701. display: flex;
  1702. flex-direction: row;
  1703. justify-content: flex-end;
  1704. }
  1705. .tip-source {
  1706. font-size: 22rpx;
  1707. color: #bbb;
  1708. }
  1709. /* ===== 通用区块 ===== */
  1710. .section {
  1711. margin: 20rpx 30rpx;
  1712. }
  1713. .section-header {
  1714. margin-bottom: 20rpx;
  1715. }
  1716. .section-title {
  1717. font-size: 30rpx;
  1718. font-weight: bold;
  1719. color: #333;
  1720. }
  1721. /* ===== 推荐阅读 ===== */
  1722. .article-list {
  1723. display: flex;
  1724. flex-direction: column;
  1725. }
  1726. .article-card {
  1727. background: #fff;
  1728. border-radius: 20rpx;
  1729. padding: 28rpx 24rpx;
  1730. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1731. margin-bottom: 20rpx;
  1732. }
  1733. .article-category {
  1734. display: inline-block;
  1735. padding: 4rpx 18rpx;
  1736. border-radius: 20rpx;
  1737. margin-bottom: 14rpx;
  1738. }
  1739. .article-category-text {
  1740. font-size: 20rpx;
  1741. color: #fff;
  1742. font-weight: 500;
  1743. }
  1744. .article-title {
  1745. font-size: 28rpx;
  1746. font-weight: bold;
  1747. color: #333;
  1748. display: block;
  1749. margin-bottom: 10rpx;
  1750. }
  1751. .article-summary {
  1752. font-size: 24rpx;
  1753. color: #888;
  1754. line-height: 1.5;
  1755. display: block;
  1756. margin-bottom: 20rpx;
  1757. }
  1758. .article-meta {
  1759. display: flex;
  1760. flex-direction: row;
  1761. align-items: center;
  1762. justify-content: space-between;
  1763. }
  1764. .meta-item {
  1765. display: flex;
  1766. flex-direction: row;
  1767. align-items: center;
  1768. margin-right: 20rpx;
  1769. }
  1770. .meta-icon {
  1771. font-size: 22rpx;
  1772. margin-right: 4rpx;
  1773. }
  1774. .meta-text {
  1775. font-size: 22rpx;
  1776. color: #bbb;
  1777. }
  1778. .article-date {
  1779. font-size: 22rpx;
  1780. color: #bbb;
  1781. margin-left: auto;
  1782. }
  1783. /* ===== 功能区入口 ===== */
  1784. .func-section {
  1785. margin: 20rpx 30rpx;
  1786. }
  1787. .func-grid {
  1788. display: flex;
  1789. flex-direction: column;
  1790. gap: 16rpx;
  1791. background: #fff;
  1792. border-radius: 20rpx;
  1793. padding: 24rpx 16rpx;
  1794. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1795. }
  1796. .func-row {
  1797. display: flex;
  1798. flex-direction: row;
  1799. justify-content: space-between;
  1800. }
  1801. .func-item {
  1802. display: flex;
  1803. flex-direction: column;
  1804. align-items: center;
  1805. flex: 1;
  1806. }
  1807. .func-icon-wrap {
  1808. width: 80rpx;
  1809. height: 80rpx;
  1810. border-radius: 40rpx;
  1811. background: linear-gradient(135deg, #D6EAF8, #EBF2FA);
  1812. display: flex;
  1813. align-items: center;
  1814. justify-content: center;
  1815. margin-bottom: 10rpx;
  1816. }
  1817. .func-icon {
  1818. font-size: 40rpx;
  1819. }
  1820. .func-label {
  1821. font-size: 22rpx;
  1822. color: #666;
  1823. font-weight: 500;
  1824. }
  1825. .func-item:active {
  1826. opacity: 0.7;
  1827. }
  1828. /* ===== 底部 ===== */
  1829. .indicator-cards-section { margin: 20rpx 30rpx; }
  1830. .indicator-cards { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16rpx; }
  1831. .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); }
  1832. .indicator-card.no-data { opacity: 0.5; }
  1833. .indicator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
  1834. .indicator-name { font-size: 26rpx; color: #666; font-weight: 500; }
  1835. .indicator-unit { font-size: 22rpx; color: #999; }
  1836. .indicator-body { margin-bottom: 8rpx; }
  1837. .indicator-value { font-size: 40rpx; font-weight: bold; color: #FF6B9D; }
  1838. .indicator-placeholder { font-size: 26rpx; color: #ccc; }
  1839. .indicator-range { font-size: 20rpx; color: #bbb; }
  1840. .bottom-spacer { height: 120rpx; }
  1841. /* ===== 肠脑轴 ===== */
  1842. .gut-insight-text {
  1843. font-size: 24rpx;
  1844. color: #666;
  1845. margin-bottom: 16rpx;
  1846. padding: 12rpx 16rpx;
  1847. background: #F0FFF4;
  1848. border-radius: 12rpx;
  1849. line-height: 1.6;
  1850. }
  1851. .gut-indicator-list {
  1852. display: flex;
  1853. flex-direction: column;
  1854. gap: 12rpx;
  1855. }
  1856. .gut-indicator-item {
  1857. display: flex;
  1858. align-items: center;
  1859. gap: 12rpx;
  1860. }
  1861. .gut-indicator-left {
  1862. width: 80rpx;
  1863. flex-shrink: 0;
  1864. }
  1865. .gut-indicator-name {
  1866. font-size: 22rpx;
  1867. color: #666;
  1868. }
  1869. .gut-indicator-bar-track {
  1870. flex: 1;
  1871. height: 16rpx;
  1872. background: #F0F0F0;
  1873. border-radius: 8rpx;
  1874. overflow: hidden;
  1875. }
  1876. .gut-indicator-bar-fill {
  1877. height: 100%;
  1878. border-radius: 8rpx;
  1879. transition: width 0.3s;
  1880. }
  1881. .gut-indicator-value {
  1882. font-size: 22rpx;
  1883. color: #666;
  1884. width: 60rpx;
  1885. text-align: right;
  1886. }
  1887. .gut-indicator-status {
  1888. font-size: 20rpx;
  1889. padding: 2rpx 12rpx;
  1890. border-radius: 10rpx;
  1891. width: 60rpx;
  1892. text-align: center;
  1893. }
  1894. .status-normal {
  1895. background: #D1FAE5;
  1896. color: #059669;
  1897. }
  1898. .status-abnormal {
  1899. background: #FEE2E2;
  1900. color: #DC2626;
  1901. }
  1902. .status-warning {
  1903. background: #FEF3C7;
  1904. color: #D97706;
  1905. }
  1906. /* ===== 关键信息(家庭+个人) ===== */
  1907. .key-info-card {
  1908. background: #fff;
  1909. border-radius: 20rpx;
  1910. padding: 24rpx;
  1911. margin-top: 20rpx;
  1912. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1913. }
  1914. .key-info-header {
  1915. display: flex;
  1916. align-items: center;
  1917. margin-bottom: 20rpx;
  1918. }
  1919. .key-info-icon {
  1920. font-size: 28rpx;
  1921. margin-right: 8rpx;
  1922. }
  1923. .key-info-title {
  1924. font-size: 28rpx;
  1925. font-weight: 600;
  1926. color: #333;
  1927. }
  1928. .key-info-body {
  1929. display: flex;
  1930. flex-direction: row;
  1931. gap: 20rpx;
  1932. }
  1933. .key-info-col {
  1934. flex: 1;
  1935. background: #F8F9FA;
  1936. border-radius: 14rpx;
  1937. padding: 16rpx;
  1938. min-width: 0;
  1939. }
  1940. .ki-subtitle {
  1941. font-size: 22rpx;
  1942. color: #999;
  1943. margin-bottom: 12rpx;
  1944. font-weight: 500;
  1945. }
  1946. .ki-row {
  1947. display: flex;
  1948. align-items: center;
  1949. margin-bottom: 10rpx;
  1950. flex-wrap: nowrap;
  1951. }
  1952. .ki-row:last-child {
  1953. margin-bottom: 0;
  1954. }
  1955. .ki-label {
  1956. font-size: 22rpx;
  1957. color: #888;
  1958. margin-right: 8rpx;
  1959. white-space: nowrap;
  1960. }
  1961. .ki-dot {
  1962. width: 16rpx;
  1963. height: 16rpx;
  1964. border-radius: 50%;
  1965. margin-right: 6rpx;
  1966. flex-shrink: 0;
  1967. }
  1968. .ki-valuel {
  1969. font-size: 24rpx;
  1970. color: #333;
  1971. font-weight: 500;
  1972. white-space: nowrap;
  1973. }
  1974. .ki-valued {
  1975. font-size: 24rpx;
  1976. color: #333;
  1977. font-weight: 500;
  1978. }
  1979. .ki-swatch {
  1980. width: 28rpx;
  1981. height: 28rpx;
  1982. border-radius: 50%;
  1983. margin-right: 6rpx;
  1984. border: 2rpx solid rgba(0,0,0,0.06);
  1985. flex-shrink: 0;
  1986. }
  1987. .ki-num {
  1988. font-size: 30rpx;
  1989. font-weight: 700;
  1990. color: #FF6B9D;
  1991. }
  1992. .ki-fortune {
  1993. font-size: 24rpx;
  1994. font-weight: 700;
  1995. padding: 2rpx 12rpx;
  1996. border-radius: 10rpx;
  1997. }
  1998. .ki-fortune-0 {
  1999. color: #D32F2F;
  2000. background: #FFEBEE;
  2001. }
  2002. .ki-fortune-1 {
  2003. color: #E65100;
  2004. background: #FFF3E0;
  2005. }
  2006. .ki-fortune-2 {
  2007. color: #F9A825;
  2008. background: #FFFDE7;
  2009. }
  2010. .ki-fortune-3 {
  2011. color: #7B1FA2;
  2012. background: #F3E5F5;
  2013. }
  2014. .ki-fortune-4 {
  2015. color: #B71C1C;
  2016. background: #FFCDD2;
  2017. }
  2018. .ki-insight {
  2019. display: flex;
  2020. align-items: flex-start;
  2021. margin-top: 16rpx;
  2022. padding: 16rpx;
  2023. background: #FFF8F0;
  2024. border-radius: 12rpx;
  2025. }
  2026. .ki-insight-icon {
  2027. font-size: 24rpx;
  2028. margin-right: 8rpx;
  2029. flex-shrink: 0;
  2030. }
  2031. .ki-insight-text {
  2032. font-size: 22rpx;
  2033. color: #8B6914;
  2034. line-height: 1.5;
  2035. }
  2036. .ki-footer {
  2037. margin-top: 16rpx;
  2038. text-align: center;
  2039. padding: 12rpx;
  2040. font-size: 24rpx;
  2041. color: #8B5CF6;
  2042. font-weight: 500;
  2043. background: #F5F3FF;
  2044. border-radius: 12rpx;
  2045. }
  2046. .ki-footer:active {
  2047. opacity: 0.7;
  2048. }
  2049. /* DAN 报告卡片 */
  2050. .dan-card {
  2051. background: #fff;
  2052. border-radius: 16rpx;
  2053. padding: 24rpx;
  2054. margin-bottom: 16rpx;
  2055. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  2056. }
  2057. .dan-card-header {
  2058. display: flex;
  2059. justify-content: space-between;
  2060. align-items: center;
  2061. margin-bottom: 12rpx;
  2062. }
  2063. .dan-report-date {
  2064. font-size: 26rpx;
  2065. color: #666;
  2066. }
  2067. .dan-status {
  2068. font-size: 22rpx;
  2069. padding: 4rpx 16rpx;
  2070. border-radius: 8rpx;
  2071. }
  2072. .dan-status.confirmed {
  2073. background: #D1FAE5;
  2074. color: #065F46;
  2075. }
  2076. .dan-status.pending {
  2077. background: #FEF3C7;
  2078. color: #92400E;
  2079. }
  2080. .dan-report-desc {
  2081. font-size: 28rpx;
  2082. color: #333;
  2083. font-weight: 500;
  2084. margin-bottom: 12rpx;
  2085. display: block;
  2086. }
  2087. .dan-card-footer {
  2088. text-align: right;
  2089. }
  2090. .dan-view-link {
  2091. font-size: 26rpx;
  2092. color: #6366F1;
  2093. }
  2094. .section-header {
  2095. display: flex;
  2096. justify-content: space-between;
  2097. align-items: center;
  2098. margin-bottom: 20rpx;
  2099. }
  2100. .section-title {
  2101. font-size: 32rpx;
  2102. font-weight: 700;
  2103. color: #333;
  2104. }
  2105. .section-more {
  2106. font-size: 26rpx;
  2107. color: #6366F1;
  2108. padding: 8rpx 16rpx;
  2109. }
  2110. /* 品牌定位语 */
  2111. .brand-strap {
  2112. margin: 16rpx 30rpx 0;
  2113. padding: 20rpx 28rpx;
  2114. background: linear-gradient(135deg, #FFF0F5, rgba(255,107,157,0.12));
  2115. border-radius: 16rpx;
  2116. border-left: 4rpx solid #FF6B9D;
  2117. }
  2118. .brand-strap-text {
  2119. font-size: 26rpx;
  2120. color: #9D174D;
  2121. font-weight: 500;
  2122. }
  2123. /* 每月引导语 */
  2124. .monthly-guidance {
  2125. margin: 16rpx 30rpx 0;
  2126. padding: 20rpx 28rpx;
  2127. background: linear-gradient(135deg, #FFF0F5, rgba(255,107,157,0.08));
  2128. border-radius: 16rpx;
  2129. border-left: 4rpx solid #FF6B9D;
  2130. display: flex;
  2131. align-items: center;
  2132. gap: 12rpx;
  2133. }
  2134. .guidance-icon { font-size: 32rpx; }
  2135. .guidance-text {
  2136. font-size: 26rpx;
  2137. color: #9D174D;
  2138. font-weight: 500;
  2139. }
  2140. /* 雷达图分组 */
  2141. .radar-group { margin-bottom: 30rpx; }
  2142. .radar-group-label {
  2143. font-size: 28rpx;
  2144. font-weight: bold;
  2145. color: #9D174D;
  2146. margin-bottom: 16rpx;
  2147. padding-left: 10rpx;
  2148. }
  2149. </style>