|
|
@@ -1,139 +1,519 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
+ <!-- ===== 未登录状态 ===== -->
|
|
|
+ <view v-if="!isLoggedIn" class="login-prompt">
|
|
|
+ <view class="prompt-icon">👤</view>
|
|
|
+ <text class="prompt-title">登录浠艾福</text>
|
|
|
+ <text class="prompt-desc">登录后可查看个人资料、积分记录等</text>
|
|
|
+ <button class="login-btn" @click="goLogin">登录 / 注册</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- ===== 已登录状态 ===== -->
|
|
|
+ <template v-else>
|
|
|
+ <!-- 品牌头部 -->
|
|
|
<PageBanner theme="wealth"
|
|
|
- tagline="财商培养 · 富足人生"
|
|
|
- quote="君子爱财,取之有道" />
|
|
|
+ tagline="财富管理 · 价值创造"
|
|
|
+ quote="富足源于利他与坚持" />
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('today_tasks') && isLoggedIn">
|
|
|
+ <!-- 退出切换按钮(仅家长切换到孩子状态时显示) -->
|
|
|
+ <view class="exit-switch" v-if="isSwitchedChild" @click="exitSwitch">
|
|
|
+ <text>🔄 退出切换</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="user-card">
|
|
|
+ <view class="avatar">👤</view>
|
|
|
+ <view class="user-info">
|
|
|
+ <view class="nickname">{{ nickname || '未设置昵称' }}</view>
|
|
|
+ <view class="role">{{ role === 'parent' ? '家长模式' : (role === 'child' ? '孩子模式' : '成长规划师模式') }}</view>
|
|
|
+ <view class="system-points" v-if="role === 'parent' && children.length > 0">🏅 系统积分: {{ children[0].systemPoints || 0 }}</view>
|
|
|
+ </view>
|
|
|
+ <!-- 切换按钮仅在非切换状态下显示 -->
|
|
|
+ <button class="btn-switch" v-if="!isSwitchedChild" @click="switchMode">切换</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 行动数据 -->
|
|
|
+ <view class="section">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">📋 我的任务</text>
|
|
|
- <text class="section-more" @click="goTasks">全部 ›</text>
|
|
|
+ <text class="section-title">🎯 行动数据</text>
|
|
|
</view>
|
|
|
- <view class="task-wrap" v-if="todayTasks.length > 0">
|
|
|
- <view class="task-item" v-for="task in todayTasks" :key="task.id">
|
|
|
- <text class="task-name">{{ task.title }}</text>
|
|
|
- <text class="task-points">+{{ task.points || 0 }}分</text>
|
|
|
+ <view class="wealth-card">
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ actionData.taskCount }}</text>
|
|
|
+ <text class="wealth-label">完成任务</text>
|
|
|
+ </view>
|
|
|
+ <view class="wealth-divider"></view>
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ actionData.purchaseCount }}</text>
|
|
|
+ <text class="wealth-label">购买商品</text>
|
|
|
+ </view>
|
|
|
+ <view class="wealth-divider"></view>
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ actionData.activityCount }}</text>
|
|
|
+ <text class="wealth-label">参加活动</text>
|
|
|
+ </view>
|
|
|
+ <view class="wealth-divider"></view>
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ actionData.courseCount }}</text>
|
|
|
+ <text class="wealth-label">学习课程</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="task-empty" v-else>
|
|
|
- <text class="task-empty-text">今日暂无任务</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="func-section" v-if="sectionVisible('func_entries')">
|
|
|
- <view class="func-grid">
|
|
|
- <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
|
|
|
- <view class="func-icon-wrap">
|
|
|
- <text class="func-icon">{{ item.icon }}</text>
|
|
|
- </view>
|
|
|
- <text class="func-label">{{ item.label }}</text>
|
|
|
+ <!-- 财富数据(推广收益) -->
|
|
|
+ <view class="section">
|
|
|
+ <view class="section-header">
|
|
|
+ <text class="section-title">💰 财富数据</text>
|
|
|
+ <text class="section-more" @click="goToPromotion">全部 ›</text>
|
|
|
+ </view>
|
|
|
+ <view class="wealth-card">
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ formatPriceWithSymbol(wealthData.totalEarnings) }}</text>
|
|
|
+ <text class="wealth-label">累计收益</text>
|
|
|
+ </view>
|
|
|
+ <view class="wealth-divider"></view>
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ formatPriceWithSymbol(wealthData.availableAmount) }}</text>
|
|
|
+ <text class="wealth-label">可提现</text>
|
|
|
</view>
|
|
|
+ <view class="wealth-divider"></view>
|
|
|
+ <view class="wealth-item">
|
|
|
+ <text class="wealth-value">{{ wealthData.referralCount }}</text>
|
|
|
+ <text class="wealth-label">邀请人数</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="referral-code-bar" @click="copyReferralCode" v-if="wealthData.referralCode">
|
|
|
+ <text class="referral-code-label">邀请码</text>
|
|
|
+ <text class="referral-code-value">{{ wealthData.referralCode }}</text>
|
|
|
+ <text class="referral-code-copy">复制</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('hot_activities')">
|
|
|
+ <!-- 成就徽章 -->
|
|
|
+ <view class="section">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">🔥 热门活动</text>
|
|
|
- <text class="section-more" @click="goMoreActivities">更多 ›</text>
|
|
|
+ <text class="section-title">🏅 成就徽章</text>
|
|
|
+ <text class="section-more" @click="goAllBadges">全部 ›</text>
|
|
|
</view>
|
|
|
- <scroll-view scroll-x class="activity-scroll" show-scrollbar="false">
|
|
|
- <view class="activity-card" v-for="act in hotActivities" :key="act.id" @click="goActivityDetail(act.id)">
|
|
|
- <image class="activity-img" :src="act.image || '/static/default-activity.png'" mode="aspectFill" />
|
|
|
- <view class="activity-info">
|
|
|
- <text class="activity-name">{{ act.name }}</text>
|
|
|
- <text class="activity-meta">{{ act.date }} · {{ act.location }}</text>
|
|
|
+ <view class="badge-grid">
|
|
|
+ <view class="badge-item" v-for="badge in badges" :key="badge.id">
|
|
|
+ <view :class="['badge-icon-wrap', badge.unlocked ? 'unlocked' : 'locked']">
|
|
|
+ <text class="badge-icon">{{ badge.icon }}</text>
|
|
|
</view>
|
|
|
+ <text class="badge-name">{{ badge.name }}</text>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('recommended_products')">
|
|
|
+ <!-- 成长报告 -->
|
|
|
+ <view class="section">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">🛍️ 推荐商品</text>
|
|
|
- <text class="section-more" @click="goMoreProducts">更多 ›</text>
|
|
|
+ <text class="section-title">📈 成长报告</text>
|
|
|
+ <text class="section-more" @click="goGrowthReport">查看 ›</text>
|
|
|
</view>
|
|
|
- <view class="product-list">
|
|
|
- <view class="product-card" v-for="prod in recommendedProducts" :key="prod.id" @click="goProductDetail(prod.id)">
|
|
|
- <image class="product-img" :src="prod.image || '/static/default-product.png'" mode="aspectFill" />
|
|
|
- <text class="product-name line-clamp-2">{{ prod.name }}</text>
|
|
|
- <text class="product-price">¥{{ prod.price }}</text>
|
|
|
+ <view class="report-card" @click="goGrowthReport">
|
|
|
+ <view class="report-stat-item">
|
|
|
+ <text class="report-stat">{{ growthReport.monthActiveDays || 0 }}天</text>
|
|
|
+ <text class="report-label">本月活跃</text>
|
|
|
+ </view>
|
|
|
+ <view class="report-divider"></view>
|
|
|
+ <view class="report-stat-item">
|
|
|
+ <text class="report-stat">{{ growthReport.totalTasks || 0 }}</text>
|
|
|
+ <text class="report-label">累计任务</text>
|
|
|
</view>
|
|
|
+ <view class="report-divider"></view>
|
|
|
+ <view class="report-stat-item">
|
|
|
+ <text class="report-stat">{{ growthReport.completionRate || 0 }}%</text>
|
|
|
+ <text class="report-label">完成率</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="menu-list">
|
|
|
+ <!-- 修改个人资料:所有角色可见 -->
|
|
|
+ <view class="menu-item" @click="goToEditInfo">
|
|
|
+ <text>📝 修改个人资料</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <!-- 我的孩子:仅家长可见 -->
|
|
|
+ <view class="menu-item" v-if="role === 'parent'" @click="goToChildren">
|
|
|
+ <text>👶 我的孩子</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <!-- 家庭成员 -->
|
|
|
+ <view class="menu-item" v-if="role === 'parent'" @click="goToFamilyMembers">
|
|
|
+ <text>👨👩👧👦 家庭成员</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <view class="menu-item" @click="goToPointsLogs">
|
|
|
+ <text>📊 积分记录</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <!-- 设置/重置密码:仅家长和成长规划师可见,孩子不可见 -->
|
|
|
+ <view class="menu-item" v-if="role === 'parent'" @click="showPasswordModal = true">
|
|
|
+ <text>🔐 {{ hasPassword ? '重置密码' : '设置密码' }}</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <!-- 对家庭成员可见:仅家长可见 -->
|
|
|
+ <view class="menu-item menu-item-switch" v-if="role === 'parent'">
|
|
|
+ <text>👁 对家庭成员可见</text>
|
|
|
+ <switch :checked="showToFamily === 1" @change="onShowToFamilyChange" color="#5B9BD5" />
|
|
|
+ </view>
|
|
|
+ <button class="menu-item menu-item-btn" open-type="share" @click="inviteFamily" v-if="role === 'parent'">
|
|
|
+ <text>👨👩👧👦 邀请家人</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </button>
|
|
|
+ <button class="menu-item menu-item-btn" open-type="share" @click="inviteTeacher" v-if="role === 'parent'">
|
|
|
+ <text>👨🏫 邀请规划师</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </button>
|
|
|
+ <!-- 会员中心(浠艾福俱乐部) -->
|
|
|
+ <view class="menu-item" @click="goToMembership">
|
|
|
+ <text>👑 会员中心</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <!-- 服务商中心(仅已通过服务商可见) -->
|
|
|
+ <view class="menu-item" v-if="isVendor" @click="goToVendorCenter">
|
|
|
+ <text>🏪 服务商中心</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
+ </view>
|
|
|
+ <view class="menu-item" @click="logout">
|
|
|
+ <text>🚪 退出登录</text>
|
|
|
+ <text class="arrow">›</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="bottom-spacer"></view>
|
|
|
+ <!-- 设置/重置密码弹窗 -->
|
|
|
+ <view class="modal-mask" v-if="showPasswordModal" @click="showPasswordModal = false">
|
|
|
+ <view class="modal" @click.stop>
|
|
|
+ <view class="modal-title">{{ hasPassword ? '重置密码' : '设置密码' }}</view>
|
|
|
+ <view class="form-item" v-if="hasPassword">
|
|
|
+ <input v-model="oldPassword" type="number" password placeholder="输入旧密码" maxlength="6" />
|
|
|
+ </view>
|
|
|
+ <view class="form-item">
|
|
|
+ <input v-model="newPassword" type="number" password placeholder="输入新密码" maxlength="6" />
|
|
|
+ </view>
|
|
|
+ <view class="form-item">
|
|
|
+ <input v-model="confirmPassword" type="number" password placeholder="确认新密码" maxlength="6" />
|
|
|
+ </view>
|
|
|
+ <view class="modal-btns">
|
|
|
+ <button @click="showPasswordModal = false">取消</button>
|
|
|
+ <button class="btn-primary" @click="savePassword">确定</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
-import { getVisibleSections, getEnergyOverview, getTodayTasks } from '../../utils/api.js'
|
|
|
+import { setPassword, verifyPassword, getChildren, vendorStatus, getEnergyOverview, getUserActionStats, getReferralCode, getReferralSummary, getCommissionSummary, updateMemberVisibility, getVisibleFamilyMembers } from '../../utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
components: { PageBanner },
|
|
|
data() {
|
|
|
return {
|
|
|
- isLoggedIn: false,
|
|
|
- role: null,
|
|
|
- currentChildId: null,
|
|
|
+ nickname: '',
|
|
|
+ role: 'parent',
|
|
|
+ hasPassword: false,
|
|
|
+ showPasswordModal: false,
|
|
|
+ oldPassword: '',
|
|
|
+ newPassword: '',
|
|
|
+ confirmPassword: '',
|
|
|
+ children: [],
|
|
|
+ isSwitchedChild: false,
|
|
|
+ shareData: null,
|
|
|
+ isVendor: false,
|
|
|
+ showToFamily: 1,
|
|
|
totalEnergy: null,
|
|
|
- visibleSections: [],
|
|
|
- funcList: [
|
|
|
- { icon: '\u{1F4B0}', label: '财商打卡', needLogin: true, page: '/pages/wealth/checkin' },
|
|
|
- { icon: '\u{1F4B5}', label: '零花钱管理', needLogin: true, page: '' },
|
|
|
- { icon: '\u{1F4C8}', label: '推广中心', needLogin: true, page: '/pages/promotion/index' },
|
|
|
- { icon: '\u{1F3E6}', label: '商城', needLogin: false, page: '/pages/shop/index' },
|
|
|
- { icon: '\u{1F4CB}', label: '保单管理', needLogin: true, page: '/pages/wealth/insurance-list' }
|
|
|
+ badges: [
|
|
|
+ { id: 1, icon: '\u{1F3C6}', name: '连续7天', unlocked: false },
|
|
|
+ { id: 2, icon: '\u{2B50}', name: '积分达人', unlocked: false },
|
|
|
+ { id: 3, icon: '\u{1F525}', name: '执行之星', unlocked: false },
|
|
|
+ { id: 4, icon: '\u{1F31F}', name: '学习先锋', unlocked: false }
|
|
|
],
|
|
|
- hotActivities: [
|
|
|
- { id: 1, name: '小小理财师体验营', date: '周六', location: '浠艾福中心', image: '' },
|
|
|
- { id: 2, name: '跳蚤市场亲子活动', date: '周日', location: '朝阳公园', image: '' },
|
|
|
- { id: 3, name: '财商启蒙绘本共读', date: '下周六', location: '线上', image: '' }
|
|
|
- ],
|
|
|
- recommendedProducts: [
|
|
|
- { id: 1, name: '儿童理财启蒙套装', price: 199, image: '' },
|
|
|
- { id: 2, name: '亲子财商桌游', price: 159, image: '' },
|
|
|
- { id: 3, name: '零花钱记账本', price: 49, image: '' },
|
|
|
- { id: 4, name: '少儿财商课程', price: 399, image: '' }
|
|
|
- ],
|
|
|
- todayTasks: []
|
|
|
+ actionData: {
|
|
|
+ purchaseCount: 0,
|
|
|
+ activityCount: 0,
|
|
|
+ taskCount: 0,
|
|
|
+ courseCount: 0
|
|
|
+ },
|
|
|
+ wealthData: {
|
|
|
+ totalEarnings: '0.00',
|
|
|
+ availableAmount: '0.00',
|
|
|
+ referralCount: 0,
|
|
|
+ referralCode: ''
|
|
|
+ },
|
|
|
+ growthReport: {
|
|
|
+ monthActiveDays: 0,
|
|
|
+ totalTasks: 0,
|
|
|
+ completionRate: 0
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
- var token = uni.getStorageSync('token')
|
|
|
- this.isLoggedIn = !!token
|
|
|
- if (this.isLoggedIn) {
|
|
|
- this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
|
|
|
- this.currentChildId = uni.getStorageSync('currentChildId') || null
|
|
|
+ computed: {
|
|
|
+ isLoggedIn() {
|
|
|
+ return !!uni.getStorageSync('token')
|
|
|
}
|
|
|
- this.loadSectionConfig()
|
|
|
- if (this.isLoggedIn) {
|
|
|
- this.loadEnergyData()
|
|
|
- this.loadTodayTasks()
|
|
|
+ },
|
|
|
+ onShareAppMessage() {
|
|
|
+ if (this.shareData) {
|
|
|
+ return {
|
|
|
+ title: this.shareData.title,
|
|
|
+ path: this.shareData.path,
|
|
|
+ imageUrl: '/static/invite-card.png'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ if (!uni.getStorageSync('token')) return
|
|
|
+ const currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
|
|
|
+ if (currentRole === 'teacher') {
|
|
|
+ uni.redirectTo({ url: '/pages/teacher/teacher-profile' })
|
|
|
+ return
|
|
|
}
|
|
|
+ var userInfo = uni.getStorageSync('userInfo')
|
|
|
+ this.nickname = this.$store.state.nickname || (userInfo && userInfo.nickname) || ''
|
|
|
+ // 使用 currentRole(视图角色),而非 role(实际角色)
|
|
|
+ this.role = currentRole
|
|
|
+ this.hasPassword = !!uni.getStorageSync('passwordSet')
|
|
|
+ // 获取切换标记
|
|
|
+ this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
|
|
|
+ this.loadChildren()
|
|
|
+ this.loadShowToFamily()
|
|
|
+ this.checkVendorStatus()
|
|
|
+ this.loadEnergyData()
|
|
|
+ this.loadBadges()
|
|
|
+ this.loadActionData()
|
|
|
+ this.loadWealthData()
|
|
|
},
|
|
|
methods: {
|
|
|
- async loadSectionConfig() {
|
|
|
- var baseSections = ['func_entries', 'hot_activities', 'recommended_products']
|
|
|
- if (!uni.getStorageSync('token')) {
|
|
|
- this.visibleSections = baseSections
|
|
|
+ goLogin() {
|
|
|
+ uni.navigateTo({ url: '/pages/login/login' })
|
|
|
+ },
|
|
|
+ async loadChildren() {
|
|
|
+ try {
|
|
|
+ const res = await getChildren()
|
|
|
+ this.children = res.data || []
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取孩子列表失败', e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async loadShowToFamily() {
|
|
|
+ try {
|
|
|
+ var uid = this.$store.state.userId || uni.getStorageSync('userId')
|
|
|
+ var res = await getVisibleFamilyMembers()
|
|
|
+ var members = res.data || []
|
|
|
+ var self = members.find(function(m) { return m.id == uid })
|
|
|
+ if (self) {
|
|
|
+ this.showToFamily = self.showToFamily !== 0 ? 1 : 0
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取可见性设置失败', e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goToEditInfo() {
|
|
|
+ uni.navigateTo({ url: '/pages/user-edit/user-edit' })
|
|
|
+ },
|
|
|
+ goToChildren() {
|
|
|
+ uni.navigateTo({ url: '/pages/profile/children' })
|
|
|
+ },
|
|
|
+ goToFamilyMembers() {
|
|
|
+ uni.navigateTo({ url: '/pages/profile/family-members' })
|
|
|
+ },
|
|
|
+ goToPointsLogs() {
|
|
|
+ uni.navigateTo({ url: '/pages/points/points' })
|
|
|
+ },
|
|
|
+ async onShowToFamilyChange(e) {
|
|
|
+ var val = e.detail.value ? 1 : 0
|
|
|
+ var uid = this.$store.state.userId || uni.getStorageSync('userId')
|
|
|
+ try {
|
|
|
+ await updateMemberVisibility(uid, 'parent', val)
|
|
|
+ this.showToFamily = val
|
|
|
+ uni.showToast({ title: val ? '已对家庭成员可见' : '已对家庭成员隐藏', icon: 'none' })
|
|
|
+ } catch (e) {
|
|
|
+ console.error('更新可见性失败', e)
|
|
|
+ uni.showToast({ title: '操作失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ switchMode() {
|
|
|
+ if (this.role === 'child') {
|
|
|
+ this.verifyPasswordForSwitch(() => {
|
|
|
+ this.doSwitchMode()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.doSwitchMode()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ doSwitchMode() {
|
|
|
+ const newRole = this.role === 'parent' ? 'child' : 'parent'
|
|
|
+ if (newRole === 'child') {
|
|
|
+ if (this.children.length === 0) {
|
|
|
+ this.loadChildren()
|
|
|
+ }
|
|
|
+ if (this.children.length === 0) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '您还没有添加孩子,是否现在去添加?',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateTo({ url: '/pages/profile/create-child' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.children.length === 1) {
|
|
|
+ this.$store.commit('switchToChild', this.children[0].id)
|
|
|
+ this.role = newRole
|
|
|
+ uni.showToast({ title: '已切换为孩子模式', icon: 'success' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uni.showActionSheet({
|
|
|
+ itemList: this.children.map(c => c.nickname),
|
|
|
+ success: (res) => {
|
|
|
+ const selectedChild = this.children[res.tapIndex]
|
|
|
+ this.$store.commit('switchToChild', selectedChild.id)
|
|
|
+ this.role = newRole
|
|
|
+ uni.showToast({ title: `已切换为${selectedChild.nickname}模式`, icon: 'success' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$store.commit('switchBackToParent')
|
|
|
+ this.role = newRole
|
|
|
+ uni.showToast({ title: `已切换为${newRole === 'parent' ? '家长' : '孩子'}模式`, icon: 'success' })
|
|
|
+ },
|
|
|
+ verifyPasswordForSwitch(callback) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '验证密码',
|
|
|
+ content: '请输入家长密码',
|
|
|
+ editable: true,
|
|
|
+ success: async (res) => {
|
|
|
+ if (res.confirm && res.content) {
|
|
|
+ try {
|
|
|
+ const result = await verifyPassword(res.content)
|
|
|
+ if (result.code === 200) {
|
|
|
+ callback && callback()
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: '密码错误', icon: 'none' })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: '验证失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async savePassword() {
|
|
|
+ if (this.newPassword.length !== 6) {
|
|
|
+ uni.showToast({ title: '请输入6位密码', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.newPassword !== this.confirmPassword) {
|
|
|
+ uni.showToast({ title: '两次密码不一致', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.hasPassword && this.oldPassword.length !== 6) {
|
|
|
+ uni.showToast({ title: '请输入旧密码', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
- var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
|
|
|
try {
|
|
|
- var res = await getVisibleSections({ pageKey: 'wealth', role: role })
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
- var keys = res.data.map(function(s) { return s.sectionKey })
|
|
|
- var merged = baseSections.slice()
|
|
|
- keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
|
|
|
- this.visibleSections = merged
|
|
|
+ if (this.hasPassword) {
|
|
|
+ const verifyRes = await verifyPassword(this.oldPassword)
|
|
|
+ if (verifyRes.code !== 200) {
|
|
|
+ uni.showToast({ title: '旧密码错误', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ await setPassword(this.newPassword)
|
|
|
+ uni.setStorageSync('passwordSet', true)
|
|
|
+ this.hasPassword = true
|
|
|
+ uni.showToast({ title: '密码设置成功', icon: 'success' })
|
|
|
+ this.showPasswordModal = false
|
|
|
+ this.oldPassword = ''
|
|
|
+ this.newPassword = ''
|
|
|
+ this.confirmPassword = ''
|
|
|
+ } catch (e) {
|
|
|
+ console.error('设置密码失败', e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ logout() {
|
|
|
+ uni.showModal({
|
|
|
+ title: '确认退出',
|
|
|
+ content: '确定要退出登录吗?',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.$store.commit('logout')
|
|
|
+ // 退出后返回首页 Tab(预登录状态,5 个底签可见)
|
|
|
+ uni.reLaunch({ url: '/pages/index/index' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ inviteFamily() {
|
|
|
+ const userInfo = uni.getStorageSync('userInfo')
|
|
|
+ const familyId = uni.getStorageSync('familyId')
|
|
|
+ if (!familyId) {
|
|
|
+ uni.showToast({ title: '您暂未加入家庭', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.inviteFamilyGenerate(familyId, userInfo)
|
|
|
+ },
|
|
|
+ async inviteFamilyGenerate(familyId, userInfo) {
|
|
|
+ try {
|
|
|
+ const { generateInviteCard } = require('../../utils/api.js')
|
|
|
+ const res = await generateInviteCard('family', familyId)
|
|
|
+ const code = res.data.code
|
|
|
+ this.shareData = {
|
|
|
+ title: (userInfo && userInfo.nickname ? userInfo.nickname : '家人') + ' 邀请你加入家庭',
|
|
|
+ path: '/pages/login/login?invite_code=' + code
|
|
|
+ }
|
|
|
+ uni.showToast({ title: '点击右上角转发给TA', icon: 'none' })
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: e.message || '生成邀请失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ inviteTeacher() {
|
|
|
+ const userInfo = uni.getStorageSync('userInfo')
|
|
|
+ const familyId = uni.getStorageSync('familyId')
|
|
|
+ if (!familyId) {
|
|
|
+ uni.showToast({ title: '您暂未加入家庭', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.inviteTeacherGenerate(familyId, userInfo)
|
|
|
+ },
|
|
|
+ async inviteTeacherGenerate(familyId, userInfo) {
|
|
|
+ try {
|
|
|
+ const { generateInviteCard } = require('../../utils/api.js')
|
|
|
+ const res = await generateInviteCard('guide', familyId)
|
|
|
+ const code = res.data.code
|
|
|
+ this.shareData = {
|
|
|
+ title: (userInfo && userInfo.nickname ? userInfo.nickname : '家长') + ' 邀请你成为家庭成长规划师',
|
|
|
+ path: '/pages/login/login?invite_code=' + code
|
|
|
}
|
|
|
+ uni.showToast({ title: '点击右上角转发给规划师', icon: 'none' })
|
|
|
} catch (e) {
|
|
|
- this.visibleSections = ['func_entries', 'hot_activities', 'recommended_products']
|
|
|
+ uni.showToast({ title: e.message || '生成邀请失败', icon: 'none' })
|
|
|
}
|
|
|
},
|
|
|
+ goToMembership() {
|
|
|
+ uni.showToast({ title: '即将上线', icon: 'none' })
|
|
|
+ },
|
|
|
+ goToVendorCenter() {
|
|
|
+ uni.navigateTo({ url: '/pages/vendor/center' })
|
|
|
+ },
|
|
|
+ goToPromotion() {
|
|
|
+ uni.navigateTo({ url: '/pages/promotion/index' })
|
|
|
+ },
|
|
|
async loadEnergyData() {
|
|
|
- var childId = this.currentChildId
|
|
|
+ var childId = uni.getStorageSync('currentChildId') || null
|
|
|
+ if (!childId) {
|
|
|
+ // Try to get first child
|
|
|
+ if (this.children.length > 0) {
|
|
|
+ childId = this.children[0].id
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!childId) return
|
|
|
try {
|
|
|
var res = await getEnergyOverview(childId)
|
|
|
@@ -142,50 +522,102 @@ export default {
|
|
|
}
|
|
|
} catch (e) { console.log('获取能量概览失败', e) }
|
|
|
},
|
|
|
- async loadTodayTasks() {
|
|
|
- var childId = this.currentChildId
|
|
|
- if (!childId) return
|
|
|
+ loadBadges() {
|
|
|
+ // Unlock based on stored stats
|
|
|
+ var streakDays = parseInt(uni.getStorageSync('streakDays') || 0)
|
|
|
+ var totalPoints = parseInt(uni.getStorageSync('totalPoints') || 0)
|
|
|
+ if (streakDays >= 7) this.badges[0].unlocked = true
|
|
|
+ if (totalPoints >= 1000) this.badges[1].unlocked = true
|
|
|
+
|
|
|
+ // Growth report mock
|
|
|
+ this.growthReport.monthActiveDays = streakDays > 0 ? Math.min(streakDays, 30) : 0
|
|
|
+ this.growthReport.totalTasks = parseInt(uni.getStorageSync('completedTasks') || 0)
|
|
|
+ this.growthReport.completionRate = 85
|
|
|
+ },
|
|
|
+ async loadActionData() {
|
|
|
try {
|
|
|
- var res = await getTodayTasks(childId)
|
|
|
- if (res && res.data) {
|
|
|
- this.todayTasks = res.data.slice(0, 5)
|
|
|
+ const res = await getUserActionStats()
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
+ this.actionData.purchaseCount = res.data.purchaseCount || 0
|
|
|
+ this.actionData.activityCount = res.data.activityCount || 0
|
|
|
+ this.actionData.taskCount = res.data.taskCount || 0
|
|
|
+ this.actionData.courseCount = res.data.courseCount || 0
|
|
|
}
|
|
|
- } catch (e) { console.log('获取今日任务失败', e) }
|
|
|
- },
|
|
|
- sectionVisible(key) {
|
|
|
- return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
|
|
|
- },
|
|
|
- onFuncClick(item) {
|
|
|
- if (item.needLogin && !this.isLoggedIn) {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请先登录后使用此功能',
|
|
|
- success: function(res) { if (res.confirm) uni.navigateTo({ url: '/pages/login/login' }) }
|
|
|
- })
|
|
|
- return
|
|
|
+ } catch (e) {
|
|
|
+ // Fallback to local computed stats
|
|
|
+ this.actionData.taskCount = parseInt(uni.getStorageSync('completedTasks') || 0)
|
|
|
+ console.log('获取行动统计失败,使用本地数据', e)
|
|
|
}
|
|
|
- if (item.page) {
|
|
|
- var nativeTabs = ['/pages/tasks/tasks', '/pages/index/index', '/pages/body/index', '/pages/mind/index', '/pages/action/index', '/pages/wisdom/index', '/pages/profile/profile']
|
|
|
- if (nativeTabs.indexOf(item.page) !== -1) {
|
|
|
- uni.switchTab({ url: item.page })
|
|
|
- } else {
|
|
|
- uni.navigateTo({ url: item.page })
|
|
|
+ },
|
|
|
+ async loadWealthData() {
|
|
|
+ try {
|
|
|
+ const codeRes = await getReferralCode()
|
|
|
+ if (codeRes.data) {
|
|
|
+ this.wealthData.referralCode = codeRes.data.referralCode || codeRes.data.code || ''
|
|
|
}
|
|
|
- }
|
|
|
+ } catch (e) { console.log('获取邀请码失败', e) }
|
|
|
+ try {
|
|
|
+ const summaryRes = await getReferralSummary()
|
|
|
+ if (summaryRes.data) {
|
|
|
+ this.wealthData.totalEarnings = summaryRes.data.totalEarnings || '0.00'
|
|
|
+ this.wealthData.referralCount = summaryRes.data.referredCount || summaryRes.data.totalCount || 0
|
|
|
+ }
|
|
|
+ } catch (e) { console.log('获取邀请统计失败', e) }
|
|
|
+ try {
|
|
|
+ const comRes = await getCommissionSummary()
|
|
|
+ if (comRes.data) {
|
|
|
+ this.wealthData.availableAmount = comRes.data.availableAmount || '0.00'
|
|
|
+ }
|
|
|
+ } catch (e) { console.log('获取佣金总览失败', e) }
|
|
|
},
|
|
|
- goMoreActivities() {},
|
|
|
- goActivityDetail(id) {},
|
|
|
- goMoreProducts() {},
|
|
|
- goProductDetail(id) {
|
|
|
- var token = uni.getStorageSync('token')
|
|
|
- if (token) {
|
|
|
- uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
|
|
|
- } else {
|
|
|
- uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/wealth/index') })
|
|
|
+ copyReferralCode() {
|
|
|
+ if (!this.wealthData.referralCode) return
|
|
|
+ uni.setClipboardData({
|
|
|
+ data: this.wealthData.referralCode,
|
|
|
+ success: () => { uni.showToast({ title: '邀请码已复制', icon: 'success' }) }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goAllBadges() {
|
|
|
+ uni.showToast({ title: '即将上线', icon: 'none' })
|
|
|
+ },
|
|
|
+ goGrowthReport() {
|
|
|
+ uni.showToast({ title: '即将上线', icon: 'none' })
|
|
|
+ },
|
|
|
+ async checkVendorStatus() {
|
|
|
+ try {
|
|
|
+ const res = await vendorStatus()
|
|
|
+ this.isVendor = res.data && res.data.vendorStatus === 'approved'
|
|
|
+ } catch (e) {
|
|
|
+ this.isVendor = false
|
|
|
}
|
|
|
},
|
|
|
- goTasks() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
|
|
|
- goLogin() { uni.navigateTo({ url: '/pages/login/login' }) }
|
|
|
+ exitSwitch() {
|
|
|
+ if (!this.isSwitchedChild) return
|
|
|
+ uni.showModal({
|
|
|
+ title: '退出切换',
|
|
|
+ content: '请输入家长密码以确认退出',
|
|
|
+ editable: true,
|
|
|
+ success: async (res) => {
|
|
|
+ if (res.confirm && res.content) {
|
|
|
+ try {
|
|
|
+ const verifyResult = await verifyPassword(res.content)
|
|
|
+ if (verifyResult.code === 200) {
|
|
|
+ this.$store.commit('switchBackToParent')
|
|
|
+ this.isSwitchedChild = false
|
|
|
+ this.role = 'parent'
|
|
|
+ uni.showToast({ title: '已退出切换', icon: 'success' })
|
|
|
+ // 刷新首页
|
|
|
+ uni.reLaunch({ url: '/pages/index/index' })
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: '密码错误', icon: 'none' })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: '验证失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -197,48 +629,9 @@ export default {
|
|
|
padding-bottom: 120rpx;
|
|
|
}
|
|
|
|
|
|
-.func-section {
|
|
|
- margin: -40rpx 20rpx 0;
|
|
|
- position: relative;
|
|
|
- z-index: 2;
|
|
|
-}
|
|
|
-.func-grid {
|
|
|
- background: #fff;
|
|
|
- border-radius: 24rpx;
|
|
|
- padding: 30rpx 16rpx;
|
|
|
- display: flex;
|
|
|
- box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
|
|
|
-}
|
|
|
-.func-item {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
-}
|
|
|
-.func-item:active {
|
|
|
- opacity: 0.7;
|
|
|
-}
|
|
|
-.func-icon-wrap {
|
|
|
- width: 88rpx;
|
|
|
- height: 88rpx;
|
|
|
- border-radius: 50%;
|
|
|
- background: #E3F2FD;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-bottom: 10rpx;
|
|
|
-}
|
|
|
-.func-icon {
|
|
|
- font-size: 40rpx;
|
|
|
-}
|
|
|
-.func-label {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #333;
|
|
|
- font-weight: 500;
|
|
|
-}
|
|
|
-
|
|
|
+/* ===== 通用区块 ===== */
|
|
|
.section {
|
|
|
- margin: 20rpx 20rpx;
|
|
|
+ margin: 20rpx 30rpx;
|
|
|
}
|
|
|
.section-header {
|
|
|
display: flex;
|
|
|
@@ -256,112 +649,290 @@ export default {
|
|
|
color: #999;
|
|
|
}
|
|
|
|
|
|
-.activity-scroll {
|
|
|
- white-space: nowrap;
|
|
|
-}
|
|
|
-.activity-card {
|
|
|
- display: inline-block;
|
|
|
- width: 280rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
+/* ===== 推广邀请码 ===== */
|
|
|
+.referral-code-bar {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
+ padding: 20rpx 24rpx;
|
|
|
+ margin-top: 16rpx;
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
}
|
|
|
-.activity-img {
|
|
|
- width: 280rpx;
|
|
|
- height: 180rpx;
|
|
|
- background: #f0f0f0;
|
|
|
+.referral-code-label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #999;
|
|
|
+ margin-right: 16rpx;
|
|
|
+}
|
|
|
+.referral-code-value {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #F97316;
|
|
|
+ letter-spacing: 4rpx;
|
|
|
}
|
|
|
-.activity-info {
|
|
|
- padding: 16rpx;
|
|
|
+.referral-code-copy {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #5B9BD5;
|
|
|
+ padding: 4rpx 16rpx;
|
|
|
+ border: 1rpx solid #5B9BD5;
|
|
|
+ border-radius: 8rpx;
|
|
|
}
|
|
|
-.activity-name {
|
|
|
- font-size: 26rpx;
|
|
|
+
|
|
|
+/* ===== 行动数据(推广收益) ===== */
|
|
|
+.wealth-card {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+}
|
|
|
+.wealth-item {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.wealth-value {
|
|
|
+ font-size: 40rpx;
|
|
|
font-weight: bold;
|
|
|
- color: #333;
|
|
|
- display: block;
|
|
|
+ color: #F97316;
|
|
|
}
|
|
|
-.activity-meta {
|
|
|
- font-size: 22rpx;
|
|
|
+.wealth-label {
|
|
|
+ font-size: 24rpx;
|
|
|
color: #999;
|
|
|
margin-top: 8rpx;
|
|
|
- display: block;
|
|
|
+}
|
|
|
+.wealth-divider {
|
|
|
+ width: 1rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ background: #f0f0f0;
|
|
|
}
|
|
|
|
|
|
-.product-list {
|
|
|
+/* ===== 成就徽章 ===== */
|
|
|
+.badge-grid {
|
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 24rpx 16rpx;
|
|
|
+ box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+}
|
|
|
+.badge-item {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.badge-icon-wrap {
|
|
|
+ width: 72rpx;
|
|
|
+ height: 72rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.badge-icon-wrap.unlocked {
|
|
|
+ background: linear-gradient(135deg, #FBBF24, #F97316);
|
|
|
}
|
|
|
-.product-card {
|
|
|
- width: calc(50% - 10rpx);
|
|
|
+.badge-icon-wrap.locked {
|
|
|
+ background: #f0f0f0;
|
|
|
+ opacity: 0.5;
|
|
|
+}
|
|
|
+.badge-icon {
|
|
|
+ font-size: 36rpx;
|
|
|
+}
|
|
|
+.badge-name {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #666;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== 成长报告 ===== */
|
|
|
+.report-card {
|
|
|
background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
}
|
|
|
-.product-img {
|
|
|
- width: 100%;
|
|
|
- height: 240rpx;
|
|
|
+.report-stat-item {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.report-stat {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #5B9BD5;
|
|
|
+}
|
|
|
+.report-label {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #999;
|
|
|
+ margin-top: 6rpx;
|
|
|
+}
|
|
|
+.report-divider {
|
|
|
+ width: 1rpx;
|
|
|
+ height: 50rpx;
|
|
|
background: #f0f0f0;
|
|
|
}
|
|
|
-.product-name {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #333;
|
|
|
- padding: 12rpx 16rpx 0;
|
|
|
+.user-card {
|
|
|
+ background: linear-gradient(135deg, #5B9BD5 0%, #3A7CC4 100%);
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 40rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
-.product-price {
|
|
|
- font-size: 28rpx;
|
|
|
- color: #F97316;
|
|
|
+.avatar {
|
|
|
+ font-size: 80rpx;
|
|
|
+ margin-right: 30rpx;
|
|
|
+}
|
|
|
+.user-info {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.nickname {
|
|
|
+ font-size: 36rpx;
|
|
|
font-weight: bold;
|
|
|
- padding: 8rpx 16rpx 16rpx;
|
|
|
- display: block;
|
|
|
}
|
|
|
-.line-clamp-2 {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
+.role {
|
|
|
+ font-size: 24rpx;
|
|
|
+ opacity: 0.8;
|
|
|
}
|
|
|
-
|
|
|
-.task-wrap {
|
|
|
+.system-points {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #D6EAF8;
|
|
|
+ margin-top: 8rpx;
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+.btn-switch {
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 24rpx;
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+}
|
|
|
+.menu-list {
|
|
|
+ margin-top: 30rpx;
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
}
|
|
|
-.task-item {
|
|
|
+.menu-item {
|
|
|
+ padding: 30rpx;
|
|
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- padding: 28rpx 24rpx;
|
|
|
- border-bottom: 1rpx solid #f0f0f0;
|
|
|
+ font-size: 28rpx;
|
|
|
}
|
|
|
-.task-item:last-child {
|
|
|
+.menu-item:last-child {
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
-.task-name {
|
|
|
- font-size: 26rpx;
|
|
|
+.arrow {
|
|
|
+ color: #ccc;
|
|
|
+ font-size: 32rpx;
|
|
|
+}
|
|
|
+.menu-item-btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ padding: 28rpx 24rpx;
|
|
|
+ border: none;
|
|
|
+ background: transparent;
|
|
|
+ font-size: 28rpx;
|
|
|
color: #333;
|
|
|
}
|
|
|
-.task-points {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #F97316;
|
|
|
+.menu-item-btn::after { border: none; }
|
|
|
+.menu-item-switch {
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.modal-mask {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
}
|
|
|
-.task-empty {
|
|
|
+.modal {
|
|
|
background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 40rpx;
|
|
|
+ width: 80%;
|
|
|
+}
|
|
|
+.modal-title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.form-item {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+.form-item input {
|
|
|
+ border: 1rpx solid #ddd;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+}
|
|
|
+.modal-btns {
|
|
|
+ display: flex;
|
|
|
+ gap: 20rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
+}
|
|
|
+.modal-btns button {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+
|
|
|
+/* ===== 未登录提示 ===== */
|
|
|
+.login-prompt {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ min-height: 80vh;
|
|
|
padding: 60rpx;
|
|
|
+}
|
|
|
+.prompt-icon {
|
|
|
+ font-size: 120rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ width: 160rpx;
|
|
|
+ height: 160rpx;
|
|
|
+ line-height: 160rpx;
|
|
|
text-align: center;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+ background: #f5f5f5;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
-.task-empty-text {
|
|
|
+.prompt-title {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
+.prompt-desc {
|
|
|
font-size: 26rpx;
|
|
|
color: #999;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+}
|
|
|
+.login-prompt .login-btn {
|
|
|
+ width: 60%;
|
|
|
+ height: 80rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ text-align: center;
|
|
|
+ border: none;
|
|
|
}
|
|
|
-
|
|
|
-.bottom-spacer {
|
|
|
- height: 20rpx;
|
|
|
+.login-prompt .login-btn::after {
|
|
|
+ border: none;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|