提交修改
CI / Server (Go) (push) Has been cancelled
CI / Web (Next.js) (push) Has been cancelled
CI / Mobile (React Native) (push) Has been cancelled
CI / Admin (React) (push) Has been cancelled
CI / Docker Build (push) Has been cancelled

This commit is contained in:
zeronline
2026-06-29 16:49:54 +08:00
parent 545329ac40
commit b01a5f91c3
43 changed files with 740 additions and 338 deletions
+6 -1
View File
@@ -2,9 +2,10 @@ const api = require('../../../services/api')
const app = getApp()
Page({
data: { user: null },
data: { user: null, themeMode: 'light' },
onShow() {
if (!app.globalData.token) { wx.reLaunch({ url: '/pages/login/index' }); return }
this.setData({ themeMode: app.globalData.themeMode })
this.loadProfile()
},
async loadProfile() {
@@ -16,6 +17,10 @@ Page({
},
goEdit() { wx.navigateTo({ url: '/pages/profile/edit/index' }) },
goAchievements() { wx.navigateTo({ url: '/pages/achievements/index' }) },
onThemeToggle(e) {
app.toggleTheme()
this.setData({ themeMode: app.globalData.themeMode })
},
onLogout() {
wx.showModal({ title: '确认退出', content: '确定要退出登录吗?', success: (res) => {
if (res.confirm) {
+16 -13
View File
@@ -1,16 +1,19 @@
<view class="profile-card" wx:if="{{user}}">
<view class="profile-avatar">{{(user.nickname?.[0]) || (user.phone?.slice(-4)) || '?'}}</view>
<text class="profile-name">{{user.nickname || '未设置昵称'}}</text>
<text class="profile-bio">{{user.bio || '还没有个性签名'}}</text>
</view>
<view data-theme="{{themeMode}}">
<view class="profile-card" wx:if="{{user}}">
<view class="profile-avatar">{{(user.nickname?.[0]) || (user.phone?.slice(-4)) || '?'}}</view>
<text class="profile-name">{{user.nickname || '未设置昵称'}}</text>
<text class="profile-bio">{{user.bio || '还没有个性签名'}}</text>
</view>
<view class="stats-card">
<view class="stat-item"><text class="stat-value">{{user?.points || 0}}</text><text class="stat-label">积分</text></view>
<view class="stat-item"><text class="stat-value">--</text><text class="stat-label">连续</text></view>
<view class="stat-item"><text class="stat-value">--</text><text class="stat-label">徽章</text></view>
</view>
<view class="stats-card">
<view class="stat-item"><text class="stat-value">{{user?.points || 0}}</text><text class="stat-label">积分</text></view>
<view class="stat-item"><text class="stat-value">--</text><text class="stat-label">连续</text></view>
<view class="stat-item"><text class="stat-value">--</text><text class="stat-label">徽章</text></view>
</view>
<view class="menu-card">
<view class="menu-item" bindtap="goAchievements"><text>成就徽章</text><text class="menu-arrow">→</text></view>
<view class="menu-item" bindtap="onLogout" style="color:#FF3B30"><text>退出登录</text><text class="menu-arrow">→</text></view>
<view class="menu-card">
<view class="menu-item" bindtap="goAchievements"><text>成就徽章</text><text class="menu-arrow">→</text></view>
<view class="menu-item"><text>深色模式</text><switch checked="{{themeMode === 'dark'}}" bindchange="onThemeToggle" color="#FF6B35" /></view>
<view class="menu-item" bindtap="onLogout"><text style="color:var(--color-error)">退出登录</text><text class="menu-arrow">→</text></view>
</view>
</view>
+10 -10
View File
@@ -1,12 +1,12 @@
.profile-card { background: white; border-radius: 12px; margin: 12px 16px; padding: 32px 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.profile-avatar { width: 72px; height: 72px; border-radius: 36px; background: linear-gradient(135deg,#FF6B35,#FF4D6D); display: flex; align-items: center; justify-content: center; font-size: 28px; color: white; font-weight: 600; margin: 0 auto 12px; }
.profile-name { font-size: 22px; font-weight: 700; display: block; }
.profile-bio { font-size: 14px; color: #86868B; margin-top: 4px; display: block; }
.stats-card { background: white; border-radius: 12px; margin: 8px 16px; padding: 16px; display: flex; justify-content: space-around; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.profile-card { background: var(--color-card); border-radius: 12px; margin: 12px 16px; padding: 32px 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.profile-avatar { width: 72px; height: 72px; border-radius: 36px; background: var(--color-primary-gradient); display: flex; align-items: center; justify-content: center; font-size: 28px; color: white; font-weight: 600; margin: 0 auto 12px; }
.profile-name { font-size: 22px; font-weight: 700; display: block; color: var(--color-text); }
.profile-bio { font-size: 14px; color: var(--color-text-secondary); margin-top: 4px; display: block; }
.stats-card { background: var(--color-card); border-radius: 12px; margin: 8px 16px; padding: 16px; display: flex; justify-content: space-around; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.stat-item { text-align: center; }
.stat-value { font-size: 24px; font-weight: 700; color: #FF6B35; display: block; }
.stat-label { font-size: 13px; color: #86868B; }
.menu-card { background: white; border-radius: 12px; margin: 8px 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid #E5E5EA; font-size: 15px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--color-primary); display: block; }
.stat-label { font-size: 13px; color: var(--color-text-secondary); }
.menu-card { background: var(--color-card); border-radius: 12px; margin: 8px 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid var(--color-border); font-size: 15px; color: var(--color-text); }
.menu-item:last-child { border-bottom: none; }
.menu-arrow { font-size: 15px; color: #86868B; }
.menu-arrow { font-size: 15px; color: var(--color-text-secondary); }