index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. <template>
  2. <view class="container">
  3. <!-- Tabbar 切换过渡页 -->
  4. <tab-transition v-if="showTabTransition" dimCode="action" waitingFor="action" />
  5. <!-- 品牌头部 -->
  6. <PageBanner theme="action"
  7. tagline="知行合一 · 快乐成长"
  8. quote="千里之行,始于足下" />
  9. <!-- 游客登录引导卡 -->
  10. <template v-if="!isLoggedIn">
  11. <LoginGuideCard
  12. title="登录后查看任务和活动记录"
  13. :items="[
  14. '查看今日任务,完成打卡获取行动能量',
  15. '报名参加热门活动,记录成长足迹',
  16. '查看专属商品和活动价格'
  17. ]" />
  18. </template>
  19. <!-- 登录后:五维能量条 -->
  20. <FamilyEnergyBar
  21. v-if="isLoggedIn"
  22. dimensionCode="action"
  23. :sandboxData="sandboxData"
  24. :dualDimension="dualDimension" />
  25. <!-- 能量沙盘(登录后可见) — Canvas 五行星图 -->
  26. <WuxingSandbox
  27. v-if="isLoggedIn && sandboxData"
  28. mode="live"
  29. :scores="{
  30. body: sandboxData.bodyScore || 0,
  31. mind: sandboxData.mindScore || 0,
  32. wisdom: sandboxData.wisdomScore || 0,
  33. action: sandboxData.actionScore || 0,
  34. wealth: sandboxData.wealthScore || 0
  35. }"
  36. :overallScore="sandboxData.overallScore || 0"
  37. :members="sandboxData.members || []"
  38. showDimensionBar
  39. starHeight="480rpx" />
  40. <!-- 关系图谱(登录后可见) — 家庭关系网络 -->
  41. <FamilyRelationGraph
  42. v-if="isLoggedIn && familyMembersVisible.length > 0"
  43. dimensionCode="action"
  44. :selfId="activeChildId"
  45. :members="familyMembersVisible"
  46. :energyMap="energyMapForGraph"
  47. :intimacyMap="intimacyMapForGraph"
  48. @memberTap="goMemberDetail" />
  49. <!-- ===== 维度任务/活动/商品 ===== -->
  50. <DimensionTasks
  51. v-if="isLoggedIn"
  52. dimensionCode="action"
  53. :tasks="dimensionTasks"
  54. @taskClick="onTaskClick"
  55. @moreTasks="goTasks" />
  56. <DimensionActivities
  57. dimensionCode="action"
  58. :activities="dimensionActivities"
  59. :isLoggedIn="isLoggedIn"
  60. @activityClick="goActivityDetail"
  61. @moreActivities="goMoreActivities" />
  62. <DimensionProducts
  63. dimensionCode="action"
  64. :products="dimensionProducts"
  65. :isLoggedIn="isLoggedIn"
  66. @productClick="goProductDetail"
  67. @moreProducts="goMoreProducts" />
  68. <!-- 推荐阅读 -->
  69. <DimensionArticles
  70. dimensionCode="action"
  71. :articles="actionArticles"
  72. :isLoggedIn="isLoggedIn"
  73. @articleClick="goArticleDetail"
  74. @moreArticles="goMoreArticles" />
  75. <!-- ===== 重要关系维护 ===== -->
  76. <OctopusGraph
  77. :contactList="contactList"
  78. :healthAlerts="healthAlerts"
  79. :isLoggedIn="isLoggedIn" />
  80. <!-- 功能入口(4个:活动、商品、课程) -->
  81. <view class="func-section" v-if="sectionVisible('func_entries')">
  82. <view class="func-grid">
  83. <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
  84. <view class="func-icon-wrap">
  85. <text class="func-icon">{{ item.icon }}</text>
  86. </view>
  87. <text class="func-label">{{ item.label }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 导入联系人弹窗 -->
  92. <ContactImport
  93. :visible="showImportModal"
  94. @close="onCloseImport"
  95. @success="onImportSuccess" />
  96. <!-- 底部占位 -->
  97. <view class="bottom-spacer"></view>
  98. </view>
  99. </template>
  100. <script>
  101. import TabTransition from '../../components/tab-transition.vue'
  102. import PageBanner from '../../components/PageBanner.vue'
  103. import LoginGuideCard from '../../components/LoginGuideCard.vue'
  104. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  105. import DimensionTasks from '../../components/DimensionTasks.vue'
  106. import DimensionActivities from '../../components/DimensionActivities.vue'
  107. import DimensionProducts from '../../components/DimensionProducts.vue'
  108. import DimensionArticles from '../../components/DimensionArticles.vue'
  109. import ContactCard from '../../components/ContactCard.vue'
  110. import ContactImport from '../../components/ContactImport.vue'
  111. import OctopusGraph from '../../components/OctopusGraph.vue'
  112. import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
  113. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  114. import { getVisibleSections, getEnergyOverview, getFamilyEnergySandbox, getTodayTasksByCategory, getActivityList, getProductsByDomain, getChildren, getContactList, getVisibleFamilyMembers, getFeaturedArticles, getHealthAlerts, getMilestones } from '../../utils/api.js'
  115. export default {
  116. components: { TabTransition, PageBanner, LoginGuideCard, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, DimensionArticles, ContactCard, ContactImport, FamilyRelationGraph, OctopusGraph, WuxingSandbox },
  117. data() {
  118. return {
  119. showTabTransition: true,
  120. isLoggedIn: false,
  121. role: null,
  122. currentChildId: null,
  123. activeChildId: null,
  124. currentChildName: '',
  125. userName: '',
  126. children: [],
  127. familyMembersVisible: [],
  128. sandboxData: null,
  129. dualDimension: null,
  130. visibleSections: [],
  131. dimensionTasks: [],
  132. dimensionActivities: [],
  133. dimensionProducts: [],
  134. articles: [],
  135. contactList: [],
  136. showImportModal: false,
  137. healthAlerts: [],
  138. funcList: [
  139. { icon: '\u{1F3CB}', label: '任务', needLogin: true, page: '/pages/tasks/tasks' },
  140. { icon: '\u{1F3C0}', label: '活动', needLogin: false, page: '/pages/discover/index?type=activity' },
  141. { icon: '\u{1F6CD}', label: '商城', needLogin: false, page: '/pages/discover/index?type=product' },
  142. { icon: '\u{1F3EB}', label: '课程', needLogin: false, page: '/pages/discover/index?type=course' }
  143. ]
  144. }
  145. },
  146. computed: {
  147. energyMapForGraph: function() {
  148. var map = {}
  149. if (this.sandboxData && this.sandboxData.members) {
  150. for (var i = 0; i < this.sandboxData.members.length; i++) {
  151. var m = this.sandboxData.members[i]
  152. map[m.memberId || m.id] = {
  153. bodyScore: m.bodyScore || 0,
  154. mindScore: m.mindScore || 0,
  155. actionScore: m.actionScore || 0
  156. }
  157. }
  158. }
  159. return map
  160. },
  161. intimacyMapForGraph: function() {
  162. return {}
  163. },
  164. actionArticles: function() {
  165. if (!this.articles || this.articles.length === 0) return []
  166. var result = []
  167. for (var i = 0; i < this.articles.length; i++) {
  168. var a = this.articles[i]
  169. if (a.relatedDimensions && a.relatedDimensions.indexOf('action') !== -1) {
  170. result.push(a)
  171. }
  172. }
  173. if (result.length === 0) return this.articles.slice(0, 5)
  174. return result.slice(0, 5)
  175. }
  176. },
  177. onShow() {
  178. this.showTabTransition = true
  179. var token = uni.getStorageSync('token')
  180. this.isLoggedIn = !!token
  181. if (this.isLoggedIn) {
  182. this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  183. this.currentChildId = uni.getStorageSync('currentChildId') || null
  184. this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '家长'
  185. }
  186. this.loadSectionConfig()
  187. if (this.isLoggedIn) {
  188. var self = this
  189. this.loadChildren().finally(function() {
  190. uni.setStorageSync('actionReadyTime', Date.now())
  191. })
  192. this.loadFamilyMembersVisible()
  193. this.loadRelationshipHealth()
  194. }
  195. // 游客也能浏览活动和商品
  196. this.loadDimensionActivities()
  197. this.loadDimensionProducts()
  198. // 游客也能浏览文章
  199. this.loadFeaturedArticles()
  200. this._watchPageReady()
  201. },
  202. methods: {
  203. loadSectionConfig: function() {
  204. var self = this
  205. var baseSections = ['func_entries']
  206. if (!uni.getStorageSync('token')) {
  207. self.visibleSections = baseSections
  208. return
  209. }
  210. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
  211. getVisibleSections({ pageKey: 'action', role: role }).then(function(res) {
  212. if (res.code === 200 && res.data) {
  213. var keys = res.data.map(function(s) { return s.sectionKey })
  214. var merged = baseSections.slice()
  215. keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
  216. self.visibleSections = merged
  217. }
  218. }).catch(function() {
  219. self.visibleSections = ['func_entries']
  220. })
  221. },
  222. loadChildren: function() {
  223. var self = this
  224. getChildren().then(function(res) {
  225. if (res.code === 200 && res.data) {
  226. self.children = res.data
  227. var savedChildId = uni.getStorageSync('currentChildId')
  228. var found = false
  229. for (var i = 0; i < self.children.length; i++) {
  230. if (self.children[i].childId === savedChildId) {
  231. self.currentChildId = savedChildId
  232. self.activeChildId = savedChildId
  233. self.currentChildName = self.children[i].name || self.children[i].nickname || '孩子'
  234. found = true
  235. break
  236. }
  237. }
  238. // FIX: 不再自动选择第一个孩子
  239. if (found) {
  240. self.loadDimensionData()
  241. }
  242. self.loadContacts()
  243. }
  244. }).catch(function(e) {
  245. console.log('获取孩子列表失败', e)
  246. })
  247. },
  248. loadDimensionData: function() {
  249. this.loadEnergyData()
  250. this.loadSandboxData()
  251. this.loadDimensionTasks()
  252. this.loadDimensionActivities()
  253. this.loadDimensionProducts()
  254. },
  255. loadEnergyData: function() {
  256. var self = this
  257. if (!this.currentChildId) return
  258. getEnergyOverview(this.currentChildId).then(function(res) {
  259. if (res && res.data) {
  260. var dims = res.data.dimensions
  261. if (dims && dims.length > 0) {
  262. for (var i = 0; i < dims.length; i++) {
  263. if (dims[i].code === 'action') {
  264. self.dualDimension = dims[i]
  265. break
  266. }
  267. }
  268. }
  269. }
  270. }).catch(function(e) {
  271. console.log('获取能量概览失败', e)
  272. })
  273. },
  274. loadSandboxData: function() {
  275. var self = this
  276. getFamilyEnergySandbox().then(function(res) {
  277. if (res && res.data) {
  278. self.sandboxData = res.data
  279. }
  280. }).catch(function() {})
  281. },
  282. loadDimensionTasks: function() {
  283. var self = this
  284. if (!this.currentChildId) return
  285. getTodayTasksByCategory(this.currentChildId, 'action').then(function(res) {
  286. if (res && res.data) {
  287. self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
  288. }
  289. }).catch(function() { self.dimensionTasks = [] })
  290. },
  291. loadDimensionActivities: function() {
  292. var self = this
  293. getActivityList({ dimensionCode: 'action', page: 1, size: 3 }).then(function(res) {
  294. if (res && res.data) {
  295. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  296. self.dimensionActivities = list.slice(0, 3)
  297. }
  298. }).catch(function() { self.dimensionActivities = [] })
  299. },
  300. loadDimensionProducts: function() {
  301. var self = this
  302. getProductsByDomain('action', 1, 4).then(function(res) {
  303. if (res && res.data) {
  304. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  305. self.dimensionProducts = list.slice(0, 4)
  306. }
  307. }).catch(function() { self.dimensionProducts = [] })
  308. },
  309. loadContacts: function() {
  310. var self = this
  311. getContactList({}).then(function(res) {
  312. if (res.code === 200 && res.data) {
  313. self.contactList = Array.isArray(res.data) ? res.data : []
  314. }
  315. }).catch(function(e) {
  316. console.log('获取联系人失败', e)
  317. })
  318. },
  319. onContactClick: function(item) {
  320. uni.navigateTo({ url: '/pages/action-detail/contact-detail?id=' + item.id })
  321. },
  322. onShowImport: function() {
  323. this.showImportModal = true
  324. },
  325. onCloseImport: function() {
  326. this.showImportModal = false
  327. },
  328. onImportSuccess: function() {
  329. this.showImportModal = false
  330. this.loadContacts()
  331. },
  332. onChildChanged: function(child) {
  333. this.currentChildId = child.childId
  334. this.currentChildName = child.name || child.nickname || '孩子'
  335. // FIX: 同步提交到 Vuex store
  336. this.$store.commit('switchToChild', child.childId)
  337. this.loadDimensionData()
  338. },
  339. loadFamilyMembersVisible: function() {
  340. var self = this
  341. getVisibleFamilyMembers().then(function(res) {
  342. self.familyMembersVisible = res.data || []
  343. }).catch(function(e) {
  344. console.log('获取可见家庭成员失败', e)
  345. self.familyMembersVisible = []
  346. })
  347. },
  348. scrollToSection: function(section) {
  349. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  350. },
  351. sectionVisible: function(key) {
  352. return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
  353. },
  354. onTaskClick: function(task) {
  355. uni.navigateTo({ url: '/pages/tasks/tasks' })
  356. },
  357. goActivityDetail: function(act) {
  358. if (!act || !act.id) return
  359. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  360. },
  361. goMoreActivities: function() {
  362. uni.navigateTo({ url: '/pages/activity/index' })
  363. },
  364. goProductDetail: function(prod) {
  365. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  366. },
  367. goMoreProducts: function() {
  368. uni.navigateTo({ url: '/pages/shop/index' })
  369. },
  370. onFuncClick: function(item) {
  371. if (item.needLogin && !this.isLoggedIn) {
  372. uni.showModal({
  373. title: '提示',
  374. content: '请先登录后使用此功能',
  375. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  376. })
  377. return
  378. }
  379. if (item.page) {
  380. var nativeTabs = ['/pages/tasks/tasks', '/pages/index/index', '/pages/body/index', '/pages/mind/index', '/pages/action/index', '/pages/profile/profile']
  381. if (nativeTabs.indexOf(item.page) !== -1) {
  382. uni.switchTab({ url: item.page })
  383. } else {
  384. uni.navigateTo({ url: item.page })
  385. }
  386. }
  387. },
  388. goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
  389. goMemberDetail: function(member) {
  390. if (!member || !member.memberId) return
  391. uni.navigateTo({
  392. url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&memberType=' + (member.memberType || 'child') + '&entrySource=relation-graph&dimensionCode=action'
  393. })
  394. },
  395. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  396. parseRelatedDimensions: function(val) {
  397. if (!val) return []
  398. if (Array.isArray(val)) return val
  399. if (typeof val === 'string') {
  400. try {
  401. var parsed = JSON.parse(val)
  402. return Array.isArray(parsed) ? parsed : []
  403. } catch (e) {
  404. // 逗号分隔格式 fallback: "action,mind"
  405. return val.split(',').map(function(s) { return s.trim() }).filter(function(s) { return s })
  406. }
  407. }
  408. return []
  409. },
  410. loadFeaturedArticles: function() {
  411. var self = this
  412. getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
  413. if (res.code === 200 && res.data) {
  414. var gradientColors = [
  415. 'linear-gradient(135deg, #10B981, #34D399)',
  416. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  417. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  418. 'linear-gradient(135deg, #F97316, #FB923C)',
  419. 'linear-gradient(135deg, #6366F1, #818CF8)'
  420. ]
  421. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  422. self.articles = list.map(function(item, index) {
  423. return {
  424. id: item.id,
  425. category: item.categoryName || '行动社交',
  426. categoryColor: gradientColors[index % gradientColors.length],
  427. title: item.title || '',
  428. summary: item.summary || '',
  429. dimensionWeights: item.dimensionWeights || null,
  430. views: item.viewCount ? String(item.viewCount) : '0',
  431. likes: '0',
  432. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  433. relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions)
  434. }
  435. })
  436. }
  437. }).catch(function() {})
  438. },
  439. goArticleDetail: function(article) {
  440. var id = article.id || article
  441. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  442. },
  443. goMoreArticles: function() {
  444. uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
  445. },
  446. loadRelationshipHealth: function() {
  447. var self = this
  448. getHealthAlerts({}).then(function(res) {
  449. if (res.code === 200 && res.data) {
  450. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  451. }
  452. }).catch(function() {
  453. self.healthAlerts = []
  454. })
  455. },
  456. goInteractionLog: function(memberId) {
  457. if (memberId) {
  458. uni.navigateTo({ url: '/pages/action-detail/interaction-log?memberId=' + memberId })
  459. } else {
  460. uni.navigateTo({ url: '/pages/action-detail/interaction-log' })
  461. }
  462. },
  463. goRelationshipQuestionnaire: function() {
  464. uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire' })
  465. },
  466. _watchPageReady() {
  467. var self = this
  468. var unwatch = this.$watch(function() {
  469. if (self.isLoggedIn) {
  470. return !!(self.dualDimension || self.sandboxData || (self.dimensionTasks && self.dimensionTasks.length > 0))
  471. }
  472. return !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  473. !!(self.dimensionProducts && self.dimensionProducts.length > 0)
  474. }, function(val) {
  475. if (val) {
  476. if (unwatch) unwatch()
  477. self.showTabTransition = false
  478. }
  479. })
  480. setTimeout(function() {
  481. if (unwatch) unwatch()
  482. self.showTabTransition = false
  483. }, 5000)
  484. }
  485. }
  486. }
  487. </script>
  488. <style scoped>
  489. .container {
  490. min-height: 100vh;
  491. background: #f5f7fa;
  492. padding-bottom: 120rpx;
  493. }
  494. /* ===== 功能入口 ===== */
  495. .func-section {
  496. margin: -40rpx 20rpx 0;
  497. position: relative;
  498. z-index: 2;
  499. }
  500. .func-grid {
  501. background: #fff;
  502. border-radius: 24rpx;
  503. padding: 30rpx 16rpx;
  504. display: flex;
  505. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  506. }
  507. .func-item {
  508. flex: 1;
  509. display: flex;
  510. flex-direction: column;
  511. align-items: center;
  512. }
  513. .func-item:active {
  514. opacity: 0.7;
  515. }
  516. .func-icon-wrap {
  517. width: 88rpx;
  518. height: 88rpx;
  519. border-radius: 50%;
  520. background: #FFF7ED;
  521. display: flex;
  522. align-items: center;
  523. justify-content: center;
  524. margin-bottom: 10rpx;
  525. }
  526. .func-icon {
  527. font-size: 40rpx;
  528. }
  529. .func-label {
  530. font-size: 24rpx;
  531. color: #333;
  532. font-weight: 500;
  533. }
  534. /* ===== 重要关系 ===== */
  535. .contact-section {
  536. margin: 20rpx 20rpx 0;
  537. }
  538. .contact-header {
  539. display: flex;
  540. justify-content: space-between;
  541. align-items: center;
  542. margin-bottom: 16rpx;
  543. }
  544. .contact-section-title {
  545. font-size: 30rpx;
  546. font-weight: 600;
  547. color: #333;
  548. }
  549. .contact-header-right {
  550. display: flex;
  551. gap: 16rpx;
  552. align-items: center;
  553. }
  554. .contact-more {
  555. font-size: 24rpx;
  556. color: #999;
  557. }
  558. .contact-import-btn {
  559. font-size: 24rpx;
  560. color: #F97316;
  561. font-weight: 500;
  562. }
  563. .contact-scroll {
  564. white-space: nowrap;
  565. overflow: hidden;
  566. }
  567. .contact-scroll-inner {
  568. display: flex;
  569. flex-direction: row;
  570. gap: 16rpx;
  571. padding: 8rpx 0 16rpx;
  572. }
  573. .contact-card-wrap {
  574. flex-shrink: 0;
  575. width: 220rpx;
  576. }
  577. .contact-card-wrap:active {
  578. opacity: 0.8;
  579. }
  580. .contact-add-card {
  581. width: 160rpx;
  582. }
  583. .add-card-inner {
  584. width: 160rpx;
  585. height: 280rpx;
  586. background: #fff;
  587. border-radius: 16rpx;
  588. border: 2rpx dashed #ddd;
  589. display: flex;
  590. flex-direction: column;
  591. align-items: center;
  592. justify-content: center;
  593. gap: 12rpx;
  594. }
  595. .add-card-icon {
  596. font-size: 48rpx;
  597. color: #ccc;
  598. }
  599. .add-card-label {
  600. font-size: 22rpx;
  601. color: #999;
  602. }
  603. .contact-empty {
  604. padding: 40rpx 0;
  605. text-align: center;
  606. }
  607. .contact-empty-text {
  608. font-size: 26rpx;
  609. color: #ccc;
  610. }
  611. /* ===== 关系健康概览 ===== */
  612. .rq-section {
  613. margin: 20rpx 20rpx 0;
  614. }
  615. .rq-header {
  616. display: flex;
  617. justify-content: space-between;
  618. align-items: center;
  619. margin-bottom: 16rpx;
  620. }
  621. .rq-title {
  622. font-size: 30rpx;
  623. font-weight: 600;
  624. color: #333;
  625. }
  626. .rq-more {
  627. font-size: 24rpx;
  628. color: #F97316;
  629. font-weight: 500;
  630. }
  631. /* 健康预警卡片 */
  632. .rq-alerts {
  633. display: flex;
  634. flex-direction: column;
  635. gap: 12rpx;
  636. margin-bottom: 16rpx;
  637. }
  638. .rq-alert-card {
  639. background: #FFF7ED;
  640. border-radius: 16rpx;
  641. padding: 20rpx;
  642. display: flex;
  643. align-items: center;
  644. gap: 16rpx;
  645. border: 1rpx solid #FED7AA;
  646. }
  647. .rq-alert-card:active {
  648. opacity: 0.8;
  649. }
  650. .rq-alert-icon {
  651. width: 64rpx;
  652. height: 64rpx;
  653. border-radius: 50%;
  654. background: #fff;
  655. display: flex;
  656. align-items: center;
  657. justify-content: center;
  658. flex-shrink: 0;
  659. }
  660. .rq-alert-emoji {
  661. font-size: 32rpx;
  662. }
  663. .rq-alert-info {
  664. flex: 1;
  665. display: flex;
  666. flex-direction: column;
  667. gap: 4rpx;
  668. }
  669. .rq-alert-name {
  670. font-size: 28rpx;
  671. font-weight: 600;
  672. color: #333;
  673. }
  674. .rq-alert-desc {
  675. font-size: 24rpx;
  676. color: #F97316;
  677. }
  678. .rq-alert-action {
  679. flex-shrink: 0;
  680. }
  681. .rq-alert-btn {
  682. font-size: 24rpx;
  683. color: #fff;
  684. background: #F97316;
  685. padding: 8rpx 20rpx;
  686. border-radius: 20rpx;
  687. }
  688. /* 里程碑卡片 */
  689. .rq-milestones {
  690. display: flex;
  691. flex-direction: column;
  692. gap: 12rpx;
  693. margin-bottom: 16rpx;
  694. }
  695. .rq-milestone-card {
  696. background: #F0F9FF;
  697. border-radius: 16rpx;
  698. padding: 20rpx;
  699. display: flex;
  700. align-items: center;
  701. gap: 16rpx;
  702. border: 1rpx solid #BAE6FD;
  703. }
  704. .rq-milestone-icon {
  705. width: 64rpx;
  706. height: 64rpx;
  707. border-radius: 50%;
  708. background: #fff;
  709. display: flex;
  710. align-items: center;
  711. justify-content: center;
  712. flex-shrink: 0;
  713. }
  714. .rq-milestone-emoji {
  715. font-size: 32rpx;
  716. }
  717. .rq-milestone-info {
  718. flex: 1;
  719. display: flex;
  720. flex-direction: column;
  721. gap: 4rpx;
  722. }
  723. .rq-milestone-name {
  724. font-size: 28rpx;
  725. font-weight: 600;
  726. color: #333;
  727. }
  728. .rq-milestone-desc {
  729. font-size: 24rpx;
  730. color: #0EA5E9;
  731. }
  732. /* 快捷操作 */
  733. .rq-quick-actions {
  734. display: flex;
  735. gap: 16rpx;
  736. margin-top: 8rpx;
  737. }
  738. .rq-action-btn {
  739. flex: 1;
  740. background: #fff;
  741. border-radius: 16rpx;
  742. padding: 20rpx;
  743. display: flex;
  744. align-items: center;
  745. justify-content: center;
  746. gap: 10rpx;
  747. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  748. }
  749. .rq-action-btn:active {
  750. opacity: 0.8;
  751. }
  752. .rq-action-icon {
  753. font-size: 36rpx;
  754. }
  755. .rq-action-label {
  756. font-size: 26rpx;
  757. color: #333;
  758. font-weight: 500;
  759. }
  760. /* ===== 底部 ===== */
  761. .bottom-spacer {
  762. height: 20rpx;
  763. }
  764. </style>