feat: Kinetic Dark 设计语言 + Lucide 图标迁移 + 首页轻量个性化

- 建立 Lucide 子集 iconfont(49 字形),全站 emoji 替换为 fc-icon 组件
- 重塑 Design Token(冷中性近黑底 + Volt 荧光绿 #B6F24E),消除硬编码颜色
- 首页登录后个性化:我的计划 / 我的收藏 / 今日推荐(纯前端复用现有 API)
- 后端 DEFAULT_EMOJI→Lucide 名,PALETTE 对齐 Kinetic Dark 语义色板
- 修复 person-standing 缺失字形;14 个官方组合 seed emoji 全部映射到现有字形
This commit is contained in:
2026-07-22 21:38:56 +08:00
parent ca0af6f7d2
commit b94eb706ff
64 changed files with 1572 additions and 173 deletions

View File

@@ -3,20 +3,22 @@ const auth = require('../../utils/auth');
const favSvc = require('../../services/favorite');
const planSvc = require('../../services/plan');
const EMOJIS = ['💪', '🏋️', '🔥', '🏃', '🧘', '🤸', '🥊', '🚴', '⚡', '🌟', '🐯', '🦁'];
// UGC 头像图标选择器Lucide 运动子集(非 emoji
const ICONS = ['dumbbell', 'accessibility', 'person-standing', 'bike', 'heart', 'flame',
'target', 'medal', 'trophy', 'award', 'star', 'activity', 'sparkles', 'zap', 'trending-up'];
Page({
data: {
statusBarHeight: 20,
loggedIn: false,
profile: { nickname: '', avatar: '💪' },
profile: { nickname: '', avatar: 'user' },
counts: { fav: 0, plans: 0, favPlans: 0 },
loading: false,
// 编辑态
showEmojiPicker: false,
emojis: EMOJIS,
emojis: ICONS,
draftNickname: '',
draftAvatar: '💪'
draftAvatar: 'user'
},
onLoad() {
@@ -70,7 +72,7 @@ Page({
if (res.confirm) {
this.setData({
draftNickname: (res.content || '').trim() || cur.nickname,
draftAvatar: cur.avatar || '💪',
draftAvatar: cur.avatar || 'user',
showEmojiPicker: true
});
}
@@ -112,7 +114,7 @@ Page({
auth.logout();
this.setData({
loggedIn: false,
profile: { nickname: '', avatar: '💪' },
profile: { nickname: '', avatar: 'user' },
counts: { fav: 0, plans: 0, favPlans: 0 }
});
}

View File

@@ -3,6 +3,7 @@
"usingComponents": {
"navbar": "/components/navbar/index",
"avatar": "/components/avatar/index",
"bottom-nav": "/components/bottom-nav/index"
"bottom-nav": "/components/bottom-nav/index",
"fc-icon": "/components/fc-icon/index"
}
}

View File

@@ -3,7 +3,7 @@
<!-- 未登录 -->
<view wx:if="{{!loggedIn}}" class="login">
<view class="login__logo">💪</view>
<view class="login__logo"><fc-icon name="dumbbell" size="64" color="var(--accent)" /></view>
<view class="login__title">FITCOACH 智能健身教练</view>
<view class="login__sub">登录后同步你的收藏与训练计划</view>
<button class="login__btn" bindtap="onLogin">微信登录</button>
@@ -38,22 +38,22 @@
<view class="menu card">
<view class="cell" bindtap="goFav">
<text class="cell__icon">❤️</text>
<fc-icon class="cell__icon" name="heart" size="24" color="var(--text-2)" />
<text class="cell__label">我的收藏动作</text>
<text class="cell__arrow"></text>
</view>
<view class="cell" bindtap="goPlans">
<text class="cell__icon">🗂️</text>
<fc-icon class="cell__icon" name="folder-open" size="24" color="var(--text-2)" />
<text class="cell__label">我的训练计划</text>
<text class="cell__arrow"></text>
</view>
<view class="cell" bindtap="goFavPlans">
<text class="cell__icon">⭐</text>
<fc-icon class="cell__icon" name="star" size="24" color="var(--text-2)" />
<text class="cell__label">收藏的官方计划</text>
<text class="cell__arrow"></text>
</view>
<view class="cell" bindtap="goOfficial">
<text class="cell__icon">📋</text>
<fc-icon class="cell__icon" name="clipboard-list" size="24" color="var(--text-2)" />
<text class="cell__label">官方训练计划</text>
<text class="cell__arrow"></text>
</view>
@@ -72,7 +72,9 @@
wx:key="*this"
class="emoji {{draftAvatar === item ? 'emoji--active' : ''}}"
data-emoji="{{item}}"
bindtap="onPickEmoji">{{item}}</view>
bindtap="onPickEmoji">
<fc-icon name="{{item}}" size="48" color="var(--text)" />
</view>
</scroll-view>
<view class="sheet__nick">{{draftNickname || '未命名'}}</view>
<view class="sheet__actions">

View File

@@ -16,7 +16,7 @@
.login__btn {
margin-top: 56rpx; width: 420rpx;
background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
color: #0E1110; font-weight: 700; font-size: 32rpx;
color: var(--accent-on); font-weight: 700; font-size: 32rpx;
border-radius: 999rpx; padding: 24rpx;
}
.login__btn::after { border: none; }
@@ -24,7 +24,7 @@
/* 个人中心 */
.center { padding: 32rpx; }
.profile {
background: linear-gradient(135deg, rgba(217,179,108,0.14), var(--surface));
background: linear-gradient(135deg, var(--accent-soft), var(--surface));
border: 1rpx solid var(--gold-line);
border-radius: var(--radius); padding: 36rpx;
}
@@ -57,7 +57,7 @@
/* 头像选择弹层 */
.sheet {
position: fixed; inset: 0; z-index: 80;
background: rgba(0,0,0,0.5);
background: var(--scrim);
display: flex; align-items: flex-end;
}
.sheet__panel {
@@ -81,4 +81,4 @@
font-size: 30rpx; font-weight: 700;
}
.sheet__btn--ghost { background: var(--surface-2); color: var(--text); border: 1rpx solid var(--line); }
.sheet__btn--gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%); color: #0E1110; }
.sheet__btn--gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%); color: var(--accent-on); }