index.vue 55 KB

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