| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903 |
- <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="富足源于利他与坚持" />
- <!-- 退出切换按钮(仅家长切换到孩子状态时显示) -->
- <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>
- </view>
- <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>
- <!-- 财富数据(推广收益) -->
- <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">¥{{ wealthData.totalEarnings }}</text>
- <text class="wealth-label">累计收益</text>
- </view>
- <view class="wealth-divider"></view>
- <view class="wealth-item">
- <text class="wealth-value">¥{{ 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">
- <view class="section-header">
- <text class="section-title">🏅 成就徽章</text>
- <text class="section-more" @click="goAllBadges">全部 ›</text>
- </view>
- <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>
- </view>
- </view>
- <!-- 成长报告 -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">📈 成长报告</text>
- <text class="section-more" @click="goGrowthReport">查看 ›</text>
- </view>
- <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>
- <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="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 { setPassword, verifyPassword, getChildren, vendorStatus, getEnergyOverview, getUserActionStats, getReferralCode, getReferralSummary, getCommissionSummary } from '../../utils/api.js'
- export default {
- components: { PageBanner },
- data() {
- return {
- nickname: '',
- role: 'parent',
- hasPassword: false,
- showPasswordModal: false,
- oldPassword: '',
- newPassword: '',
- confirmPassword: '',
- children: [],
- isSwitchedChild: false,
- shareData: null,
- isVendor: false,
- totalEnergy: null,
- 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 }
- ],
- 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
- }
- }
- },
- computed: {
- isLoggedIn() {
- return !!uni.getStorageSync('token')
- }
- },
- 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.checkVendorStatus()
- this.loadEnergyData()
- this.loadBadges()
- this.loadActionData()
- this.loadWealthData()
- },
- methods: {
- goLogin() {
- uni.navigateTo({ url: '/pages/login/login' })
- },
- async loadChildren() {
- try {
- const res = await getChildren()
- this.children = res.data || []
- } 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' })
- },
- 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
- }
- try {
- 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) {
- 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 = 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)
- if (res && res.data) {
- this.totalEnergy = res.data.totalEnergy || 0
- }
- } catch (e) { console.log('获取能量概览失败', e) }
- },
- 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 {
- 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) {
- // Fallback to local computed stats
- this.actionData.taskCount = parseInt(uni.getStorageSync('completedTasks') || 0)
- console.log('获取行动统计失败,使用本地数据', e)
- }
- },
- 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) }
- },
- 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
- }
- },
- 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>
- <style scoped>
- .container {
- min-height: 100vh;
- background: #f5f7fa;
- padding-bottom: 120rpx;
- }
- /* ===== 通用区块 ===== */
- .section {
- margin: 20rpx 30rpx;
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .section-more {
- font-size: 24rpx;
- color: #999;
- }
- /* ===== 推广邀请码 ===== */
- .referral-code-bar {
- display: flex;
- align-items: center;
- background: #fff;
- border-radius: 16rpx;
- padding: 20rpx 24rpx;
- margin-top: 16rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .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;
- }
- .referral-code-copy {
- font-size: 24rpx;
- color: #5B9BD5;
- padding: 4rpx 16rpx;
- border: 1rpx solid #5B9BD5;
- border-radius: 8rpx;
- }
- /* ===== 行动数据(推广收益) ===== */
- .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: #F97316;
- }
- .wealth-label {
- font-size: 24rpx;
- color: #999;
- margin-top: 8rpx;
- }
- .wealth-divider {
- width: 1rpx;
- height: 60rpx;
- background: #f0f0f0;
- }
- /* ===== 成就徽章 ===== */
- .badge-grid {
- display: flex;
- 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);
- }
- .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: 20rpx;
- padding: 30rpx 20rpx;
- display: flex;
- align-items: center;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .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;
- }
- .user-card {
- background: linear-gradient(135deg, #5B9BD5 0%, #3A7CC4 100%);
- border-radius: 20rpx;
- padding: 40rpx;
- display: flex;
- align-items: center;
- color: #fff;
- }
- .avatar {
- font-size: 80rpx;
- margin-right: 30rpx;
- }
- .user-info {
- flex: 1;
- }
- .nickname {
- font-size: 36rpx;
- font-weight: bold;
- }
- .role {
- font-size: 24rpx;
- opacity: 0.8;
- }
- .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;
- }
- .menu-item {
- padding: 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
- display: flex;
- justify-content: space-between;
- font-size: 28rpx;
- }
- .menu-item:last-child {
- border-bottom: none;
- }
- .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;
- }
- .menu-item-btn::after { border: none; }
- .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;
- }
- .modal {
- background: #fff;
- 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;
- background: #f5f5f5;
- border-radius: 50%;
- }
- .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;
- }
- .login-prompt .login-btn::after {
- border: none;
- }
- </style>
|