index.vue 25 KB

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