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