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