记账微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

344 lines
4.9 KiB

1 week ago
/* 基础样式 */
.container {
padding: 20rpx;
background-color: #f5f5f5;
min-height: calc(100vh - 100rpx);
box-sizing: border-box;
}
/* 时间筛选 */
.time-filter {
margin: 20rpx 0;
}
.time-btns {
display: flex;
justify-content: center;
background-color: #f0f0f0;
border-radius: 60rpx;
padding: 6rpx;
width: 600rpx;
margin: 0 auto;
}
.time-btn {
flex: 1;
height: 72rpx;
line-height: 72rpx;
border-radius: 50rpx;
background-color: transparent;
font-size: 30rpx;
font-weight: 500;
color: #666;
}
.time-btn-active {
background-color: #3B82F6;
color: #fff;
}
/* 当前时间选择 */
.current-period {
margin: 30rpx 0;
}
.period-container {
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
border-radius: 20rpx;
padding: 20rpx;
width: 400rpx;
margin: 0 auto;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.period-btn {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
}
.arrow-icon {
width: 30rpx;
height: 30rpx;
}
.period-text {
font-size: 34rpx;
font-weight: 600;
color: #333;
margin: 0 20rpx;
}
/* 总额卡片 */
.total-cards {
display: flex;
justify-content: space-between;
margin: 30rpx 0;
gap: 20rpx;
}
.card {
flex: 1;
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 20rpx;
}
.card-label {
font-size: 28rpx;
color: #666;
}
.card-icon {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.income-icon {
background-color: rgba(59, 130, 246, 0.1);
}
.expense-icon {
background-color: rgba(239, 68, 68, 0.1);
}
.icon-img {
width: 30rpx;
height: 30rpx;
}
.card-amount {
font-size: 40rpx;
font-weight: 700;
margin-bottom: 15rpx;
}
.income-card .card-amount {
color: #3B82F6;
}
.expense-card .card-amount {
color: #EF4444;
}
.card-change {
display: flex;
align-items: center;
font-size: 24rpx;
}
.change-icon {
margin-right: 5rpx;
}
.positive-change .change-icon,
.positive-change .change-value {
color: #10B981;
}
.negative-change .change-icon,
.negative-change .change-value {
color: #EF4444;
}
.change-desc {
color: #999;
margin-left: 5rpx;
}
/* 图表容器 */
.chart-container {
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.chart-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.chart-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.chart-legend {
display: flex;
gap: 20rpx;
}
.legend-item {
display: flex;
align-items: center;
font-size: 26rpx;
color: #666;
}
.legend-color {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.income-color {
background-color: #3B82F6;
}
.expense-color {
background-color: #EF4444;
}
.chart-canvas {
width: 100%;
height: 400rpx;
}
/* 饼图部分 */
.pie-type-switch {
display: flex;
background-color: #f0f0f0;
border-radius: 40rpx;
padding: 4rpx;
}
.type-btn {
padding: 0 20rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 30rpx;
background-color: transparent;
font-size: 26rpx;
color: #666;
}
.type-btn-active {
background-color: #3B82F6;
color: #fff;
}
.pie-content {
display: flex;
flex-direction: column;
}
.pie-canvas {
width: 100%;
height: 300rpx;
margin: 0 auto;
}
.pie-legend {
margin-top: 20rpx;
}
.legend-list {
display: flex;
flex-direction: column;
gap: 15rpx;
}
.pie-legend .legend-item {
justify-content: space-between;
padding: 5rpx 0;
border-bottom: 1rpx solid #f0f0f0;
}
.pie-legend .legend-item:last-child {
border-bottom: none;
}
.legend-value {
font-weight: 500;
margin-right: 15rpx;
}
.legend-percent {
color: #999;
}
/* 底部导航 */
.tab-bar {
display: flex;
justify-content: space-around;
align-items: center;
height: 100rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
}
.tab-bar-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.tab-bar-icon {
width: 44rpx;
height: 44rpx;
margin-bottom: 8rpx;
}
.tab-bar-text {
font-size: 20rpx;
color: #999;
}
.tab-bar-text-active {
color: #3B82F6;
}
.add-btn {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background-color: #3B82F6;
display: flex;
align-items: center;
justify-content: center;
margin-top: -40rpx;
box-shadow: 0 4rpx 10rpx rgba(59, 130, 246, 0.3);
}
.add-btn .tab-bar-icon {
width: 40rpx;
height: 40rpx;
margin-bottom: 0;
}
.currentTab {
color: #3B82F6;
}