index.vue 58 KB

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