index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <view class="container" :style="{ '--font-scale': fontScale }">
  3. <!-- 登录浮层(全局组件,页面内弹出底部登录) -->
  4. <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
  5. <!-- 顶部导航栏 -->
  6. <view class="nav-bar" :style="{ background: navGradient }">
  7. <view class="nav-back" @click="goBack">
  8. <text class="nav-back-icon">&#x2190;</text>
  9. </view>
  10. <view class="nav-right" @click="toggleView">
  11. <text class="nav-right-icon">{{ currentView === 'family' ? '🏠' : (currentMemberIcon) }}</text>
  12. <text class="nav-right-label">{{ currentView === 'family' ? '全家' : currentTabLabel }}</text>
  13. <text class="nav-right-arrow">&#x21C4;</text>
  14. </view>
  15. </view>
  16. <!-- 加载中 -->
  17. <view class="loading-wrap" v-if="loading">
  18. <text class="loading-text">加载中...</text>
  19. </view>
  20. <!-- 未登录 -->
  21. <template v-else-if="!isLoggedIn">
  22. <view class="empty-state">
  23. <text class="empty-icon">🌟</text>
  24. <text class="empty-title">登录后查看五维能量</text>
  25. <text class="empty-desc">了解您和家人的身·智·富·行·心能量状态</text>
  26. <button class="login-btn" @click="goLogin">去登录</button>
  27. </view>
  28. </template>
  29. <!-- 已登录 -->
  30. <template v-else-if="!loading && (familySandboxData || sandboxData)">
  31. <!-- ===== 能量总览卡 ===== -->
  32. <view class="overview-card">
  33. <view class="overview-header">
  34. <view class="overview-avatar" :style="{ background: avatarGradient }">
  35. <text class="avatar-text">{{ avatarChar }}</text>
  36. </view>
  37. <view class="overview-info">
  38. <text class="overview-name">{{ currentMemberName }}</text>
  39. <text class="overview-role">{{ currentRoleLabel }}</text>
  40. </view>
  41. <view class="overview-score">
  42. <text class="score-value">{{ overallScore || '--' }}</text>
  43. <text class="score-label">综合能量</text>
  44. </view>
  45. </view>
  46. <!-- 五维能量条 -->
  47. <view class="dims-row">
  48. <view class="dim-bar" v-for="dim in dimList" :key="dim.code" @click="goDimension(dim.code)">
  49. <view class="dim-icon-wrap" :style="{ background: dim.color }">
  50. <text class="dim-icon">{{ dim.icon }}</text>
  51. </view>
  52. <view class="dim-bar-track">
  53. <view class="dim-bar-fill" :style="{ width: getDimScore(dim.code) + '%', background: dim.color }"></view>
  54. </view>
  55. <text class="dim-bar-score">{{ getDimScore(dim.code) }}</text>
  56. <text class="dim-bar-label">{{ dim.label }}</text>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- ===== 五维雷达图 ===== -->
  61. <view class="section radar-section">
  62. <view class="section-header">
  63. <text class="section-title">五维雷达</text>
  64. <text class="section-hint" v-if="currentView === 'family'">全家平均</text>
  65. <text class="section-hint" v-else>{{ currentMemberName }}个人</text>
  66. </view>
  67. <RadarChart
  68. v-if="radarDims.length >= 3"
  69. :dimensions="radarDims"
  70. :scores="radarScores"
  71. :avg-scores="radarFamilyScores"
  72. :population-scores="[]"
  73. fillColor="rgba(102,126,234,0.2)"
  74. :stroke-color="radarStrokeColor"
  75. gridColor="rgba(102,126,234,0.15)"
  76. :label-color="radarLabelColor"
  77. :width="580"
  78. :height="580"
  79. @dimensionClick="goDimension" />
  80. <view class="empty-radar" v-else>
  81. <text>暂无足够数据生成雷达图</text>
  82. </view>
  83. </view>
  84. <!-- ===== 家庭成员对比 ===== -->
  85. <view class="section compare-section" v-if="currentView !== 'self' && familyMembers.length > 1">
  86. <view class="section-header">
  87. <text class="section-title">家庭成员能量对比</text>
  88. </view>
  89. <view class="compare-list">
  90. <view
  91. class="compare-item"
  92. v-for="m in familyMembers"
  93. :key="m.memberId"
  94. :class="{ active: selectedMemberId === m.memberId }"
  95. @click="selectMember(m)">
  96. <view class="compare-avatar" :style="{ background: memberColor(m) }">
  97. <text class="compare-avatar-text">{{ m.name ? m.name.charAt(0) : '?' }}</text>
  98. </view>
  99. <view class="compare-info">
  100. <text class="compare-name">{{ m.name || '成员' }}</text>
  101. <text class="compare-role">{{ m.familyRole || m.memberType || '' }}</text>
  102. </view>
  103. <view class="compare-score">
  104. <text class="compare-score-value" :style="{ color: memberColor(m) }">{{ m.overallScore || '--' }}</text>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- ===== 快速入口 ===== -->
  110. <view class="section quick-section">
  111. <view class="section-header">
  112. <text class="section-title">能量详情</text>
  113. </view>
  114. <view class="quick-grid">
  115. <view
  116. class="quick-item"
  117. v-for="dim in dimList"
  118. :key="dim.code"
  119. @click="goDimension(dim.code)">
  120. <view class="quick-icon-wrap" :style="{ background: dim.color + '22' }">
  121. <text class="quick-icon">{{ dim.icon }}</text>
  122. </view>
  123. <text class="quick-label">{{ dim.label }}</text>
  124. <text class="quick-score">{{ getDimScore(dim.code) }}</text>
  125. </view>
  126. </view>
  127. </view>
  128. <!-- 底部占位 -->
  129. <view class="bottom-spacer"></view>
  130. </template>
  131. </view>
  132. </template>
  133. <script>
  134. import { primary, success } from '@/utils/brand-colors.js'
  135. import RadarChart from '../../components/RadarChart.vue'
  136. import { normalizeMembers } from '../../utils/memberNormalize.js'
  137. import { getFamilyEnergySandbox, getFamilyMemberList } from '../../utils/api.js'
  138. import { BrandColors } from '../../utils/brand-colors.js'
  139. var DIM_CONFIG = [
  140. { code: 'body', label: '身', icon: '💪', color: BrandColors.success, gradient: `linear-gradient(135deg,${BrandColors.success},${BrandColors.successLight3})` },
  141. { code: 'mind', label: '心', icon: '❤️', color: BrandColors.primary, gradient: `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})` },
  142. { code: 'wisdom', label: '智', icon: '🧠', color: BrandColors.wealth, gradient: `linear-gradient(135deg,${BrandColors.wealth},${BrandColors.warning})` },
  143. { code: 'action', label: '行', icon: '⚡', color: BrandColors.primary, gradient: `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})` },
  144. { code: 'wealth', label: '富', icon: '💎', color: BrandColors.infoBlue, gradient: `linear-gradient(135deg,${BrandColors.infoBlue},${BrandColors.infoBlueLight})` }
  145. ]
  146. import fontScaleMixin from '@/mixins/font-scale.js'
  147. export default {
  148. mixins: [fontScaleMixin],
  149. components: { RadarChart },
  150. data() {
  151. return {
  152. loading: true,
  153. isLoggedIn: false,
  154. sandboxData: null,
  155. familySandboxData: null,
  156. familyMembers: [],
  157. selectedMemberId: null,
  158. currentView: 'self', // self | family
  159. radarStrokeColor: BrandColors.primary, // 雷达描边(品牌橙)
  160. radarLabelColor: BrandColors.textFaint, // 雷达标签(中灰)
  161. showMemberPicker: false
  162. }
  163. },
  164. computed: {
  165. dimList() { return DIM_CONFIG },
  166. currentMember() {
  167. if (this.currentView === 'family') return null
  168. if (this.familySandboxData && this.familySandboxData.members) {
  169. return this.familySandboxData.members.find(function(m) { return m.memberId === this.selectedMemberId }.bind(this)) || null
  170. }
  171. return this.familyMembers.find(function(m) { return m.memberId === this.selectedMemberId }) || null
  172. },
  173. currentMemberName() {
  174. if (this.currentView === 'family') return '全家'
  175. if (!this.currentMember) return '我'
  176. return this.currentMember.name || '成员'
  177. },
  178. currentRoleLabel() {
  179. if (this.currentView === 'family') return '家庭整体'
  180. if (!this.currentMember) return ''
  181. return this.currentMember.familyRole || this.currentMember.memberType || ''
  182. },
  183. overallScore() {
  184. if (this.currentView === 'family') {
  185. return this.familySandboxData && this.familySandboxData.overallScore
  186. }
  187. if (this.currentMember) {
  188. return this.currentMember.overallScore
  189. }
  190. if (this.sandboxData) {
  191. return this.sandboxData.overallScore
  192. }
  193. return null
  194. },
  195. avatarChar() {
  196. if (this.currentView === 'family') return '🏠'
  197. if (this.currentMember) return (this.currentMember.name || '?').charAt(0)
  198. return '👤'
  199. },
  200. avatarGradient() {
  201. if (this.currentView === 'family') return `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})`
  202. if (this.currentMember) return this.memberColor(this.currentMember)
  203. return `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})`
  204. },
  205. navTitle() { return this.currentMemberName + ' · 五维能量' },
  206. currentMemberIcon() {
  207. if (this.currentView === 'family') return '🏠'
  208. if (this.currentMember) return (this.currentMember.name || '?').charAt(0)
  209. return '👤'
  210. },
  211. currentTabLabel() {
  212. if (this.currentView === 'family') return '全家'
  213. if (!this.currentMember) return '我的'
  214. return this.currentMember.name || '我的'
  215. },
  216. navGradient() {
  217. if (this.currentView === 'family') return `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})`
  218. if (this.currentMember) {
  219. var dim = DIM_CONFIG[0]
  220. return dim.gradient
  221. }
  222. return `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})`
  223. },
  224. pageTitle() { return this.navTitle },
  225. radarDims() {
  226. return DIM_CONFIG.map(d => d.label)
  227. },
  228. radarScores() {
  229. if (this.currentView === 'family') {
  230. var d = this.familySandboxData
  231. return DIM_CONFIG.map(function(dim) { return d ? (d[dim.code + 'Score'] || 0) : 0 })
  232. }
  233. if (this.currentMember) {
  234. return DIM_CONFIG.map(function(dim) { return this.currentMember[dim.code + 'Score'] || 0 }.bind(this))
  235. }
  236. if (this.sandboxData) {
  237. return DIM_CONFIG.map(function(dim) { return this.sandboxData[dim.code + 'Score'] || 0 }.bind(this))
  238. }
  239. return [0, 0, 0, 0, 0]
  240. },
  241. /** 五维雷达图:家庭平均分 */
  242. radarFamilyScores() {
  243. if (this.currentView !== 'self') return []
  244. if (!this.familySandboxData) return []
  245. return DIM_CONFIG.map(function(dim) { return this.familySandboxData[dim.code + 'Score'] || 0 }.bind(this))
  246. }
  247. },
  248. onLoad() {
  249. this.checkLogin()
  250. this.loadData()
  251. this._onLoadFired = true
  252. },
  253. onShow() {
  254. if (this._onLoadFired) {
  255. this._onLoadFired = false
  256. } else {
  257. if (this.isLoggedIn) this.loadData()
  258. }
  259. },
  260. methods: {
  261. checkLogin() {
  262. this.isLoggedIn = !!uni.getStorageSync('token')
  263. },
  264. goLogin() {
  265. this.openLoginSheet()
  266. },
  267. // 登录浮层成功回调:刷新登录态与能量数据
  268. onLoginSuccess() {
  269. this.checkLogin()
  270. if (this.isLoggedIn) this.loadData()
  271. },
  272. goBack() {
  273. uni.navigateBack({ fail: function() { uni.switchTab({ url: '/pages/index-home/index' }) } })
  274. },
  275. memberColor(member) {
  276. if (!member) return `linear-gradient(135deg,${BrandColors.primary},${BrandColors.primaryLight})`
  277. var types = { parent: BrandColors.wealth, child: BrandColors.success, teacher: BrandColors.infoBlue }
  278. var t = member.memberType || 'parent'
  279. var colors = {
  280. parent: `linear-gradient(135deg,${BrandColors.wealth},${BrandColors.warning})`,
  281. child: `linear-gradient(135deg,${BrandColors.success},${BrandColors.successLight3})`,
  282. teacher:`linear-gradient(135deg,${BrandColors.infoBlue},${BrandColors.infoBlueLight})`
  283. }
  284. return colors[t] || colors.parent
  285. },
  286. getDimScore(code) {
  287. if (this.currentView === 'family') {
  288. return this.familySandboxData ? (this.familySandboxData[code + 'Score'] || 0) : 0
  289. }
  290. if (this.currentMember) {
  291. return this.currentMember[code + 'Score'] || 0
  292. }
  293. return 0
  294. },
  295. async loadData() {
  296. this.loading = true
  297. try {
  298. // 个人沙盘(当前登录用户五维)
  299. var res = await getFamilyEnergySandbox()
  300. if (res && res.code === 200 && res.data) {
  301. this.sandboxData = res.data
  302. // 兼容新格式:解包 personalData
  303. if (res.data.personalData) {
  304. this.sandboxData = res.data.personalData
  305. } else if (res.data.familyData) {
  306. this.sandboxData = res.data.familyData
  307. }
  308. }
  309. // 家庭沙盘(全家聚合 + 各成员个人数据,作为成员分数来源)
  310. var famRes = await getEnergySandbox('family')
  311. if (famRes && famRes.code === 200 && famRes.data && famRes.data.familyData) {
  312. this.familySandboxData = famRes.data.familyData
  313. }
  314. // 加载家庭成员(visibleOnly 列表,用于 isSelf/name 等展示属性)
  315. var memRes = await getFamilyMemberList({ visibleOnly: true })
  316. if (memRes && memRes.code === 200 && memRes.data) {
  317. // 前端防御层:按 user_id 折叠同用户多行,isSelf 唯一;统一身份键 memberId
  318. this.familyMembers = normalizeMembers(memRes.data, { userId: uni.getStorageSync('userId') })
  319. }
  320. // 确定默认选中成员:优先全局切换的成员
  321. var switchedId = uni.getStorageSync('currentMemberId') || uni.getStorageSync('currentChildId')
  322. var pool = (this.familySandboxData && this.familySandboxData.members) || this.familyMembers
  323. if (switchedId && pool.length > 0) {
  324. var matched = pool.find(function(m) { return m.memberId === switchedId })
  325. if (matched) {
  326. this.selectedMemberId = switchedId
  327. } else if (pool.length > 0) {
  328. this.selectedMemberId = pool[0].memberId
  329. }
  330. } else if (pool.length > 0 && !this.selectedMemberId) {
  331. this.selectedMemberId = pool[0].memberId
  332. }
  333. } catch (e) {
  334. console.error('加载能量数据失败', e)
  335. } finally {
  336. this.loading = false
  337. }
  338. },
  339. switchView(view) {
  340. this.currentView = view
  341. if (view === 'family') {
  342. this.selectedMemberId = null
  343. } else if (!this.selectedMemberId) {
  344. // 「我的」Tab:若尚未选中成员,绑定全局切换成员或第一个
  345. var switchedId = uni.getStorageSync('currentMemberId') || uni.getStorageSync('currentChildId')
  346. if (switchedId && this.familyMembers.length > 0) {
  347. var matched = this.familyMembers.find(function(m) { return m.memberId === switchedId })
  348. if (matched) {
  349. this.selectedMemberId = switchedId
  350. }
  351. }
  352. if (!this.selectedMemberId && this.familyMembers.length > 0) {
  353. this.selectedMemberId = this.familyMembers[0].memberId
  354. }
  355. }
  356. this.showMemberPicker = false
  357. },
  358. toggleView() {
  359. if (this.currentView === 'family') {
  360. this.switchView('self')
  361. return
  362. }
  363. // 进入全家态前检查成员数(以 /api/family/member/list 为准,sandbox 接口 members 不全)
  364. var members = this.familyMembers
  365. if (!members || members.length < 2) {
  366. uni.showModal({
  367. title: '需要更多家庭成员',
  368. content: '至少需要 2 位家庭成员才能查看全家能量,快去添加吧!',
  369. confirmText: '去添加',
  370. cancelText: '取消',
  371. success: (res) => {
  372. if (res.confirm) {
  373. uni.navigateTo({ url: '/pages/profile-extra/family-members' })
  374. }
  375. }
  376. })
  377. return
  378. }
  379. this.switchView('family')
  380. },
  381. selectMember(member) {
  382. this.selectedMemberId = member.memberId
  383. this.currentView = 'self'
  384. this.showMemberPicker = false
  385. },
  386. goDimension(code) {
  387. var url = ''
  388. switch (code) {
  389. case 'body':
  390. url = '/pages/body-detail/index'
  391. break
  392. case 'mind':
  393. url = '/pages/mind-detail/index'
  394. break
  395. case 'wisdom':
  396. url = '/pages/wisdom-detail/index'
  397. break
  398. case 'action':
  399. url = '/pages/action-detail/index'
  400. break
  401. case 'wealth':
  402. url = '/pages/wealth/index'
  403. break
  404. default:
  405. return
  406. }
  407. if (this.currentView !== 'family' && this.selectedMemberId) {
  408. url += '?memberId=' + this.selectedMemberId
  409. }
  410. uni.navigateTo({ url: url })
  411. }
  412. }
  413. }
  414. </script>
  415. <style scoped lang="scss">
  416. // ===== 能量页专属色阶(导航/卡面深海军蓝,单页专用;约定见 uni.scss §14)=====
  417. $c-energy-deep-1: #0F1B2D; // 导航渐变起(深夜蓝)
  418. $c-energy-deep-2: #1A2744; // 导航渐变终 / 卡片底(藏蓝)
  419. .container {
  420. min-height: 100vh;
  421. background: linear-gradient(180deg, $c-energy-deep-1 0%, $c-energy-deep-2 100%);
  422. padding-bottom: 40rpx;
  423. }
  424. .nav-bar {
  425. display: flex;
  426. align-items: center;
  427. justify-content: space-between;
  428. height: 88rpx;
  429. padding-top: env(safe-area-inset-top);
  430. position: relative;
  431. padding-left: $uni-space-page;
  432. padding-right: $uni-space-page;
  433. }
  434. .nav-back {
  435. width: 60rpx;
  436. height: 60rpx;
  437. display: flex;
  438. align-items: center;
  439. justify-content: center;
  440. }
  441. .nav-back-icon {
  442. font-size: calc(36rpx * var(--font-scale, 1));
  443. color: $app-surface;
  444. font-weight: bold;
  445. }
  446. .nav-right {
  447. display: flex;
  448. align-items: center;
  449. gap: 6rpx;
  450. background: rgba(255,255,255,0.15);
  451. padding: 10rpx 20rpx;
  452. border-radius: 24rpx;
  453. }
  454. .nav-right:active {
  455. background: rgba(255,255,255,0.25);
  456. }
  457. .nav-right-icon {
  458. font-size: calc(28rpx * var(--font-scale, 1));
  459. line-height: 1;
  460. }
  461. .nav-right-label {
  462. font-size: calc(24rpx * var(--font-scale, 1));
  463. color: $app-surface;
  464. font-weight: 500;
  465. }
  466. .nav-right-arrow {
  467. font-size: calc(20rpx * var(--font-scale, 1));
  468. color: rgba(255,255,255,0.5);
  469. }
  470. .nav-current-member {
  471. font-size: calc(24rpx * var(--font-scale, 1));
  472. color: $app-surface;
  473. }
  474. .nav-arrow {
  475. font-size: calc(20rpx * var(--font-scale, 1));
  476. color: rgba(255,255,255,0.6);
  477. }
  478. .loading-wrap {
  479. display: flex;
  480. align-items: center;
  481. justify-content: center;
  482. padding: 200rpx;
  483. }
  484. .loading-text {
  485. font-size: calc(28rpx * var(--font-scale, 1));
  486. color: rgba(255,255,255,0.5);
  487. }
  488. .empty-state {
  489. display: flex;
  490. flex-direction: column;
  491. align-items: center;
  492. padding: 200rpx 40rpx;
  493. }
  494. .empty-icon { font-size: calc($uni-font-size-6xl * var(--font-scale, 1)); margin-bottom: 20rpx; }
  495. .empty-title { font-size: calc(32rpx * var(--font-scale, 1)); color: $app-surface; font-weight: 600; margin-bottom: 12rpx; }
  496. .empty-desc { font-size: calc(24rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.5); text-align: center; margin-bottom: 40rpx; }
  497. .login-btn {
  498. width: 280rpx;
  499. height: 80rpx;
  500. line-height: 80rpx;
  501. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  502. color: $app-surface;
  503. border-radius: 24rpx;
  504. font-size: calc(28rpx * var(--font-scale, 1));
  505. border: none;
  506. }
  507. /* ===== 总览卡 ===== */
  508. .overview-card {
  509. margin: 20rpx $uni-space-lg;
  510. padding: $uni-space-page;
  511. background: rgba(255,255,255,0.06);
  512. border-radius: 24rpx;
  513. border: 1rpx solid rgba(255,255,255,0.1);
  514. }
  515. .overview-header {
  516. display: flex;
  517. align-items: center;
  518. margin-bottom: $uni-space-lg;
  519. }
  520. .overview-avatar {
  521. width: 80rpx;
  522. height: 80rpx;
  523. border-radius: 24rpx;
  524. display: flex;
  525. align-items: center;
  526. justify-content: center;
  527. margin-right: 20rpx;
  528. flex-shrink: 0;
  529. }
  530. .avatar-text { font-size: calc(36rpx * var(--font-scale, 1)); }
  531. .overview-info { flex: 1; }
  532. .overview-name { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: 600; color: $app-surface; display: block; }
  533. .overview-role { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.5); margin-top: 4rpx; display: block; }
  534. .overview-score { text-align: right; }
  535. .score-value { font-size: calc(48rpx * var(--font-scale, 1)); font-weight: 700; color: $brand-primary; display: block; line-height: 1; }
  536. .score-label { font-size: calc(20rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.4); }
  537. /* ===== 五维能量条 ===== */
  538. .dims-row {
  539. display: flex;
  540. flex-direction: column;
  541. gap: 16rpx;
  542. }
  543. .dim-bar {
  544. display: flex;
  545. align-items: center;
  546. gap: 16rpx;
  547. }
  548. .dim-icon-wrap {
  549. width: 52rpx;
  550. height: 52rpx;
  551. border-radius: 16rpx;
  552. display: flex;
  553. align-items: center;
  554. justify-content: center;
  555. flex-shrink: 0;
  556. }
  557. .dim-icon { font-size: calc(26rpx * var(--font-scale, 1)); }
  558. .dim-bar-track {
  559. flex: 1;
  560. height: 20rpx;
  561. background: rgba(255,255,255,0.08);
  562. border-radius: 8rpx;
  563. overflow: hidden;
  564. }
  565. .dim-bar-fill {
  566. height: 100%;
  567. border-radius: 8rpx;
  568. transition: width 0.5s ease;
  569. }
  570. .dim-bar-score {
  571. width: 50rpx;
  572. text-align: right;
  573. font-size: calc(26rpx * var(--font-scale, 1));
  574. font-weight: 600;
  575. color: $app-surface;
  576. flex-shrink: 0;
  577. }
  578. .dim-bar-label {
  579. width: 40rpx;
  580. font-size: calc(22rpx * var(--font-scale, 1));
  581. color: rgba(255,255,255,0.5);
  582. text-align: center;
  583. flex-shrink: 0;
  584. }
  585. /* ===== 雷达图 ===== */
  586. .section {
  587. margin: 20rpx $uni-space-lg;
  588. }
  589. .section-header {
  590. display: flex;
  591. justify-content: space-between;
  592. align-items: center;
  593. margin-bottom: 16rpx;
  594. }
  595. .section-title {
  596. font-size: calc(28rpx * var(--font-scale, 1));
  597. font-weight: 600;
  598. color: $app-surface;
  599. }
  600. .section-hint {
  601. font-size: calc(22rpx * var(--font-scale, 1));
  602. color: rgba(255,255,255,0.4);
  603. }
  604. .radar-section { }
  605. .empty-radar {
  606. text-align: center;
  607. padding: 80rpx;
  608. color: rgba(255,255,255,0.3);
  609. font-size: calc(26rpx * var(--font-scale, 1));
  610. }
  611. /* ===== 成员对比 ===== */
  612. .compare-section { }
  613. .compare-list {
  614. background: rgba(255,255,255,0.06);
  615. border-radius: 24rpx;
  616. overflow: hidden;
  617. border: 1rpx solid rgba(255,255,255,0.08);
  618. }
  619. .compare-item {
  620. display: flex;
  621. align-items: center;
  622. padding: 24rpx $uni-space-page;
  623. border-bottom: 1rpx solid rgba(255,255,255,0.06);
  624. background: rgba(255,255,255,0.02);
  625. }
  626. .compare-item:last-child { border-bottom: none; }
  627. .compare-item.active { background: rgba(102,126,234,0.15); }
  628. .compare-avatar {
  629. width: 64rpx;
  630. height: 64rpx;
  631. border-radius: 24rpx;
  632. display: flex;
  633. align-items: center;
  634. justify-content: center;
  635. margin-right: 20rpx;
  636. flex-shrink: 0;
  637. }
  638. .compare-avatar-text { font-size: calc(28rpx * var(--font-scale, 1)); color: $app-surface; font-weight: 600; }
  639. .compare-info { flex: 1; }
  640. .compare-name { font-size: calc(28rpx * var(--font-scale, 1)); color: $app-surface; font-weight: 500; display: block; }
  641. .compare-role { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.4); margin-top: 4rpx; display: block; }
  642. .compare-score { text-align: right; }
  643. .compare-score-value { font-size: calc(36rpx * var(--font-scale, 1)); font-weight: 700; }
  644. /* ===== 快速入口 ===== */
  645. .quick-section { }
  646. .quick-grid {
  647. display: flex;
  648. flex-wrap: wrap;
  649. gap: 16rpx;
  650. background: rgba(255,255,255,0.06);
  651. border-radius: 24rpx;
  652. padding: 20rpx;
  653. border: 1rpx solid rgba(255,255,255,0.08);
  654. }
  655. .quick-item {
  656. width: calc(20% - 14rpx);
  657. display: flex;
  658. flex-direction: column;
  659. align-items: center;
  660. padding: 20rpx 0;
  661. background: rgba(255,255,255,0.04);
  662. border-radius: 16rpx;
  663. }
  664. .quick-icon-wrap {
  665. width: 72rpx;
  666. height: 72rpx;
  667. border-radius: 24rpx;
  668. display: flex;
  669. align-items: center;
  670. justify-content: center;
  671. margin-bottom: 12rpx;
  672. }
  673. .quick-icon { font-size: calc(36rpx * var(--font-scale, 1)); }
  674. .quick-label { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.7); margin-bottom: 6rpx; }
  675. .quick-score { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 600; color: $app-surface; }
  676. /* ===== 成员选择弹窗 ===== */
  677. .modal-mask {
  678. position: fixed;
  679. top: 0; left: 0; right: 0; bottom: 0;
  680. background: rgba(0,0,0,0.6);
  681. z-index: 1000;
  682. display: flex;
  683. align-items: flex-end;
  684. }
  685. .member-picker {
  686. width: 100%;
  687. background: $c-energy-deep-2;
  688. border-radius: 24rpx 24rpx 0 0;
  689. padding: 20rpx $uni-space-page 60rpx;
  690. max-height: 70vh;
  691. overflow-y: auto;
  692. }
  693. .picker-header {
  694. display: flex;
  695. justify-content: space-between;
  696. align-items: center;
  697. margin-bottom: 24rpx;
  698. }
  699. .picker-title { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 600; color: $app-surface; }
  700. .picker-close { font-size: calc(40rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.4); line-height: 1; }
  701. .picker-item {
  702. display: flex;
  703. align-items: center;
  704. padding: 24rpx 0;
  705. border-bottom: 1rpx solid rgba(255,255,255,0.06);
  706. }
  707. .picker-item:last-child { border-bottom: none; }
  708. .picker-item.active { background: rgba(102,126,234,0.1); margin: 0 -$uni-space-lg; padding-left: $uni-space-page; padding-right: $uni-space-page; border-radius: 16rpx; }
  709. .picker-icon { font-size: calc(36rpx * var(--font-scale, 1)); margin-right: 20rpx; }
  710. .picker-avatar {
  711. width: 64rpx;
  712. height: 64rpx;
  713. border-radius: 24rpx;
  714. display: flex;
  715. align-items: center;
  716. justify-content: center;
  717. margin-right: 20rpx;
  718. flex-shrink: 0;
  719. }
  720. .picker-avatar-text { font-size: calc(28rpx * var(--font-scale, 1)); color: $app-surface; font-weight: 600; }
  721. .picker-label { font-size: calc(28rpx * var(--font-scale, 1)); color: $app-surface; font-weight: 500; flex: 1; }
  722. .picker-desc { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba(255,255,255,0.4); margin-top: 4rpx; display: block; }
  723. .bottom-spacer { height: 40rpx; }
  724. </style>