index.vue 58 KB

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