index.vue 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599
  1. <template>
  2. <view class="container" :style="{ '--font-scale': fontScale }">
  3. <!-- 通用登录浮层 -->
  4. <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
  5. <!-- Tabbar 切换过渡页 -->
  6. <tab-transition v-if="showTabTransition" dimCode="mind" ref="tabTransition" @close="showTabTransition = false" />
  7. <!-- 品牌头部 -->
  8. <PageBanner theme="mind-wisdom"
  9. tagline="心智成长 · 智慧人生"
  10. quote="知己知彼,百战不殆" />
  11. <DimensionPageSkeleton v-if="pageLoading" dim-code="mind" />
  12. <!-- 品牌定位语(登录前显示) -->
  13. <view class="brand-strap" v-if="!isLoggedIn">
  14. <text class="brand-strap-text">关注全家心理健康与情绪成长</text>
  15. </view>
  16. <!-- ===== 家庭天盘模块(今日运势 / 今日心情 / 吉位) ===== -->
  17. <FamilyTianpanCard
  18. v-if="isLoggedIn"
  19. :visible="isLoggedIn"
  20. :fortune="dailyFortuneSafe"
  21. :mood="todayMood"
  22. :dominantElement="dominantElementSafe"
  23. :weeklyTip="familyWeeklyInsight"
  24. :traditionalData="traditionalData" />
  25. <!-- 家庭成员选择条 -->
  26. <MemberSelector
  27. variant="tabs"
  28. v-if="currentView === 'self' && isLoggedIn"
  29. :members="familyMembersVisible"
  30. :selectedMemberId="selectedMemberId"
  31. dimension-code="mind"
  32. :score-map="memberScoreMap"
  33. @select="onFamilyMemberSelect"
  34. @longpress="onMemberLongPress"
  35. @manage="onMemberManage"
  36. @removed="loadFamilyMembersVisible" />
  37. <!-- 游客引导语 -->
  38. <view class="monthly-guidance" v-if="!isLoggedIn">
  39. <text class="guidance-icon">🔥</text>
  40. <text class="guidance-text">{{ monthlyGuidance }}</text>
  41. </view>
  42. <!-- 游客价值卡(统一组件:维度色 CTA + 价值预览) -->
  43. <DimensionVisitorCard
  44. v-if="!isLoggedIn"
  45. dimCode="mind"
  46. card-title="心维度 · 心理成长"
  47. :benefits="[
  48. '心理测评 EQ 报告与情绪画像',
  49. '情绪与肠胃关联解读',
  50. '家庭关系质量分析'
  51. ]"
  52. cta-text="登录查看心理画像"
  53. secondary-text="了解心理维度"
  54. secondary-url="/pages/mind-detail/dimension-intro"
  55. preview-text="登录后展示你的心理画像与情绪关联" />
  56. <!-- 登录后:五维能量条 -->
  57. <FamilyEnergyBar
  58. v-if="isLoggedIn"
  59. dimensionCode="mind"
  60. :sandboxData="sandboxData" />
  61. <!-- 心理指标卡片 -->
  62. <view class="indicator-cards-section" v-if="isLoggedIn && mindIndicators.length > 0">
  63. <view class="section-header">
  64. <text class="section-title">🔥 心理指标</text>
  65. <text class="section-more" @click="goMindDetail">更多 ›</text>
  66. </view>
  67. <view class="indicator-cards">
  68. <view
  69. v-for="(ind, i) in mindIndicators"
  70. :key="ind.code"
  71. class="indicator-card"
  72. :class="{ 'no-data': !ind.value }"
  73. @click="goMindDetail()"
  74. >
  75. <view class="indicator-header">
  76. <text class="indicator-name">{{ ind.name }}</text>
  77. <text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
  78. </view>
  79. <view class="indicator-body">
  80. <text class="indicator-value" v-if="ind.value || ind.numericValue !== null">{{ ind.value || formatNumeric(ind.numericValue) }}</text>
  81. <text class="indicator-placeholder" v-else>暂无数据</text>
  82. </view>
  83. <view class="indicator-footer">
  84. <text class="indicator-range" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 心理报告卡片(登录后可见) -->
  90. <view class="emi-card" v-if="isLoggedIn && emiData">
  91. <view class="emi-header">
  92. <text class="emi-title">心理测评报告</text>
  93. <view class="emi-overall-wrap">
  94. <text class="emi-overall-label">综合EQ分</text>
  95. <text class="emi-overall-value">{{ emiData.overallScore || 0 }}</text>
  96. <text :class="['emi-overall-level', 'level-' + getScoreLevel(emiData.overallScore || 0)]">
  97. {{ getScoreLevelText(emiData.overallScore || 0) }}
  98. </text>
  99. </view>
  100. </view>
  101. <view class="emi-dimensions">
  102. <view class="emi-dimension" v-for="dim in emiDimensions" :key="dim.key">
  103. <view class="emi-dim-header">
  104. <text class="emi-dim-label">{{ dim.label }}</text>
  105. <view class="emi-dim-values">
  106. <text class="emi-dim-score">{{ emiData[dim.key] || 0 }}</text>
  107. <text :class="['emi-dim-level', 'level-' + getScoreLevel(emiData[dim.key] || 0)]">
  108. {{ getScoreLevelText(emiData[dim.key] || 0) }}
  109. </text>
  110. </view>
  111. </view>
  112. <view class="emi-dim-bar">
  113. <view class="emi-dim-bar-fill" :style="{ width: (emiData[dim.key] || 0) + '%', background: dim.color }"></view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="emi-footer" @click="goEmotionReport">
  118. <text class="emi-footer-text">查看详情</text>
  119. <text class="emi-footer-icon">&#x2192;</text>
  120. </view>
  121. </view>
  122. <!-- 心维度画像 - 总体说明 -->
  123. <view class="dimension-portrait-section" v-if="isLoggedIn && mindPortrait">
  124. <view class="section-header">
  125. <text class="section-title">🧭 心维度画像</text>
  126. <text class="portrait-tier">{{ mindPortrait.tierLabel }}</text>
  127. </view>
  128. <view class="portrait-summary">
  129. <text class="portrait-desc">{{ mindPortrait.summary }}</text>
  130. </view>
  131. <view class="portrait-dimensions">
  132. <view class="portrait-dim-item" v-for="dim in mindPortrait.dims" :key="dim.code">
  133. <view class="portrait-dim-header">
  134. <view class="portrait-dim-icon" :style="{ background: dim.color }">{{ dim.icon }}</view>
  135. <text class="portrait-dim-name">{{ dim.name }}</text>
  136. <text class="portrait-dim-score">{{ dim.score }}</text>
  137. </view>
  138. <view class="portrait-dim-bar-track">
  139. <view class="portrait-dim-bar-fill" :style="{ width: dim.score + '%', background: dim.color }"></view>
  140. </view>
  141. <text class="portrait-dim-desc">{{ dim.desc }}</text>
  142. </view>
  143. </view>
  144. <view class="portrait-tip" v-if="mindPortrait.tip">
  145. <text class="portrait-tip-text">💡 {{ mindPortrait.tip }}</text>
  146. </view>
  147. </view>
  148. <!-- ===== DAN 报告(登录后) ===== -->
  149. <view class="section" v-if="isLoggedIn">
  150. <view class="section-header">
  151. <text class="section-title">📊 DAN 报告</text>
  152. <text class="section-more" @click="goDanUpload('mind')">上传 +</text>
  153. </view>
  154. <view class="dan-card" v-for="report in danReports" :key="report.id" @click="viewDanReport(report)">
  155. <view class="dan-card-header">
  156. <text class="dan-report-date">{{ formatDate(report.assessmentDate) }}</text>
  157. <text :class="['dan-status', report.draftStatus === 'confirmed' ? 'confirmed' : 'pending']">
  158. {{ report.draftStatus === 'confirmed' ? '已确认' : '待确认' }}
  159. </text>
  160. </view>
  161. <text class="dan-report-desc">DAN A2 心维度测评报告</text>
  162. </view>
  163. <view class="dan-empty" v-if="danReports.length === 0">
  164. <text class="dan-empty-text">暂无 DAN 报告,点击上方「上传 +」上传测评报告</text>
  165. </view>
  166. </view>
  167. <!-- 肠脑轴情绪卡片 -->
  168. <view class="section" v-if="gutIndicators && gutIndicators.length > 0">
  169. <view class="section-header">
  170. <text class="section-title">🌱 情绪与肠胃</text>
  171. </view>
  172. <view class="gut-insight-text" v-if="gutInsight">
  173. <text>{{ gutInsight }}</text>
  174. </view>
  175. <view class="gut-indicator-list">
  176. <view class="gut-indicator-item" v-for="ind in gutIndicators" :key="ind.id">
  177. <view class="gut-indicator-left">
  178. <text class="gut-indicator-name">{{ ind.indicatorName || ind.name }}</text>
  179. <text class="gut-indicator-impact" v-if="emotionImpactLabel(ind.indicatorName || ind.name)">影响{{ emotionImpactLabel(ind.indicatorName || ind.name) }}</text>
  180. </view>
  181. <view class="gut-indicator-bar-track">
  182. <view class="gut-indicator-bar-fill" :style="{ width: indicatorBarWidth(ind), background: indicatorColor(ind.status) }"></view>
  183. </view>
  184. <text class="gut-indicator-value">{{ formatIndicatorValue(ind) }}{{ ind.unit || '%' }}</text>
  185. <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
  186. </view>
  187. </view>
  188. </view>
  189. <!-- ===== Phase 1.2: 心理告警横幅 ===== -->
  190. <PsychCrisisBanner v-if="isLoggedIn" :memberId="currentChildId" source="screening" />
  191. <!-- ===== 底部:功能入口 Grid(通用,两行) ===== -->
  192. <view class="func-section" v-if="sectionVisible('func_entries')">
  193. <view class="func-grid">
  194. <view class="func-row">
  195. <view class="func-item" v-for="item in funcListRow1" :key="item.label" @click="onFuncClick(item)">
  196. <view class="func-icon-wrap">
  197. <text class="func-icon">{{ item.icon }}</text>
  198. </view>
  199. <text class="func-label">{{ item.label }}</text>
  200. </view>
  201. </view>
  202. <view class="func-row">
  203. <view class="func-item" v-for="item in funcListRow2" :key="item.label" @click="onFuncClick(item)">
  204. <view class="func-icon-wrap">
  205. <text class="func-icon">{{ item.icon }}</text>
  206. </view>
  207. <text class="func-label">{{ item.label }}</text>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. <!-- 心13维雷达图(分组展示,登录后且选中成员时) -->
  213. <view class="section" v-if="isLoggedIn && currentMemberEnergies">
  214. <view class="section-header">
  215. <text class="section-title">🧠 情绪与性格</text>
  216. </view>
  217. <view class="radar-group" v-for="(group, gIdx) in mindRadarGroups" :key="gIdx">
  218. <text class="radar-group-label">{{ group.label }}</text>
  219. <RadarChart
  220. :dimensions="group.dimensions"
  221. :scores="getMindGroupScores(group)"
  222. :avg-scores="getMindGroupFamilyScores(group)"
  223. :population-scores="getGroupPopulationScores(group)"
  224. :fillColor="mindColor"
  225. :gridColor="gridColor"
  226. :labelColor="labelColor"
  227. :width="540"
  228. :height="540" />
  229. </view>
  230. </view>
  231. <!-- 心维度介绍卡片(登录后显示) -->
  232. <DimensionIntroCard dimCode="mind" v-if="isLoggedIn" learn-more-url="/pages/mind-detail/dimension-intro" />
  233. <!-- 底部占位 -->
  234. <view class="bottom-spacer"></view>
  235. </view>
  236. </template>
  237. <script>
  238. import { BrandColors } from '../../utils/brand-colors.js'
  239. import TabTransition from '../../components/tab-transition.vue'
  240. import PageBanner from '../../components/PageBanner.vue'
  241. import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
  242. import DimensionVisitorCard from '../../components/DimensionVisitorCard.vue'
  243. import RadarChart from '../../components/RadarChart.vue'
  244. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  245. import PsychCrisisBanner from '@/pages/mind-detail/components/PsychCrisisBanner.vue'
  246. import FamilyTianpanCard from '@/pages/mind-detail/components/FamilyTianpanCard.vue'
  247. import DimensionPageSkeleton from '../../components/DimensionPageSkeleton.vue'
  248. import MemberSelector from '@/components/MemberSelector.vue'
  249. import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getEnergySandbox, getChildren, getFamilyMemberList, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune, getLatestIndicators, getRadarData, kickFamilyMemberById } from '../../utils/api.js'
  250. import nav from '../../utils/nav.js'
  251. import config from '../../config.js'
  252. import { parseDate } from '../../utils/format.js'
  253. import fontScaleMixin from '@/mixins/font-scale.js'
  254. export default {
  255. mixins: [fontScaleMixin],
  256. components: { TabTransition, PageBanner, RadarChart, FamilyEnergyBar, PsychCrisisBanner, FamilyTianpanCard, MemberSelector, DimensionIntroCard, DimensionVisitorCard, DimensionPageSkeleton },
  257. data() {
  258. return {
  259. gridColor: BrandColors.pink100,
  260. labelColor: BrandColors.pink800,
  261. mindColor: BrandColors.mind,
  262. memberScoreMap: {},
  263. pageLoading: false,
  264. isLoggedIn: false,
  265. role: null,
  266. showTabTransition: true,
  267. currentChildId: null,
  268. selectedMemberId: null,
  269. visibleSections: [],
  270. familyMembersVisible: [],
  271. // 心理 Tab 数据
  272. emiData: null,
  273. emiLoading: true,
  274. emiDimensions: [
  275. { key: 'emotionStability', label: '情绪稳定性', color: BrandColors.mindAccent }
  276. ],
  277. // 大五维度(用于雷达图)
  278. personalityDimensions: [
  279. { key: 'opennessScore', label: '开放性' },
  280. { key: 'conscientiousnessScore', label: '尽责性' },
  281. { key: 'extraversionScore', label: '外向性' },
  282. { key: 'agreeablenessScore', label: '宜人性' },
  283. { key: 'neuroticismScore', label: '神经质' }
  284. ],
  285. // 功能入口
  286. funcList: [
  287. { icon: '\u{1F4D6}', label: '阅读', needLogin: false, page: '/pages/article-center/index?dimension=mind' },
  288. { icon: '\u{1F4CA}', label: '测评报告', needLogin: true, page: '/pages/mind-detail/emotion-report' },
  289. { icon: '\u{1F4DD}', label: '成长记录', needLogin: true, page: '/pages/growth-main/index' },
  290. { icon: '\u{2728}', label: '情绪打卡', needLogin: true, page: '/pages/mind-detail/emotion-checkin' },
  291. { icon: '\u{1F4C8}', label: '情绪趋势', needLogin: true, page: '/pages/mind-detail/emotion-trend' },
  292. { icon: '\u{1F9E9}', label: '心理自评', needLogin: true, page: '/pages/mind-detail/screening' },
  293. { icon: '\u{1F3E0}', label: '家庭天盘', needLogin: true, page: '/pages/mind-detail/family-dashboard' },
  294. { icon: '\u{1F9D8}', label: '疏导工具', needLogin: true, page: '/pages/mind-detail/soothe-toolbox' },
  295. { icon: '\u{1F31F}', label: '先天画像', needLogin: true, page: '/pages/mind-detail/innate-portrait' }
  296. ],
  297. articles: [],
  298. // 肠脑轴数据
  299. gutIndicators: null,
  300. gutInsight: '',
  301. // 传统文化数据
  302. traditionalData: null,
  303. traditionalLoading: true,
  304. compatibilityData: null,
  305. wuxingConfig: {
  306. wood: { label: '木', color: BrandColors.success },
  307. fire: { label: '火', color: BrandColors.mind },
  308. earth: { label: '土', color: BrandColors.body },
  309. metal: { label: '金', color: BrandColors.wisdom },
  310. water: { label: '水', color: BrandColors.infoBlue }
  311. },
  312. pillarLabels: { year: '年柱', month: '月柱', day: '日柱', hour: '时柱' },
  313. familyScore: 0,
  314. // 五维组件数据
  315. userName: '',
  316. children: [],
  317. mindSubDims: [],
  318. mindIndicators: [],
  319. sandboxData: null,
  320. currentView: 'self', // 'self' | 'family'
  321. contactList: [],
  322. healthAlerts: [],
  323. milestones: [],
  324. danReports: [],
  325. // 心13维雷达图分组配置
  326. mindRadarGroups: [
  327. {
  328. label: '大五人格',
  329. dimensions: [
  330. { key: 'bigFiveOpenness', label: '开放性' },
  331. { key: 'bigFiveConscientiousness', label: '尽责性' },
  332. { key: 'bigFiveExtraversion', label: '外向性' },
  333. { key: 'bigFiveAgreeableness', label: '宜人性' },
  334. { key: 'bigFiveNeuroticism', label: '神经质' }
  335. ]
  336. },
  337. {
  338. label: '情绪稳定性',
  339. dimensions: [
  340. { key: 'emotionStability', label: '情绪稳定性' }
  341. ]
  342. },
  343. {
  344. label: '自驱力',
  345. dimensions: [
  346. { key: 'driveAutonomy', label: '自主性' },
  347. { key: 'driveCompetence', label: '胜任感' },
  348. { key: 'driveRelatedness', label: '归属感' }
  349. ]
  350. },
  351. {
  352. label: '自我概念',
  353. dimensions: [
  354. { key: 'selfConceptOverall', label: '综合自我概念' }
  355. ]
  356. }
  357. ],
  358. // 家庭天盘 - 今日心情(占位数据)
  359. todayMood: {
  360. emoji: '\u{1F60A}',
  361. text: '平静',
  362. score: 65
  363. },
  364. // 家庭天盘 - 每日运势数据
  365. dailyFortuneData: null,
  366. // 心维度雷达图人群位置分数 (dimensionKey -> score)
  367. mindPopulationScores: {}
  368. }
  369. },
  370. computed: {
  371. /** 每月引导语 */
  372. monthlyGuidance: function() {
  373. var month = new Date().getMonth()
  374. var messages = [
  375. '一月:新年新起点,从情绪觉察开始',
  376. '二月:春节团聚,关注家人心理联结',
  377. '三月:春意盎然,适合情绪释放',
  378. '四月:清明时节,整理内心情绪',
  379. '五月:劳动之余,关注心理健康',
  380. '六月:中考高考季,减压情绪管理',
  381. '七月:暑期到来,培养情绪调节能力',
  382. '八月:夏末秋初,回顾情绪成长',
  383. '九月:开学季,关注家庭成员心理适应',
  384. '十月:国庆假期,增进亲子沟通',
  385. '十一月:秋冬交替,预防情绪低落',
  386. '十二月:年终总结,规划心理成长'
  387. ]
  388. return messages[month] || messages[0]
  389. },
  390. personalityScores: function() {
  391. if (!this.emiData) return []
  392. return [
  393. this.emiData.opennessScore || 0,
  394. this.emiData.conscientiousnessScore || 0,
  395. this.emiData.extraversionScore || 0,
  396. this.emiData.agreeablenessScore || 0,
  397. this.emiData.neuroticismScore || 0
  398. ]
  399. },
  400. emotionArticles: function() {
  401. if (!this.articles || this.articles.length === 0) return []
  402. var result = []
  403. for (var i = 0; i < this.articles.length; i++) {
  404. var a = this.articles[i]
  405. if (a.relatedDimensions && a.relatedDimensions.indexOf('mind') !== -1) {
  406. result.push(a)
  407. }
  408. }
  409. if (result.length === 0) return this.articles.slice(0, 5)
  410. return result.slice(0, 5)
  411. },
  412. wuxingData: function() {
  413. if (!this.traditionalData || !this.traditionalData.wuxingElements) return []
  414. var elements = this.traditionalData.wuxingElements
  415. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  416. var result = []
  417. for (var i = 0; i < keys.length; i++) {
  418. var k = keys[i]
  419. if (elements[k] !== undefined) {
  420. result.push({
  421. key: k,
  422. label: this.wuxingConfig[k].label,
  423. color: this.wuxingConfig[k].color,
  424. value: elements[k]
  425. })
  426. }
  427. }
  428. return result.sort(function(a, b) { return b.value - a.value })
  429. },
  430. currentDimensionCode: function() {
  431. return 'mind'
  432. },
  433. funcListRow1: function() {
  434. return this.funcList.slice(0, 4)
  435. },
  436. funcListRow2: function() {
  437. return this.funcList.slice(4)
  438. },
  439. // ===== 关键信息 - 家庭 =====
  440. familyWuxingLabel: function() {
  441. if (!this.compatibilityData || !this.compatibilityData.familyWuxing || !this.compatibilityData.familyWuxing.aggregatePercentages) return null
  442. var pcts = this.compatibilityData.familyWuxing.aggregatePercentages
  443. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  444. var maxKey = null
  445. var maxVal = -1
  446. for (var i = 0; i < keys.length; i++) {
  447. if (pcts[keys[i]] !== undefined && pcts[keys[i]] > maxVal) {
  448. maxVal = pcts[keys[i]]
  449. maxKey = keys[i]
  450. }
  451. }
  452. if (!maxKey) return null
  453. return { key: maxKey, label: this.wuxingConfig[maxKey].label, color: this.wuxingConfig[maxKey].color, value: maxVal }
  454. },
  455. familyMemberCount: function() {
  456. if (!this.compatibilityData || !this.compatibilityData.members) return 0
  457. return this.compatibilityData.members.length
  458. },
  459. familyWeeklyInsight: function() {
  460. if (!this.compatibilityData || !this.compatibilityData.weeklyInsight) return ''
  461. return this.compatibilityData.weeklyInsight
  462. },
  463. // ===== 关键信息 - 个人 =====
  464. dominantElement: function() {
  465. if (!this.traditionalData || !this.traditionalData.wuxingElements) return null
  466. var elements = this.traditionalData.wuxingElements
  467. var keys = ['wood', 'fire', 'earth', 'metal', 'water']
  468. var maxKey = null
  469. var maxVal = -1
  470. for (var i = 0; i < keys.length; i++) {
  471. if (elements[keys[i]] !== undefined && elements[keys[i]] > maxVal) {
  472. maxVal = elements[keys[i]]
  473. maxKey = keys[i]
  474. }
  475. }
  476. return maxKey
  477. },
  478. luckyColorInfo: function() {
  479. var colorMap = {
  480. wood: { name: '绿', hex: BrandColors.success },
  481. fire: { name: '红', hex: BrandColors.mind },
  482. earth: { name: '黄', hex: BrandColors.body },
  483. metal: { name: '白', hex: BrandColors.wisdom },
  484. water: { name: '蓝', hex: BrandColors.infoBlue }
  485. }
  486. var elem = this.dominantElement
  487. if (!elem) return null
  488. return colorMap[elem] || null
  489. },
  490. luckyNumber: function() {
  491. if (this.traditionalData && this.traditionalData.lifeNumber) {
  492. return this.traditionalData.lifeNumber
  493. }
  494. var numMap = { wood: 3, fire: 9, earth: 5, metal: 7, water: 1 }
  495. var elem = this.dominantElement
  496. return elem ? numMap[elem] : null
  497. },
  498. fortuneSeed: function() {
  499. if (this.traditionalData && this.traditionalData.lifeNumber) {
  500. return String(this.traditionalData.lifeNumber)
  501. }
  502. return '0'
  503. },
  504. // WXML 不支持模板内 || {} 字面量,需在 computed 中预先做 fallback
  505. dailyFortuneSafe: function() {
  506. return this.dailyFortune || {}
  507. },
  508. // WXML 不支持模板内 || '' 字面量,需在 computed 中预先做 fallback
  509. dominantElementSafe: function() {
  510. return this.dominantElement || ''
  511. },
  512. dailyFortune: function() {
  513. // 优先使用后端接口数据
  514. if (this.dailyFortuneData) {
  515. var levels = ['大吉', '吉', '平', '凶', '大凶']
  516. return {
  517. level: this.dailyFortuneData.level,
  518. text: levels[this.dailyFortuneData.level],
  519. description: this.dailyFortuneData.description
  520. }
  521. }
  522. // 兼容模式:没有接口数据时使用原算法
  523. if (!this.dominantElement) return null
  524. var today = new Date()
  525. var dateStr = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate()
  526. var seedStr = dateStr + (this.fortuneSeed || '')
  527. var hash = 0
  528. for (var i = 0; i < seedStr.length; i++) {
  529. hash = ((hash << 5) - hash) + seedStr.charCodeAt(i)
  530. hash = hash & hash
  531. }
  532. var level = Math.abs(hash) % 5
  533. var levels = ['大吉', '吉', '平', '凶', '大凶']
  534. var descMap = {
  535. wood: ['大吉:木气旺盛,宜规划', '吉:行动力强', '平:静心养性', '凶:谨言慎行', '大凶:忌冲动'],
  536. fire: ['大吉:热情高涨', '吉:精力充沛', '平:适当休息', '凶:注意情绪', '大凶:静心冥想'],
  537. earth: ['大吉:稳重踏实', '吉:贵人运佳', '平:按部就班', '凶:注意肠胃', '大凶:不宜投资'],
  538. metal: ['大吉:决策力强', '吉:思维清晰', '平:保持专注', '凶:注意言辞', '大凶:不宜强求'],
  539. water: ['大吉:灵感丰富', '吉:人际和谐', '平:安静内省', '凶:情绪波动', '大凶:宜藏不宜放']
  540. }
  541. var descList = descMap[this.dominantElement] || descMap.wood
  542. return { level: level, text: levels[level], description: descList[level] }
  543. },
  544. /** 当前选中成员的能量数据(从 sandboxData.members 中按 selectedMemberId 查找) */
  545. currentMemberEnergies: function() {
  546. if (!this.sandboxData || !this.sandboxData.members) return null
  547. var members = this.sandboxData.members
  548. var targetId = this.selectedMemberId || this.currentChildId
  549. for (var i = 0; i < members.length; i++) {
  550. var m = members[i]
  551. if (m && (m.memberId === targetId)) return m
  552. }
  553. return members[0] || null
  554. },
  555. mindPortrait: function() {
  556. var self = this
  557. if (!this.isLoggedIn || !this.emiData) return null
  558. var e = this.emiData
  559. var dims = [
  560. { key: 'emotionStability', label: '情绪稳定性', color: BrandColors.mind, desc: '情绪识别与调控能力' },
  561. { key: 'opennessScore', label: '开放性', color: BrandColors.wisdom, desc: '对新事物的接受程度' },
  562. { key: 'conscientiousnessScore', label: '尽责性', color: BrandColors.wealth, desc: '做事有条理、自律程度' },
  563. { key: 'extraversionScore', label: '外向性', color: BrandColors.success, desc: '社交活跃与外向程度' },
  564. { key: 'agreeablenessScore', label: '宜人性', color: BrandColors.body, desc: '与人相处的和谐程度' },
  565. { key: 'neuroticismScore', label: '神经质', color: BrandColors.primary, desc: '情绪波动程度(反向)' }
  566. ]
  567. var result = { overall: 0, tierLabel: '', summary: '', dims: [], tip: '' }
  568. var total = 0
  569. var count = 0
  570. var dimList = []
  571. for (var i = 0; i < dims.length; i++) {
  572. var key = dims[i].key
  573. var score = e[key] || 0
  574. if (isNaN(score)) score = 0
  575. score = Math.max(0, Math.min(100, Number(score)))
  576. total += score
  577. count++
  578. var matched = dims.find(function(d) { return d.key === key })
  579. dimList.push({
  580. code: key,
  581. name: matched ? matched.label : key,
  582. score: Math.round(score),
  583. color: matched ? matched.color : BrandColors.mind,
  584. desc: matched ? matched.desc : ''
  585. })
  586. }
  587. if (count === 0) return null
  588. result.overall = Math.round(total / count)
  589. result.dims = dimList
  590. var o = result.overall
  591. if (o >= 80) {
  592. result.tierLabel = '心灵智者'
  593. result.summary = '您的心理状态非常健康,情绪稳定、人格成熟且内心强大。'
  594. result.tip = '保持内心平衡,可分享经验帮助家人共同成长'
  595. } else if (o >= 60) {
  596. result.tierLabel = '心灵进取者'
  597. result.summary = '您的心理状态良好,具备较强的情绪调节能力和自我认知。'
  598. result.tip = '关注情绪波动,练习正念冥想,持续提升心理韧性'
  599. } else if (o >= 40) {
  600. result.tierLabel = '心灵探索者'
  601. result.summary = '您的心理状态正在建立基础,情绪管理有待加强。'
  602. result.tip = '从每日情绪打卡开始,逐步建立情绪觉察习惯'
  603. } else {
  604. result.tierLabel = '心灵关怀者'
  605. result.summary = '您可能正处于情绪波动期,需要更多关注与支持。'
  606. result.tip = '建议寻求专业心理帮助,或向家人朋友倾诉'
  607. }
  608. return result
  609. }
  610. },
  611. created() {
  612. // 首屏加载骨架:已登录用户的数据请求期间占位,稳态视觉零变化
  613. // 未登录走静态内容,不进 loading,故此处不读 isLoggedIn
  614. var token = uni.getStorageSync('token')
  615. if (token) {
  616. this.pageLoading = true
  617. var self = this
  618. setTimeout(function() { self.pageLoading = false }, 600)
  619. }
  620. },
  621. onShow() {
  622. this.showTabTransition = true
  623. var token = uni.getStorageSync('token')
  624. this.isLoggedIn = !!token
  625. if (this.isLoggedIn) {
  626. this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  627. // FIX: 从 Vuex store 读取 currentChildId,而非仅从 localStorage
  628. this.currentChildId = (this.$store.state && this.$store.state.currentChildId) || uni.getStorageSync('currentChildId') || null
  629. this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '本人'
  630. }
  631. this.loadSectionConfig()
  632. if (this.isLoggedIn) {
  633. this.loadChildren()
  634. this.loadFamilyMembersVisible()
  635. this.loadSandboxData()
  636. this.loadMindRadarPopulationData()
  637. this.loadEmiData()
  638. this.loadGutData()
  639. this.loadEnergyData()
  640. this.loadTraditionalCultureData()
  641. this.loadContacts()
  642. this.loadHealthAlerts()
  643. this.loadMilestones()
  644. this.loadDanReports()
  645. }
  646. // 游客也能浏览活动和商品
  647. this.loadFamilyFortune()
  648. this._watchPageReady()
  649. },
  650. methods: {
  651. /** 获取心维度分组雷达图的分值数组 */
  652. getMindGroupScores: function(group) {
  653. var member = this.currentMemberEnergies
  654. if (!member) return []
  655. var scores = []
  656. var dims = group.dimensions
  657. for (var i = 0; i < dims.length; i++) {
  658. scores.push(member[dims[i].key] || 0)
  659. }
  660. return scores
  661. },
  662. /** 获取心维度分组雷达图的家庭平均分(sandboxData.members 各维度均值) */
  663. getMindGroupFamilyScores: function(group) {
  664. if (!this.sandboxData || !this.sandboxData.members) return []
  665. var members = this.sandboxData.members
  666. var dims = group.dimensions
  667. var scores = []
  668. for (var i = 0; i < dims.length; i++) {
  669. var key = dims[i].key
  670. var sum = 0, count = 0
  671. for (var j = 0; j < members.length; j++) {
  672. var val = members[j][key]
  673. if (val !== undefined && val !== null && val > 0) { sum += val; count++ }
  674. }
  675. scores.push(count > 0 ? Math.round(sum / count) : 0)
  676. }
  677. return scores
  678. },
  679. /** 获取分组对应的人群位置分数 */
  680. getGroupPopulationScores: function(group) {
  681. if (!this.mindPopulationScores) return []
  682. var scores = []
  683. var dims = group.dimensions
  684. for (var i = 0; i < dims.length; i++) {
  685. scores.push(this.mindPopulationScores[dims[i].key] || 0)
  686. }
  687. return scores
  688. },
  689. // ===== 区块可见性 =====
  690. loadSectionConfig: function() {
  691. var self = this
  692. var baseSections = ['func_entries', 'daily_tip', 'recommended_reading']
  693. if (!uni.getStorageSync('token')) {
  694. self.visibleSections = baseSections
  695. return
  696. }
  697. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  698. getVisibleSections({ pageKey: 'mind', role: role }).then(function(res) {
  699. if (res.code === 200 && res.data) {
  700. var keys = res.data.map(function(s) { return s.sectionKey })
  701. var merged = baseSections.slice()
  702. keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
  703. self.visibleSections = merged
  704. }
  705. }).catch(function() {
  706. self.visibleSections = ['func_entries', 'daily_tip', 'recommended_reading', 'mind_tasks', 'related_activities', 'purchased_courses']
  707. })
  708. },
  709. // 加载家庭天盘数据
  710. loadFamilyFortune: function() {
  711. var self = this
  712. if (!self.isLoggedIn) return
  713. getFamilyFortune().then(function(res) {
  714. if (res.code === 200 && res.data) {
  715. // 更新 todayMood 占位数据为真实接口数据
  716. self.todayMood = {
  717. emoji: res.data.moodEmoji || '\u{1F60A}',
  718. text: res.data.moodText || '平静',
  719. score: res.data.moodScore || 65
  720. }
  721. // 更新 dailyFortune computed 函数依赖的数据
  722. self.dailyFortuneData = {
  723. level: res.data.fortuneLevel,
  724. text: res.data.fortuneLevelText,
  725. description: res.data.fortuneDescription
  726. }
  727. // 更新主导五行
  728. self.traditionalData = self.traditionalData || {}
  729. self.traditionalData.wuxingElements = {}
  730. if (res.data.dominantElement) {
  731. self.traditionalData.wuxingElements[res.data.dominantElement] = 100
  732. }
  733. // 更新周报提示
  734. self.compatibilityData = self.compatibilityData || {}
  735. self.compatibilityData.weeklyInsight = res.data.weeklyTip || self.compatibilityData.weeklyInsight
  736. }
  737. }).catch(function(err) {
  738. console.error('Failed to load family fortune:', err)
  739. })
  740. },
  741. viewReport: function(report) {
  742. if (report && report.fileUrl) {
  743. uni.downloadFile({
  744. url: report.fileUrl,
  745. success: function(res) {
  746. if (res.statusCode === 200) {
  747. uni.openDocument({
  748. filePath: res.tempFilePath,
  749. success: function() {
  750. console.log('打开报告成功')
  751. }
  752. })
  753. }
  754. }
  755. })
  756. }
  757. },
  758. formatDate: function(dateStr) {
  759. if (!dateStr) return ''
  760. var d = parseDate(dateStr)
  761. if (!d) return ''
  762. var month = d.getMonth() + 1
  763. var day = d.getDate()
  764. return month + '月' + day + '日'
  765. },
  766. sectionVisible: function(key) {
  767. return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
  768. },
  769. // ===== 心理 Tab:EMI 数据 =====
  770. loadEmiData: function() {
  771. var self = this
  772. var memberId = self.currentChildId
  773. if (!memberId) {
  774. self.emiLoading = false
  775. return
  776. }
  777. self.emiLoading = true
  778. getEmiReport(memberId).then(function(res) {
  779. if (res.code === 200 && res.data) {
  780. self.emiData = res.data
  781. self.mindSubDims = (function() { var e = self.emiData || {}; return [{label:'情绪稳定性', score:e.emotionStability||0, desc:'识别、理解和管理情绪的综合能力'}, {label:'开放性', score:e.opennessScore||0, desc:'对新事物的接受程度'}, {label:'尽责性', score:e.conscientiousnessScore||0, desc:'做事有条理的程度'}, {label:'外向性', score:e.extraversionScore||0, desc:'社交活跃度'}, {label:'宜人性', score:e.agreeablenessScore||0, desc:'与人相处的和谐度'}, {label:'神经质', score:e.neuroticismScore||0, desc:'情绪波动程度(反向)'}, {label:'自主性', score:e.driveAutonomy||0, desc:'内在驱动力'}, {label:'胜任感', score:e.driveCompetence||0, desc:'对自己能力的信心'}, {label:'归属感', score:e.driveRelatedness||0, desc:'感受被接纳'}]; })();
  782. self.loadMindIndicators(memberId)
  783. }
  784. self.emiLoading = false
  785. }).catch(function() {
  786. self.emiLoading = false
  787. })
  788. },
  789. // ===== 肠脑轴情绪指标 =====
  790. loadGutData: function() {
  791. var self = this
  792. var memberId = self.currentChildId
  793. if (!memberId) return
  794. var token = uni.getStorageSync('token')
  795. // 获取神经递质指标
  796. uni.request({
  797. url: config.API_BASE_URL + '/api/mind/neurotransmitters',
  798. method: 'POST',
  799. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  800. data: { memberId: memberId },
  801. success: function(r) {
  802. if (r.statusCode === 200 && r.data && r.data.code === 200) {
  803. var list = r.data.data
  804. if (Array.isArray(list) && list.length > 0) {
  805. self.gutIndicators = list.slice(0, 4)
  806. }
  807. }
  808. }
  809. })
  810. // 获取情绪洞察摘要
  811. uni.request({
  812. url: config.API_BASE_URL + '/api/mind/gut-emotion-insight',
  813. method: 'POST',
  814. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  815. data: { memberId: memberId },
  816. success: function(r) {
  817. if (r.statusCode === 200 && r.data && r.data.code === 200 && r.data.data) {
  818. self.gutInsight = r.data.data.summary || ''
  819. }
  820. }
  821. })
  822. },
  823. indicatorColor: function(status) {
  824. if (status === 'abnormal' || status === '偏高' || status === '偏低') return BrandColors.danger
  825. if (status === 'warning' || status === '偏高' || status === '偏低') return BrandColors.wealth
  826. return BrandColors.success
  827. },
  828. statusLabel: function(status) {
  829. if (status === 'normal') return '正常'
  830. if (status === 'abnormal') return '异常'
  831. if (status === 'warning') return '警讯'
  832. return status || '正常'
  833. },
  834. // 情绪影响映射:指标名 → 影响的情绪功能
  835. emotionImpactLabel: function(name) {
  836. if (!name) return ''
  837. if (name.indexOf('血清素') !== -1 || name.indexOf('5-HT') !== -1) return '情绪稳定'
  838. if (name.indexOf('多巴胺') !== -1 || name.indexOf('Dopamine') !== -1) return '愉悦·动力'
  839. if (name.indexOf('GABA') !== -1 || name.indexOf('氨基丁酸') !== -1) return '放松·减压'
  840. if (name.indexOf('色氨酸') !== -1 || name.indexOf('Tryptophan') !== -1) return '睡眠·情绪'
  841. if (name.indexOf('褪黑素') !== -1 || name.indexOf('Melatonin') !== -1) return '睡眠调节'
  842. if (name.indexOf('皮质醇') !== -1 || name.indexOf('Cortisol') !== -1) return '压力水平'
  843. return ''
  844. },
  845. // 指标值展示:后端字段为 indicatorValue,兼容数值型
  846. formatIndicatorValue: function(ind) {
  847. if (!ind) return ''
  848. var v = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
  849. if (v === undefined || v === null || v === '') return ''
  850. return String(v)
  851. },
  852. // 指标条宽度:将指标值归一化为 0-100% 百分比
  853. indicatorBarWidth: function(ind) {
  854. var raw = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
  855. var n = parseFloat(raw)
  856. if (!isNaN(n) && n >= 0 && n <= 100) return n + '%'
  857. if (!isNaN(n) && n > 100) return '100%'
  858. var st = ind.status || ''
  859. if (st === '偏低' || st === '缺乏' || st === 'abnormal') return '30%'
  860. if (st === '偏高' || st === '过高') return '75%'
  861. return '55%'
  862. },
  863. // ===== EMI 分数评级 =====
  864. getScoreLevel: function(score) {
  865. if (score >= 85) return 'excellent'
  866. if (score >= 70) return 'good'
  867. if (score >= 55) return 'average'
  868. return 'low'
  869. },
  870. getScoreLevelText: function(score) {
  871. if (score >= 85) return '优秀'
  872. if (score >= 70) return '良好'
  873. if (score >= 55) return '一般'
  874. return '需提升'
  875. },
  876. // ===== 导航 =====
  877. goEmotionReport: function() {
  878. var memberId = this.currentChildId || ''
  879. uni.navigateTo({ url: '/pages/mind-detail/emotion-report?memberId=' + memberId })
  880. },
  881. goArticles: function() {
  882. uni.navigateTo({ url: '/pages/article-center/index?dimension=mind' })
  883. },
  884. onFuncClick: function(item) {
  885. if (item.needLogin && !this.isLoggedIn) {
  886. uni.showModal({
  887. title: '提示',
  888. content: '请先登录后使用此功能',
  889. success: (res) => { if (res.confirm) this.openLoginSheet() }
  890. })
  891. return
  892. }
  893. if (item.page) {
  894. var url = item.page
  895. if (item.page.indexOf('innate-portrait') !== -1 || item.page.indexOf('innate-trajectory') !== -1) {
  896. var memberId = this.currentChildId
  897. if (!memberId) {
  898. uni.showToast({ title: '请先选择家庭成员', icon: 'none' })
  899. return
  900. }
  901. var familyId = (this.$store.state && this.$store.state.familyId) || uni.getStorageSync('familyId') || ''
  902. url += '?memberId=' + memberId + '&memberType=child&familyId=' + familyId
  903. }
  904. nav.goPage(url)
  905. }
  906. },
  907. // ===== 成员列表与维度数据 =====
  908. loadChildren: function() {
  909. var self = this
  910. getChildren().then(function(res) {
  911. if (res.code === 200 && res.data) {
  912. self.children = res.data
  913. var savedChildId = uni.getStorageSync('currentChildId')
  914. var found = false
  915. for (var i = 0; i < self.children.length; i++) {
  916. if (self.children[i].memberId === savedChildId) {
  917. self.currentChildId = savedChildId
  918. found = true
  919. break
  920. }
  921. }
  922. // FIX: 不再自动选择第一个成员。仅在用户通过 UserQuickEntry 切换时设置 currentChildId
  923. if (found) {
  924. self.loadDimensionData()
  925. self.loadEmiData()
  926. }
  927. }
  928. }).catch(function(e) {
  929. console.log('获取成员列表失败', e)
  930. })
  931. },
  932. loadDimensionData: function() {
  933. if (this.familyMembersVisible.length > 0) {
  934. this.loadCompatibilityData()
  935. }
  936. },
  937. loadSandboxData: function() {
  938. var self = this
  939. getFamilyEnergySandbox().then(function(res) {
  940. if (res && res.data) {
  941. self.sandboxData = res.data
  942. }
  943. }).catch(function() {})
  944. },
  945. loadMindRadarPopulationData: function() {
  946. var self = this
  947. if (!this.currentChildId && !this.selectedMemberId) return
  948. var memberId = this.selectedMemberId || this.currentChildId
  949. if (!memberId) return
  950. getRadarData({
  951. memberId: memberId,
  952. dimensions: ['bigFiveOpenness','bigFiveConscientiousness','bigFiveExtraversion','bigFiveAgreeableness','bigFiveNeuroticism','emotionStability','driveAutonomy','driveCompetence','driveRelatedness','selfConceptOverall']
  953. }).then(function(res) {
  954. if (res && res.data && res.data.populationScores) {
  955. var dims = res.data.dimensions || []
  956. var scores = res.data.populationScores
  957. var map = {}
  958. for (var i = 0; i < dims.length && i < scores.length; i++) {
  959. map[dims[i]] = scores[i]
  960. }
  961. self.mindPopulationScores = map
  962. }
  963. }).catch(function(e) { console.warn('[mind] radar-data failed', e) })
  964. },
  965. switchView: function(view) {
  966. this.currentView = view
  967. if (view === 'family') {
  968. this.selectedMemberId = null
  969. var self = this
  970. getEnergySandbox('family').then(function(res) {
  971. if (res && res.data && !res.data.locked) {
  972. self.sandboxData = res.data.familyData || res.data
  973. }
  974. }).catch(function(e) { console.log('获取家庭数据失败', e) })
  975. } else {
  976. this.loadSandboxData()
  977. }
  978. },
  979. },
  980. loadEnergyData: function() {
  981. var self = this
  982. if (!this.currentChildId) return
  983. getEnergyOverview(this.currentChildId).then(function(res) {
  984. if (res && res.data) {
  985. var dims = res.data.dimensions
  986. if (dims && dims.length > 0) {
  987. for (var i = 0; i < dims.length; i++) {
  988. if (dims[i] && dims[i].code === 'mind' && res.data.energyScores) {
  989. self.familyScore = res.data.energyScores.mindScore || 0
  990. }
  991. }
  992. }
  993. }
  994. }).catch(function(e) {
  995. console.log('获取能量概览失败', e)
  996. })
  997. },
  998. // 切换成员:同步成员ID并持久化,重载该页全部成员相关数据
  999. onFamilyMemberSelect: function(member) {
  1000. if (!member || member.id === this.selectedMemberId) return
  1001. this.selectedMemberId = member.id
  1002. this.currentChildId = member.id
  1003. uni.setStorageSync('currentChildId', member.id)
  1004. if (this.$store) this.$store.commit('switchToChild', member.id)
  1005. this.reloadForMember()
  1006. },
  1007. // 切换成员后的统一重载入口
  1008. reloadForMember: function() {
  1009. if (!this.isLoggedIn) return
  1010. this.loadSandboxData()
  1011. this.loadMindRadarPopulationData()
  1012. this.loadEmiData()
  1013. this.loadGutData()
  1014. this.loadEnergyData()
  1015. this.loadTraditionalCultureData()
  1016. this.loadContacts()
  1017. this.loadHealthAlerts()
  1018. this.loadMilestones()
  1019. this.loadDanReports()
  1020. },
  1021. // 成员标签长按:唤出管理动作面板
  1022. onMemberLongPress: function(member) {
  1023. this.showMemberActions(member)
  1024. },
  1025. // 成员标签管理入口
  1026. onMemberManage: function() {
  1027. uni.navigateTo({ url: '/pages/profile-extra/family-members' })
  1028. },
  1029. // 成员管理动作面板(系统 ActionSheet,触摸目标由微信保证)
  1030. showMemberActions: function(member) {
  1031. if (!member) return
  1032. var self = this
  1033. var items = ['切换到该成员视角', '编辑资料', '移除成员']
  1034. uni.showActionSheet({
  1035. itemList: items,
  1036. success: function(res) {
  1037. if (res.tapIndex === 0) {
  1038. uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire?memberId=' + member.id })
  1039. } else if (res.tapIndex === 1) {
  1040. uni.navigateTo({ url: '/pages/family/add-member?memberId=' + member.id })
  1041. } else if (res.tapIndex === 2) {
  1042. uni.showModal({
  1043. title: '确认移除',
  1044. content: '确定要移除 ' + (member.nickname || '该成员') + ' 吗?',
  1045. success: function(m) {
  1046. if (m.confirm) {
  1047. uni.showLoading({ title: '移除中...' })
  1048. kickFamilyMemberById(member.id).then(function() {
  1049. uni.hideLoading()
  1050. uni.showToast({ title: '已移除', icon: 'success' })
  1051. self.loadFamilyMembersVisible()
  1052. }).catch(function(err) {
  1053. uni.hideLoading()
  1054. uni.showToast({ title: (err && err.message) || '移除失败', icon: 'none' })
  1055. })
  1056. }
  1057. }
  1058. })
  1059. }
  1060. }
  1061. })
  1062. },
  1063. onChildChanged: function(child) {
  1064. this.currentChildId = child.memberId
  1065. // FIX: 同步提交到 Vuex store
  1066. this.$store.commit('switchToChild', child.memberId)
  1067. this.loadDimensionData()
  1068. this.loadEmiData()
  1069. this.loadTraditionalCultureData()
  1070. },
  1071. loadMindIndicators: function(memberId) {
  1072. var self = this
  1073. getLatestIndicators({ memberId: memberId, domain: 'mind' }).then(function(res) {
  1074. if (res.code === 200) self.mindIndicators = res.data || []
  1075. }).catch(function(e) { console.log('[mind] loadMindIndicators failed', e) })
  1076. },
  1077. goMindDetail: function() {
  1078. var id = this.activeChildId || uni.getStorageSync('currentChildId')
  1079. if (!id) return
  1080. uni.navigateTo({ url: '/pages/mind-detail/member-mind-detail?memberId=' + id })
  1081. },
  1082. formatNumeric: function(v) {
  1083. if (v === null || v === undefined) return ''
  1084. var n = parseFloat(v)
  1085. if (isNaN(n)) return String(v)
  1086. return n % 1 === 0 ? String(n) : n.toFixed(1)
  1087. },
  1088. loadFamilyMembersVisible: function() {
  1089. var self = this
  1090. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  1091. self.familyMembersVisible = res.data || []
  1092. }).catch(function(e) {
  1093. console.log('获取可见家庭成员失败', e)
  1094. self.familyMembersVisible = []
  1095. })
  1096. },
  1097. loadCompatibilityData: function() {
  1098. var self = this
  1099. var token = uni.getStorageSync('token')
  1100. uni.request({
  1101. url: config.API_BASE_URL + '/api/mind/traditional/family-dashboard',
  1102. method: 'POST',
  1103. header: { 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token },
  1104. data: {},
  1105. success: function(res) {
  1106. if (res.data && res.data.code === 200 && res.data.data) {
  1107. self.compatibilityData = res.data.data
  1108. }
  1109. },
  1110. fail: function() {}
  1111. })
  1112. },
  1113. scrollToSection: function(section) {
  1114. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  1115. },
  1116. goAssessment: function() { uni.navigateTo({ url: '/pages/assessment/apply' }) },
  1117. goLogin: function() { this.openLoginSheet() },
  1118. // 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
  1119. onLoginSuccess: function() {
  1120. this.isLoggedIn = true
  1121. this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  1122. this.currentChildId = (this.$store.state && this.$store.state.currentChildId) || uni.getStorageSync('currentChildId') || null
  1123. this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '本人'
  1124. this.loadSectionConfig()
  1125. this.loadChildren()
  1126. this.loadFamilyMembersVisible()
  1127. this.loadSandboxData()
  1128. this.loadMindRadarPopulationData()
  1129. this.loadEmiData()
  1130. this.loadGutData()
  1131. this.loadEnergyData()
  1132. this.loadTraditionalCultureData()
  1133. this.loadContacts()
  1134. this.loadHealthAlerts()
  1135. this.loadMilestones()
  1136. this.loadDanReports()
  1137. this._watchPageReady()
  1138. },
  1139. // ===== 传统文化数据 =====
  1140. // ===== 联系人 / 关系健康 =====
  1141. loadContacts: function() {
  1142. var self = this
  1143. getContactList({}).then(function(res) {
  1144. if (res.code === 200) {
  1145. self.contactList = Array.isArray(res.data) ? res.data : []
  1146. } else {
  1147. self.contactList = []
  1148. }
  1149. }).catch(function() {
  1150. self.contactList = []
  1151. })
  1152. },
  1153. loadHealthAlerts: function() {
  1154. var self = this
  1155. getHealthAlerts().then(function(res) {
  1156. if (res.code === 200) {
  1157. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  1158. } else {
  1159. self.healthAlerts = []
  1160. }
  1161. }).catch(function() {
  1162. self.healthAlerts = []
  1163. })
  1164. },
  1165. loadMilestones: function() {
  1166. var self = this
  1167. getMilestones(30).then(function(res) {
  1168. if (res.code === 200) {
  1169. self.milestones = Array.isArray(res.data) ? res.data : []
  1170. } else {
  1171. self.milestones = []
  1172. }
  1173. }).catch(function() {
  1174. self.milestones = []
  1175. })
  1176. },
  1177. loadTraditionalCultureData: function() {
  1178. var self = this
  1179. var memberId = this.currentChildId
  1180. if (!memberId) {
  1181. self.traditionalLoading = false
  1182. return
  1183. }
  1184. self.traditionalLoading = true
  1185. uni.request({
  1186. url: config.API_BASE_URL + '/api/mind/traditional/mirror',
  1187. method: 'POST',
  1188. data: { memberId: memberId, memberType: 'child' },
  1189. success: function(res) {
  1190. self.traditionalLoading = false
  1191. if (res.data && res.data.code === 200 && res.data.data) {
  1192. var d = res.data.data
  1193. if (d.eightCharacters || d.wuxingElements || d.zodiac || d.numSoul) {
  1194. self.traditionalData = d
  1195. } else {
  1196. self.traditionalData = null
  1197. }
  1198. } else {
  1199. self.traditionalData = null
  1200. }
  1201. },
  1202. fail: function() {
  1203. self.traditionalLoading = false
  1204. self.traditionalData = null
  1205. }
  1206. })
  1207. },
  1208. _watchPageReady() {
  1209. var self = this
  1210. var unwatch = this.$watch(function() {
  1211. if (self.isLoggedIn) {
  1212. return !!(self.emiData || self.energyOverview)
  1213. } }, function(val) {
  1214. if (val) {
  1215. if (unwatch) unwatch()
  1216. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  1217. }
  1218. })
  1219. },
  1220. // ===== DAN 报告 =====
  1221. loadDanReports: function() {
  1222. var self = this
  1223. var memberId = self.currentChildId
  1224. if (!memberId) return
  1225. getDanReportByChild(memberId, 'mind').then(function(res) {
  1226. if (res.code === 200 && res.data) {
  1227. self.danReports = res.data
  1228. }
  1229. }).catch(function() {})
  1230. },
  1231. goDanUpload: function(dimension) {
  1232. var memberId = this.selectedMemberId || this.currentChildId
  1233. var url = '/pages/health/report-upload?type=a2'
  1234. if (memberId) {
  1235. url += '&memberId=' + memberId
  1236. }
  1237. uni.navigateTo({ url: url })
  1238. },
  1239. viewDanReport: function(report) {
  1240. var reportId = report.sourceReportId || report.id
  1241. uni.navigateTo({ url: '/pages/health/report-detail?reportType=dan&reportId=' + reportId })
  1242. },
  1243. formatDate: function(dateStr) {
  1244. if (!dateStr) return ''
  1245. var d = parseDate(dateStr)
  1246. if (!d) return ''
  1247. return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
  1248. }
  1249. }
  1250. </script>
  1251. <style scoped lang="scss">
  1252. // 页面级局部调色板:仅本页专有色阶,跨页共性一律走 uni.scss 全局令牌
  1253. // 心·极深文字
  1254. $c-mind-ink: #9D174D;
  1255. // 玫瑰浅底
  1256. $tint-rose: #FDF2F7;
  1257. // 天蓝浅底
  1258. $tint-sky: #EBF2FA;
  1259. // 天蓝浅底·深(旧蓝系浅档,C-2 待翻转)
  1260. $tint-sky-deep: $tint-sky-blue;
  1261. // 中性浅底
  1262. $tint-gray: #F8F9FA;
  1263. // 青灰浅底
  1264. $tint-cyan: #F0F6F7;
  1265. .container {
  1266. min-height: 100vh;
  1267. background: $app-bg;
  1268. padding-bottom: 120rpx;
  1269. }
  1270. /* ===== 心·心理 标题栏 ===== */
  1271. .section-title-bar {
  1272. display: flex;
  1273. flex-direction: row;
  1274. align-items: center;
  1275. margin: 20rpx $uni-space-lg 10rpx;
  1276. padding: 16rpx 24rpx;
  1277. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  1278. border-radius: 24rpx;
  1279. box-shadow: 0 4rpx 16rpx rgba(139,92,246,0.25);
  1280. }
  1281. .section-title-icon {
  1282. font-size: calc(32rpx * var(--font-scale, 1));
  1283. color: $app-surface;
  1284. margin-right: 12rpx;
  1285. }
  1286. .section-title-text {
  1287. font-size: calc(32rpx * var(--font-scale, 1));
  1288. font-weight: bold;
  1289. color: $app-surface;
  1290. }
  1291. /* ===== 心理报告上传卡片 ===== */
  1292. .mind-report-section {
  1293. margin: 20rpx $uni-space-lg;
  1294. }
  1295. .mind-report-card {
  1296. display: flex;
  1297. flex-direction: row;
  1298. align-items: center;
  1299. background: linear-gradient(135deg, $tint-purple-soft, $dim-mind-tint);
  1300. border-radius: 24rpx;
  1301. padding: 28rpx 24rpx;
  1302. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1303. }
  1304. .mind-report-left {
  1305. width: 100rpx;
  1306. height: 100rpx;
  1307. background: rgba(255,255,255,0.7);
  1308. border-radius: 24rpx;
  1309. display: flex;
  1310. align-items: center;
  1311. justify-content: center;
  1312. margin-right: 20rpx;
  1313. flex-shrink: 0;
  1314. }
  1315. .mind-report-icon {
  1316. font-size: calc($uni-font-size-3xl * var(--font-scale, 1));
  1317. }
  1318. .mind-report-right {
  1319. flex: 1;
  1320. }
  1321. .mind-report-title {
  1322. font-size: calc(30rpx * var(--font-scale, 1));
  1323. font-weight: bold;
  1324. color: $facade-violet-deep;
  1325. display: block;
  1326. margin-bottom: 6rpx;
  1327. }
  1328. .mind-report-desc {
  1329. font-size: calc(22rpx * var(--font-scale, 1));
  1330. color: $facade-violet-light-2;
  1331. line-height: 1.5;
  1332. display: block;
  1333. margin-bottom: 10rpx;
  1334. }
  1335. .mind-report-tags {
  1336. display: flex;
  1337. flex-direction: row;
  1338. gap: 10rpx;
  1339. }
  1340. .mind-tag {
  1341. font-size: calc(20rpx * var(--font-scale, 1));
  1342. color: $facade-violet-deep;
  1343. background: rgba(255,255,255,0.6);
  1344. padding: 4rpx 14rpx;
  1345. border-radius: 24rpx;
  1346. }
  1347. .mind-report-arrow {
  1348. font-size: calc(36rpx * var(--font-scale, 1));
  1349. color: $brand-primary-light;
  1350. margin-left: 10rpx;
  1351. flex-shrink: 0;
  1352. }
  1353. .mind-report-card:active {
  1354. opacity: 0.7;
  1355. }
  1356. .mind-report-list {
  1357. margin-top: 12rpx;
  1358. }
  1359. .mind-report-item {
  1360. display: flex;
  1361. flex-direction: row;
  1362. align-items: center;
  1363. background: $app-surface;
  1364. border-radius: 16rpx;
  1365. padding: 20rpx 20rpx;
  1366. margin-bottom: 8rpx;
  1367. box-shadow: 0 1rpx 6rpx rgba(0,0,0,0.05);
  1368. }
  1369. .mind-report-item:active {
  1370. opacity: 0.7;
  1371. }
  1372. .mind-report-item-icon {
  1373. font-size: calc(28rpx * var(--font-scale, 1));
  1374. margin-right: 14rpx;
  1375. }
  1376. .mind-report-item-name {
  1377. font-size: calc(26rpx * var(--font-scale, 1));
  1378. color: $app-text;
  1379. flex: 1;
  1380. }
  1381. .mind-report-item-date {
  1382. font-size: calc(22rpx * var(--font-scale, 1));
  1383. color: $app-text-muted;
  1384. margin-right: 14rpx;
  1385. }
  1386. .mind-report-item-status {
  1387. font-size: calc(22rpx * var(--font-scale, 1));
  1388. padding: 2rpx 12rpx;
  1389. border-radius: 24rpx;
  1390. }
  1391. .mind-report-item-status.parsed {
  1392. color: $facade-violet-deep;
  1393. background: $tint-purple-soft;
  1394. }
  1395. .mind-report-item-status.pending {
  1396. color: $app-text-muted;
  1397. background: $app-surface-subtle;
  1398. }
  1399. .mind-report-empty {
  1400. display: flex;
  1401. flex-direction: row;
  1402. align-items: center;
  1403. justify-content: center;
  1404. padding: 24rpx;
  1405. margin-top: 8rpx;
  1406. }
  1407. .mind-report-empty-icon {
  1408. font-size: calc(32rpx * var(--font-scale, 1));
  1409. margin-right: 10rpx;
  1410. }
  1411. .mind-report-empty-text {
  1412. font-size: calc(24rpx * var(--font-scale, 1));
  1413. color: $app-border;
  1414. }
  1415. /* ===== 心理能量概况 ===== */
  1416. .energy-overview {
  1417. display: flex;
  1418. flex-direction: row;
  1419. margin: 20rpx $uni-space-lg;
  1420. background: $app-surface;
  1421. border-radius: 24rpx;
  1422. padding: 24rpx 16rpx;
  1423. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1424. justify-content: space-around;
  1425. }
  1426. .energy-badge {
  1427. display: flex;
  1428. flex-direction: column;
  1429. align-items: center;
  1430. flex: 1;
  1431. }
  1432. .badge-icon {
  1433. font-size: calc(36rpx * var(--font-scale, 1));
  1434. margin-bottom: 8rpx;
  1435. }
  1436. .badge-value {
  1437. font-size: calc(36rpx * var(--font-scale, 1));
  1438. font-weight: bold;
  1439. color: $app-text;
  1440. }
  1441. .badge-label {
  1442. font-size: calc(20rpx * var(--font-scale, 1));
  1443. color: $app-text-muted;
  1444. margin-top: 4rpx;
  1445. }
  1446. /* ===== EMI 四维条形图 ===== */
  1447. .emi-section {
  1448. margin: 20rpx $uni-space-lg;
  1449. }
  1450. .emi-card {
  1451. background: $app-surface;
  1452. border-radius: 24rpx;
  1453. padding: $uni-space-page;
  1454. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1455. }
  1456. .emi-card-title {
  1457. font-size: calc(30rpx * var(--font-scale, 1));
  1458. font-weight: bold;
  1459. color: $app-text;
  1460. display: block;
  1461. }
  1462. .personality-header {
  1463. display: flex;
  1464. flex-direction: row;
  1465. align-items: center;
  1466. justify-content: space-between;
  1467. margin-bottom: 24rpx;
  1468. }
  1469. .test-btn {
  1470. background: $brand-primary;
  1471. padding: 8rpx 28rpx;
  1472. border-radius: 24rpx;
  1473. }
  1474. .test-btn-text {
  1475. font-size: calc(24rpx * var(--font-scale, 1));
  1476. color: $app-surface;
  1477. font-weight: 500;
  1478. }
  1479. .emi-bar-item {
  1480. display: flex;
  1481. flex-direction: row;
  1482. align-items: center;
  1483. margin-bottom: 20rpx;
  1484. }
  1485. .emi-bar-label {
  1486. font-size: calc(24rpx * var(--font-scale, 1));
  1487. color: $app-text-secondary;
  1488. width: 120rpx;
  1489. flex-shrink: 0;
  1490. }
  1491. .emi-bar-track {
  1492. flex: 1;
  1493. height: 20rpx;
  1494. background: $app-surface-subtle;
  1495. border-radius: 8rpx;
  1496. overflow: hidden;
  1497. margin: 0 16rpx;
  1498. }
  1499. .emi-bar-fill {
  1500. height: 100%;
  1501. border-radius: 8rpx;
  1502. transition: width 0.5s;
  1503. }
  1504. .emi-bar-score {
  1505. font-size: calc(26rpx * var(--font-scale, 1));
  1506. font-weight: bold;
  1507. color: $app-text;
  1508. width: 60rpx;
  1509. text-align: right;
  1510. flex-shrink: 0;
  1511. }
  1512. .emi-bar-level {
  1513. font-size: calc(20rpx * var(--font-scale, 1));
  1514. width: 80rpx;
  1515. text-align: right;
  1516. flex-shrink: 0;
  1517. }
  1518. .level-excellent { color: $status-success; }
  1519. .level-good { color: $status-info; }
  1520. .level-average { color: $brand-primary; }
  1521. .level-low { color: $status-danger; }
  1522. .emi-footer {
  1523. display: flex;
  1524. flex-direction: row;
  1525. justify-content: space-between;
  1526. align-items: center;
  1527. margin-top: 20rpx;
  1528. padding-top: 20rpx;
  1529. border-top: 1rpx solid $app-surface-subtle;
  1530. }
  1531. .emi-overall {
  1532. font-size: calc(28rpx * var(--font-scale, 1));
  1533. font-weight: bold;
  1534. color: $mind-accent;
  1535. }
  1536. .emi-link {
  1537. display: flex;
  1538. flex-direction: row;
  1539. align-items: center;
  1540. }
  1541. .emi-link-text {
  1542. font-size: calc(26rpx * var(--font-scale, 1));
  1543. color: $mind-accent;
  1544. font-weight: 500;
  1545. }
  1546. .emi-link-arrow {
  1547. font-size: calc(26rpx * var(--font-scale, 1));
  1548. color: $mind-accent;
  1549. margin-left: 8rpx;
  1550. }
  1551. /* ===== EMI 心理报告卡片 ===== */
  1552. .emi-card {
  1553. margin: $uni-space-lg;
  1554. background: $app-surface;
  1555. border-radius: 24rpx;
  1556. padding: $uni-space-page;
  1557. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1558. }
  1559. .emi-header {
  1560. margin-bottom: 24rpx;
  1561. }
  1562. .emi-title {
  1563. font-size: calc(30rpx * var(--font-scale, 1));
  1564. font-weight: bold;
  1565. color: $app-text;
  1566. display: block;
  1567. }
  1568. .emi-overall-wrap {
  1569. display: flex;
  1570. flex-direction: column;
  1571. align-items: center;
  1572. padding: 32rpx 0;
  1573. background: linear-gradient(135deg, $mind-accent, $accent-gold);
  1574. border-radius: 16rpx;
  1575. margin: 20rpx 0;
  1576. color: $app-surface;
  1577. }
  1578. .emi-overall-label {
  1579. font-size: calc(26rpx * var(--font-scale, 1));
  1580. margin-bottom: 6rpx;
  1581. }
  1582. .emi-overall-value {
  1583. font-size: calc($uni-font-size-4xl * var(--font-scale, 1));
  1584. font-weight: bold;
  1585. margin-bottom: 6rpx;
  1586. }
  1587. .emi-overall-level {
  1588. font-size: calc(24rpx * var(--font-scale, 1));
  1589. padding: 4rpx 16rpx;
  1590. border-radius: 16rpx;
  1591. background: rgba(255,255,255,0.2);
  1592. }
  1593. .emi-dimensions {
  1594. display: flex;
  1595. flex-direction: column;
  1596. gap: 20rpx;
  1597. }
  1598. .emi-dimension {
  1599. display: flex;
  1600. flex-direction: column;
  1601. }
  1602. .emi-dim-header {
  1603. display: flex;
  1604. flex-direction: row;
  1605. justify-content: space-between;
  1606. align-items: center;
  1607. margin-bottom: 8rpx;
  1608. }
  1609. .emi-dim-label {
  1610. font-size: calc(26rpx * var(--font-scale, 1));
  1611. color: $app-text-secondary;
  1612. }
  1613. .emi-dim-values {
  1614. display: flex;
  1615. flex-direction: row;
  1616. align-items: center;
  1617. }
  1618. .emi-dim-score {
  1619. font-size: calc(28rpx * var(--font-scale, 1));
  1620. font-weight: bold;
  1621. color: $mind-accent;
  1622. margin-right: 12rpx;
  1623. }
  1624. .emi-dim-level {
  1625. font-size: calc(20rpx * var(--font-scale, 1));
  1626. padding: 2rpx 12rpx;
  1627. border-radius: 8rpx;
  1628. }
  1629. .emi-dim-bar {
  1630. height: 14rpx;
  1631. background: $app-surface-subtle;
  1632. border-radius: 8rpx;
  1633. overflow: hidden;
  1634. }
  1635. .emi-dim-bar-fill {
  1636. height: 100%;
  1637. border-radius: 8rpx;
  1638. transition: width 0.5s;
  1639. }
  1640. .emi-footer {
  1641. display: flex;
  1642. justify-content: flex-end;
  1643. align-items: center;
  1644. padding-top: 20rpx;
  1645. border-top: 1rpx solid $app-surface-subtle;
  1646. margin-top: 20rpx;
  1647. }
  1648. .emi-footer-text {
  1649. font-size: calc(24rpx * var(--font-scale, 1));
  1650. color: $brand-primary;
  1651. font-weight: 500;
  1652. }
  1653. .emi-footer-icon {
  1654. font-size: calc(24rpx * var(--font-scale, 1));
  1655. margin-left: 8rpx;
  1656. }
  1657. .level-excellent { color: $status-success; background: $status-success-tint; }
  1658. .level-good { color: $status-info; background: $status-info-tint; }
  1659. .level-average { color: $brand-primary; background: $dim-wealth-tint; }
  1660. .level-low { color: $status-danger; background: $status-danger-tint; }
  1661. /* 雷达图内的空状态 */
  1662. .placeholder-content {
  1663. display: flex;
  1664. flex-direction: column;
  1665. align-items: center;
  1666. padding: 40rpx 20rpx;
  1667. }
  1668. /* ===== 占位卡 ===== */
  1669. .placeholder-card {
  1670. margin: $uni-space-lg;
  1671. background: $app-surface;
  1672. border-radius: 24rpx;
  1673. padding: 60rpx 40rpx;
  1674. display: flex;
  1675. flex-direction: column;
  1676. align-items: center;
  1677. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1678. }
  1679. .placeholder-icon {
  1680. font-size: calc($uni-font-size-5xl * var(--font-scale, 1));
  1681. margin-bottom: 20rpx;
  1682. }
  1683. .placeholder-title {
  1684. font-size: calc(32rpx * var(--font-scale, 1));
  1685. font-weight: bold;
  1686. color: $app-text;
  1687. margin-bottom: 16rpx;
  1688. }
  1689. .placeholder-desc {
  1690. font-size: calc(26rpx * var(--font-scale, 1));
  1691. color: $app-text-muted;
  1692. text-align: center;
  1693. line-height: 1.6;
  1694. margin-bottom: $uni-space-lg;
  1695. }
  1696. .placeholder-btn {
  1697. background: linear-gradient(135deg, $mind-accent, $accent-gold);
  1698. color: $app-surface;
  1699. font-size: calc(28rpx * var(--font-scale, 1));
  1700. font-weight: bold;
  1701. padding: 16rpx 64rpx;
  1702. border-radius: 24rpx;
  1703. box-shadow: 0 4rpx 16rpx rgba(255,107,53,0.3);
  1704. }
  1705. /* ===== 传统文化卡片 ===== */
  1706. .culture-section {
  1707. margin: 20rpx $uni-space-lg;
  1708. }
  1709. .culture-card {
  1710. background: $app-surface;
  1711. border-radius: 24rpx;
  1712. padding: 24rpx;
  1713. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1714. margin-bottom: 16rpx;
  1715. }
  1716. .culture-card-header {
  1717. display: flex;
  1718. align-items: center;
  1719. margin-bottom: 16rpx;
  1720. }
  1721. .culture-card-icon {
  1722. font-size: calc(32rpx * var(--font-scale, 1));
  1723. margin-right: 10rpx;
  1724. }
  1725. .culture-card-title {
  1726. font-size: calc(28rpx * var(--font-scale, 1));
  1727. font-weight: 600;
  1728. color: $app-text;
  1729. }
  1730. .culture-card-body {
  1731. font-size: calc(24rpx * var(--font-scale, 1));
  1732. color: $app-text-secondary;
  1733. line-height: 1.6;
  1734. }
  1735. /* 八字四柱 */
  1736. .bazi-grid {
  1737. display: flex;
  1738. justify-content: space-around;
  1739. padding: 8rpx 0;
  1740. }
  1741. .bazi-column {
  1742. display: flex;
  1743. flex-direction: column;
  1744. align-items: center;
  1745. }
  1746. .bazi-pillar-label {
  1747. font-size: calc(22rpx * var(--font-scale, 1));
  1748. color: $app-text-muted;
  1749. margin-bottom: 6rpx;
  1750. }
  1751. .bazi-pillar-value {
  1752. font-size: calc(32rpx * var(--font-scale, 1));
  1753. font-weight: 700;
  1754. color: $brand-primary;
  1755. background: $facade-violet-tint;
  1756. padding: 10rpx 14rpx;
  1757. border-radius: 8rpx;
  1758. }
  1759. /* 五行能量 */
  1760. .wuxing-list {
  1761. display: flex;
  1762. flex-direction: column;
  1763. gap: 12rpx;
  1764. }
  1765. .wuxing-item {
  1766. display: flex;
  1767. align-items: center;
  1768. gap: 12rpx;
  1769. }
  1770. .wuxing-label {
  1771. font-size: calc(26rpx * var(--font-scale, 1));
  1772. font-weight: 600;
  1773. width: 44rpx;
  1774. text-align: center;
  1775. }
  1776. .wuxing-bar-track {
  1777. flex: 1;
  1778. height: 20rpx;
  1779. background: $app-surface-subtle;
  1780. border-radius: 8rpx;
  1781. overflow: hidden;
  1782. }
  1783. .wuxing-bar-fill {
  1784. height: 100%;
  1785. border-radius: 8rpx;
  1786. }
  1787. .wuxing-value {
  1788. font-size: calc(22rpx * var(--font-scale, 1));
  1789. color: $app-text-secondary;
  1790. width: 56rpx;
  1791. text-align: right;
  1792. }
  1793. .energy-card {
  1794. margin-top: 20rpx;
  1795. padding: 24rpx 20rpx;
  1796. background: linear-gradient(135deg, $app-ink-night 0%, $app-ink-night-2 50%, $app-ink-night-3 100%);
  1797. border-radius: 24rpx;
  1798. position: relative;
  1799. overflow: hidden;
  1800. }
  1801. .energy-card::before {
  1802. content: '';
  1803. position: absolute;
  1804. top: -60rpx;
  1805. right: -60rpx;
  1806. width: 200rpx;
  1807. height: 200rpx;
  1808. background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
  1809. border-radius: 50%;
  1810. }
  1811. .energy-card::after {
  1812. content: '';
  1813. position: absolute;
  1814. bottom: -40rpx;
  1815. left: -40rpx;
  1816. width: 160rpx;
  1817. height: 160rpx;
  1818. background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  1819. border-radius: 50%;
  1820. }
  1821. .energy-header {
  1822. display: flex;
  1823. align-items: center;
  1824. margin-bottom: 14rpx;
  1825. position: relative;
  1826. z-index: 1;
  1827. }
  1828. .energy-icon {
  1829. font-size: calc(32rpx * var(--font-scale, 1));
  1830. margin-right: 10rpx;
  1831. }
  1832. .energy-label {
  1833. font-size: calc(28rpx * var(--font-scale, 1));
  1834. font-weight: 700;
  1835. background: linear-gradient(135deg, $dim-wealth, $dim-mind);
  1836. -webkit-background-clip: text;
  1837. -webkit-text-fill-color: transparent;
  1838. background-clip: text;
  1839. }
  1840. .energy-divider {
  1841. height: 2rpx;
  1842. background: linear-gradient(90deg, rgba(255,215,0,0.5), rgba(255,107,157,0.3), transparent);
  1843. margin-bottom: 18rpx;
  1844. position: relative;
  1845. z-index: 1;
  1846. }
  1847. .energy-quote {
  1848. font-size: calc(26rpx * var(--font-scale, 1));
  1849. color: $app-border-subtle;
  1850. line-height: 1.8;
  1851. display: block;
  1852. margin-bottom: 14rpx;
  1853. position: relative;
  1854. z-index: 1;
  1855. padding-left: 20rpx;
  1856. letter-spacing: 1rpx;
  1857. }
  1858. .energy-quote::before {
  1859. content: '';
  1860. position: absolute;
  1861. left: 0;
  1862. top: 4rpx;
  1863. bottom: 4rpx;
  1864. width: 4rpx;
  1865. background: linear-gradient(180deg, $dim-wealth, $dim-mind);
  1866. border-radius: 8rpx;
  1867. }
  1868. .energy-advice {
  1869. font-size: calc(24rpx * var(--font-scale, 1));
  1870. color: $app-text-subtle;
  1871. line-height: 1.7;
  1872. display: block;
  1873. position: relative;
  1874. z-index: 1;
  1875. padding: 14rpx 18rpx;
  1876. background: rgba(255,255,255,0.05);
  1877. border-radius: 16rpx;
  1878. border: 1rpx solid rgba(255,255,255,0.08);
  1879. }
  1880. .energy-footer {
  1881. display: flex;
  1882. justify-content: center;
  1883. gap: 12rpx;
  1884. margin-top: 18rpx;
  1885. position: relative;
  1886. z-index: 1;
  1887. }
  1888. .energy-footer-dot {
  1889. width: 8rpx;
  1890. height: 8rpx;
  1891. border-radius: 50%;
  1892. background: rgba(255,255,255,0.3);
  1893. }
  1894. .energy-footer-dot:nth-child(2) {
  1895. background: rgba(255,215,0,0.6);
  1896. width: 10rpx;
  1897. height: 10rpx;
  1898. }
  1899. /* 星座+灵数双栏 */
  1900. .culture-dual {
  1901. display: flex;
  1902. gap: 16rpx;
  1903. }
  1904. .culture-dual-item {
  1905. flex: 1;
  1906. background: $app-surface;
  1907. border-radius: 24rpx;
  1908. padding: 20rpx;
  1909. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  1910. display: flex;
  1911. flex-direction: column;
  1912. align-items: center;
  1913. }
  1914. .culture-dual-icon {
  1915. font-size: calc(36rpx * var(--font-scale, 1));
  1916. margin-bottom: 8rpx;
  1917. }
  1918. .culture-dual-label {
  1919. font-size: calc(22rpx * var(--font-scale, 1));
  1920. color: $app-text-muted;
  1921. margin-bottom: 6rpx;
  1922. }
  1923. .culture-dual-value {
  1924. font-size: calc(28rpx * var(--font-scale, 1));
  1925. font-weight: 700;
  1926. color: $brand-primary;
  1927. }
  1928. .culture-empty {
  1929. text-align: center;
  1930. padding: $uni-space-lg 0;
  1931. color: $app-border;
  1932. font-size: calc(24rpx * var(--font-scale, 1));
  1933. }
  1934. /* ===== 每日心理 ===== */
  1935. .tip-card {
  1936. background: $app-surface;
  1937. border-radius: 24rpx;
  1938. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1939. display: flex;
  1940. flex-direction: row;
  1941. overflow: hidden;
  1942. }
  1943. .tip-left-bar {
  1944. width: 8rpx;
  1945. background: $dim-mind;
  1946. flex-shrink: 0;
  1947. }
  1948. .tip-body {
  1949. flex: 1;
  1950. padding: 28rpx 24rpx;
  1951. }
  1952. .tip-title {
  1953. font-size: calc(28rpx * var(--font-scale, 1));
  1954. font-weight: bold;
  1955. color: $dim-mind;
  1956. display: block;
  1957. margin-bottom: 12rpx;
  1958. }
  1959. .tip-content {
  1960. font-size: calc(24rpx * var(--font-scale, 1));
  1961. color: $app-text-secondary;
  1962. line-height: 1.6;
  1963. display: block;
  1964. margin-bottom: 16rpx;
  1965. }
  1966. .tip-footer {
  1967. display: flex;
  1968. flex-direction: row;
  1969. justify-content: flex-end;
  1970. }
  1971. .tip-source {
  1972. font-size: calc(22rpx * var(--font-scale, 1));
  1973. color: $app-border;
  1974. }
  1975. /* ===== 通用区块 ===== */
  1976. .section {
  1977. margin: 20rpx $uni-space-lg;
  1978. }
  1979. .section-header {
  1980. margin-bottom: 20rpx;
  1981. }
  1982. .section-title {
  1983. font-size: calc(30rpx * var(--font-scale, 1));
  1984. font-weight: bold;
  1985. color: $app-text;
  1986. }
  1987. /* ===== 推荐阅读 ===== */
  1988. .article-list {
  1989. display: flex;
  1990. flex-direction: column;
  1991. }
  1992. .article-card {
  1993. background: $app-surface;
  1994. border-radius: 24rpx;
  1995. padding: 28rpx 24rpx;
  1996. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1997. margin-bottom: 20rpx;
  1998. }
  1999. .article-category {
  2000. display: inline-block;
  2001. padding: 4rpx 18rpx;
  2002. border-radius: 24rpx;
  2003. margin-bottom: 14rpx;
  2004. }
  2005. .article-category-text {
  2006. font-size: calc(20rpx * var(--font-scale, 1));
  2007. color: $app-surface;
  2008. font-weight: 500;
  2009. }
  2010. .article-title {
  2011. font-size: calc(28rpx * var(--font-scale, 1));
  2012. font-weight: bold;
  2013. color: $app-text;
  2014. display: block;
  2015. margin-bottom: 10rpx;
  2016. }
  2017. .article-summary {
  2018. font-size: calc(24rpx * var(--font-scale, 1));
  2019. color: $app-text-muted;
  2020. line-height: 1.5;
  2021. display: block;
  2022. margin-bottom: 20rpx;
  2023. }
  2024. .article-meta {
  2025. display: flex;
  2026. flex-direction: row;
  2027. align-items: center;
  2028. justify-content: space-between;
  2029. }
  2030. .meta-item {
  2031. display: flex;
  2032. flex-direction: row;
  2033. align-items: center;
  2034. margin-right: 20rpx;
  2035. }
  2036. .meta-icon {
  2037. font-size: calc(22rpx * var(--font-scale, 1));
  2038. margin-right: 4rpx;
  2039. }
  2040. .meta-text {
  2041. font-size: calc(22rpx * var(--font-scale, 1));
  2042. color: $app-border;
  2043. }
  2044. .article-date {
  2045. font-size: calc(22rpx * var(--font-scale, 1));
  2046. color: $app-border;
  2047. margin-left: auto;
  2048. }
  2049. /* ===== 功能区入口 ===== */
  2050. .func-section {
  2051. margin: 20rpx $uni-space-lg;
  2052. }
  2053. .func-grid {
  2054. display: flex;
  2055. flex-direction: column;
  2056. gap: 16rpx;
  2057. background: $app-surface;
  2058. border-radius: 24rpx;
  2059. padding: 24rpx 16rpx;
  2060. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  2061. }
  2062. .func-row {
  2063. display: flex;
  2064. flex-direction: row;
  2065. justify-content: space-between;
  2066. }
  2067. .func-item {
  2068. display: flex;
  2069. flex-direction: column;
  2070. align-items: center;
  2071. flex: 1;
  2072. }
  2073. .func-icon-wrap {
  2074. width: 80rpx;
  2075. height: 80rpx;
  2076. border-radius: 24rpx;
  2077. background: linear-gradient(135deg, $tint-sky-deep, $tint-sky);
  2078. display: flex;
  2079. align-items: center;
  2080. justify-content: center;
  2081. margin-bottom: 10rpx;
  2082. }
  2083. .func-icon {
  2084. font-size: calc(40rpx * var(--font-scale, 1));
  2085. }
  2086. .func-label {
  2087. font-size: calc(22rpx * var(--font-scale, 1));
  2088. color: $app-text-secondary;
  2089. font-weight: 500;
  2090. }
  2091. .func-item:active {
  2092. opacity: 0.7;
  2093. }
  2094. /* ===== 底部 ===== */
  2095. .indicator-cards-section { margin: 20rpx $uni-space-lg; }
  2096. .indicator-cards { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16rpx; }
  2097. .indicator-card { width: calc(50% - 8rpx); background: $app-surface; border-radius: 24rpx; padding: 24rpx 20rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
  2098. .indicator-card.no-data { opacity: 0.5; }
  2099. .indicator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
  2100. .indicator-name { font-size: calc(26rpx * var(--font-scale, 1)); color: $app-text-secondary; font-weight: 500; }
  2101. .indicator-unit { font-size: calc(22rpx * var(--font-scale, 1)); color: $app-text-muted; }
  2102. .indicator-body { margin-bottom: 8rpx; }
  2103. .indicator-value { font-size: calc(40rpx * var(--font-scale, 1)); font-weight: bold; color: $dim-mind; }
  2104. .indicator-placeholder { font-size: calc(26rpx * var(--font-scale, 1)); color: $app-border; }
  2105. .indicator-range { font-size: calc(20rpx * var(--font-scale, 1)); color: $app-border; }
  2106. .bottom-spacer { height: 120rpx; }
  2107. /* ===== 肠脑轴 ===== */
  2108. .gut-insight-text {
  2109. font-size: calc(24rpx * var(--font-scale, 1));
  2110. color: $app-text-secondary;
  2111. margin-bottom: 16rpx;
  2112. padding: 12rpx 16rpx;
  2113. background: $dim-action-tint;
  2114. border-radius: 16rpx;
  2115. line-height: 1.6;
  2116. }
  2117. .gut-indicator-list {
  2118. display: flex;
  2119. flex-direction: column;
  2120. gap: 12rpx;
  2121. }
  2122. .gut-indicator-item {
  2123. display: flex;
  2124. align-items: center;
  2125. gap: 12rpx;
  2126. }
  2127. .gut-indicator-left {
  2128. width: 110rpx;
  2129. flex-shrink: 0;
  2130. }
  2131. .gut-indicator-name {
  2132. font-size: calc(22rpx * var(--font-scale, 1));
  2133. color: $app-text-secondary;
  2134. font-weight: 500;
  2135. display: block;
  2136. }
  2137. .gut-indicator-impact {
  2138. font-size: calc(18rpx * var(--font-scale, 1));
  2139. color: $dim-mind;
  2140. display: block;
  2141. margin-top: 2rpx;
  2142. }
  2143. .gut-indicator-bar-track {
  2144. flex: 1;
  2145. height: 16rpx;
  2146. background: $app-surface-subtle;
  2147. border-radius: 8rpx;
  2148. overflow: hidden;
  2149. }
  2150. .gut-indicator-bar-fill {
  2151. height: 100%;
  2152. border-radius: 8rpx;
  2153. transition: width 0.3s;
  2154. }
  2155. .gut-indicator-value {
  2156. font-size: calc(22rpx * var(--font-scale, 1));
  2157. color: $app-text-secondary;
  2158. width: 60rpx;
  2159. text-align: right;
  2160. }
  2161. .gut-indicator-status {
  2162. font-size: calc(20rpx * var(--font-scale, 1));
  2163. padding: 2rpx 12rpx;
  2164. border-radius: 8rpx;
  2165. width: 60rpx;
  2166. text-align: center;
  2167. }
  2168. .status-normal {
  2169. background: $status-success-soft;
  2170. color: $status-success-deep;
  2171. }
  2172. .status-abnormal {
  2173. background: $status-danger-soft;
  2174. color: $status-danger-deep;
  2175. }
  2176. .status-warning {
  2177. background: $status-warning-soft;
  2178. color: $status-warning-deep;
  2179. }
  2180. /* ===== 关键信息(家庭+个人) ===== */
  2181. .key-info-card {
  2182. background: $app-surface;
  2183. border-radius: 24rpx;
  2184. padding: 24rpx;
  2185. margin-top: 20rpx;
  2186. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  2187. }
  2188. .key-info-header {
  2189. display: flex;
  2190. align-items: center;
  2191. margin-bottom: 20rpx;
  2192. }
  2193. .key-info-icon {
  2194. font-size: calc(28rpx * var(--font-scale, 1));
  2195. margin-right: 8rpx;
  2196. }
  2197. .key-info-title {
  2198. font-size: calc(28rpx * var(--font-scale, 1));
  2199. font-weight: 600;
  2200. color: $app-text;
  2201. }
  2202. .key-info-body {
  2203. display: flex;
  2204. flex-direction: row;
  2205. gap: 20rpx;
  2206. }
  2207. .key-info-col {
  2208. flex: 1;
  2209. background: $tint-gray;
  2210. border-radius: 16rpx;
  2211. padding: 16rpx;
  2212. min-width: 0;
  2213. }
  2214. .ki-subtitle {
  2215. font-size: calc(22rpx * var(--font-scale, 1));
  2216. color: $app-text-muted;
  2217. margin-bottom: 12rpx;
  2218. font-weight: 500;
  2219. }
  2220. .ki-row {
  2221. display: flex;
  2222. align-items: center;
  2223. margin-bottom: 10rpx;
  2224. flex-wrap: nowrap;
  2225. }
  2226. .ki-row:last-child {
  2227. margin-bottom: 0;
  2228. }
  2229. .ki-label {
  2230. font-size: calc(22rpx * var(--font-scale, 1));
  2231. color: $app-text-muted;
  2232. margin-right: 8rpx;
  2233. white-space: nowrap;
  2234. }
  2235. .ki-dot {
  2236. width: 16rpx;
  2237. height: 16rpx;
  2238. border-radius: 50%;
  2239. margin-right: 6rpx;
  2240. flex-shrink: 0;
  2241. }
  2242. .ki-valuel {
  2243. font-size: calc(24rpx * var(--font-scale, 1));
  2244. color: $app-text;
  2245. font-weight: 500;
  2246. white-space: nowrap;
  2247. }
  2248. .ki-valued {
  2249. font-size: calc(24rpx * var(--font-scale, 1));
  2250. color: $app-text;
  2251. font-weight: 500;
  2252. }
  2253. .ki-swatch {
  2254. width: 28rpx;
  2255. height: 28rpx;
  2256. border-radius: 50%;
  2257. margin-right: 6rpx;
  2258. border: 2rpx solid rgba(0,0,0,0.06);
  2259. flex-shrink: 0;
  2260. }
  2261. .ki-num {
  2262. font-size: calc(30rpx * var(--font-scale, 1));
  2263. font-weight: 700;
  2264. color: $dim-mind;
  2265. }
  2266. .ki-fortune {
  2267. font-size: calc(24rpx * var(--font-scale, 1));
  2268. font-weight: 700;
  2269. padding: 2rpx 12rpx;
  2270. border-radius: 8rpx;
  2271. }
  2272. .ki-fortune-0 {
  2273. color: $fortune-0-ink;
  2274. background: $fortune-0-tint;
  2275. }
  2276. .ki-fortune-1 {
  2277. color: $fortune-1-ink;
  2278. background: $fortune-1-tint;
  2279. }
  2280. .ki-fortune-2 {
  2281. color: $fortune-2-ink;
  2282. background: $fortune-2-tint;
  2283. }
  2284. .ki-fortune-3 {
  2285. color: $fortune-3-ink;
  2286. background: $fortune-3-tint;
  2287. }
  2288. .ki-fortune-4 {
  2289. color: $fortune-4-ink;
  2290. background: $fortune-4-tint;
  2291. }
  2292. .ki-insight {
  2293. display: flex;
  2294. align-items: flex-start;
  2295. margin-top: 16rpx;
  2296. padding: 16rpx;
  2297. background: $dim-body-tint;
  2298. border-radius: 16rpx;
  2299. }
  2300. .ki-insight-icon {
  2301. font-size: calc(24rpx * var(--font-scale, 1));
  2302. margin-right: 8rpx;
  2303. flex-shrink: 0;
  2304. }
  2305. .ki-insight-text {
  2306. font-size: calc(22rpx * var(--font-scale, 1));
  2307. color: $mind-insight-ink;
  2308. line-height: 1.5;
  2309. }
  2310. .ki-footer {
  2311. margin-top: 16rpx;
  2312. text-align: center;
  2313. padding: 12rpx;
  2314. font-size: calc(24rpx * var(--font-scale, 1));
  2315. color: $brand-primary;
  2316. font-weight: 500;
  2317. background: $facade-violet-tint-2;
  2318. border-radius: 16rpx;
  2319. }
  2320. .ki-footer:active {
  2321. opacity: 0.7;
  2322. }
  2323. /* DAN 报告卡片 */
  2324. .dan-card {
  2325. background: $app-surface;
  2326. border-radius: 16rpx;
  2327. padding: 24rpx;
  2328. margin-bottom: 16rpx;
  2329. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  2330. }
  2331. .dan-card-header {
  2332. display: flex;
  2333. justify-content: space-between;
  2334. align-items: center;
  2335. margin-bottom: 12rpx;
  2336. }
  2337. .dan-report-date {
  2338. font-size: calc(26rpx * var(--font-scale, 1));
  2339. color: $app-text-secondary;
  2340. }
  2341. .dan-status {
  2342. font-size: calc(22rpx * var(--font-scale, 1));
  2343. padding: 4rpx 16rpx;
  2344. border-radius: 8rpx;
  2345. }
  2346. .dan-status.confirmed {
  2347. background: $status-success-soft;
  2348. color: $status-success-strong;
  2349. }
  2350. .dan-status.pending {
  2351. background: $status-warning-soft;
  2352. color: $status-warning-strong;
  2353. }
  2354. .dan-report-desc {
  2355. font-size: calc(28rpx * var(--font-scale, 1));
  2356. color: $app-text;
  2357. font-weight: 500;
  2358. margin-bottom: 12rpx;
  2359. display: block;
  2360. }
  2361. .dan-card-footer {
  2362. text-align: right;
  2363. }
  2364. .dan-view-link {
  2365. font-size: calc(26rpx * var(--font-scale, 1));
  2366. color: $dim-wisdom;
  2367. }
  2368. .section-header {
  2369. display: flex;
  2370. justify-content: space-between;
  2371. align-items: center;
  2372. margin-bottom: 20rpx;
  2373. }
  2374. .section-title {
  2375. font-size: calc(32rpx * var(--font-scale, 1));
  2376. font-weight: 700;
  2377. color: $app-text;
  2378. }
  2379. .section-more {
  2380. position: relative;
  2381. font-size: calc(26rpx * var(--font-scale, 1));
  2382. color: $dim-wisdom;
  2383. padding: 8rpx 16rpx;
  2384. }
  2385. /* 触摸目标扩展至 88rpx(微信最小可点区域):文字链 ~52rpx -> 88rpx,视觉零变化 */
  2386. .section-more::after {
  2387. content: '';
  2388. position: absolute;
  2389. left: -8rpx;
  2390. right: -16rpx;
  2391. top: -18rpx;
  2392. bottom: -18rpx;
  2393. }
  2394. /* 品牌定位语 */
  2395. .brand-strap {
  2396. margin: 16rpx $uni-space-lg 0;
  2397. padding: 20rpx 28rpx;
  2398. background: linear-gradient(135deg, $dim-mind-tint, rgba(255,107,157,0.12));
  2399. border-radius: 16rpx;
  2400. border-left: 8rpx solid $dim-mind;
  2401. }
  2402. .brand-strap-text {
  2403. font-size: calc(26rpx * var(--font-scale, 1));
  2404. color: $c-mind-ink;
  2405. font-weight: 500;
  2406. }
  2407. /* 每月引导语 */
  2408. .monthly-guidance {
  2409. margin: 16rpx $uni-space-lg 0;
  2410. padding: 20rpx 28rpx;
  2411. background: linear-gradient(135deg, $dim-mind-tint, rgba(255,107,157,0.08));
  2412. border-radius: 16rpx;
  2413. border-left: 8rpx solid $dim-mind;
  2414. display: flex;
  2415. align-items: center;
  2416. gap: 12rpx;
  2417. }
  2418. .guidance-icon { font-size: calc(32rpx * var(--font-scale, 1)); }
  2419. .guidance-text {
  2420. font-size: calc(26rpx * var(--font-scale, 1));
  2421. color: $c-mind-ink;
  2422. font-weight: 500;
  2423. }
  2424. /* 雷达图分组 */
  2425. .radar-group { margin-bottom: $uni-space-lg; }
  2426. .radar-group-label {
  2427. font-size: calc(28rpx * var(--font-scale, 1));
  2428. font-weight: bold;
  2429. color: $c-mind-ink;
  2430. margin-bottom: 16rpx;
  2431. padding-left: 10rpx;
  2432. }
  2433. /* 维度画像样式 */
  2434. .dimension-portrait-section {
  2435. margin: 24rpx $uni-space-lg;
  2436. background: $app-surface;
  2437. border-radius: 24rpx;
  2438. padding: 32rpx 24rpx;
  2439. box-shadow: 0 4rpx 20rpx rgba(255, 107, 157, 0.12);
  2440. border: 2rpx solid rgba(255, 107, 157, 0.1);
  2441. }
  2442. .portrait-tier {
  2443. font-size: calc(26rpx * var(--font-scale, 1));
  2444. color: $dim-mind;
  2445. font-weight: bold;
  2446. margin-left: 16rpx;
  2447. }
  2448. .portrait-summary {
  2449. margin-bottom: 24rpx;
  2450. }
  2451. .portrait-desc {
  2452. font-size: calc(26rpx * var(--font-scale, 1));
  2453. color: $app-text-secondary;
  2454. line-height: 1.6;
  2455. display: block;
  2456. }
  2457. .portrait-dimensions {
  2458. margin-bottom: 20rpx;
  2459. }
  2460. .portrait-dim-item {
  2461. margin-bottom: 18rpx;
  2462. }
  2463. .portrait-dim-header {
  2464. display: flex;
  2465. align-items: center;
  2466. margin-bottom: 6rpx;
  2467. }
  2468. .portrait-dim-icon {
  2469. width: 36rpx;
  2470. height: 36rpx;
  2471. border-radius: 16rpx;
  2472. display: flex;
  2473. align-items: center;
  2474. justify-content: center;
  2475. margin-right: 10rpx;
  2476. font-size: calc(20rpx * var(--font-scale, 1));
  2477. }
  2478. .portrait-dim-name {
  2479. font-size: calc(24rpx * var(--font-scale, 1));
  2480. color: $app-text;
  2481. flex: 1;
  2482. }
  2483. .portrait-dim-score {
  2484. font-size: calc(26rpx * var(--font-scale, 1));
  2485. font-weight: bold;
  2486. color: $dim-mind;
  2487. margin-right: 12rpx;
  2488. }
  2489. .portrait-dim-bar-track {
  2490. height: 10rpx;
  2491. background: $tint-cyan;
  2492. border-radius: 8rpx;
  2493. overflow: hidden;
  2494. margin-bottom: 4rpx;
  2495. flex: 1;
  2496. }
  2497. .portrait-dim-bar-fill {
  2498. height: 100%;
  2499. border-radius: 8rpx;
  2500. transition: width 0.3s ease;
  2501. }
  2502. .portrait-dim-desc {
  2503. font-size: calc(20rpx * var(--font-scale, 1));
  2504. color: $app-text-muted;
  2505. display: block;
  2506. }
  2507. .portrait-tip {
  2508. padding: 16rpx 20rpx;
  2509. background: linear-gradient(135deg, $dim-mind-tint, $tint-rose);
  2510. border-radius: 16rpx;
  2511. border-left: 8rpx solid $dim-mind;
  2512. margin-top: 16rpx;
  2513. }
  2514. .portrait-tip-text {
  2515. font-size: calc(22rpx * var(--font-scale, 1));
  2516. color: $brand-primary-deep;
  2517. line-height: 1.5;
  2518. }
  2519. </style>