index.vue 58 KB

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