index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  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. if (!act || !act.id) return
  372. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  373. },
  374. goMoreActivities: function() {
  375. uni.navigateTo({ url: '/pages/activity/index' })
  376. },
  377. goProductDetail: function(prod) {
  378. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  379. },
  380. goMoreProducts: function() {
  381. uni.navigateTo({ url: '/pages/shop/index' })
  382. },
  383. onFuncClick: function(item) {
  384. if (item.needLogin && !this.isLoggedIn) {
  385. uni.showModal({
  386. title: '提示',
  387. content: '请先登录后使用此功能',
  388. success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
  389. })
  390. return
  391. }
  392. if (item.page) {
  393. var nativeTabs = ['/pages/tasks/tasks', '/pages/index/index', '/pages/body/index', '/pages/mind/index', '/pages/action/index', '/pages/profile/profile']
  394. if (nativeTabs.indexOf(item.page) !== -1) {
  395. uni.switchTab({ url: item.page })
  396. } else {
  397. uni.navigateTo({ url: item.page })
  398. }
  399. }
  400. },
  401. goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
  402. goMemberDetail: function(member) {
  403. if (!member || !member.memberId) return
  404. uni.navigateTo({
  405. url: '/pages/action-detail/member-action-detail?childId=' + member.memberId
  406. })
  407. },
  408. goLogin: function() { uni.navigateTo({ url: '/pages/login/login' }) },
  409. loadFeaturedArticles: function() {
  410. var self = this
  411. getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
  412. if (res.code === 200 && res.data) {
  413. var gradientColors = [
  414. 'linear-gradient(135deg, #10B981, #34D399)',
  415. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  416. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  417. 'linear-gradient(135deg, #F97316, #FB923C)',
  418. 'linear-gradient(135deg, #6366F1, #818CF8)'
  419. ]
  420. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  421. self.articles = list.map(function(item, index) {
  422. return {
  423. id: item.id,
  424. category: item.categoryName || '行动文章',
  425. categoryColor: gradientColors[index % gradientColors.length],
  426. title: item.title || '',
  427. summary: item.summary || '',
  428. views: item.viewCount ? String(item.viewCount) : '0',
  429. likes: '0',
  430. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  431. relatedDimensions: item.relatedDimensions || []
  432. }
  433. })
  434. }
  435. }).catch(function() {})
  436. },
  437. goArticleDetail: function(article) {
  438. var id = article.id || article
  439. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  440. },
  441. goMoreArticles: function() {
  442. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  443. },
  444. loadRelationshipHealth: function() {
  445. var self = this
  446. getHealthAlerts({}).then(function(res) {
  447. if (res.code === 200 && res.data) {
  448. self.healthAlerts = Array.isArray(res.data) ? res.data : []
  449. }
  450. }).catch(function() {
  451. self.healthAlerts = []
  452. })
  453. getMilestones({}, 30).then(function(res) {
  454. if (res.code === 200 && res.data) {
  455. self.milestones = Array.isArray(res.data) ? res.data : []
  456. }
  457. }).catch(function() {
  458. self.milestones = []
  459. })
  460. },
  461. goInteractionLog: function(memberId) {
  462. if (memberId) {
  463. uni.navigateTo({ url: '/pages/action-detail/interaction-log?memberId=' + memberId })
  464. } else {
  465. uni.navigateTo({ url: '/pages/action-detail/interaction-log' })
  466. }
  467. },
  468. goRelationshipQuestionnaire: function() {
  469. uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire' })
  470. },
  471. _watchPageReady() {
  472. var self = this
  473. var unwatch = this.$watch(function() {
  474. if (self.isLoggedIn) {
  475. return !!(self.dualDimension || self.sandboxData || (self.dimensionTasks && self.dimensionTasks.length > 0))
  476. }
  477. return !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  478. !!(self.dimensionProducts && self.dimensionProducts.length > 0)
  479. }, function(val) {
  480. if (val) {
  481. if (unwatch) unwatch()
  482. self.showTabTransition = false
  483. }
  484. })
  485. setTimeout(function() {
  486. if (unwatch) unwatch()
  487. self.showTabTransition = false
  488. }, 5000)
  489. }
  490. }
  491. }
  492. </script>
  493. <style scoped>
  494. .container {
  495. min-height: 100vh;
  496. background: #f5f7fa;
  497. padding-bottom: 120rpx;
  498. }
  499. /* ===== 功能入口 ===== */
  500. .func-section {
  501. margin: -40rpx 20rpx 0;
  502. position: relative;
  503. z-index: 2;
  504. }
  505. .func-grid {
  506. background: #fff;
  507. border-radius: 24rpx;
  508. padding: 30rpx 16rpx;
  509. display: flex;
  510. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  511. }
  512. .func-item {
  513. flex: 1;
  514. display: flex;
  515. flex-direction: column;
  516. align-items: center;
  517. }
  518. .func-item:active {
  519. opacity: 0.7;
  520. }
  521. .func-icon-wrap {
  522. width: 88rpx;
  523. height: 88rpx;
  524. border-radius: 50%;
  525. background: #FFF7ED;
  526. display: flex;
  527. align-items: center;
  528. justify-content: center;
  529. margin-bottom: 10rpx;
  530. }
  531. .func-icon {
  532. font-size: 40rpx;
  533. }
  534. .func-label {
  535. font-size: 24rpx;
  536. color: #333;
  537. font-weight: 500;
  538. }
  539. /* ===== 重要关系 ===== */
  540. .contact-section {
  541. margin: 20rpx 20rpx 0;
  542. }
  543. .contact-header {
  544. display: flex;
  545. justify-content: space-between;
  546. align-items: center;
  547. margin-bottom: 16rpx;
  548. }
  549. .contact-section-title {
  550. font-size: 30rpx;
  551. font-weight: 600;
  552. color: #333;
  553. }
  554. .contact-header-right {
  555. display: flex;
  556. gap: 16rpx;
  557. align-items: center;
  558. }
  559. .contact-more {
  560. font-size: 24rpx;
  561. color: #999;
  562. }
  563. .contact-import-btn {
  564. font-size: 24rpx;
  565. color: #F97316;
  566. font-weight: 500;
  567. }
  568. .contact-scroll {
  569. white-space: nowrap;
  570. overflow: hidden;
  571. }
  572. .contact-scroll-inner {
  573. display: flex;
  574. flex-direction: row;
  575. gap: 16rpx;
  576. padding: 8rpx 0 16rpx;
  577. }
  578. .contact-card-wrap {
  579. flex-shrink: 0;
  580. width: 220rpx;
  581. }
  582. .contact-card-wrap:active {
  583. opacity: 0.8;
  584. }
  585. .contact-add-card {
  586. width: 160rpx;
  587. }
  588. .add-card-inner {
  589. width: 160rpx;
  590. height: 280rpx;
  591. background: #fff;
  592. border-radius: 16rpx;
  593. border: 2rpx dashed #ddd;
  594. display: flex;
  595. flex-direction: column;
  596. align-items: center;
  597. justify-content: center;
  598. gap: 12rpx;
  599. }
  600. .add-card-icon {
  601. font-size: 48rpx;
  602. color: #ccc;
  603. }
  604. .add-card-label {
  605. font-size: 22rpx;
  606. color: #999;
  607. }
  608. .contact-empty {
  609. padding: 40rpx 0;
  610. text-align: center;
  611. }
  612. .contact-empty-text {
  613. font-size: 26rpx;
  614. color: #ccc;
  615. }
  616. /* ===== 关系健康概览 ===== */
  617. .rq-section {
  618. margin: 20rpx 20rpx 0;
  619. }
  620. .rq-header {
  621. display: flex;
  622. justify-content: space-between;
  623. align-items: center;
  624. margin-bottom: 16rpx;
  625. }
  626. .rq-title {
  627. font-size: 30rpx;
  628. font-weight: 600;
  629. color: #333;
  630. }
  631. .rq-more {
  632. font-size: 24rpx;
  633. color: #F97316;
  634. font-weight: 500;
  635. }
  636. /* 健康预警卡片 */
  637. .rq-alerts {
  638. display: flex;
  639. flex-direction: column;
  640. gap: 12rpx;
  641. margin-bottom: 16rpx;
  642. }
  643. .rq-alert-card {
  644. background: #FFF7ED;
  645. border-radius: 16rpx;
  646. padding: 20rpx;
  647. display: flex;
  648. align-items: center;
  649. gap: 16rpx;
  650. border: 1rpx solid #FED7AA;
  651. }
  652. .rq-alert-card:active {
  653. opacity: 0.8;
  654. }
  655. .rq-alert-icon {
  656. width: 64rpx;
  657. height: 64rpx;
  658. border-radius: 50%;
  659. background: #fff;
  660. display: flex;
  661. align-items: center;
  662. justify-content: center;
  663. flex-shrink: 0;
  664. }
  665. .rq-alert-emoji {
  666. font-size: 32rpx;
  667. }
  668. .rq-alert-info {
  669. flex: 1;
  670. display: flex;
  671. flex-direction: column;
  672. gap: 4rpx;
  673. }
  674. .rq-alert-name {
  675. font-size: 28rpx;
  676. font-weight: 600;
  677. color: #333;
  678. }
  679. .rq-alert-desc {
  680. font-size: 24rpx;
  681. color: #F97316;
  682. }
  683. .rq-alert-action {
  684. flex-shrink: 0;
  685. }
  686. .rq-alert-btn {
  687. font-size: 24rpx;
  688. color: #fff;
  689. background: #F97316;
  690. padding: 8rpx 20rpx;
  691. border-radius: 20rpx;
  692. }
  693. /* 里程碑卡片 */
  694. .rq-milestones {
  695. display: flex;
  696. flex-direction: column;
  697. gap: 12rpx;
  698. margin-bottom: 16rpx;
  699. }
  700. .rq-milestone-card {
  701. background: #F0F9FF;
  702. border-radius: 16rpx;
  703. padding: 20rpx;
  704. display: flex;
  705. align-items: center;
  706. gap: 16rpx;
  707. border: 1rpx solid #BAE6FD;
  708. }
  709. .rq-milestone-icon {
  710. width: 64rpx;
  711. height: 64rpx;
  712. border-radius: 50%;
  713. background: #fff;
  714. display: flex;
  715. align-items: center;
  716. justify-content: center;
  717. flex-shrink: 0;
  718. }
  719. .rq-milestone-emoji {
  720. font-size: 32rpx;
  721. }
  722. .rq-milestone-info {
  723. flex: 1;
  724. display: flex;
  725. flex-direction: column;
  726. gap: 4rpx;
  727. }
  728. .rq-milestone-name {
  729. font-size: 28rpx;
  730. font-weight: 600;
  731. color: #333;
  732. }
  733. .rq-milestone-desc {
  734. font-size: 24rpx;
  735. color: #0EA5E9;
  736. }
  737. /* 快捷操作 */
  738. .rq-quick-actions {
  739. display: flex;
  740. gap: 16rpx;
  741. margin-top: 8rpx;
  742. }
  743. .rq-action-btn {
  744. flex: 1;
  745. background: #fff;
  746. border-radius: 16rpx;
  747. padding: 20rpx;
  748. display: flex;
  749. align-items: center;
  750. justify-content: center;
  751. gap: 10rpx;
  752. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  753. }
  754. .rq-action-btn:active {
  755. opacity: 0.8;
  756. }
  757. .rq-action-icon {
  758. font-size: 36rpx;
  759. }
  760. .rq-action-label {
  761. font-size: 26rpx;
  762. color: #333;
  763. font-weight: 500;
  764. }
  765. /* ===== 底部 ===== */
  766. .bottom-spacer {
  767. height: 20rpx;
  768. }
  769. </style>