index.vue 25 KB

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