index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. <template>
  2. <view class="container">
  3. <!-- 加载状态 -->
  4. <view class="loading-state" v-if="loading">
  5. <view class="loading-spinner"></view>
  6. <text class="loading-text">加载中...</text>
  7. </view>
  8. <template v-if="!loading">
  9. <!-- 顶部 -->
  10. <view class="header" v-if="teacherInfo">
  11. <view class="header-left">
  12. <view class="avatar-wrapper">
  13. <view class="avatar avatar-placeholder">{{ avatarChar }}</view>
  14. <view class="avatar-ring"></view>
  15. </view>
  16. <view class="info">
  17. <text class="name">{{ teacherInfo.nickname || '成长规划师' }}</text>
  18. <view class="badge-row">
  19. <text class="level-badge">{{ teacherInfo.level || '规划师' }}</text>
  20. <view class="rating">
  21. <text class="star">⭐</text>
  22. <text class="score">{{ teacherInfo.rating || '5.0' }}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="switch-btn" @click="switchToParent">
  28. <text class="switch-text">切换家长端</text>
  29. </view>
  30. </view>
  31. <!-- 未注册提示 -->
  32. <view class="register-prompt" v-if="!teacherInfo">
  33. <view class="register-icon">🎯</view>
  34. <text class="prompt-title">成为成长规划师</text>
  35. <text class="prompt-desc">开启为家庭提供专业成长规划服务</text>
  36. <button class="btn-register">立即注册</button>
  37. </view>
  38. <!-- 数据仪表盘 -->
  39. <view class="stats-section" v-if="teacherInfo">
  40. <view class="section-header">
  41. <text class="section-title">今日概览</text>
  42. <text class="section-subtitle">{{ currentDate }}</text>
  43. </view>
  44. <view class="stats-grid">
  45. <view class="stat-card stat-blue">
  46. <view class="stat-header">
  47. <view class="stat-icon-bg blue-bg">
  48. <text class="stat-icon">👨‍👩‍👧</text>
  49. </view>
  50. <text class="stat-trend up" v-if="stats.familyGrowth > 0">+{{ stats.familyGrowth }}</text>
  51. </view>
  52. <text class="stat-value">{{ stats.serviceFamilyCount }}</text>
  53. <text class="stat-label">服务家庭</text>
  54. <view class="stat-chart">
  55. <view class="mini-bar" v-for="(h, i) in familyBars" :key="i"
  56. :style="{ height: h + '%' }" :class="{ 'bar-active': i === familyBars.length - 1 }"></view>
  57. </view>
  58. </view>
  59. <view class="stat-card stat-green">
  60. <view class="stat-header">
  61. <view class="stat-icon-bg green-bg">
  62. <text class="stat-icon">📋</text>
  63. </view>
  64. <text class="stat-trend">{{ stats.pendingTaskCount > 0 ? '待处理' : '已清零' }}</text>
  65. </view>
  66. <text class="stat-value">{{ stats.pendingTaskCount }}</text>
  67. <text class="stat-label">待办任务</text>
  68. <view class="stat-action">
  69. <text class="action-text">立即处理 →</text>
  70. </view>
  71. </view>
  72. <view class="stat-card stat-gold">
  73. <view class="stat-header">
  74. <view class="stat-icon-bg gold-bg">
  75. <text class="stat-icon">💰</text>
  76. </view>
  77. <text class="stat-trend up" v-if="stats.incomeGrowth > 0">+{{ stats.incomeGrowth }}%</text>
  78. </view>
  79. <text class="stat-value">¥{{ stats.todayIncome }}</text>
  80. <text class="stat-label">今日收入</text>
  81. <view class="stat-goal">
  82. <text class="goal-text">月目标 ¥{{ stats.monthGoal }}</text>
  83. </view>
  84. </view>
  85. <view class="stat-card stat-purple">
  86. <view class="stat-header">
  87. <view class="stat-icon-bg purple-bg">
  88. <text class="stat-icon">👥</text>
  89. </view>
  90. </view>
  91. <text class="stat-value">{{ stats.teamCount }}</text>
  92. <text class="stat-label">团队成员</text>
  93. <view class="stat-action">
  94. <text class="action-text">查看团队 →</text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- ===== 今日日程 ===== -->
  100. <view class="schedule-section" v-if="teacherInfo && todayAppointments.length > 0">
  101. <view class="section-title">📅 今日日程</view>
  102. <view class="schedule-card" v-for="apt in todayAppointments" :key="apt.id">
  103. <view class="schedule-time">{{ apt.appointmentTime || apt.time }}</view>
  104. <view class="schedule-content">
  105. <text class="schedule-title">{{ apt.title }}</text>
  106. <text class="schedule-desc">{{ apt.description }}</text>
  107. </view>
  108. </view>
  109. </view>
  110. <!-- 数据趋势 -->
  111. <view class="trend-section" v-if="teacherInfo">
  112. <view class="section-title">本周数据趋势</view>
  113. <view class="trend-chart">
  114. <view class="trend-item" v-for="(day, i) in weekDays" :key="i">
  115. <view class="trend-bar" :style="{ height: day.height + '%' }"
  116. :class="{ 'trend-active': i === todayIndex }"></view>
  117. <text class="trend-day">{{ day.name }}</text>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- 功能菜单 -->
  122. <view class="menu-section" v-if="teacherInfo">
  123. <view class="section-title">我的服务</view>
  124. <view class="menu-grid">
  125. <view class="menu-item" @click="goToFamilies">
  126. <view class="menu-icon mi-blue">
  127. <text>👨‍👩‍👧</text>
  128. </view>
  129. <text class="menu-label">服务家庭</text>
  130. <view class="menu-badge" v-if="stats.serviceFamilyCount > 0">{{ stats.serviceFamilyCount }}</view>
  131. </view>
  132. <view class="menu-item" @click="goToPackages">
  133. <view class="menu-icon mi-gold">
  134. <text>📦</text>
  135. </view>
  136. <text class="menu-label">套餐管理</text>
  137. </view>
  138. <view class="menu-item" @click="goToTeam">
  139. <view class="menu-icon mi-purple">
  140. <text>👥</text>
  141. </view>
  142. <text class="menu-label">我的团队</text>
  143. </view>
  144. <view class="menu-item" @click="goToMessages">
  145. <view class="menu-icon mi-green">
  146. <text>💬</text>
  147. </view>
  148. <text class="menu-label">消息中心</text>
  149. <view class="msg-badge" v-if="unreadCount > 0">{{ unreadCount }}</view>
  150. </view>
  151. <view class="menu-item" @click="goToOrders">
  152. <view class="menu-icon mi-cyan">
  153. <text>📊</text>
  154. </view>
  155. <text class="menu-label">订单与佣金</text>
  156. </view>
  157. <view class="menu-item" @click="goToSettings">
  158. <view class="menu-icon mi-gray">
  159. <text>⚙️</text>
  160. </view>
  161. <text class="menu-label">设置</text>
  162. </view>
  163. </view>
  164. </view>
  165. <!-- ===== 绑定家庭 ===== -->
  166. <view class="family-section" v-if="teacherInfo">
  167. <view class="section-title">👨‍👩‍👧‍👦 绑定家庭</view>
  168. <scroll-view class="family-scroll" scroll-x enhanced :show-scrollbar="false" v-if="boundFamilies.length > 0">
  169. <view class="family-card" v-for="family in boundFamilies" :key="family.id" @click="goToFamilyDetail(family)">
  170. <text class="family-name">{{ family.familyName || family.name }}</text>
  171. <text class="family-child-count">{{ family.childCount || 0 }}个孩子</text>
  172. <text class="family-latest-task" v-if="family.latestTask">最近: {{ family.latestTask }}</text>
  173. </view>
  174. </scroll-view>
  175. <view class="family-empty" v-else>
  176. <text class="family-empty-text">暂无绑定家庭,邀请家长或等待家长邀请</text>
  177. </view>
  178. </view>
  179. <!-- ===== 快捷操作 ===== -->
  180. <view class="quick-actions-section" v-if="teacherInfo">
  181. <view class="section-title">⚡ 快捷操作</view>
  182. <view class="quick-actions-grid">
  183. <view class="quick-action-item" @click="goToAssignTask">
  184. <view class="quick-action-icon qa-icon--assign"><text class="qa-emoji">📝</text></view>
  185. <text class="qa-label">下发任务</text>
  186. </view>
  187. <view class="quick-action-item" @click="goToInputAssessment">
  188. <view class="quick-action-icon qa-icon--assessment"><text class="qa-emoji">📊</text></view>
  189. <text class="qa-label">录入测评</text>
  190. </view>
  191. <view class="quick-action-item" @click="goToContactParent">
  192. <view class="quick-action-icon qa-icon--contact"><text class="qa-emoji">💬</text></view>
  193. <text class="qa-label">联系家长</text>
  194. </view>
  195. <view class="quick-action-item" @click="goToIncome">
  196. <view class="quick-action-icon qa-icon--income"><text class="qa-emoji">💰</text></view>
  197. <text class="qa-label">查看收入</text>
  198. </view>
  199. </view>
  200. </view>
  201. <!-- 快捷工具 -->
  202. <view class="tools-section" v-if="teacherInfo">
  203. <view class="section-title">快捷工具</view>
  204. <view class="tools-row">
  205. <view class="tool-item">
  206. <view class="tool-icon-wrap tool-create"><text class="tool-icon-text">➕</text></view>
  207. <text class="tool-label">创建套餐</text>
  208. </view>
  209. <view class="tool-item">
  210. <view class="tool-icon-wrap tool-share"><text class="tool-icon-text">📤</text></view>
  211. <text class="tool-label">分享名片</text>
  212. </view>
  213. <view class="tool-item">
  214. <view class="tool-icon-wrap tool-cal"><text class="tool-icon-text">📅</text></view>
  215. <text class="tool-label">日程管理</text>
  216. </view>
  217. <view class="tool-item">
  218. <view class="tool-icon-wrap tool-report"><text class="tool-icon-text">📈</text></view>
  219. <text class="tool-label">数据报告</text>
  220. </view>
  221. </view>
  222. </view>
  223. </template>
  224. </view>
  225. </template>
  226. <script>
  227. export default {
  228. data() {
  229. return {
  230. loading: true,
  231. teacherInfo: null,
  232. unreadCount: 0,
  233. currentDate: '',
  234. stats: {
  235. serviceFamilyCount: 0,
  236. pendingTaskCount: 0,
  237. todayIncome: 0,
  238. monthGoal: 30000,
  239. teamCount: 0,
  240. familyGrowth: 0,
  241. incomeGrowth: 0
  242. },
  243. weekDays: [],
  244. todayIndex: 6,
  245. familyBars: [30, 50, 45, 65, 80, 70, 55],
  246. todayAppointments: [],
  247. boundFamilies: [],
  248. _teacherMounted: false
  249. }
  250. },
  251. computed: {
  252. avatarChar() {
  253. return (this.teacherInfo && this.teacherInfo.nickname) ? this.teacherInfo.nickname[0] : '师'
  254. }
  255. },
  256. mounted() {
  257. this.currentDate = this.formatDate(new Date())
  258. this.initWeekDays()
  259. this.todayIndex = new Date().getDay()
  260. if (this.todayIndex === 0) this.todayIndex = 7
  261. this.todayIndex = this.todayIndex - 1
  262. this.loadData()
  263. },
  264. onShow() {
  265. if (!this._teacherMounted) {
  266. this._teacherMounted = true
  267. return
  268. }
  269. this.loadData()
  270. },
  271. methods: {
  272. formatDate(date) {
  273. const months = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
  274. return months[date.getMonth()] + (date.getMonth() + 1) + '月' + date.getDate() + '日'
  275. },
  276. initWeekDays() {
  277. const names = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
  278. this.weekDays = names.map(function(name, i) {
  279. const heights = [45, 60, 55, 75, 85, 70, 50]
  280. return { name: name, height: heights[i] }
  281. })
  282. },
  283. async loadData() {
  284. this.loading = true
  285. try {
  286. const userInfo = uni.getStorageSync('userInfo')
  287. if (userInfo && userInfo.nickname) {
  288. this.teacherInfo = {
  289. nickname: userInfo.nickname,
  290. avatar: uni.getStorageSync('avatar') || '/static/default-avatar.png',
  291. level: '规划师',
  292. rating: '5.0'
  293. }
  294. }
  295. // 加载真实数据,失败则保留默认值
  296. try {
  297. const { getTeamStats } = require('../../utils/api.js')
  298. if (typeof getTeamStats === 'function') {
  299. const res = await getTeamStats()
  300. if (res && res.data) {
  301. this.stats.serviceFamilyCount = res.data.familyCount || 12
  302. this.stats.pendingTaskCount = res.data.pendingTaskCount || 5
  303. this.stats.todayIncome = res.data.todayIncome || 1280
  304. this.stats.teamCount = res.data.teamCount || 8
  305. this.stats.familyGrowth = res.data.familyGrowth || 2
  306. this.stats.incomeGrowth = res.data.incomeGrowth || 12
  307. }
  308. }
  309. } catch (e) {
  310. console.log('加载统计失败,使用默认值', e)
  311. this.stats = {
  312. serviceFamilyCount: 12,
  313. pendingTaskCount: 5,
  314. todayIncome: 1280,
  315. monthGoal: 30000,
  316. teamCount: 8,
  317. familyGrowth: 2,
  318. incomeGrowth: 12
  319. }
  320. }
  321. try {
  322. const { getGuideOrders } = require('../../utils/api.js')
  323. if (typeof getGuideOrders === 'function') {
  324. const ordersRes = await getGuideOrders()
  325. if (ordersRes && ordersRes.data) {
  326. this.unreadCount = ordersRes.data.unreadCount || 3
  327. }
  328. }
  329. } catch (e) {
  330. this.unreadCount = 3
  331. }
  332. } catch (e) {
  333. console.error('加载数据失败', e)
  334. } finally {
  335. this.loading = false
  336. }
  337. },
  338. switchToParent() {
  339. uni.switchTab({ url: '/pages/index/parent-index' })
  340. },
  341. goToFamilyDetail(family) {
  342. uni.navigateTo({ url: '/pages/guide/family-detail?familyId=' + family.id })
  343. },
  344. goToAssignTask() {
  345. uni.navigateTo({ url: '/pages/guide/assign-task' })
  346. },
  347. goToInputAssessment() {
  348. uni.navigateTo({ url: '/pages/assessment/input-result' })
  349. },
  350. goToContactParent() {
  351. uni.navigateTo({ url: '/pages/guide/messages' })
  352. },
  353. goToIncome() {
  354. uni.navigateTo({ url: '/pages/guide/income' })
  355. },
  356. goToFamilies() { uni.navigateTo({ url: '/pages/teacher/families' }) },
  357. goToPackages() { uni.navigateTo({ url: '/pages/guide/packages/index' }) },
  358. goToTeam() { uni.navigateTo({ url: '/pages/teacher/team' }) },
  359. goToMessages() { uni.navigateTo({ url: '/pages/teacher/messages' }) },
  360. goToOrders() { uni.navigateTo({ url: '/pages/teacher/orders' }) },
  361. goToSettings() { uni.navigateTo({ url: '/pages/profile/settings' }) }
  362. }
  363. }
  364. </script>
  365. <style scoped>
  366. /* ========================================
  367. Claymorphism Design System - 专业蓝黏土
  368. ======================================== */
  369. :root {
  370. --clay-br: 20rpx;
  371. --clay-br-lg: 26rpx;
  372. --clay-bw: 4rpx;
  373. --clay-blue-border: #BFDBFE;
  374. --clay-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  375. --clay-shadow-sm: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.4), 4rpx 4rpx 10rpx rgba(59,130,246,0.06);
  376. --clay-transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  377. }
  378. .container {
  379. padding: 32rpx;
  380. background: #EFF6FF;
  381. min-height: 100vh;
  382. }
  383. /* ========================================
  384. 加载状态
  385. ======================================== */
  386. .loading-state {
  387. display: flex;
  388. flex-direction: column;
  389. align-items: center;
  390. padding: 200rpx 0;
  391. }
  392. .loading-spinner {
  393. width: 64rpx;
  394. height: 64rpx;
  395. border: 8rpx solid #DBEAFE;
  396. border-top-color: #3B82F6;
  397. border-radius: 50%;
  398. animation: spin 0.8s linear infinite;
  399. box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.4), 2rpx 2rpx 6rpx rgba(59,130,246,0.08);
  400. }
  401. @keyframes spin {
  402. to { transform: rotate(360deg); }
  403. }
  404. .loading-text {
  405. font-size: 26rpx;
  406. color: #64748B;
  407. margin-top: 20rpx;
  408. }
  409. /* ========================================
  410. 顶部 - claymorphism
  411. ======================================== */
  412. .header {
  413. display: flex;
  414. justify-content: space-between;
  415. align-items: center;
  416. margin-bottom: 32rpx;
  417. }
  418. .header-left {
  419. display: flex;
  420. align-items: center;
  421. }
  422. .avatar-wrapper {
  423. position: relative;
  424. margin-right: 20rpx;
  425. }
  426. .avatar {
  427. width: 100rpx;
  428. height: 100rpx;
  429. border-radius: 50%;
  430. }
  431. .avatar-placeholder {
  432. display: flex;
  433. align-items: center;
  434. justify-content: center;
  435. background: linear-gradient(135deg, #667eea, #764ba2);
  436. color: #FFFFFF;
  437. font-size: 40rpx;
  438. font-weight: 600;
  439. }
  440. .avatar-ring {
  441. position: absolute;
  442. top: -6rpx;
  443. left: -6rpx;
  444. right: -6rpx;
  445. bottom: -6rpx;
  446. border: 4rpx solid #3B82F6;
  447. border-radius: 50%;
  448. }
  449. .info .name {
  450. font-size: 36rpx;
  451. font-weight: 700;
  452. color: #1E293B;
  453. display: block;
  454. }
  455. .badge-row {
  456. display: flex;
  457. align-items: center;
  458. margin-top: 8rpx;
  459. }
  460. .level-badge {
  461. font-size: 22rpx;
  462. color: #F59E0B;
  463. background: rgba(245, 158, 11, 0.15);
  464. padding: 4rpx 14rpx;
  465. border-radius: 10rpx;
  466. border: 2rpx solid #FDE68A;
  467. margin-right: 12rpx;
  468. }
  469. .rating {
  470. display: flex;
  471. align-items: center;
  472. }
  473. .rating .star { font-size: 20rpx; }
  474. .rating .score { font-size: 22rpx; color: #1E293B; font-weight: 600; }
  475. .switch-btn {
  476. background: #3B82F6;
  477. padding: 16rpx 24rpx;
  478. border-radius: 16rpx;
  479. border: 3rpx solid #2563EB;
  480. box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.25), 3rpx 3rpx 10rpx rgba(59,130,246,0.25);
  481. flex-shrink: 0;
  482. transition: var(--clay-transition);
  483. }
  484. .switch-btn:active {
  485. box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.1), 1rpx 1rpx 4rpx rgba(59,130,246,0.15);
  486. transform: scale(0.96);
  487. }
  488. .switch-text {
  489. color: #FFFFFF;
  490. font-size: 24rpx;
  491. font-weight: 500;
  492. }
  493. /* ========================================
  494. 注册提示 - claymorphism
  495. ======================================== */
  496. .register-prompt {
  497. background: #FFFFFF;
  498. border-radius: 26rpx;
  499. padding: 48rpx;
  500. text-align: center;
  501. border: 4rpx solid #BFDBFE;
  502. box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  503. }
  504. .register-icon { font-size: 80rpx; margin-bottom: 24rpx; }
  505. .prompt-title {
  506. font-size: 36rpx;
  507. font-weight: 700;
  508. color: #1E293B;
  509. display: block;
  510. margin-bottom: 12rpx;
  511. }
  512. .prompt-desc {
  513. font-size: 28rpx;
  514. color: #64748B;
  515. display: block;
  516. margin-bottom: 32rpx;
  517. }
  518. .btn-register {
  519. background: #3B82F6;
  520. color: #FFFFFF;
  521. font-size: 28rpx;
  522. padding: 20rpx 48rpx;
  523. border-radius: 16rpx;
  524. border: 3rpx solid #2563EB;
  525. box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.25), 3rpx 3rpx 10rpx rgba(59,130,246,0.25);
  526. transition: var(--clay-transition);
  527. }
  528. .btn-register:active {
  529. box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.1), 1rpx 1rpx 4rpx rgba(59,130,246,0.15);
  530. transform: scale(0.97);
  531. }
  532. /* ========================================
  533. 数据仪表盘 - claymorphism
  534. ======================================== */
  535. .stats-section { margin-bottom: 32rpx; }
  536. .section-header {
  537. display: flex;
  538. justify-content: space-between;
  539. align-items: center;
  540. margin-bottom: 24rpx;
  541. }
  542. .section-title {
  543. font-size: 32rpx;
  544. font-weight: 700;
  545. color: #1E293B;
  546. margin-bottom: 16rpx;
  547. }
  548. .section-subtitle {
  549. font-size: 24rpx;
  550. color: #64748B;
  551. }
  552. .stats-grid {
  553. display: flex;
  554. flex-wrap: wrap;
  555. gap: 16rpx;
  556. }
  557. .stat-card {
  558. width: calc(50% - 8rpx);
  559. background: #FFFFFF;
  560. border-radius: 24rpx;
  561. padding: 24rpx;
  562. box-sizing: border-box;
  563. border: 4rpx solid #BFDBFE;
  564. box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  565. transition: var(--clay-transition);
  566. }
  567. .stat-card:active {
  568. box-shadow: inset 2rpx 2rpx 8rpx rgba(0,0,0,0.04), 3rpx 3rpx 10rpx rgba(59,130,246,0.05);
  569. }
  570. .stat-header {
  571. display: flex;
  572. justify-content: space-between;
  573. align-items: center;
  574. margin-bottom: 14rpx;
  575. }
  576. .stat-icon-bg {
  577. width: 60rpx;
  578. height: 60rpx;
  579. border-radius: 18rpx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: center;
  583. border: 3rpx solid transparent;
  584. box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.04);
  585. }
  586. .stat-icon { font-size: 30rpx; }
  587. .blue-bg { background: rgba(59, 130, 246, 0.18); border-color: #BFDBFE; }
  588. .green-bg { background: rgba(16, 185, 129, 0.18); border-color: #A7F3D0; }
  589. .gold-bg { background: rgba(245, 158, 11, 0.18); border-color: #FDE68A; }
  590. .purple-bg { background: rgba(139, 92, 246, 0.18); border-color: #DDD6FE; }
  591. .stat-trend {
  592. font-size: 22rpx;
  593. color: #64748B;
  594. }
  595. .stat-trend.up { color: #10B981; }
  596. .stat-value {
  597. font-size: 40rpx;
  598. font-weight: 800;
  599. display: block;
  600. }
  601. .stat-label {
  602. font-size: 24rpx;
  603. color: #64748B;
  604. display: block;
  605. margin-top: 4rpx;
  606. }
  607. .stat-blue .stat-value { color: #3B82F6; }
  608. .stat-green .stat-value { color: #10B981; }
  609. .stat-gold .stat-value { color: #F59E0B; }
  610. .stat-purple .stat-value { color: #8B5CF6; }
  611. .stat-chart {
  612. display: flex;
  613. align-items: flex-end;
  614. gap: 6rpx;
  615. height: 48rpx;
  616. margin-top: 14rpx;
  617. }
  618. .mini-bar {
  619. flex: 1;
  620. background: #E2E8F0;
  621. border-radius: 4rpx;
  622. transition: height 0.3s;
  623. }
  624. .mini-bar.bar-active {
  625. background: #3B82F6;
  626. }
  627. .stat-action {
  628. margin-top: 14rpx;
  629. }
  630. .action-text {
  631. font-size: 22rpx;
  632. color: #3B82F6;
  633. font-weight: 500;
  634. }
  635. .stat-goal {
  636. margin-top: 14rpx;
  637. font-size: 20rpx;
  638. color: #F59E0B;
  639. }
  640. /* ========================================
  641. 今日日程
  642. ======================================== */
  643. .schedule-section { margin-bottom: 32rpx; }
  644. .schedule-card {
  645. display: flex;
  646. background: #fff;
  647. border-radius: 20rpx;
  648. padding: 24rpx;
  649. margin-bottom: 12rpx;
  650. border: 4rpx solid #BFDBFE;
  651. box-shadow: var(--clay-shadow-sm);
  652. }
  653. .schedule-time {
  654. font-size: 26rpx;
  655. font-weight: 700;
  656. color: #3B82F6;
  657. min-width: 120rpx;
  658. flex-shrink: 0;
  659. }
  660. .schedule-content { flex: 1; min-width: 0; margin-left: 16rpx; }
  661. .schedule-title { font-size: 28rpx; font-weight: 600; color: #1E293B; display: block; }
  662. .schedule-desc { font-size: 24rpx; color: #64748B; margin-top: 4rpx; display: block; }
  663. /* ========================================
  664. 绑定家庭
  665. ======================================== */
  666. .family-section { margin-bottom: 32rpx; }
  667. .family-scroll { display: flex; flex-direction: row; white-space: nowrap; overflow: hidden; padding: 8rpx 0; }
  668. .family-card {
  669. display: inline-flex; flex-direction: column;
  670. width: 240rpx; min-height: 160rpx;
  671. background: #fff;
  672. border-radius: 20rpx;
  673. padding: 24rpx;
  674. margin-right: 16rpx;
  675. border: 4rpx solid #BFDBFE;
  676. box-shadow: var(--clay-shadow-sm);
  677. flex-shrink: 0;
  678. }
  679. .family-card:active { transform: scale(0.96); }
  680. .family-name { font-size: 28rpx; font-weight: 700; color: #1E293B; display: block; }
  681. .family-child-count { font-size: 22rpx; color: #64748B; margin-top: 6rpx; display: block; }
  682. .family-latest-task { font-size: 22rpx; color: #3B82F6; margin-top: 8rpx; display: block; }
  683. .family-empty {
  684. background: #fff;
  685. border-radius: 20rpx;
  686. padding: 32rpx;
  687. text-align: center;
  688. border: 4rpx solid #BFDBFE;
  689. box-shadow: var(--clay-shadow-sm);
  690. }
  691. .family-empty-text { font-size: 24rpx; color: #94A3B8; }
  692. /* ========================================
  693. 快捷操作 2x2
  694. ======================================== */
  695. .quick-actions-section { margin-bottom: 32rpx; }
  696. .quick-actions-grid { display: flex; flex-wrap: wrap; gap: 16rpx; }
  697. .quick-action-item {
  698. width: calc(50% - 8rpx);
  699. display: flex; flex-direction: column; align-items: center;
  700. background: #fff;
  701. border-radius: 20rpx;
  702. padding: 28rpx;
  703. border: 4rpx solid #BFDBFE;
  704. box-shadow: var(--clay-shadow-sm);
  705. transition: var(--clay-transition);
  706. }
  707. .quick-action-item:active { transform: scale(0.94); box-shadow: var(--clay-shadow-sm); }
  708. .quick-action-icon {
  709. width: 72rpx; height: 72rpx;
  710. border-radius: 20rpx;
  711. display: flex; align-items: center; justify-content: center;
  712. margin-bottom: 12rpx;
  713. border: 3rpx solid transparent;
  714. box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.04);
  715. }
  716. .qa-emoji { font-size: 34rpx; }
  717. .qa-icon--assign { background: rgba(59,130,246,0.2); border-color: #BFDBFE; }
  718. .qa-icon--assessment { background: rgba(16,185,129,0.2); border-color: #A7F3D0; }
  719. .qa-icon--contact { background: rgba(245,158,11,0.2); border-color: #FDE68A; }
  720. .qa-icon--income { background: rgba(139,92,246,0.2); border-color: #DDD6FE; }
  721. .qa-label { font-size: 24rpx; font-weight: 600; color: #475569; }
  722. /* ========================================
  723. 数据趋势 - claymorphism
  724. ======================================== */
  725. .trend-section { margin-bottom: 32rpx; }
  726. .trend-chart {
  727. display: flex;
  728. justify-content: space-between;
  729. align-items: flex-end;
  730. background: #FFFFFF;
  731. border-radius: 24rpx;
  732. padding: 28rpx 24rpx;
  733. height: 220rpx;
  734. border: 4rpx solid #BFDBFE;
  735. box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  736. }
  737. .trend-item {
  738. display: flex;
  739. flex-direction: column;
  740. align-items: center;
  741. flex: 1;
  742. }
  743. .trend-bar {
  744. width: 36rpx;
  745. background: linear-gradient(180deg, #93C5FD, #60A5FA);
  746. border-radius: 8rpx 8rpx 0 0;
  747. margin-bottom: 12rpx;
  748. transition: height 0.3s;
  749. }
  750. .trend-bar.trend-active {
  751. background: linear-gradient(180deg, #3B82F6, #2563EB);
  752. }
  753. .trend-day {
  754. font-size: 22rpx;
  755. color: #64748B;
  756. }
  757. /* ========================================
  758. 功能菜单 - claymorphism
  759. ======================================== */
  760. .menu-section { margin-bottom: 32rpx; }
  761. .menu-grid {
  762. display: flex;
  763. flex-wrap: wrap;
  764. background: #FFFFFF;
  765. border-radius: 24rpx;
  766. padding: 16rpx;
  767. border: 4rpx solid #BFDBFE;
  768. box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  769. }
  770. .menu-item {
  771. width: 33.33%;
  772. display: flex;
  773. flex-direction: column;
  774. align-items: center;
  775. padding: 28rpx 0;
  776. position: relative;
  777. transition: var(--clay-transition);
  778. }
  779. .menu-item:active {
  780. transform: scale(0.93);
  781. }
  782. .menu-icon {
  783. width: 88rpx;
  784. height: 88rpx;
  785. border-radius: 24rpx;
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. font-size: 38rpx;
  790. margin-bottom: 12rpx;
  791. border: 3rpx solid transparent;
  792. box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.04);
  793. transition: var(--clay-transition);
  794. }
  795. .menu-item:active .menu-icon {
  796. box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.06), 1rpx 1rpx 3rpx rgba(0,0,0,0.03);
  797. }
  798. .mi-blue { background: rgba(59, 130, 246, 0.2); border-color: #BFDBFE; }
  799. .mi-gold { background: rgba(245, 158, 11, 0.2); border-color: #FDE68A; }
  800. .mi-purple { background: rgba(139, 92, 246, 0.2); border-color: #DDD6FE; }
  801. .mi-green { background: rgba(16, 185, 129, 0.2); border-color: #A7F3D0; }
  802. .mi-cyan { background: rgba(6, 182, 212, 0.2); border-color: #A5F3FC; }
  803. .mi-gray { background: rgba(100, 116, 139, 0.2); border-color: #CBD5E1; }
  804. .menu-label {
  805. font-size: 24rpx;
  806. color: #475569;
  807. font-weight: 500;
  808. }
  809. .menu-badge {
  810. position: absolute;
  811. top: 16rpx;
  812. right: 28rpx;
  813. background: #3B82F6;
  814. color: #FFFFFF;
  815. font-size: 20rpx;
  816. padding: 4rpx 12rpx;
  817. border-radius: 20rpx;
  818. border: 2rpx solid #60A5FA;
  819. }
  820. .msg-badge {
  821. position: absolute;
  822. top: 16rpx;
  823. right: 28rpx;
  824. background: #EF4444;
  825. color: #FFFFFF;
  826. font-size: 20rpx;
  827. min-width: 32rpx;
  828. text-align: center;
  829. padding: 4rpx 8rpx;
  830. border-radius: 20rpx;
  831. border: 2rpx solid #FCA5A5;
  832. }
  833. /* ========================================
  834. 快捷工具 - claymorphism
  835. ======================================== */
  836. .tools-section { margin-bottom: 48rpx; }
  837. .tools-row {
  838. display: flex;
  839. justify-content: space-between;
  840. background: #FFFFFF;
  841. border-radius: 24rpx;
  842. padding: 28rpx 16rpx;
  843. border: 4rpx solid #BFDBFE;
  844. box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(59,130,246,0.08);
  845. }
  846. .tool-item {
  847. display: flex;
  848. flex-direction: column;
  849. align-items: center;
  850. flex: 1;
  851. transition: var(--clay-transition);
  852. }
  853. .tool-item:active {
  854. transform: scale(0.92);
  855. }
  856. .tool-icon-wrap {
  857. width: 72rpx;
  858. height: 72rpx;
  859. border-radius: 20rpx;
  860. display: flex;
  861. align-items: center;
  862. justify-content: center;
  863. margin-bottom: 10rpx;
  864. border: 3rpx solid transparent;
  865. box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.04);
  866. transition: var(--clay-transition);
  867. }
  868. .tool-item:active .tool-icon-wrap {
  869. box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.06), 1rpx 1rpx 3rpx rgba(0,0,0,0.03);
  870. }
  871. .tool-icon-text { font-size: 34rpx; }
  872. .tool-create { background: rgba(59, 130, 246, 0.2); border-color: #BFDBFE; }
  873. .tool-share { background: rgba(16, 185, 129, 0.2); border-color: #A7F3D0; }
  874. .tool-cal { background: rgba(245, 158, 11, 0.2); border-color: #FDE68A; }
  875. .tool-report { background: rgba(139, 92, 246, 0.2); border-color: #DDD6FE; }
  876. .tool-label {
  877. font-size: 22rpx;
  878. color: #475569;
  879. }
  880. </style>