index.vue 23 KB

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