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

@@ -216,51 +216,44 @@ function goBack() {
</script>
<style lang="scss" scoped>
@import '@/styles/mixins.scss';
.page {
min-height: 100vh;
background: #FFF8F0;
@include page-base;
display: flex;
flex-direction: column;
padding-bottom: 0;
}
.header-fixed {
position: sticky;
top: 0;
z-index: 100;
background: #FFF8F0;
@include sticky-header;
}
.status-bar {
background: #FFF8F0;
@include status-bar;
}
.header {
display: flex;
@include nav-bar;
justify-content: space-between;
align-items: center;
padding: 16rpx 40rpx;
}
.nav-back {
width: 88rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
@include nav-back;
border-radius: 50%;
&:active { background: #F0E0D6; }
&:active { background: $border; }
}
.title { font-size: 32rpx; font-weight: 500; color: #2D1B1B; }
.title { font-size: $font-xl; font-weight: 500; color: $text; }
.type-toggle-wrap { display: flex; justify-content: center; margin: 16rpx 0; }
.type-toggle-wrap { display: flex; justify-content: center; margin: $space-sm 0; }
.type-toggle {
display: inline-flex;
background: #FFF0E6;
border-radius: 24rpx;
padding: 8rpx;
background: $surface-warm;
border-radius: $radius-lg;
padding: $space-xs;
position: relative;
}
@@ -270,48 +263,48 @@ function goBack() {
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #8B7E7E;
border-radius: 20rpx;
font-size: $font-lg;
color: $text-sec;
border-radius: $radius-lg;
position: relative;
z-index: 1;
transition: color 0.2s;
transition: color $transition-normal;
&.active { color: #FF8C69; font-weight: 600; }
&.active { color: $primary; font-weight: 600; }
}
.slider {
position: absolute;
top: 8rpx;
left: 8rpx;
top: $space-xs;
left: $space-xs;
width: 160rpx;
height: 72rpx;
background: #FFFFFF;
border-radius: 20rpx;
box-shadow: 2rpx 2rpx 8rpx rgba(45, 27, 27, 0.08);
transition: transform 0.2s;
background: $surface;
border-radius: $radius-lg;
box-shadow: $shadow-sm;
transition: transform $transition-normal;
}
.income .slider { transform: translateX(160rpx); }
.amount-display {
text-align: center;
padding: 32rpx 40rpx 24rpx;
padding: $space-lg $space-xl $space-md;
}
.currency {
font-family: 'Fredoka', sans-serif;
font-size: 48rpx;
font-size: $space-2xl;
font-weight: 500;
color: #BFB3B3;
margin-right: 8rpx;
color: $text-muted;
margin-right: $space-xs;
}
.digits {
font-family: 'Fredoka', sans-serif;
font-size: 88rpx;
font-weight: 700;
color: #2D1B1B;
color: $text;
font-variant-numeric: tabular-nums;
}
@@ -319,7 +312,7 @@ function goBack() {
font-family: 'Fredoka', monospace;
font-size: 88rpx;
font-weight: 300;
color: #FF8C69;
color: $primary;
animation: blink 1s step-end infinite;
}
@@ -334,8 +327,8 @@ function goBack() {
.category-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16rpx;
padding: 8rpx 0;
gap: $space-sm;
padding: $space-xs 0;
}
.cat-item {
@@ -348,15 +341,15 @@ function goBack() {
&:active { transform: scale(0.95); }
}
.cat-name { font-size: 22rpx; color: #8B7E7E; }
.cat-name { font-size: $font-sm; color: $text-sec; }
.cat-name.active {
color: #FF8C69;
color: $primary;
font-weight: 600;
}
.extra-fields {
padding: 16rpx 40rpx;
padding: $space-sm $space-xl;
display: flex;
flex-direction: column;
gap: 12rpx;
@@ -364,19 +357,19 @@ function goBack() {
.extra-row {
height: 88rpx;
background: #FFFFFF;
border-radius: 20rpx;
border: 2rpx solid #F0E0D6;
padding: 0 24rpx;
background: $surface;
border-radius: $radius-lg;
border: 2rpx solid $border;
padding: 0 $space-md;
display: flex;
align-items: center;
gap: 12rpx;
}
.extra-text { font-size: 28rpx; color: #2D1B1B; flex: 1; }
.extra-input { font-size: 28rpx; color: #2D1B1B; flex: 1; }
.extra-text { font-size: $font-lg; color: $text; flex: 1; }
.extra-input { font-size: $font-lg; color: $text; flex: 1; }
.placeholder { color: #BFB3B3; }
.placeholder { color: $text-muted; }
@media (prefers-reduced-motion: reduce) {
.cursor {