index.vue 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979
  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-extra/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. dimensionWeights: item.dimensionWeights || null,
  828. views: item.viewCount ? String(item.viewCount) : '0',
  829. likes: '0',
  830. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  831. relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions)
  832. }
  833. })
  834. }
  835. }).catch(function() {})
  836. },
  837. // ===== EMI 分数评级 =====
  838. getScoreLevel: function(score) {
  839. if (score >= 85) return 'excellent'
  840. if (score >= 70) return 'good'
  841. if (score >= 55) return 'average'
  842. return 'low'
  843. },
  844. getScoreLevelText: function(score) {
  845. if (score >= 85) return '优秀'
  846. if (score >= 70) return '良好'
  847. if (score >= 55) return '一般'
  848. return '需提升'
  849. },
  850. // ===== 导航 =====
  851. goEmotionReport: function() {
  852. var childId = this.currentChildId || ''
  853. uni.navigateTo({ url: '/pages/mind-detail/emotion-report?childId=' + childId })
  854. },
  855. goArticles: function() {
  856. uni.navigateTo({ url: '/pages/article-center/index?dimension=mind' })
  857. },
  858. onFuncClick: function(item) {
  859. if (item.needLogin && !this.isLoggedIn) {
  860. uni.showModal({
  861. title: '提示',
  862. content: '请先登录后使用此功能',
  863. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  864. })
  865. return
  866. }
  867. if (item.page) uni.navigateTo({ url: item.page })
  868. },
  869. goArticleDetail: function(article) {
  870. var id = article.id || article
  871. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  872. },
  873. // ===== 孩子列表与维度数据 =====
  874. loadChildren: function() {
  875. var self = this
  876. getChildren().then(function(res) {
  877. if (res.code === 200 && res.data) {
  878. self.children = res.data
  879. var savedChildId = uni.getStorageSync('currentChildId')
  880. var found = false
  881. for (var i = 0; i < self.children.length; i++) {
  882. if (self.children[i].childId === savedChildId) {
  883. self.currentChildId = savedChildId
  884. found = true
  885. break
  886. }
  887. }
  888. // FIX: 不再自动选择第一个孩子。仅在用户通过 UserQuickEntry 切换时设置 currentChildId
  889. if (found) {
  890. self.loadDimensionData()
  891. self.loadEmiData()
  892. }
  893. }
  894. }).catch(function(e) {
  895. console.log('获取孩子列表失败', e)
  896. })
  897. },
  898. loadDimensionData: function() {
  899. this.loadDimensionTasks()
  900. this.loadDimensionActivities()
  901. this.loadDimensionProducts()
  902. if (this.familyMembersVisible.length > 0) {
  903. this.loadCompatibilityData()
  904. }
  905. },
  906. loadSandboxData: function() {
  907. var self = this
  908. getFamilyEnergySandbox().then(function(res) {
  909. if (res && res.data) {
  910. self.sandboxData = res.data
  911. }
  912. }).catch(function() {})
  913. },
  914. loadEnergyData: function() {
  915. var self = this
  916. if (!this.currentChildId) return
  917. getEnergyOverview(this.currentChildId).then(function(res) {
  918. if (res && res.data) {
  919. var dims = res.data.dimensions
  920. if (dims && dims.length > 0) {
  921. for (var i = 0; i < dims.length; i++) {
  922. if (dims[i] && dims[i].code === 'mind' && res.data.energyScores) {
  923. self.familyScore = res.data.energyScores.mindScore || 0
  924. }
  925. }
  926. }
  927. }
  928. }).catch(function(e) {
  929. console.log('获取能量概览失败', e)
  930. })
  931. },
  932. loadDimensionTasks: function() {
  933. var self = this
  934. if (!this.currentChildId) return
  935. getTodayTasksByCategory(this.currentChildId, 'mind').then(function(res) {
  936. if (res && res.data) {
  937. self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
  938. }
  939. }).catch(function() { self.dimensionTasks = [] })
  940. },
  941. loadDimensionActivities: function() {
  942. var self = this
  943. var dimCode = self.currentDimensionCode
  944. getActivityList({ dimensionCode: dimCode, page: 1, size: 3 }).then(function(res) {
  945. if (res && res.data) {
  946. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  947. self.dimensionActivities = list.slice(0, 3)
  948. }
  949. }).catch(function() { self.dimensionActivities = [] })
  950. },
  951. loadDimensionProducts: function() {
  952. var self = this
  953. var dimCode = self.currentDimensionCode
  954. getProductsByDomain(dimCode, 1, 4).then(function(res) {
  955. if (res && res.data) {
  956. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  957. self.dimensionProducts = list.slice(0, 4)
  958. }
  959. }).catch(function() { self.dimensionProducts = [] })
  960. },
  961. onChildChanged: function(child) {
  962. this.currentChildId = child.childId
  963. // FIX: 同步提交到 Vuex store
  964. this.$store.commit('switchToChild', child.childId)
  965. this.loadDimensionData()
  966. this.loadEmiData()
  967. this.loadTraditionalCultureData()
  968. },
  969. loadFamilyMembersVisible: function() {
  970. var self = this
  971. getVisibleFamilyMembers().then(function(res) {
  972. self.familyMembersVisible = res.data || []
  973. }).catch(function(e) {
  974. console.log('获取可见家庭成员失败', e)
  975. self.familyMembersVisible = []
  976. })
  977. },
  978. loadCompatibilityData: function() {
  979. var self = this
  980. var familyId = uni.getStorageSync('currentFamilyId')
  981. if (!familyId) {
  982. var userInfo = uni.getStorageSync('userInfo')
  983. if (userInfo && userInfo.familyId) familyId = userInfo.familyId
  984. }
  985. if (!familyId) return
  986. var token = uni.getStorageSync('token')
  987. uni.request({
  988. url: config.API_BASE_URL + '/api/mind/traditional/family-dashboard',
  989. method: 'POST',
  990. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  991. data: { familyId: familyId },
  992. success: function(res) {
  993. if (res.data && res.data.code === 200 && res.data.data) {
  994. self.compatibilityData = res.data.data
  995. }
  996. },
  997. fail: function() {}
  998. })
  999. },
  1000. scrollToSection: function(section) {
  1001. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  1002. },
  1003. onTaskClick: function(task) {
  1004. uni.navigateTo({ url: '/pages/tasks/tasks' })
  1005. },
  1006. goActivityDetail: function(act) {
  1007. if (act && act.id) uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  1008. },
  1009. goMoreActivities: function() {
  1010. uni.navigateTo({ url: '/pages/activity/index' })
  1011. },
  1012. goProductDetail: function(prod) {
  1013. if (prod && prod.id) uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  1014. },
  1015. goMoreProducts: function() {
  1016. uni.navigateTo({ url: '/pages/shop/index' })
  1017. },
  1018. goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
  1019. goMemberDetail: function(member) {
  1020. if (!member || !member.memberId) return
  1021. var currentId = this.currentChildId
  1022. uni.navigateTo({
  1023. url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&entrySource=relation-graph&selfId=' + currentId + '&dimensionCode=mind'
  1024. })
  1025. },
  1026. goFamilyMembers: function() {
  1027. uni.navigateTo({ url: '/pages/profile-extra/family-members' })
  1028. },
  1029. goAssessment: function() { uni.navigateTo({ url: '/pages/assessment/apply' }) },
  1030. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  1031. // ===== 传统文化数据 =====
  1032. // ===== 联系人 / 关系健康 =====
  1033. loadContacts: function() {
  1034. var self = this
  1035. getContactList({}).then(function(res) {
  1036. if (res.code === 200) {
  1037. self.contactList = Array.isArray(res.data) ? res.data : []
  1038. } else {
  1039. self.contactList = []
  1040. }
  1041. }).catch(function() {
  1042. self.contactList = []
  1043. })
  1044. },
  1045. loadHealthAlerts: function() {
  1046. var self = this
  1047. getHealthAlerts({}).then(function(res) {
  1048. if (res.code === 200) {
  1049. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  1050. } else {
  1051. self.healthAlerts = []
  1052. }
  1053. }).catch(function() {
  1054. self.healthAlerts = []
  1055. })
  1056. },
  1057. loadMilestones: function() {
  1058. var self = this
  1059. getMilestones({}, 30).then(function(res) {
  1060. if (res.code === 200) {
  1061. self.milestones = Array.isArray(res.data) ? res.data : []
  1062. } else {
  1063. self.milestones = []
  1064. }
  1065. }).catch(function() {
  1066. self.milestones = []
  1067. })
  1068. },
  1069. loadTraditionalCultureData: function() {
  1070. var self = this
  1071. var memberId = this.currentChildId
  1072. if (!memberId) {
  1073. self.traditionalLoading = false
  1074. return
  1075. }
  1076. self.traditionalLoading = true
  1077. uni.request({
  1078. url: config.API_BASE_URL + '/api/mind/traditional/mirror',
  1079. method: 'POST',
  1080. data: { memberId: memberId, memberType: 'child' },
  1081. success: function(res) {
  1082. self.traditionalLoading = false
  1083. if (res.data && res.data.code === 200 && res.data.data) {
  1084. var d = res.data.data
  1085. if (d.eightCharacters || d.wuxingElements || d.zodiac || d.numSoul) {
  1086. self.traditionalData = d
  1087. } else {
  1088. self.traditionalData = null
  1089. }
  1090. } else {
  1091. self.traditionalData = null
  1092. }
  1093. },
  1094. fail: function() {
  1095. self.traditionalLoading = false
  1096. self.traditionalData = null
  1097. }
  1098. })
  1099. },
  1100. _watchPageReady() {
  1101. var self = this
  1102. var unwatch = this.$watch(function() {
  1103. if (self.isLoggedIn) {
  1104. return !!(self.emiData || self.energyOverview || (self.dimensionActivities && self.dimensionActivities.length > 0))
  1105. }
  1106. return !!(self.dimensionActivities && self.dimensionActivities.length > 0)
  1107. }, function(val) {
  1108. if (val) {
  1109. if (unwatch) unwatch()
  1110. self.showTabTransition = false
  1111. }
  1112. })
  1113. setTimeout(function() {
  1114. if (unwatch) unwatch()
  1115. self.showTabTransition = false
  1116. }, 5000)
  1117. },
  1118. // ===== DAN 报告 =====
  1119. loadDanReports: function() {
  1120. var self = this
  1121. var memberId = self.currentChildId
  1122. if (!memberId) return
  1123. getDanReportByChild(memberId, 'mind').then(function(res) {
  1124. if (res.code === 200 && res.data) {
  1125. self.danReports = res.data
  1126. }
  1127. }).catch(function() {})
  1128. },
  1129. goDanUpload: function(dimension) {
  1130. uni.navigateTo({ url: '/pages/dan-assessment/report-upload' })
  1131. },
  1132. viewDanReport: function(report) {
  1133. uni.navigateTo({ url: '/pages/dan-assessment/report-upload?draftId=' + report.id })
  1134. },
  1135. formatDate: function(dateStr) {
  1136. if (!dateStr) return ''
  1137. var d = new Date(dateStr)
  1138. return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
  1139. }
  1140. }
  1141. }
  1142. </script>
  1143. <style scoped>
  1144. .container {
  1145. min-height: 100vh;
  1146. background: #f5f7fa;
  1147. padding-bottom: 120rpx;
  1148. }
  1149. /* ===== 心·心理 标题栏 ===== */
  1150. .section-title-bar {
  1151. display: flex;
  1152. flex-direction: row;
  1153. align-items: center;
  1154. margin: 20rpx 30rpx 10rpx;
  1155. padding: 16rpx 24rpx;
  1156. background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  1157. border-radius: 20rpx;
  1158. box-shadow: 0 4rpx 16rpx rgba(139,92,246,0.25);
  1159. }
  1160. .section-title-icon {
  1161. font-size: 32rpx;
  1162. color: #fff;
  1163. margin-right: 12rpx;
  1164. }
  1165. .section-title-text {
  1166. font-size: 32rpx;
  1167. font-weight: bold;
  1168. color: #fff;
  1169. }
  1170. /* ===== 心理能量概况 ===== */
  1171. .energy-overview {
  1172. display: flex;
  1173. flex-direction: row;
  1174. margin: 20rpx 30rpx;
  1175. background: #fff;
  1176. border-radius: 20rpx;
  1177. padding: 24rpx 16rpx;
  1178. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1179. justify-content: space-around;
  1180. }
  1181. .energy-badge {
  1182. display: flex;
  1183. flex-direction: column;
  1184. align-items: center;
  1185. flex: 1;
  1186. }
  1187. .badge-icon {
  1188. font-size: 36rpx;
  1189. margin-bottom: 8rpx;
  1190. }
  1191. .badge-value {
  1192. font-size: 36rpx;
  1193. font-weight: bold;
  1194. color: #333;
  1195. }
  1196. .badge-label {
  1197. font-size: 20rpx;
  1198. color: #999;
  1199. margin-top: 4rpx;
  1200. }
  1201. /* ===== EMI 四维条形图 ===== */
  1202. .emi-section {
  1203. margin: 20rpx 30rpx;
  1204. }
  1205. .emi-card {
  1206. background: #fff;
  1207. border-radius: 24rpx;
  1208. padding: 30rpx;
  1209. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1210. }
  1211. .emi-card-title {
  1212. font-size: 30rpx;
  1213. font-weight: bold;
  1214. color: #333;
  1215. display: block;
  1216. }
  1217. .personality-header {
  1218. display: flex;
  1219. flex-direction: row;
  1220. align-items: center;
  1221. justify-content: space-between;
  1222. margin-bottom: 24rpx;
  1223. }
  1224. .test-btn {
  1225. background: #8B5CF6;
  1226. padding: 8rpx 28rpx;
  1227. border-radius: 30rpx;
  1228. }
  1229. .test-btn-text {
  1230. font-size: 24rpx;
  1231. color: #fff;
  1232. font-weight: 500;
  1233. }
  1234. .emi-bar-item {
  1235. display: flex;
  1236. flex-direction: row;
  1237. align-items: center;
  1238. margin-bottom: 20rpx;
  1239. }
  1240. .emi-bar-label {
  1241. font-size: 24rpx;
  1242. color: #666;
  1243. width: 120rpx;
  1244. flex-shrink: 0;
  1245. }
  1246. .emi-bar-track {
  1247. flex: 1;
  1248. height: 20rpx;
  1249. background: #f0f0f0;
  1250. border-radius: 10rpx;
  1251. overflow: hidden;
  1252. margin: 0 16rpx;
  1253. }
  1254. .emi-bar-fill {
  1255. height: 100%;
  1256. border-radius: 10rpx;
  1257. transition: width 0.5s;
  1258. }
  1259. .emi-bar-score {
  1260. font-size: 26rpx;
  1261. font-weight: bold;
  1262. color: #333;
  1263. width: 60rpx;
  1264. text-align: right;
  1265. flex-shrink: 0;
  1266. }
  1267. .emi-bar-level {
  1268. font-size: 20rpx;
  1269. width: 80rpx;
  1270. text-align: right;
  1271. flex-shrink: 0;
  1272. }
  1273. .level-excellent { color: #10B981; }
  1274. .level-good { color: #3B82F6; }
  1275. .level-average { color: #F97316; }
  1276. .level-low { color: #EF4444; }
  1277. .emi-footer {
  1278. display: flex;
  1279. flex-direction: row;
  1280. justify-content: space-between;
  1281. align-items: center;
  1282. margin-top: 20rpx;
  1283. padding-top: 20rpx;
  1284. border-top: 1rpx solid #f0f0f0;
  1285. }
  1286. .emi-overall {
  1287. font-size: 28rpx;
  1288. font-weight: bold;
  1289. color: #FF6B35;
  1290. }
  1291. .emi-link {
  1292. display: flex;
  1293. flex-direction: row;
  1294. align-items: center;
  1295. }
  1296. .emi-link-text {
  1297. font-size: 26rpx;
  1298. color: #FF6B35;
  1299. font-weight: 500;
  1300. }
  1301. .emi-link-arrow {
  1302. font-size: 26rpx;
  1303. color: #FF6B35;
  1304. margin-left: 8rpx;
  1305. }
  1306. /* 雷达图内的空状态 */
  1307. .placeholder-content {
  1308. display: flex;
  1309. flex-direction: column;
  1310. align-items: center;
  1311. padding: 40rpx 20rpx;
  1312. }
  1313. /* ===== 占位卡 ===== */
  1314. .placeholder-card {
  1315. margin: 30rpx;
  1316. background: #fff;
  1317. border-radius: 24rpx;
  1318. padding: 60rpx 40rpx;
  1319. display: flex;
  1320. flex-direction: column;
  1321. align-items: center;
  1322. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1323. }
  1324. .placeholder-icon {
  1325. font-size: 80rpx;
  1326. margin-bottom: 20rpx;
  1327. }
  1328. .placeholder-title {
  1329. font-size: 32rpx;
  1330. font-weight: bold;
  1331. color: #333;
  1332. margin-bottom: 16rpx;
  1333. }
  1334. .placeholder-desc {
  1335. font-size: 26rpx;
  1336. color: #999;
  1337. text-align: center;
  1338. line-height: 1.6;
  1339. margin-bottom: 30rpx;
  1340. }
  1341. .placeholder-btn {
  1342. background: linear-gradient(135deg, #FF6B35, #FFD700);
  1343. color: #fff;
  1344. font-size: 28rpx;
  1345. font-weight: bold;
  1346. padding: 16rpx 64rpx;
  1347. border-radius: 40rpx;
  1348. box-shadow: 0 4rpx 16rpx rgba(255,107,53,0.3);
  1349. }
  1350. /* ===== 传统文化卡片 ===== */
  1351. .culture-section {
  1352. margin: 20rpx 30rpx;
  1353. }
  1354. .culture-card {
  1355. background: #fff;
  1356. border-radius: 20rpx;
  1357. padding: 24rpx;
  1358. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1359. margin-bottom: 16rpx;
  1360. }
  1361. .culture-card-header {
  1362. display: flex;
  1363. align-items: center;
  1364. margin-bottom: 16rpx;
  1365. }
  1366. .culture-card-icon {
  1367. font-size: 32rpx;
  1368. margin-right: 10rpx;
  1369. }
  1370. .culture-card-title {
  1371. font-size: 28rpx;
  1372. font-weight: 600;
  1373. color: #333;
  1374. }
  1375. .culture-card-body {
  1376. font-size: 24rpx;
  1377. color: #666;
  1378. line-height: 1.6;
  1379. }
  1380. /* 八字四柱 */
  1381. .bazi-grid {
  1382. display: flex;
  1383. justify-content: space-around;
  1384. padding: 8rpx 0;
  1385. }
  1386. .bazi-column {
  1387. display: flex;
  1388. flex-direction: column;
  1389. align-items: center;
  1390. }
  1391. .bazi-pillar-label {
  1392. font-size: 22rpx;
  1393. color: #999;
  1394. margin-bottom: 6rpx;
  1395. }
  1396. .bazi-pillar-value {
  1397. font-size: 32rpx;
  1398. font-weight: 700;
  1399. color: #8B5CF6;
  1400. background: #F5F0FF;
  1401. padding: 10rpx 14rpx;
  1402. border-radius: 10rpx;
  1403. }
  1404. /* 五行能量 */
  1405. .wuxing-list {
  1406. display: flex;
  1407. flex-direction: column;
  1408. gap: 12rpx;
  1409. }
  1410. .wuxing-item {
  1411. display: flex;
  1412. align-items: center;
  1413. gap: 12rpx;
  1414. }
  1415. .wuxing-label {
  1416. font-size: 26rpx;
  1417. font-weight: 600;
  1418. width: 44rpx;
  1419. text-align: center;
  1420. }
  1421. .wuxing-bar-track {
  1422. flex: 1;
  1423. height: 20rpx;
  1424. background: #F0F0F0;
  1425. border-radius: 10rpx;
  1426. overflow: hidden;
  1427. }
  1428. .wuxing-bar-fill {
  1429. height: 100%;
  1430. border-radius: 10rpx;
  1431. }
  1432. .wuxing-value {
  1433. font-size: 22rpx;
  1434. color: #666;
  1435. width: 56rpx;
  1436. text-align: right;
  1437. }
  1438. .wuxing-reading {
  1439. margin-top: 12rpx;
  1440. padding: 12rpx 14rpx;
  1441. background: #F8F6F0;
  1442. border-radius: 12rpx;
  1443. font-size: 24rpx;
  1444. color: #666;
  1445. line-height: 1.5;
  1446. }
  1447. /* 星座+灵数双栏 */
  1448. .culture-dual {
  1449. display: flex;
  1450. gap: 16rpx;
  1451. }
  1452. .culture-dual-item {
  1453. flex: 1;
  1454. background: #fff;
  1455. border-radius: 20rpx;
  1456. padding: 20rpx;
  1457. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1458. display: flex;
  1459. flex-direction: column;
  1460. align-items: center;
  1461. }
  1462. .culture-dual-icon {
  1463. font-size: 36rpx;
  1464. margin-bottom: 8rpx;
  1465. }
  1466. .culture-dual-label {
  1467. font-size: 22rpx;
  1468. color: #999;
  1469. margin-bottom: 6rpx;
  1470. }
  1471. .culture-dual-value {
  1472. font-size: 28rpx;
  1473. font-weight: 700;
  1474. color: #8B5CF6;
  1475. }
  1476. .culture-empty {
  1477. text-align: center;
  1478. padding: 30rpx 0;
  1479. color: #bbb;
  1480. font-size: 24rpx;
  1481. }
  1482. /* ===== 每日心理 ===== */
  1483. .tip-card {
  1484. background: #fff;
  1485. border-radius: 20rpx;
  1486. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1487. display: flex;
  1488. flex-direction: row;
  1489. overflow: hidden;
  1490. }
  1491. .tip-left-bar {
  1492. width: 6rpx;
  1493. background: linear-gradient(180deg, #5B9BD5, #8FC5E8);
  1494. flex-shrink: 0;
  1495. }
  1496. .tip-body {
  1497. flex: 1;
  1498. padding: 28rpx 24rpx;
  1499. }
  1500. .tip-title {
  1501. font-size: 28rpx;
  1502. font-weight: bold;
  1503. color: #5B9BD5;
  1504. display: block;
  1505. margin-bottom: 12rpx;
  1506. }
  1507. .tip-content {
  1508. font-size: 24rpx;
  1509. color: #666;
  1510. line-height: 1.6;
  1511. display: block;
  1512. margin-bottom: 16rpx;
  1513. }
  1514. .tip-footer {
  1515. display: flex;
  1516. flex-direction: row;
  1517. justify-content: flex-end;
  1518. }
  1519. .tip-source {
  1520. font-size: 22rpx;
  1521. color: #bbb;
  1522. }
  1523. /* ===== 通用区块 ===== */
  1524. .section {
  1525. margin: 20rpx 30rpx;
  1526. }
  1527. .section-header {
  1528. margin-bottom: 20rpx;
  1529. }
  1530. .section-title {
  1531. font-size: 30rpx;
  1532. font-weight: bold;
  1533. color: #333;
  1534. }
  1535. /* ===== 推荐阅读 ===== */
  1536. .article-list {
  1537. display: flex;
  1538. flex-direction: column;
  1539. }
  1540. .article-card {
  1541. background: #fff;
  1542. border-radius: 20rpx;
  1543. padding: 28rpx 24rpx;
  1544. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1545. margin-bottom: 20rpx;
  1546. }
  1547. .article-category {
  1548. display: inline-block;
  1549. padding: 4rpx 18rpx;
  1550. border-radius: 20rpx;
  1551. margin-bottom: 14rpx;
  1552. }
  1553. .article-category-text {
  1554. font-size: 20rpx;
  1555. color: #fff;
  1556. font-weight: 500;
  1557. }
  1558. .article-title {
  1559. font-size: 28rpx;
  1560. font-weight: bold;
  1561. color: #333;
  1562. display: block;
  1563. margin-bottom: 10rpx;
  1564. }
  1565. .article-summary {
  1566. font-size: 24rpx;
  1567. color: #888;
  1568. line-height: 1.5;
  1569. display: block;
  1570. margin-bottom: 20rpx;
  1571. }
  1572. .article-meta {
  1573. display: flex;
  1574. flex-direction: row;
  1575. align-items: center;
  1576. justify-content: space-between;
  1577. }
  1578. .meta-item {
  1579. display: flex;
  1580. flex-direction: row;
  1581. align-items: center;
  1582. margin-right: 20rpx;
  1583. }
  1584. .meta-icon {
  1585. font-size: 22rpx;
  1586. margin-right: 4rpx;
  1587. }
  1588. .meta-text {
  1589. font-size: 22rpx;
  1590. color: #bbb;
  1591. }
  1592. .article-date {
  1593. font-size: 22rpx;
  1594. color: #bbb;
  1595. margin-left: auto;
  1596. }
  1597. /* ===== 功能区入口 ===== */
  1598. .func-section {
  1599. margin: 20rpx 30rpx;
  1600. }
  1601. .func-grid {
  1602. display: flex;
  1603. flex-direction: column;
  1604. gap: 16rpx;
  1605. background: #fff;
  1606. border-radius: 20rpx;
  1607. padding: 24rpx 16rpx;
  1608. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1609. }
  1610. .func-row {
  1611. display: flex;
  1612. flex-direction: row;
  1613. justify-content: space-between;
  1614. }
  1615. .func-item {
  1616. display: flex;
  1617. flex-direction: column;
  1618. align-items: center;
  1619. flex: 1;
  1620. }
  1621. .func-icon-wrap {
  1622. width: 80rpx;
  1623. height: 80rpx;
  1624. border-radius: 40rpx;
  1625. background: linear-gradient(135deg, #D6EAF8, #EBF2FA);
  1626. display: flex;
  1627. align-items: center;
  1628. justify-content: center;
  1629. margin-bottom: 10rpx;
  1630. }
  1631. .func-icon {
  1632. font-size: 40rpx;
  1633. }
  1634. .func-label {
  1635. font-size: 22rpx;
  1636. color: #666;
  1637. font-weight: 500;
  1638. }
  1639. .func-item:active {
  1640. opacity: 0.7;
  1641. }
  1642. /* ===== 底部 ===== */
  1643. .bottom-spacer {
  1644. height: 120rpx;
  1645. }
  1646. /* ===== 肠脑轴 ===== */
  1647. .gut-insight-text {
  1648. font-size: 24rpx;
  1649. color: #666;
  1650. margin-bottom: 16rpx;
  1651. padding: 12rpx 16rpx;
  1652. background: #F0FFF4;
  1653. border-radius: 12rpx;
  1654. line-height: 1.6;
  1655. }
  1656. .gut-indicator-list {
  1657. display: flex;
  1658. flex-direction: column;
  1659. gap: 12rpx;
  1660. }
  1661. .gut-indicator-item {
  1662. display: flex;
  1663. align-items: center;
  1664. gap: 12rpx;
  1665. }
  1666. .gut-indicator-left {
  1667. width: 80rpx;
  1668. flex-shrink: 0;
  1669. }
  1670. .gut-indicator-name {
  1671. font-size: 22rpx;
  1672. color: #666;
  1673. }
  1674. .gut-indicator-bar-track {
  1675. flex: 1;
  1676. height: 16rpx;
  1677. background: #F0F0F0;
  1678. border-radius: 8rpx;
  1679. overflow: hidden;
  1680. }
  1681. .gut-indicator-bar-fill {
  1682. height: 100%;
  1683. border-radius: 8rpx;
  1684. transition: width 0.3s;
  1685. }
  1686. .gut-indicator-value {
  1687. font-size: 22rpx;
  1688. color: #666;
  1689. width: 60rpx;
  1690. text-align: right;
  1691. }
  1692. .gut-indicator-status {
  1693. font-size: 20rpx;
  1694. padding: 2rpx 12rpx;
  1695. border-radius: 10rpx;
  1696. width: 60rpx;
  1697. text-align: center;
  1698. }
  1699. .status-normal {
  1700. background: #D1FAE5;
  1701. color: #059669;
  1702. }
  1703. .status-abnormal {
  1704. background: #FEE2E2;
  1705. color: #DC2626;
  1706. }
  1707. .status-warning {
  1708. background: #FEF3C7;
  1709. color: #D97706;
  1710. }
  1711. /* ===== 关键信息(家庭+个人) ===== */
  1712. .key-info-card {
  1713. background: #fff;
  1714. border-radius: 20rpx;
  1715. padding: 24rpx;
  1716. margin-top: 20rpx;
  1717. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1718. }
  1719. .key-info-header {
  1720. display: flex;
  1721. align-items: center;
  1722. margin-bottom: 20rpx;
  1723. }
  1724. .key-info-icon {
  1725. font-size: 28rpx;
  1726. margin-right: 8rpx;
  1727. }
  1728. .key-info-title {
  1729. font-size: 28rpx;
  1730. font-weight: 600;
  1731. color: #333;
  1732. }
  1733. .key-info-body {
  1734. display: flex;
  1735. flex-direction: row;
  1736. gap: 20rpx;
  1737. }
  1738. .key-info-col {
  1739. flex: 1;
  1740. background: #F8F9FA;
  1741. border-radius: 14rpx;
  1742. padding: 16rpx;
  1743. min-width: 0;
  1744. }
  1745. .ki-subtitle {
  1746. font-size: 22rpx;
  1747. color: #999;
  1748. margin-bottom: 12rpx;
  1749. font-weight: 500;
  1750. }
  1751. .ki-row {
  1752. display: flex;
  1753. align-items: center;
  1754. margin-bottom: 10rpx;
  1755. flex-wrap: nowrap;
  1756. }
  1757. .ki-row:last-child {
  1758. margin-bottom: 0;
  1759. }
  1760. .ki-label {
  1761. font-size: 22rpx;
  1762. color: #888;
  1763. margin-right: 8rpx;
  1764. white-space: nowrap;
  1765. }
  1766. .ki-dot {
  1767. width: 16rpx;
  1768. height: 16rpx;
  1769. border-radius: 50%;
  1770. margin-right: 6rpx;
  1771. flex-shrink: 0;
  1772. }
  1773. .ki-valuel {
  1774. font-size: 24rpx;
  1775. color: #333;
  1776. font-weight: 500;
  1777. white-space: nowrap;
  1778. }
  1779. .ki-valued {
  1780. font-size: 24rpx;
  1781. color: #333;
  1782. font-weight: 500;
  1783. }
  1784. .ki-swatch {
  1785. width: 28rpx;
  1786. height: 28rpx;
  1787. border-radius: 50%;
  1788. margin-right: 6rpx;
  1789. border: 2rpx solid rgba(0,0,0,0.06);
  1790. flex-shrink: 0;
  1791. }
  1792. .ki-num {
  1793. font-size: 30rpx;
  1794. font-weight: 700;
  1795. color: #FF6B9D;
  1796. }
  1797. .ki-fortune {
  1798. font-size: 24rpx;
  1799. font-weight: 700;
  1800. padding: 2rpx 12rpx;
  1801. border-radius: 10rpx;
  1802. }
  1803. .ki-fortune-0 {
  1804. color: #D32F2F;
  1805. background: #FFEBEE;
  1806. }
  1807. .ki-fortune-1 {
  1808. color: #E65100;
  1809. background: #FFF3E0;
  1810. }
  1811. .ki-fortune-2 {
  1812. color: #F9A825;
  1813. background: #FFFDE7;
  1814. }
  1815. .ki-fortune-3 {
  1816. color: #7B1FA2;
  1817. background: #F3E5F5;
  1818. }
  1819. .ki-fortune-4 {
  1820. color: #B71C1C;
  1821. background: #FFCDD2;
  1822. }
  1823. .ki-insight {
  1824. display: flex;
  1825. align-items: flex-start;
  1826. margin-top: 16rpx;
  1827. padding: 16rpx;
  1828. background: #FFF8F0;
  1829. border-radius: 12rpx;
  1830. }
  1831. .ki-insight-icon {
  1832. font-size: 24rpx;
  1833. margin-right: 8rpx;
  1834. flex-shrink: 0;
  1835. }
  1836. .ki-insight-text {
  1837. font-size: 22rpx;
  1838. color: #8B6914;
  1839. line-height: 1.5;
  1840. }
  1841. .ki-footer {
  1842. margin-top: 16rpx;
  1843. text-align: center;
  1844. padding: 12rpx;
  1845. font-size: 24rpx;
  1846. color: #8B5CF6;
  1847. font-weight: 500;
  1848. background: #F5F3FF;
  1849. border-radius: 12rpx;
  1850. }
  1851. .ki-footer:active {
  1852. opacity: 0.7;
  1853. }
  1854. /* DAN 报告卡片 */
  1855. .dan-card {
  1856. background: #fff;
  1857. border-radius: 16rpx;
  1858. padding: 24rpx;
  1859. margin-bottom: 16rpx;
  1860. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  1861. }
  1862. .dan-card-header {
  1863. display: flex;
  1864. justify-content: space-between;
  1865. align-items: center;
  1866. margin-bottom: 12rpx;
  1867. }
  1868. .dan-report-date {
  1869. font-size: 26rpx;
  1870. color: #666;
  1871. }
  1872. .dan-status {
  1873. font-size: 22rpx;
  1874. padding: 4rpx 16rpx;
  1875. border-radius: 8rpx;
  1876. }
  1877. .dan-status.confirmed {
  1878. background: #D1FAE5;
  1879. color: #065F46;
  1880. }
  1881. .dan-status.pending {
  1882. background: #FEF3C7;
  1883. color: #92400E;
  1884. }
  1885. .dan-report-desc {
  1886. font-size: 28rpx;
  1887. color: #333;
  1888. font-weight: 500;
  1889. margin-bottom: 12rpx;
  1890. display: block;
  1891. }
  1892. .dan-card-footer {
  1893. text-align: right;
  1894. }
  1895. .dan-view-link {
  1896. font-size: 26rpx;
  1897. color: #6366F1;
  1898. }
  1899. .section-header {
  1900. display: flex;
  1901. justify-content: space-between;
  1902. align-items: center;
  1903. margin-bottom: 20rpx;
  1904. }
  1905. .section-title {
  1906. font-size: 32rpx;
  1907. font-weight: 700;
  1908. color: #333;
  1909. }
  1910. .section-more {
  1911. font-size: 26rpx;
  1912. color: #6366F1;
  1913. padding: 8rpx 16rpx;
  1914. }
  1915. </style>