index.vue 80 KB

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