index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  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. if (!found && self.children.length > 0) {
  239. self.currentChildId = self.children[0].childId
  240. self.activeChildId = self.children[0].childId
  241. self.currentChildName = self.children[0].name || self.children[0].nickname || '孩子'
  242. uni.setStorageSync('currentChildId', self.activeChildId)
  243. }
  244. if (self.currentChildId) {
  245. self.loadDimensionData()
  246. }
  247. self.loadContacts()
  248. }
  249. }).catch(function(e) {
  250. console.log('获取孩子列表失败', e)
  251. })
  252. },
  253. loadDimensionData: function() {
  254. this.loadEnergyData()
  255. this.loadSandboxData()
  256. this.loadDimensionTasks()
  257. this.loadDimensionActivities()
  258. this.loadDimensionProducts()
  259. },
  260. loadEnergyData: function() {
  261. var self = this
  262. if (!this.currentChildId) return
  263. getEnergyOverview(this.currentChildId).then(function(res) {
  264. if (res && res.data) {
  265. var dims = res.data.dimensions
  266. if (dims && dims.length > 0) {
  267. for (var i = 0; i < dims.length; i++) {
  268. if (dims[i].code === 'action') {
  269. self.dualDimension = dims[i]
  270. break
  271. }
  272. }
  273. }
  274. }
  275. }).catch(function(e) {
  276. console.log('获取能量概览失败', e)
  277. })
  278. },
  279. loadSandboxData: function() {
  280. var self = this
  281. getFamilyEnergySandbox().then(function(res) {
  282. if (res && res.data) {
  283. self.sandboxData = res.data
  284. }
  285. }).catch(function() {})
  286. },
  287. loadDimensionTasks: function() {
  288. var self = this
  289. if (!this.currentChildId) return
  290. getTodayTasksByCategory(this.currentChildId, 'action').then(function(res) {
  291. if (res && res.data) {
  292. self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
  293. }
  294. }).catch(function() { self.dimensionTasks = [] })
  295. },
  296. loadDimensionActivities: function() {
  297. var self = this
  298. getActivityList({ dimensionCode: 'action', page: 1, size: 3 }).then(function(res) {
  299. if (res && res.data) {
  300. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  301. self.dimensionActivities = list.slice(0, 3)
  302. }
  303. }).catch(function() { self.dimensionActivities = [] })
  304. },
  305. loadDimensionProducts: function() {
  306. var self = this
  307. getProductsByDomain('action', 1, 4).then(function(res) {
  308. if (res && res.data) {
  309. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  310. self.dimensionProducts = list.slice(0, 4)
  311. }
  312. }).catch(function() { self.dimensionProducts = [] })
  313. },
  314. loadContacts: function() {
  315. var self = this
  316. getContactList({}).then(function(res) {
  317. if (res.code === 200 && res.data) {
  318. self.contactList = Array.isArray(res.data) ? res.data : []
  319. }
  320. }).catch(function(e) {
  321. console.log('获取联系人失败', e)
  322. })
  323. },
  324. onContactClick: function(item) {
  325. uni.navigateTo({ url: '/pages/action-detail/contact-detail?id=' + item.id })
  326. },
  327. onShowImport: function() {
  328. this.showImportModal = true
  329. },
  330. onCloseImport: function() {
  331. this.showImportModal = false
  332. },
  333. onImportSuccess: function() {
  334. this.showImportModal = false
  335. this.loadContacts()
  336. },
  337. onChildChanged: function(child) {
  338. this.currentChildId = child.childId
  339. this.currentChildName = child.name || child.nickname || '孩子'
  340. uni.setStorageSync('currentChildId', child.childId)
  341. this.loadDimensionData()
  342. },
  343. loadFamilyMembersVisible: function() {
  344. var self = this
  345. getVisibleFamilyMembers().then(function(res) {
  346. self.familyMembersVisible = res.data || []
  347. }).catch(function(e) {
  348. console.log('获取可见家庭成员失败', e)
  349. self.familyMembersVisible = []
  350. })
  351. },
  352. scrollToSection: function(section) {
  353. uni.pageScrollTo({ selector: '#' + section, duration: 300 })
  354. },
  355. sectionVisible: function(key) {
  356. return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
  357. },
  358. onTaskClick: function(task) {
  359. uni.navigateTo({ url: '/pages/tasks/tasks' })
  360. },
  361. goActivityDetail: function(act) {
  362. if (!act || !act.id) return
  363. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  364. },
  365. goMoreActivities: function() {
  366. uni.navigateTo({ url: '/pages/activity/index' })
  367. },
  368. goProductDetail: function(prod) {
  369. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  370. },
  371. goMoreProducts: function() {
  372. uni.navigateTo({ url: '/pages/shop/index' })
  373. },
  374. onFuncClick: function(item) {
  375. if (item.needLogin && !this.isLoggedIn) {
  376. uni.showModal({
  377. title: '提示',
  378. content: '请先登录后使用此功能',
  379. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  380. })
  381. return
  382. }
  383. if (item.page) {
  384. var nativeTabs = ['/pages/tasks/tasks', '/pages/index/index', '/pages/body/index', '/pages/mind/index', '/pages/action/index', '/pages/profile/profile']
  385. if (nativeTabs.indexOf(item.page) !== -1) {
  386. uni.switchTab({ url: item.page })
  387. } else {
  388. uni.navigateTo({ url: item.page })
  389. }
  390. }
  391. },
  392. goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
  393. goMemberDetail: function(member) {
  394. if (!member || !member.memberId) return
  395. uni.navigateTo({
  396. url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&memberType=' + (member.memberType || 'child') + '&entrySource=relation-graph&dimensionCode=action'
  397. })
  398. },
  399. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  400. parseRelatedDimensions: function(val) {
  401. if (!val) return []
  402. if (Array.isArray(val)) return val
  403. if (typeof val === 'string') {
  404. try {
  405. var parsed = JSON.parse(val)
  406. return Array.isArray(parsed) ? parsed : []
  407. } catch (e) {
  408. // 逗号分隔格式 fallback: "action,mind"
  409. return val.split(',').map(function(s) { return s.trim() }).filter(function(s) { return s })
  410. }
  411. }
  412. return []
  413. },
  414. loadFeaturedArticles: function() {
  415. var self = this
  416. getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
  417. if (res.code === 200 && res.data) {
  418. var gradientColors = [
  419. 'linear-gradient(135deg, #10B981, #34D399)',
  420. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  421. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  422. 'linear-gradient(135deg, #F97316, #FB923C)',
  423. 'linear-gradient(135deg, #6366F1, #818CF8)'
  424. ]
  425. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  426. self.articles = list.map(function(item, index) {
  427. return {
  428. id: item.id,
  429. category: item.categoryName || '行动文章',
  430. categoryColor: gradientColors[index % gradientColors.length],
  431. title: item.title || '',
  432. summary: item.summary || '',
  433. views: item.viewCount ? String(item.viewCount) : '0',
  434. likes: '0',
  435. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  436. relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions)
  437. }
  438. })
  439. }
  440. }).catch(function() {})
  441. },
  442. goArticleDetail: function(article) {
  443. var id = article.id || article
  444. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  445. },
  446. goMoreArticles: function() {
  447. uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
  448. },
  449. loadRelationshipHealth: function() {
  450. var self = this
  451. getHealthAlerts({}).then(function(res) {
  452. if (res.code === 200 && res.data) {
  453. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  454. }
  455. }).catch(function() {
  456. self.healthAlerts = []
  457. })
  458. },
  459. goInteractionLog: function(memberId) {
  460. if (memberId) {
  461. uni.navigateTo({ url: '/pages/action-detail/interaction-log?memberId=' + memberId })
  462. } else {
  463. uni.navigateTo({ url: '/pages/action-detail/interaction-log' })
  464. }
  465. },
  466. goRelationshipQuestionnaire: function() {
  467. uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire' })
  468. },
  469. _watchPageReady() {
  470. var self = this
  471. var unwatch = this.$watch(function() {
  472. if (self.isLoggedIn) {
  473. return !!(self.dualDimension || self.sandboxData || (self.dimensionTasks && self.dimensionTasks.length > 0))
  474. }
  475. return !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  476. !!(self.dimensionProducts && self.dimensionProducts.length > 0)
  477. }, function(val) {
  478. if (val) {
  479. if (unwatch) unwatch()
  480. self.showTabTransition = false
  481. }
  482. })
  483. setTimeout(function() {
  484. if (unwatch) unwatch()
  485. self.showTabTransition = false
  486. }, 5000)
  487. }
  488. }
  489. }
  490. </script>
  491. <style scoped>
  492. .container {
  493. min-height: 100vh;
  494. background: #f5f7fa;
  495. padding-bottom: 120rpx;
  496. }
  497. /* ===== 功能入口 ===== */
  498. .func-section {
  499. margin: -40rpx 20rpx 0;
  500. position: relative;
  501. z-index: 2;
  502. }
  503. .func-grid {
  504. background: #fff;
  505. border-radius: 24rpx;
  506. padding: 30rpx 16rpx;
  507. display: flex;
  508. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  509. }
  510. .func-item {
  511. flex: 1;
  512. display: flex;
  513. flex-direction: column;
  514. align-items: center;
  515. }
  516. .func-item:active {
  517. opacity: 0.7;
  518. }
  519. .func-icon-wrap {
  520. width: 88rpx;
  521. height: 88rpx;
  522. border-radius: 50%;
  523. background: #FFF7ED;
  524. display: flex;
  525. align-items: center;
  526. justify-content: center;
  527. margin-bottom: 10rpx;
  528. }
  529. .func-icon {
  530. font-size: 40rpx;
  531. }
  532. .func-label {
  533. font-size: 24rpx;
  534. color: #333;
  535. font-weight: 500;
  536. }
  537. /* ===== 重要关系 ===== */
  538. .contact-section {
  539. margin: 20rpx 20rpx 0;
  540. }
  541. .contact-header {
  542. display: flex;
  543. justify-content: space-between;
  544. align-items: center;
  545. margin-bottom: 16rpx;
  546. }
  547. .contact-section-title {
  548. font-size: 30rpx;
  549. font-weight: 600;
  550. color: #333;
  551. }
  552. .contact-header-right {
  553. display: flex;
  554. gap: 16rpx;
  555. align-items: center;
  556. }
  557. .contact-more {
  558. font-size: 24rpx;
  559. color: #999;
  560. }
  561. .contact-import-btn {
  562. font-size: 24rpx;
  563. color: #F97316;
  564. font-weight: 500;
  565. }
  566. .contact-scroll {
  567. white-space: nowrap;
  568. overflow: hidden;
  569. }
  570. .contact-scroll-inner {
  571. display: flex;
  572. flex-direction: row;
  573. gap: 16rpx;
  574. padding: 8rpx 0 16rpx;
  575. }
  576. .contact-card-wrap {
  577. flex-shrink: 0;
  578. width: 220rpx;
  579. }
  580. .contact-card-wrap:active {
  581. opacity: 0.8;
  582. }
  583. .contact-add-card {
  584. width: 160rpx;
  585. }
  586. .add-card-inner {
  587. width: 160rpx;
  588. height: 280rpx;
  589. background: #fff;
  590. border-radius: 16rpx;
  591. border: 2rpx dashed #ddd;
  592. display: flex;
  593. flex-direction: column;
  594. align-items: center;
  595. justify-content: center;
  596. gap: 12rpx;
  597. }
  598. .add-card-icon {
  599. font-size: 48rpx;
  600. color: #ccc;
  601. }
  602. .add-card-label {
  603. font-size: 22rpx;
  604. color: #999;
  605. }
  606. .contact-empty {
  607. padding: 40rpx 0;
  608. text-align: center;
  609. }
  610. .contact-empty-text {
  611. font-size: 26rpx;
  612. color: #ccc;
  613. }
  614. /* ===== 关系健康概览 ===== */
  615. .rq-section {
  616. margin: 20rpx 20rpx 0;
  617. }
  618. .rq-header {
  619. display: flex;
  620. justify-content: space-between;
  621. align-items: center;
  622. margin-bottom: 16rpx;
  623. }
  624. .rq-title {
  625. font-size: 30rpx;
  626. font-weight: 600;
  627. color: #333;
  628. }
  629. .rq-more {
  630. font-size: 24rpx;
  631. color: #F97316;
  632. font-weight: 500;
  633. }
  634. /* 健康预警卡片 */
  635. .rq-alerts {
  636. display: flex;
  637. flex-direction: column;
  638. gap: 12rpx;
  639. margin-bottom: 16rpx;
  640. }
  641. .rq-alert-card {
  642. background: #FFF7ED;
  643. border-radius: 16rpx;
  644. padding: 20rpx;
  645. display: flex;
  646. align-items: center;
  647. gap: 16rpx;
  648. border: 1rpx solid #FED7AA;
  649. }
  650. .rq-alert-card:active {
  651. opacity: 0.8;
  652. }
  653. .rq-alert-icon {
  654. width: 64rpx;
  655. height: 64rpx;
  656. border-radius: 50%;
  657. background: #fff;
  658. display: flex;
  659. align-items: center;
  660. justify-content: center;
  661. flex-shrink: 0;
  662. }
  663. .rq-alert-emoji {
  664. font-size: 32rpx;
  665. }
  666. .rq-alert-info {
  667. flex: 1;
  668. display: flex;
  669. flex-direction: column;
  670. gap: 4rpx;
  671. }
  672. .rq-alert-name {
  673. font-size: 28rpx;
  674. font-weight: 600;
  675. color: #333;
  676. }
  677. .rq-alert-desc {
  678. font-size: 24rpx;
  679. color: #F97316;
  680. }
  681. .rq-alert-action {
  682. flex-shrink: 0;
  683. }
  684. .rq-alert-btn {
  685. font-size: 24rpx;
  686. color: #fff;
  687. background: #F97316;
  688. padding: 8rpx 20rpx;
  689. border-radius: 20rpx;
  690. }
  691. /* 里程碑卡片 */
  692. .rq-milestones {
  693. display: flex;
  694. flex-direction: column;
  695. gap: 12rpx;
  696. margin-bottom: 16rpx;
  697. }
  698. .rq-milestone-card {
  699. background: #F0F9FF;
  700. border-radius: 16rpx;
  701. padding: 20rpx;
  702. display: flex;
  703. align-items: center;
  704. gap: 16rpx;
  705. border: 1rpx solid #BAE6FD;
  706. }
  707. .rq-milestone-icon {
  708. width: 64rpx;
  709. height: 64rpx;
  710. border-radius: 50%;
  711. background: #fff;
  712. display: flex;
  713. align-items: center;
  714. justify-content: center;
  715. flex-shrink: 0;
  716. }
  717. .rq-milestone-emoji {
  718. font-size: 32rpx;
  719. }
  720. .rq-milestone-info {
  721. flex: 1;
  722. display: flex;
  723. flex-direction: column;
  724. gap: 4rpx;
  725. }
  726. .rq-milestone-name {
  727. font-size: 28rpx;
  728. font-weight: 600;
  729. color: #333;
  730. }
  731. .rq-milestone-desc {
  732. font-size: 24rpx;
  733. color: #0EA5E9;
  734. }
  735. /* 快捷操作 */
  736. .rq-quick-actions {
  737. display: flex;
  738. gap: 16rpx;
  739. margin-top: 8rpx;
  740. }
  741. .rq-action-btn {
  742. flex: 1;
  743. background: #fff;
  744. border-radius: 16rpx;
  745. padding: 20rpx;
  746. display: flex;
  747. align-items: center;
  748. justify-content: center;
  749. gap: 10rpx;
  750. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  751. }
  752. .rq-action-btn:active {
  753. opacity: 0.8;
  754. }
  755. .rq-action-icon {
  756. font-size: 36rpx;
  757. }
  758. .rq-action-label {
  759. font-size: 26rpx;
  760. color: #333;
  761. font-weight: 500;
  762. }
  763. /* ===== 底部 ===== */
  764. .bottom-spacer {
  765. height: 20rpx;
  766. }
  767. </style>