refactor: UI/UX 全面重构 — 设计系统统一

设计系统:
- uni.scss 扩展:间距/圆角/字体/阴影/动画 token 体系
- 新建 styles/mixins.scss:20+ 公共 mixin

页面重构(12 个页面):
- 首页/记账/统计/账单/个人中心/预算/分类管理
- 群组管理/通知中心/管理员/用户管理/编辑资料

所有硬编码替换为设计 token:
- 颜色:#FFF8F0→$bg, #FFFFFF→$surface, #FF8C69→$primary 等
- 间距:40rpx→$space-xl, 24rpx→$space-md 等
- 字体:28rpx→$font-lg, 24rpx→$font-md 等
- 圆角:20rpx→$radius-lg, 40rpx→$radius-2xl 等
- 阴影:统一使用 $shadow-md/$shadow-sm

重复样式提取为 mixin:
- page-base, sticky-header, nav-bar, card, modal-mask
- tabs, tab, state-box, shimmer, flex-center 等
This commit is contained in:
wangxiaogang
2026-06-06 22:37:46 +08:00
parent a35689cdda
commit 4f42f2c342
16 changed files with 1116 additions and 1030 deletions

View File

@@ -280,38 +280,33 @@ function goBills() {
</script>
<style lang="scss" scoped>
@import '@/styles/mixins.scss';
.page {
min-height: 100vh;
background: #FFF8F0;
padding: 0 0 180rpx;
@include page-base;
}
.header-fixed {
position: sticky;
top: 0;
z-index: 100;
background: #FFF8F0;
@include sticky-header;
}
.status-bar {
background: #FFF8F0;
@include status-bar;
}
.header {
display: flex;
align-items: center;
padding: 16rpx 40rpx 32rpx;
padding: $space-sm $space-xl $space-lg;
}
.avatar-wrap {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
border: 2rpx solid #F0E0D6;
background: #FFF0E6;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid $border;
background: $surface-warm;
@include flex-center;
overflow: hidden;
}
@@ -322,71 +317,63 @@ function goBills() {
.greeting {
flex: 1;
font-size: 36rpx;
font-size: $font-2xl;
font-weight: 600;
color: #2D1B1B;
margin-left: 16rpx;
color: $text;
margin-left: $space-sm;
}
.bell {
width: 88rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
@include flex-center;
position: relative;
&:active { opacity: 0.6; }
}
.bell-badge {
position: absolute;
top: 8rpx;
right: 8rpx;
top: $space-xs;
right: $space-xs;
min-width: 32rpx;
height: 32rpx;
padding: 0 8rpx;
background: #FF6B6B;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 0 $space-xs;
background: $danger;
border-radius: $radius-full;
@include flex-center;
}
.bell-badge-text {
font-size: 18rpx;
font-size: $font-xs;
font-weight: 600;
color: #FFFFFF;
color: $surface;
}
.overview-card {
margin: 0 40rpx;
padding: 48rpx;
background: #FFFFFF;
border-radius: 40rpx;
border: 2rpx solid #F0E0D6;
box-shadow: 4rpx 4rpx 12rpx rgba(45, 27, 27, 0.08),
inset -2rpx -2rpx 6rpx rgba(45, 27, 27, 0.04);
margin: 0 $space-xl;
padding: $space-2xl;
@include card($radius-2xl);
box-shadow: $shadow-clay;
}
.card-label {
font-size: 28rpx;
color: #8B7E7E;
font-size: $font-lg;
color: $text-sec;
display: block;
margin-bottom: 12rpx;
margin-bottom: $space-sm;
}
.amount-row {
display: flex;
align-items: baseline;
margin-bottom: 32rpx;
margin-bottom: $space-lg;
}
.currency {
font-family: 'Fredoka', sans-serif;
font-size: 44rpx;
font-size: $font-3xl;
font-weight: 500;
color: #8B7E7E;
color: $text-sec;
margin-right: 4rpx;
}
@@ -394,174 +381,156 @@ function goBills() {
font-family: 'Fredoka', sans-serif;
font-size: 72rpx;
font-weight: 600;
color: #2D1B1B;
color: $text;
font-variant-numeric: tabular-nums;
}
.mini-stats {
display: flex;
gap: 24rpx;
margin-top: 40rpx;
gap: $space-md;
margin-top: $space-xl;
}
.mini-stat {
flex: 1;
min-width: 0;
padding: 24rpx 12rpx;
border-radius: 24rpx;
background: #FFF8F0;
padding: $space-md $space-sm;
border-radius: $radius-xl;
background: $bg;
text-align: center;
}
.mini-label {
font-size: 24rpx;
color: #8B7E7E;
font-size: $font-md;
color: $text-sec;
display: block;
margin-bottom: 8rpx;
margin-bottom: $space-xs;
}
.mini-value {
font-family: 'Fredoka', sans-serif;
font-size: 32rpx;
font-size: $font-xl;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include text-ellipsis;
&.income { color: #7BC67E; }
&.expense { color: #FF6B6B; }
&.income { color: $success; }
&.expense { color: $danger; }
}
.today-card {
margin: 24rpx 40rpx 0;
padding: 28rpx 32rpx;
background: #FFFFFF;
border-radius: 28rpx;
border: 2rpx solid #F0E0D6;
box-shadow: 4rpx 4rpx 12rpx rgba(45, 27, 27, 0.08);
margin: $space-md $space-xl 0;
padding: $space-lg $space-lg;
@include card($radius-xl);
display: flex;
align-items: center;
gap: 24rpx;
gap: $space-md;
}
.today-item {
flex: 1;
display: flex;
flex-direction: column;
gap: 8rpx;
gap: $space-xs;
}
.today-label {
font-size: 24rpx;
color: #8B7E7E;
font-size: $font-md;
color: $text-sec;
}
.today-amount {
font-family: 'Fredoka', sans-serif;
font-size: 32rpx;
font-size: $font-xl;
font-weight: 600;
&.expense { color: #FF6B6B; }
&.income { color: #7BC67E; }
&.expense { color: $danger; }
&.income { color: $success; }
}
.today-divider {
width: 2rpx;
height: 56rpx;
background: #F0E0D6;
background: $border;
flex-shrink: 0;
}
.today-count {
font-size: 22rpx;
color: #BFB3B3;
font-size: $font-sm;
color: $text-muted;
flex-shrink: 0;
}
.quick-actions {
display: flex;
gap: 24rpx;
padding: 0 40rpx;
margin-top: 40rpx;
gap: $space-md;
padding: 0 $space-xl;
margin-top: $space-xl;
}
.quick-btn {
flex: 1;
height: 144rpx;
border-radius: 32rpx;
background: #FFFFFF;
border: 2rpx solid #F0E0D6;
box-shadow: 4rpx 4rpx 12rpx rgba(45, 27, 27, 0.08);
display: flex;
border-radius: $radius-2xl;
@include card;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8rpx;
@include flex-center;
gap: $space-xs;
&:active {
transform: scale(0.97);
box-shadow: inset 2rpx 2rpx 6rpx rgba(45, 27, 27, 0.1);
box-shadow: $shadow-clay-pressed;
}
}
.quick-text { font-size: 24rpx; font-weight: 500; color: #2D1B1B; }
.quick-text { font-size: $font-md; font-weight: 500; color: $text; }
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 48rpx 40rpx 24rpx;
@include flex-between;
padding: $space-2xl $space-xl $space-md;
}
.section-title {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 500;
color: #8B7E7E;
color: $text-sec;
}
.section-more {
font-size: 24rpx;
color: #FF8C69;
padding: 16rpx 24rpx;
margin: -16rpx -24rpx;
font-size: $font-md;
color: $primary;
padding: $space-sm $space-md;
margin: -$space-sm -#{$space-md};
&:active { opacity: 0.6; }
}
.tx-list {
padding: 0 40rpx;
padding: 0 $space-xl;
}
.amount-skeleton {
margin-bottom: 32rpx;
margin-bottom: $space-lg;
}
.skeleton-item {
display: flex;
align-items: center;
padding: 28rpx 0;
gap: 24rpx;
padding: $space-lg 0;
gap: $space-md;
}
.skeleton-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 8rpx;
gap: $space-xs;
}
.state-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16rpx;
padding: 80rpx 0;
@include state-box;
}
.state-text {
font-size: 28rpx;
color: #BFB3B3;
@include state-text;
}
/* 强提醒公告弹窗 */