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

@@ -325,59 +325,50 @@ function handleDissolve(group: Group) {
</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; }
.status-bar { @include status-bar; }
.nav-bar {
display: flex;
align-items: center;
padding: 16rpx 40rpx 24rpx;
padding: $space-sm $space-xl $space-md;
}
.nav-back {
width: 88rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
&:active { opacity: 0.6; }
@include nav-back;
}
.nav-title {
flex: 1;
text-align: center;
font-size: 36rpx;
font-size: $font-2xl;
font-weight: 600;
color: #2D1B1B;
color: $text;
}
/* Tab 卡片 */
.action-card {
margin: 24rpx 40rpx 0;
background: #FFFFFF;
border-radius: 40rpx;
border: 2rpx solid #F0E0D6;
box-shadow: 4rpx 4rpx 12rpx rgba(45, 27, 27, 0.08);
margin: $space-md $space-xl 0;
background: $surface;
border-radius: $radius-2xl;
border: 2rpx solid $border;
box-shadow: $shadow-md;
overflow: hidden;
}
.tab-bar {
display: flex;
padding: 16rpx 16rpx 0;
gap: 8rpx;
padding: $space-sm $space-sm 0;
gap: $space-xs;
}
.tab-item {
@@ -386,69 +377,69 @@ function handleDissolve(group: Group) {
display: flex;
align-items: center;
justify-content: center;
border-radius: 20rpx 20rpx 0 0;
transition: all 0.2s;
border-radius: $radius-lg $radius-lg 0 0;
transition: all $transition-normal;
&.active {
background: #FFF0E6;
background: $surface-warm;
.tab-text { color: #FF8C69; }
.tab-text { color: $primary; }
}
}
.tab-text {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 500;
color: #8B7E7E;
color: $text-sec;
}
.action-body {
display: flex;
gap: 16rpx;
padding: 24rpx 32rpx 32rpx;
gap: $space-sm;
padding: $space-md $space-lg $space-lg;
}
.action-input {
flex: 1;
height: 80rpx;
padding: 0 24rpx;
background: #FFF8F0;
border-radius: 20rpx;
border: 2rpx solid #F0E0D6;
font-size: 28rpx;
color: #2D1B1B;
padding: 0 $space-md;
background: $bg;
border-radius: $radius-lg;
border: 2rpx solid $border;
font-size: $font-lg;
color: $text;
}
.action-btn {
height: 80rpx;
padding: 0 32rpx;
background: linear-gradient(135deg, #FF8C69, #E67355);
border-radius: 20rpx;
padding: 0 $space-lg;
background: linear-gradient(135deg, $primary, #E67355);
border-radius: $radius-lg;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
gap: $space-xs;
&.disabled { opacity: 0.5; }
&:active { opacity: 0.8; }
}
.action-btn-text {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 600;
color: #FFFFFF;
color: $surface;
white-space: nowrap;
}
/* 群组列表 */
.section-header {
padding: 40rpx 40rpx 16rpx;
padding: $space-xl $space-xl $space-sm;
}
.section-title {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 500;
color: #8B7E7E;
color: $text-sec;
}
.loading-box, .empty-box {
@@ -456,36 +447,36 @@ function handleDissolve(group: Group) {
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16rpx;
gap: $space-sm;
padding: 80rpx 0;
}
.loading-text, .empty-text {
font-size: 28rpx;
color: #BFB3B3;
font-size: $font-lg;
color: $text-muted;
}
.group-list {
padding: 0 40rpx;
padding: 0 $space-xl;
}
.group-item {
display: flex;
align-items: flex-start;
padding: 28rpx 32rpx;
margin-bottom: 16rpx;
background: #FFFFFF;
border-radius: 28rpx;
border: 2rpx solid #F0E0D6;
box-shadow: 4rpx 4rpx 12rpx rgba(45, 27, 27, 0.08);
gap: 24rpx;
padding: $font-lg $space-lg;
margin-bottom: $space-sm;
background: $surface;
border-radius: $radius-xl;
border: 2rpx solid $border;
box-shadow: $shadow-md;
gap: $space-md;
}
.group-icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #FFF0E6;
background: $surface-warm;
display: flex;
align-items: center;
justify-content: center;
@@ -505,24 +496,24 @@ function handleDissolve(group: Group) {
}
.group-name {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 600;
color: #2D1B1B;
color: $text;
}
.role-badge {
padding: 2rpx 12rpx;
border-radius: 8rpx;
border-radius: $radius-xs;
}
.role-badge-text {
font-size: 20rpx;
font-size: $font-xs;
font-weight: 500;
}
.group-meta {
font-size: 24rpx;
color: #BFB3B3;
font-size: $font-md;
color: $text-muted;
display: block;
margin-top: 4rpx;
}
@@ -532,19 +523,19 @@ function handleDissolve(group: Group) {
display: flex;
align-items: center;
margin-top: 12rpx;
gap: 8rpx;
gap: $space-xs;
flex-wrap: wrap;
}
.invite-label {
font-size: 24rpx;
color: #8B7E7E;
font-size: $font-md;
color: $text-sec;
}
.invite-code {
font-size: 24rpx;
font-size: $font-md;
font-weight: 600;
color: #FF8C69;
color: $primary;
font-family: 'Fredoka', monospace;
}
@@ -553,70 +544,61 @@ function handleDissolve(group: Group) {
align-items: center;
gap: 4rpx;
padding: 4rpx 12rpx;
background: #FFF8F0;
border-radius: 12rpx;
background: $bg;
border-radius: $radius-sm;
&:active { background: #F0E0D6; }
&:active { background: $border; }
}
.invite-action-text {
font-size: 22rpx;
color: #8B7E7E;
font-size: $font-sm;
color: $text-sec;
}
/* 操作按钮 */
.group-actions {
display: flex;
flex-direction: column;
gap: 8rpx;
gap: $space-xs;
flex-shrink: 0;
}
.group-btn {
padding: 12rpx 24rpx;
border-radius: 16rpx;
padding: 12rpx $space-md;
border-radius: $radius-md;
display: flex;
align-items: center;
justify-content: center;
&.manage { background: #FFF0E6; }
&.leave { background: #FFF0E6; }
&.dissolve { background: #FFE8E8; }
&.manage { background: $surface-warm; }
&.leave { background: $surface-warm; }
&.dissolve { background: $danger-light; }
&:active { opacity: 0.7; }
}
.group-btn-text {
font-size: 24rpx;
font-size: $font-md;
font-weight: 500;
white-space: nowrap;
&.manage-text { color: #FF8C69; }
&.leave-text { color: #FF8C69; }
&.dissolve-text { color: #FF6B6B; }
&.manage-text { color: $primary; }
&.leave-text { color: $primary; }
&.dissolve-text { color: $danger; }
}
/* 成员管理弹窗 */
.modal-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 200;
display: flex;
align-items: flex-end;
@include modal-mask;
}
.member-modal {
width: 100%;
max-height: 75vh;
background: #FFFFFF;
border-radius: 40rpx 40rpx 0 0;
background: $surface;
border-radius: $radius-2xl $radius-2xl 0 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
overflow: hidden;
}
@@ -624,14 +606,14 @@ function handleDissolve(group: Group) {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 40rpx 24rpx;
border-bottom: 2rpx solid #F0E0D6;
padding: $space-lg $space-xl $space-md;
border-bottom: 2rpx solid $border;
}
.modal-title {
font-size: 32rpx;
font-size: $font-xl;
font-weight: 600;
color: #2D1B1B;
color: $text;
}
.modal-close {
@@ -641,14 +623,14 @@ function handleDissolve(group: Group) {
align-items: center;
justify-content: center;
border-radius: 50%;
background: #F0E0D6;
background: $border;
&:active { background: #E0D6D0; }
&:active { background: darken($border, 5%); }
}
.modal-close-text {
font-size: 36rpx;
color: #8B7E7E;
font-size: $font-2xl;
color: $text-sec;
line-height: 1;
}
@@ -661,19 +643,17 @@ function handleDissolve(group: Group) {
.member-list {
max-height: 60vh;
padding: 16rpx 40rpx 40rpx;
box-sizing: border-box;
padding: $space-sm $space-xl $space-xl;
width: 100%;
}
.member-item {
display: flex;
align-items: center;
padding: 20rpx 0;
gap: 20rpx;
padding: $space-lg 0;
gap: $space-lg;
border-bottom: 2rpx solid #F8F0EB;
width: 100%;
box-sizing: border-box;
&:last-child { border-bottom: none; }
}
@@ -682,7 +662,7 @@ function handleDissolve(group: Group) {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
background: #F0E0D6;
background: $border;
flex-shrink: 0;
}
@@ -692,9 +672,9 @@ function handleDissolve(group: Group) {
}
.member-name {
font-size: 28rpx;
font-size: $font-lg;
font-weight: 500;
color: #2D1B1B;
color: $text;
display: block;
overflow: hidden;
text-overflow: ellipsis;
@@ -706,22 +686,22 @@ function handleDissolve(group: Group) {
}
.member-role-text {
font-size: 22rpx;
font-size: $font-sm;
}
.member-remove {
padding: 12rpx 24rpx;
background: #FFE8E8;
border-radius: 16rpx;
padding: 12rpx $space-md;
background: $danger-light;
border-radius: $radius-md;
flex-shrink: 0;
&:active { opacity: 0.7; }
}
.member-remove-text {
font-size: 24rpx;
font-size: $font-md;
font-weight: 500;
color: #FF6B6B;
color: $danger;
}
@media (prefers-reduced-motion: reduce) {