优化了样式,抽象出了 WXSS/JS 库

This commit is contained in:
2026-06-13 18:19:46 +08:00
parent 6fbae9b32c
commit 3dc03f6fe5
51 changed files with 7154 additions and 9035 deletions

View File

@@ -1,190 +1,213 @@
/* pages/orders/orders.wxss */
.dingdan-page {
background-color: #f8f9fa;
padding-bottom: 20rpx;
}
.dingdan-tabs-scroll {
width: 100%;
height: 90rpx;
white-space: nowrap;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.03);
}
.dingdan-tabs-container {
display: flex;
align-items: center;
height: 100%;
padding: 0 20rpx;
}
.dingdan-tab-item {
position: relative;
}
.dingdan-tab-item:last-child {
margin-right: 0;
}
/* .dingdan-tab-item.tab-active 已由全局 .tab-capsule--active 覆盖 */
.tab-active-line {
width: 40rpx;
height: 4rpx;
background-color: #4caf50;
border-radius: 2rpx;
margin-top: 6rpx;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.8); }
to { opacity: 1; transform: scale(1); }
}
.tab-text {
font-weight: 400;
}
.dingdan-list-container {
padding: 20rpx;
}
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 400rpx;
}
.loading-spinner {
border: 6rpx solid #e0e0e0;
border-top-color: #4caf50;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20rpx;
}
.loading-text {
font-size: 28rpx;
color: #999999;
}
.empty-container {
height: 500rpx;
padding-top: 80rpx;
}
.empty-image {
opacity: 0.6;
}
.empty-text {
font-size: 32rpx;
color: #999999;
}
.dingdan-card {
display: flex;
align-items: center;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 20rpx;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dingdan-card:active {
transform: translateY(-2rpx);
box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
}
.dingdan-card-left {
flex-shrink: 0;
margin-right: 24rpx;
}
.dingdan-image {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
background-color: #f5f5f5;
}
.dingdan-card-center {
flex: 1;
height: 160rpx;
display: flex;
align-items: flex-start;
}
.dingdan-jieshao {
font-size: 28rpx;
line-height: 40rpx;
color: #333333;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
text-overflow: ellipsis;
}
.dingdan-card-right {
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
height: 160rpx;
margin-left: 20rpx;
}
/* 价格样式 */
.dingdan-jine {
display: flex;
align-items: center; /* 垂直居中 */
}
.jine-symbol {
font-size: 28rpx;
color: #333333;
font-weight: 500;
margin-right: 4rpx; /* 添加右边距,让符号和数字有间隔 */
}
.jine-number {
font-size: 32rpx; /* 整数和小数一样大 */
color: #333333;
font-weight: 600;
}
.load-more-line {
width: 80rpx;
height: 1rpx;
background-color: #e0e0e0;
margin: 0 20rpx;
}
.load-more-text {
white-space: nowrap;
}
@media (max-width: 375px) {
.dingdan-image {
width: 140rpx;
height: 140rpx;
}
.dingdan-card-center {
height: 140rpx;
}
.dingdan-card-right {
height: 140rpx;
}
.jine-number {
font-size: 30rpx;
}
}
/* pages/orders/orders.wxss */
.dingdan-page {
background: #f2f2f2;
min-height: 100vh;
}
/* TAB栏 */
.dingdan-tabs-scroll {
width: 100%;
background: #fff;
white-space: nowrap;
border-bottom: 1rpx solid #f0f0f0;
}
.dingdan-tabs-container {
display: flex;
align-items: center;
height: 88rpx;
padding: 0 8rpx;
}
.dingdan-tab-item {
position: relative;
padding: 0 28rpx;
height: 88rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.tab-text {
font-size: 28rpx;
color: #666;
font-weight: 400;
line-height: 1;
}
.dingdan-tab-item.tab-active .tab-text {
color: #e02e24;
font-weight: 700;
}
.tab-active-line {
width: 40rpx;
height: 6rpx;
background: #e02e24;
border-radius: 3rpx;
margin-top: 10rpx;
}
/* 列表区 */
.dingdan-list-container {
padding: 20rpx 24rpx;
}
/* 加载 */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 400rpx;
}
.loading-spinner {
width: 56rpx;
height: 56rpx;
border: 4rpx solid #f0f0f0;
border-top-color: #e02e24;
border-radius: 50%;
animation: spin 0.7s linear infinite;
margin-bottom: 20rpx;
}
.loading-text {
font-size: 26rpx;
color: #999;
}
/* 空状态 */
.empty-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 500rpx;
}
.empty-image {
width: 200rpx;
height: 200rpx;
opacity: 0.5;
margin-bottom: 24rpx;
}
.empty-text {
font-size: 30rpx;
color: #999;
margin-bottom: 8rpx;
}
.empty-subtext {
font-size: 24rpx;
color: #bbb;
}
/* 订单卡片 */
.dingdan-card {
display: flex;
align-items: center;
background: #fff;
border-radius: 12rpx;
padding: 24rpx;
margin-bottom: 16rpx;
}
.dingdan-card-left {
flex-shrink: 0;
margin-right: 20rpx;
}
.dingdan-image {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
background: #f5f5f5;
}
.dingdan-card-center {
flex: 1;
height: 160rpx;
display: flex;
align-items: flex-start;
}
.dingdan-jieshao {
font-size: 28rpx;
line-height: 40rpx;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
.dingdan-card-right {
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: space-between;
height: 160rpx;
margin-left: 16rpx;
flex-shrink: 0;
}
.dingdan-zhuangtai {
font-size: 24rpx;
color: #e02e24;
font-weight: 600;
}
.dingdan-jine {
display: flex;
align-items: baseline;
}
.jine-symbol {
font-size: 24rpx;
color: #333;
font-weight: 500;
}
.jine-number {
font-size: 32rpx;
color: #333;
font-weight: 700;
}
/* 加载更多 */
.load-more-container {
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx 0;
}
.load-more-line {
width: 80rpx;
height: 1rpx;
background: #e0e0e0;
}
.load-more-text {
font-size: 24rpx;
color: #999;
white-space: nowrap;
margin: 0 20rpx;
}
.no-more-container {
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx 0;
}
.no-more-text {
font-size: 24rpx;
color: #ccc;
}