index.vue 57 KB

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