| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136 |
- <template>
- <view class="container">
- <!-- 加载状态 -->
- <view class="loading-state" v-if="loading">
- <view class="loading-spinner"></view>
- <text class="loading-text">加载中...</text>
- </view>
- <template v-if="!loading">
- <!-- 顶部欢迎区 -->
- <view class="welcome-section">
- <view class="welcome-header">
- <view class="welcome-text">
- <text class="greeting">{{ greetingText }}!</text>
- <text class="sub-greeting">{{ nickname || '家长' }}</text>
- </view>
- <view class="sun-icon">☀️</view>
- </view>
- <!-- 孩子卡片 -->
- <view class="children-row" v-if="children.length > 0">
- <scroll-view
- class="children-scroll"
- scroll-x
- :scroll-with-animation="true"
- :enhanced="true"
- :show-scrollbar="false"
- >
- <view
- v-for="child in children"
- :key="child.id"
- class="child-card"
- :class="{ 'child-card-single': children.length === 1 }"
- @click="goToChildDetail(child)"
- >
- <view class="child-avatar" :class="'child-avatar-color-' + (child.id % 6)">
- <text class="child-avatar-text">{{ child.nickname ? child.nickname[0] : '?' }}</text>
- </view>
- <view class="child-card-body">
- <text class="child-card-name">{{ child.nickname }}</text>
- <view class="child-card-stats">
- <text class="child-card-points">⭐ {{ child.totalPoints || 0 }}</text>
- <text class="child-card-dan" v-if="child.danLevel">DAN: {{ child.danLevel }}</text>
- </view>
- <view class="child-card-badges">
- <text class="badge badge-review" v-if="child.pendingReviewCount > 0">待审 {{ child.pendingReviewCount }}</text>
- <text class="badge badge-wish" v-if="child.pendingWishCount > 0">心愿 {{ child.pendingWishCount }}</text>
- </view>
- </view>
- <view class="child-card-arrow">›</view>
- </view>
- </scroll-view>
- <view class="scroll-hint" v-if="children.length > 1">
- <text class="scroll-hint-text">← 左右滑动查看更多 →</text>
- </view>
- </view>
- <view class="empty-children-card" v-else @click="goToAddChild">
- <view class="empty-children-icon">👶</view>
- <view class="empty-children-text">
- <text class="empty-children-title">还没有添加孩子</text>
- <text class="empty-children-hint">点击添加孩子,开始成长之旅</text>
- </view>
- <view class="empty-children-arrow">›</view>
- </view>
- </view>
- <!-- 成长数据 -->
- <view class="stats-section">
- <view class="section-title">成长数据</view>
- <view class="stats-grid">
- <view class="stat-card" @click="goToCompletionStats">
- <view class="stat-icon-wrap stat-icon-orange">
- <text class="stat-icon-symbol">📋</text>
- </view>
- <view class="stat-body">
- <text class="stat-value accent-color">{{ taskCompletionRate }}%</text>
- <text class="stat-label">任务完成</text>
- </view>
- <view class="stat-progress">
- <view class="progress-bar">
- <view class="progress-fill" :style="{ width: taskCompletionRate + '%' }"></view>
- </view>
- </view>
- <text class="stat-more">查看分析 ›</text>
- </view>
- <view class="stat-card">
- <view class="stat-icon-wrap stat-icon-gold">
- <text class="stat-icon-symbol">⭐</text>
- </view>
- <view class="stat-body">
- <text class="stat-value gold-color">{{ (selectedChild && selectedChild.totalPoints) || 0 }}</text>
- <text class="stat-label">成长积分</text>
- </view>
- <view class="stat-encourage">太棒了!</view>
- </view>
- <view class="stat-card">
- <view class="stat-icon-wrap stat-icon-red">
- <text class="stat-icon-symbol">🔥</text>
- </view>
- <view class="stat-body">
- <text class="stat-value red-color">{{ (selectedChild && selectedChild.streakDays) || 0 }}</text>
- <text class="stat-label">连续天数</text>
- </view>
- <view class="stat-encourage" v-if="selectedChild && selectedChild.streakDays > 0">加油保持!</view>
- <view class="stat-encourage muted" v-else>开始坚持吧</view>
- </view>
- <view class="stat-card">
- <view class="stat-icon-wrap stat-icon-teal">
- <text class="stat-icon-symbol">✨</text>
- </view>
- <view class="stat-body">
- <text class="stat-value teal-color">{{ habitCount }}</text>
- <text class="stat-label">习惯打卡</text>
- </view>
- <view class="stat-encourage">坚持就是胜利</view>
- </view>
- </view>
- </view>
- <!-- 今日重点 -->
- <view class="today-section">
- <view class="section-title">今日重点</view>
- <view class="today-card">
- <view class="today-header">
- <text class="today-label">今日待完成</text>
- <text class="today-count">{{ pendingTasks.length }}项任务</text>
- </view>
- <view class="task-list" v-if="pendingTasks.length > 0">
- <view class="task-item" v-for="task in pendingTasks.slice(0, 3)" :key="task.id">
- <view class="task-dot" :class="'dot-color-' + (task.id % 5)"></view>
- <text class="task-title">{{ task.title }}</text>
- </view>
- </view>
- <view class="empty-state" v-else>
- <text class="empty-icon">🎉</text>
- <text class="empty-text">今日任务已完成,太棒了!</text>
- </view>
- <view class="view-all" @click="goToTaskList">
- <text>查看全部</text>
- <text class="arrow">→</text>
- </view>
- </view>
- </view>
- <!-- 成长里程碑 -->
- <view class="milestone-section">
- <view class="section-title">成长里程碑</view>
- <view class="milestone-list">
- <view class="milestone-item" v-if="selectedChild && selectedChild.streakDays >= 7">
- <view class="milestone-icon-wrap milestone-star">
- <text class="milestone-icon">🌟</text>
- </view>
- <text class="milestone-text">连续7天打卡</text>
- </view>
- <view class="milestone-item" v-if="selectedChild && selectedChild.streakDays >= 30">
- <view class="milestone-icon-wrap milestone-trophy">
- <text class="milestone-icon">🏆</text>
- </view>
- <text class="milestone-text">坚持一个月啦!</text>
- </view>
- <view class="milestone-item" v-if="(selectedChild && selectedChild.totalPoints) >= 1000">
- <view class="milestone-icon-wrap milestone-sparkle">
- <text class="milestone-icon">💫</text>
- </view>
- <text class="milestone-text">积分突破1000</text>
- </view>
- <view class="milestone-empty" v-if="!hasMilestones">
- <text class="milestone-empty-icon">🌱</text>
- <text class="milestone-empty-text">开始养成好习惯,见证成长</text>
- </view>
- </view>
- </view>
- <!-- 待审核任务 -->
- <view class="review-section" v-if="pendingReviewTasks.length > 0">
- <view class="section-title">待审核任务</view>
- <view class="review-list">
- <view class="review-item" v-for="task in pendingReviewTasks" :key="task.id">
- <view class="review-info">
- <text class="task-name">{{ task.title }}</text>
- <text class="task-child" v-if="task.childName">提供者: {{ task.childName }}</text>
- </view>
- <view class="review-actions">
- <button class="btn-pass" @click="approveTask(task.id)">通过</button>
- <button class="btn-reject" @click="rejectTask(task.id)">拒绝</button>
- </view>
- </view>
- </view>
- </view>
- <!-- 快捷操作 -->
- <view class="quick-section">
- <view class="section-title">快捷操作</view>
- <view class="quick-actions">
- <view class="action-item" @click="addTask">
- <view class="action-icon act-add">
- <text class="action-icon-text">➕</text>
- </view>
- <text class="action-label">添加任务</text>
- </view>
- <view class="action-item" @click="goToReview">
- <view class="action-icon act-review">
- <text class="action-icon-text">📋</text>
- </view>
- <text class="action-label">审核任务</text>
- </view>
- <view class="action-item" @click="manageChildren">
- <view class="action-icon act-child">
- <text class="action-icon-text">👨👩👧</text>
- </view>
- <text class="action-label">孩子管理</text>
- </view>
- <view class="action-item" @click="goToRewards">
- <view class="action-icon act-reward">
- <text class="action-icon-text">🎁</text>
- </view>
- <text class="action-label">奖励中心</text>
- </view>
- <view class="action-item" @click="inviteFriend">
- <view class="action-icon act-invite">
- <text class="action-icon-text">📤</text>
- </view>
- <text class="action-label">邀请家人</text>
- </view>
- </view>
- </view>
- </template>
- </view>
- </template>
- <script>
- import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard } from '../../utils/api.js'
- export default {
- data() {
- return {
- nickname: '',
- familyMembers: [],
- children: [],
- selectedChild: null,
- pendingReviewTasks: [],
- pendingReviewWishes: [],
- pendingTasks: [],
- taskCompletionRate: 0,
- habitCount: 0,
- loading: true,
- currentChildId: '',
- _initialLoadDone: false,
- _familyId: null
- }
- },
- computed: {
- greetingText() {
- const hour = new Date().getHours()
- if (hour < 6) return '夜深了'
- if (hour < 9) return '早上好'
- if (hour < 12) return '上午好'
- if (hour < 14) return '中午好'
- if (hour < 18) return '下午好'
- if (hour < 22) return '晚上好'
- return '夜深了'
- },
- hasMilestones() {
- const c = this.selectedChild
- if (!c) return false
- return (c.streakDays >= 7) || (c.streakDays >= 30) || (c.totalPoints >= 1000)
- }
- },
- // 使用 mounted 而非 onLoad,因为本组件作为条件渲染子组件(v-if),
- // page 生命周期钩子(onLoad/onShow)可能在组件挂载前已触发完毕
- mounted() {
- if (!uni.getStorageSync('token')) {
- uni.reLaunch({ url: '/pages/login/login' })
- return
- }
- this.loadData()
- },
- onShow() {
- // 首次 onShow 紧接 mounted 之后,跳过避免双重加载
- if (!this._initialLoadDone) {
- this._initialLoadDone = true
- return
- }
- const currentRole = uni.getStorageSync('currentRole') || 'parent'
- if (currentRole === 'child') {
- uni.reLaunch({ url: '/pages/index/child-index' })
- return
- }
- if (uni.getStorageSync('token')) {
- this.loadData()
- }
- },
- methods: {
- async loadData() {
- this.loading = true
- try {
- const userInfo = uni.getStorageSync('userInfo')
- this.nickname = (userInfo && userInfo.nickname) ? userInfo.nickname : ''
- // 优先使用仪表盘接口(包含孩子列表 + 统计数据)
- let dashboardLoaded = false
- try {
- const dashRes = await getParentDashboard()
- const dashData = dashRes.data || {}
- const dashChildren = dashData.children || []
- if (dashChildren.length > 0) {
- this.children = dashChildren
- this.selectedChild = dashChildren[0]
- this.taskCompletionRate = dashData.avgCompletionRate || 0
- this.habitCount = dashData.totalHabitCount || 0
- // 从仪表盘获取 familyId
- if (dashData.familyId) {
- this._familyId = dashData.familyId
- }
- dashboardLoaded = true
- }
- } catch (e) {
- console.log('获取仪表盘数据失败,降级到单独接口', e)
- }
- // 降级:使用原有单独接口
- if (!dashboardLoaded) {
- try {
- const currentUserId = uni.getStorageSync('userId')
- const membersRes = await getFamilyMembers()
- const data = membersRes.data || {}
- const parents = (data.parents || []).filter(function(p) { return p && p.id && p.id !== currentUserId }).map(function(p) { return { ...p, role: 'parent' } })
- const children = (data.children || []).filter(function(c) { return c && c.id }).map(function(c) { return { ...c, role: 'child' } })
- this.familyMembers = [].concat(parents, children)
- if (children.length > 0) {
- this.selectedChild = children[0]
- }
- // 保存 familyId 用于后续请求
- if (data.familyId) {
- this._familyId = data.familyId
- }
- } catch (e) {
- console.log('获取家庭成员失败', e)
- }
- if (this.children.length === 0) {
- const childrenRes = await getChildren()
- const rawChildren = childrenRes.data || []
- this.children = rawChildren
- if (this.children.length > 0 && !this.selectedChild) {
- this.selectedChild = this.children[0]
- }
- }
- }
- const reviewRes = await getPendingReviewTasks()
- const allReviewTasks = reviewRes.data || []
- this.pendingReviewTasks = allReviewTasks.slice(0, 3)
- try {
- const wishRes = await getPendingWishes(this._familyId)
- this.pendingReviewWishes = wishRes.data || []
- } catch (e) {
- console.log('获取待处理心愿失败', e)
- this.pendingReviewWishes = []
- }
- const reviewMap = {}
- const wishMap = {}
- for (let i = 0; i < allReviewTasks.length; i++) {
- const task = allReviewTasks[i]
- const cid = task.childId || task.assigneeId
- if (cid) {
- reviewMap[cid] = (reviewMap[cid] || 0) + 1
- }
- }
- for (let j = 0; j < (this.pendingReviewWishes || []).length; j++) {
- const wish = this.pendingReviewWishes[j]
- const cid = wish.childId
- if (cid) {
- wishMap[cid] = (wishMap[cid] || 0) + 1
- }
- }
- this.children = this.children.map(function(c) {
- return {
- ...c,
- pendingReviewCount: reviewMap[c.id] || 0,
- pendingWishCount: wishMap[c.id] || 0
- }
- })
- // 如果仪表盘未加载到数据,降级到单独统计接口
- if (!dashboardLoaded && this.children.length > 0) {
- const targetChild = this.selectedChild || this.children[0]
- try {
- const statsRes = await getChildCompletionStats({ childId: targetChild.id })
- if (statsRes && statsRes.data) {
- this.taskCompletionRate = statsRes.data.completionRate || 0
- this.habitCount = statsRes.data.completedTasks || 0
- }
- } catch (e) {
- console.log('获取完成率失败', e)
- this.taskCompletionRate = 0
- }
- }
- // 待完成任务 - 使用真实统计中的pendingTasks
- this.pendingTasks = []
- if (this.children.length > 0) {
- const targetChild = this.selectedChild || this.children[0]
- try {
- const r2 = await getChildCompletionStats({ childId: targetChild.id })
- if (r2 && r2.data && r2.data.pendingTasks > 0) {
- for (let k = 0; k < Math.min(r2.data.pendingTasks, 3); k++) {
- this.pendingTasks.push({ id: 100 + k, title: '待完成任务 ' + (k + 1) })
- }
- }
- } catch (e) {
- this.pendingTasks = []
- }
- }
- } catch (e) {
- console.error('加载数据失败', e)
- } finally {
- this.loading = false
- }
- },
- async approveTask(taskId) {
- try {
- await approveTask(taskId)
- uni.showToast({ title: '已通过', icon: 'success' })
- this.loadData()
- } catch (e) {
- uni.showToast({ title: '操作失败', icon: 'none' })
- }
- },
- async rejectTask(taskId) {
- try {
- await rejectTask(taskId)
- uni.showToast({ title: '已拒绝', icon: 'success' })
- this.loadData()
- } catch (e) {
- uni.showToast({ title: '操作失败', icon: 'none' })
- }
- },
- goToCompletionStats() {
- if (this.children.length === 1) {
- uni.navigateTo({ url: '/pages/stats/completion-rate?childId=' + this.children[0].id })
- } else {
- uni.navigateTo({ url: '/pages/stats/completion-rate?familyView=1' })
- }
- },
- goToChildDetail(child) {
- uni.navigateTo({ url: '/pages/parent/child-detail?childId=' + child.id + '&childName=' + encodeURIComponent(child.nickname || '') })
- },
- addTask() { uni.navigateTo({ url: '/pages/tasks/create-task' }) },
- goToReview() { uni.navigateTo({ url: '/pages/tasks/review' }) },
- goToRewards() { uni.switchTab({ url: '/pages/rewards/rewards' }) },
- goToTaskList() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
- manageChildren() { uni.navigateTo({ url: '/pages/profile/children' }) },
- inviteFriend() { uni.navigateTo({ url: '/pages/parent/invite/index' }) },
- goToAddChild() { uni.navigateTo({ url: '/pages/profile/create-child' }) }
- }
- }
- </script>
- <style scoped>
- /* ========================================
- Claymorphism Design System - 暖色琥珀黏土
- ======================================== */
- :root {
- --clay-br: 20rpx;
- --clay-br-lg: 26rpx;
- --clay-bw: 4rpx;
- --clay-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.10);
- --clay-shadow-sm: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.4), 4rpx 4rpx 10rpx rgba(255,140,66,0.08);
- --clay-transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
- }
- .container {
- padding: 32rpx;
- background: #FFF5EB;
- min-height: 100vh;
- }
- /* ========================================
- 加载状态
- ======================================== */
- .loading-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 200rpx 0;
- }
- .loading-spinner {
- width: 64rpx;
- height: 64rpx;
- border: 8rpx solid #FFE0CC;
- border-top-color: #FF8C42;
- border-radius: 50%;
- animation: spin 0.8s linear infinite;
- box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.4), 2rpx 2rpx 6rpx rgba(255,140,66,0.08);
- }
- @keyframes spin {
- to { transform: rotate(360deg); }
- }
- .loading-text {
- font-size: 26rpx;
- color: #B2BEC3;
- margin-top: 20rpx;
- }
- /* ========================================
- 顶部欢迎区
- ======================================== */
- .welcome-section {
- margin-bottom: 48rpx;
- }
- .welcome-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 24rpx;
- }
- .greeting {
- font-size: 40rpx;
- font-weight: 700;
- color: #2D3436;
- display: block;
- line-height: 1.2;
- }
- .sub-greeting {
- font-size: 28rpx;
- color: #636E72;
- display: block;
- margin-top: 8rpx;
- }
- .sun-icon {
- font-size: 64rpx;
- }
- /* ========================================
- 孩子卡片 - claymorphism
- ======================================== */
- .children-row {
- margin-top: 24rpx;
- }
- .children-scroll {
- display: flex;
- flex-direction: row;
- white-space: nowrap;
- overflow: hidden;
- }
- .child-card {
- display: inline-flex;
- align-items: center;
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 24rpx;
- margin-right: 20rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.10);
- min-width: 440rpx;
- width: auto;
- position: relative;
- transition: var(--clay-transition);
- }
- .child-card:active {
- box-shadow: inset 2rpx 2rpx 8rpx rgba(0,0,0,0.06), 3rpx 3rpx 10rpx rgba(255,140,66,0.08);
- transform: scale(0.98);
- }
- .child-card-single {
- width: 100%;
- margin-right: 0;
- }
- .child-avatar {
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- }
- .child-avatar-color-0 { background: linear-gradient(135deg, #FF8C42, #FF7A2E); }
- .child-avatar-color-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
- .child-avatar-color-2 { background: linear-gradient(135deg, #4ECDC4, #44B09E); }
- .child-avatar-color-3 { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
- .child-avatar-color-4 { background: linear-gradient(135deg, #A8E063, #56AB2F); }
- .child-avatar-color-5 { background: linear-gradient(135deg, #F093FB, #F5576C); }
- .child-avatar-text {
- color: #FFFFFF;
- font-size: 36rpx;
- font-weight: 600;
- }
- .child-card-body {
- flex: 1;
- margin-left: 16rpx;
- min-width: 0;
- }
- .child-card-name {
- font-size: 30rpx;
- font-weight: 600;
- color: #2D3436;
- display: block;
- line-height: 1.3;
- }
- .child-card-stats {
- display: flex;
- align-items: center;
- margin-top: 6rpx;
- gap: 16rpx;
- }
- .child-card-points {
- font-size: 24rpx;
- color: #FF8C42;
- font-weight: 600;
- }
- .child-card-dan {
- font-size: 22rpx;
- color: #667eea;
- font-weight: 500;
- }
- .child-card-badges {
- display: flex;
- gap: 8rpx;
- margin-top: 8rpx;
- flex-wrap: wrap;
- }
- .badge {
- font-size: 20rpx;
- padding: 4rpx 14rpx;
- border-radius: 20rpx;
- font-weight: 500;
- border: 2rpx solid transparent;
- }
- .badge-review { background: #FFF5EB; color: #FF8C42; border-color: #FED7AA; }
- .badge-wish { background: #FFF0F0; color: #FF6B6B; border-color: #FECACA; }
- .child-card-arrow {
- font-size: 36rpx;
- color: #D5D5D5;
- margin-left: 8rpx;
- flex-shrink: 0;
- }
- .scroll-hint {
- text-align: center;
- margin-top: 12rpx;
- }
- .scroll-hint-text {
- font-size: 22rpx;
- color: #B2BEC3;
- }
- .empty-children-card {
- display: flex;
- align-items: center;
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 28rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.10);
- margin-top: 24rpx;
- transition: var(--clay-transition);
- }
- .empty-children-card:active {
- box-shadow: inset 2rpx 2rpx 8rpx rgba(0,0,0,0.06), 3rpx 3rpx 10rpx rgba(255,140,66,0.08);
- transform: scale(0.98);
- }
- .empty-children-icon { font-size: 56rpx; margin-right: 16rpx; }
- .empty-children-text { flex: 1; }
- .empty-children-title { font-size: 28rpx; font-weight: 600; color: #2D3436; display: block; }
- .empty-children-hint { font-size: 24rpx; color: #B2BEC3; margin-top: 6rpx; display: block; }
- .empty-children-arrow { font-size: 36rpx; color: #D5D5D5; }
- /* ========================================
- 区块标题
- ======================================== */
- .section-title {
- font-size: 32rpx;
- font-weight: 700;
- color: #2D3436;
- margin-bottom: 24rpx;
- }
- /* ========================================
- 成长数据 - claymorphism
- ======================================== */
- .stats-section {
- margin-bottom: 48rpx;
- }
- .stats-grid {
- display: flex;
- flex-wrap: wrap;
- gap: 16rpx;
- }
- .stat-card {
- width: calc(50% - 8rpx);
- background: #FFFFFF;
- border-radius: 24rpx;
- padding: 24rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.08);
- box-sizing: border-box;
- transition: var(--clay-transition);
- }
- .stat-card:active {
- box-shadow: inset 2rpx 2rpx 8rpx rgba(0,0,0,0.04), 3rpx 3rpx 10rpx rgba(255,140,66,0.06);
- }
- .stat-icon-wrap {
- width: 64rpx;
- height: 64rpx;
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 14rpx;
- border: 3rpx solid transparent;
- box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.05);
- }
- .stat-icon-symbol {
- font-size: 32rpx;
- }
- .stat-icon-orange { background: rgba(255, 140, 66, 0.2); border-color: #FED7AA; }
- .stat-icon-gold { background: rgba(255, 217, 61, 0.25); border-color: #FDE68A; }
- .stat-icon-red { background: rgba(255, 107, 107, 0.2); border-color: #FECACA; }
- .stat-icon-teal { background: rgba(78, 205, 196, 0.2); border-color: #A7F3D0; }
- .stat-body {
- margin-bottom: 8rpx;
- }
- .stat-value {
- font-size: 40rpx;
- font-weight: 800;
- display: block;
- line-height: 1.1;
- }
- .stat-label {
- font-size: 22rpx;
- color: #636E72;
- display: block;
- margin-top: 4rpx;
- }
- .accent-color { color: #FF8C42; }
- .gold-color { color: #F59E0B; }
- .red-color { color: #FF6B6B; }
- .teal-color { color: #4ECDC4; }
- .stat-progress {
- margin-top: 8rpx;
- }
- .progress-bar {
- height: 8rpx;
- background: #FFF5EB;
- border-radius: 999rpx;
- overflow: hidden;
- }
- .progress-fill {
- height: 100%;
- background: linear-gradient(90deg, #FF8C42, #FFD93D);
- border-radius: 999rpx;
- transition: width 0.3s ease;
- }
- .stat-more {
- font-size: 20rpx;
- color: #4ECDC4;
- margin-top: 10rpx;
- font-weight: 500;
- display: block;
- }
- .stat-encourage {
- font-size: 20rpx;
- color: #4ECDC4;
- margin-top: 10rpx;
- font-weight: 500;
- }
- .stat-encourage.muted {
- color: #B2BEC3;
- }
- /* ========================================
- 今日重点 - claymorphism
- ======================================== */
- .today-section {
- margin-bottom: 48rpx;
- }
- .today-card {
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 28rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.08);
- }
- .today-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .today-label {
- font-size: 28rpx;
- font-weight: 600;
- color: #2D3436;
- }
- .today-count {
- font-size: 24rpx;
- color: #FF8C42;
- font-weight: 600;
- }
- .task-list {
- margin-bottom: 16rpx;
- }
- .task-item {
- display: flex;
- align-items: center;
- padding: 18rpx 0;
- border-bottom: 1rpx solid #F0E8DE;
- }
- .task-item:last-child {
- border-bottom: none;
- }
- .task-dot {
- width: 14rpx;
- height: 14rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- flex-shrink: 0;
- border: 2rpx solid transparent;
- }
- .dot-color-0 { background: #FF8C42; border-color: #FED7AA; }
- .dot-color-1 { background: #4ECDC4; border-color: #A7F3D0; }
- .dot-color-2 { background: #667eea; border-color: #C7D2FE; }
- .dot-color-3 { background: #F59E0B; border-color: #FDE68A; }
- .dot-color-4 { background: #FF6B6B; border-color: #FECACA; }
- .task-title {
- font-size: 28rpx;
- color: #2D3436;
- }
- .empty-state {
- display: flex;
- align-items: center;
- padding: 24rpx 0;
- }
- .empty-icon {
- font-size: 40rpx;
- margin-right: 16rpx;
- }
- .empty-text {
- font-size: 28rpx;
- color: #4ECDC4;
- }
- .view-all {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- color: #636E72;
- font-size: 24rpx;
- padding-top: 16rpx;
- border-top: 1rpx solid #F0E8DE;
- }
- .view-all .arrow {
- margin-left: 8rpx;
- }
- /* ========================================
- 里程碑 - claymorphism
- ======================================== */
- .milestone-section {
- margin-bottom: 48rpx;
- }
- .milestone-list {
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 24rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.08);
- }
- .milestone-item {
- display: flex;
- align-items: center;
- padding: 18rpx 0;
- border-bottom: 1rpx solid #F0E8DE;
- }
- .milestone-item:last-child {
- border-bottom: none;
- }
- .milestone-icon-wrap {
- width: 56rpx;
- height: 56rpx;
- border-radius: 18rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- flex-shrink: 0;
- border: 3rpx solid transparent;
- box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.3), 3rpx 3rpx 8rpx rgba(0,0,0,0.04);
- }
- .milestone-icon {
- font-size: 28rpx;
- }
- .milestone-star { background: rgba(255, 215, 0, 0.25); border-color: #FDE68A; }
- .milestone-trophy { background: rgba(255, 140, 66, 0.2); border-color: #FED7AA; }
- .milestone-sparkle { background: rgba(78, 205, 196, 0.2); border-color: #A7F3D0; }
- .milestone-text {
- font-size: 28rpx;
- color: #2D3436;
- }
- .milestone-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 36rpx;
- }
- .milestone-empty-icon {
- font-size: 64rpx;
- margin-bottom: 16rpx;
- }
- .milestone-empty-text {
- font-size: 28rpx;
- color: #B2BEC3;
- text-align: center;
- }
- /* ========================================
- 待审核
- ======================================== */
- .review-section {
- margin-bottom: 48rpx;
- }
- .review-list {
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 8rpx 24rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.08);
- }
- .review-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 22rpx 0;
- border-bottom: 1rpx solid #F0E8DE;
- }
- .review-item:last-child {
- border-bottom: none;
- }
- .review-info {
- flex: 1;
- }
- .review-info .task-name {
- font-size: 28rpx;
- color: #2D3436;
- display: block;
- margin-bottom: 6rpx;
- }
- .review-info .task-child {
- font-size: 24rpx;
- color: #B2BEC3;
- }
- .review-actions {
- display: flex;
- gap: 16rpx;
- flex-shrink: 0;
- }
- .review-actions .btn-pass,
- .review-actions .btn-reject {
- font-size: 24rpx;
- padding: 12rpx 24rpx;
- border-radius: 14rpx;
- margin: 0;
- border: 3rpx solid transparent;
- }
- .btn-pass {
- background: #00B894;
- color: #FFFFFF;
- border-color: #059669;
- box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.3), 3rpx 3rpx 8rpx rgba(0,184,148,0.2);
- transition: var(--clay-transition);
- }
- .btn-pass:active {
- box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.1), 1rpx 1rpx 4rpx rgba(0,184,148,0.1);
- transform: scale(0.96);
- }
- .btn-reject {
- background: #FF6B6B;
- color: #FFFFFF;
- border-color: #E05555;
- box-shadow: inset -2rpx -2rpx 6rpx rgba(255,255,255,0.3), 3rpx 3rpx 8rpx rgba(255,107,107,0.2);
- transition: var(--clay-transition);
- }
- .btn-reject:active {
- box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.1), 1rpx 1rpx 4rpx rgba(255,107,107,0.1);
- transform: scale(0.96);
- }
- /* ========================================
- 快捷操作 - claymorphism
- ======================================== */
- .quick-section {
- margin-bottom: 48rpx;
- }
- .quick-actions {
- display: flex;
- flex-wrap: wrap;
- background: #FFFFFF;
- border-radius: 26rpx;
- padding: 24rpx 12rpx;
- border: 4rpx solid #FFE0CC;
- box-shadow: inset -3rpx -3rpx 8rpx rgba(255,255,255,0.5), 6rpx 6rpx 18rpx rgba(255,140,66,0.08);
- }
- .action-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 33.33%;
- margin-bottom: 20rpx;
- transition: var(--clay-transition);
- }
- .action-item:active {
- transform: scale(0.92);
- }
- .action-item:nth-last-child(-n+2) {
- margin-bottom: 0;
- }
- .action-icon {
- width: 88rpx;
- height: 88rpx;
- border-radius: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 12rpx;
- border: 3rpx solid transparent;
- box-shadow: inset -2rpx -2rpx 5rpx rgba(255,255,255,0.4), 3rpx 3rpx 8rpx rgba(0,0,0,0.05);
- transition: var(--clay-transition);
- }
- .action-item:active .action-icon {
- box-shadow: inset 2rpx 2rpx 6rpx rgba(0,0,0,0.08), 1rpx 1rpx 3rpx rgba(0,0,0,0.04);
- }
- .action-icon-text {
- font-size: 36rpx;
- }
- .act-add { background: rgba(255, 140, 66, 0.25); border-color: #FED7AA; }
- .act-review { background: rgba(78, 205, 196, 0.2); border-color: #A7F3D0; }
- .act-child { background: rgba(116, 185, 255, 0.2); border-color: #BFDBFE; }
- .act-reward { background: rgba(255, 217, 61, 0.3); border-color: #FDE68A; }
- .act-invite { background: rgba(0, 184, 148, 0.2); border-color: #A7F3D0; }
- .action-label {
- font-size: 24rpx;
- color: #636E72;
- font-weight: 500;
- }
- </style>
|