refactor(components): 重构优惠券组件样式和结构

- 更新 CouponCard 组件样式,优化主题颜色和布局
- 调整 CouponList 组件样式,使用原生样式替代自定义样式
- 修改 orderConfirm 页面中的地址栏样式
- 更新 QuantitySelector 组件样式,统一数量选择器样式
- 删除 Questions 组件代码
This commit is contained in:
2025-08-11 18:15:36 +08:00
parent bcaf8203e4
commit 6f76be4da4
9 changed files with 230 additions and 297 deletions

View File

@@ -6,193 +6,173 @@
margin-bottom: 12px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
background: #fff;
&--disabled {
&.disabled {
opacity: 0.6;
}
// 主题颜色
&--red {
.coupon-card__left {
background: linear-gradient(135deg, #ff6b6b, #ff5252);
}
.coupon-card__btn--receive,
.coupon-card__btn--use {
background: linear-gradient(135deg, #ff6b6b, #ff5252);
color: #fff;
}
}
&--orange {
.coupon-card__left {
background: linear-gradient(135deg, #ffa726, #ff9800);
}
.coupon-card__btn--receive,
.coupon-card__btn--use {
background: linear-gradient(135deg, #ffa726, #ff9800);
color: #fff;
}
}
&--blue {
.coupon-card__left {
background: linear-gradient(135deg, #42a5f5, #2196f3);
}
.coupon-card__btn--receive,
.coupon-card__btn--use {
background: linear-gradient(135deg, #42a5f5, #2196f3);
color: #fff;
}
}
&--purple {
.coupon-card__left {
background: linear-gradient(135deg, #ab47bc, #9c27b0);
}
.coupon-card__btn--receive,
.coupon-card__btn--use {
background: linear-gradient(135deg, #ab47bc, #9c27b0);
color: #fff;
}
}
&--green {
.coupon-card__left {
background: linear-gradient(135deg, #66bb6a, #4caf50);
}
.coupon-card__btn--receive,
.coupon-card__btn--use {
background: linear-gradient(135deg, #66bb6a, #4caf50);
color: #fff;
}
}
// 左侧金额区域
&__left {
flex: 0 0 100px;
.coupon-left {
flex-shrink: 0;
width: 100px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
position: relative;
&.theme-red {
background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}
&.theme-orange {
background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
&.theme-blue {
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}
&.theme-purple {
background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}
&.theme-green {
background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}
.amount-wrapper {
display: flex;
align-items: baseline;
margin-bottom: 4px;
.currency {
font-size: 14px;
font-weight: 500;
margin-right: 2px;
}
.amount {
font-size: 30px;
font-weight: bold;
line-height: 1;
}
}
.condition {
font-size: 12px;
opacity: 0.9;
margin-top: 2px;
}
}
&__amount {
display: flex;
align-items: baseline;
margin-bottom: 4px;
}
&__currency {
font-size: 14px;
font-weight: 500;
margin-right: 1px;
}
&__value {
font-size: 28px;
font-weight: bold;
line-height: 1;
}
&__condition {
font-size: 11px;
opacity: 0.9;
margin-top: 2px;
}
// 分割线区域
&__divider {
flex: 0 0 2px;
.coupon-divider {
flex-shrink: 0;
width: 2px;
position: relative;
background: #f0f0f0;
}
&__divider-line {
width: 100%;
height: 100%;
background: repeating-linear-gradient(
to bottom,
transparent 0px,
transparent 4px,
#ddd 4px,
#ddd 8px
);
}
&__circle {
position: absolute;
width: 16px;
height: 16px;
background: #f5f5f5;
border-radius: 50%;
left: 50%;
transform: translateX(-50%);
&--top {
top: -8px;
.divider-line {
width: 100%;
height: 100%;
background: repeating-linear-gradient(
to bottom,
transparent 0px,
transparent 4px,
#ddd 4px,
#ddd 8px
);
}
&--bottom {
.divider-circle-top {
position: absolute;
width: 16px;
height: 16px;
background: #f5f5f5;
border-radius: 50%;
top: -8px;
left: -7px;
}
.divider-circle-bottom {
position: absolute;
width: 16px;
height: 16px;
background: #f5f5f5;
border-radius: 50%;
bottom: -8px;
left: -7px;
}
}
// 右侧信息区域
&__right {
.coupon-right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12px;
}
&__info {
flex: 1;
}
.coupon-info {
flex: 1;
&__title {
font-size: 14px;
font-weight: 600;
color: #333;
margin-bottom: 4px;
}
.coupon-title {
font-size: 14px;
font-weight: 600;
color: #1f2937;
margin-bottom: 4px;
}
&__validity {
font-size: 11px;
color: #999;
}
.coupon-validity {
font-size: 12px;
color: #6b7280;
}
}
&__action {
display: flex;
justify-content: flex-end;
align-items: center;
}
.coupon-actions {
display: flex;
justify-content: flex-end;
align-items: center;
&__btn {
min-width: 50px;
height: 24px;
border-radius: 12px;
font-size: 11px;
border: none;
.coupon-btn {
min-width: 48px;
height: 24px;
border-radius: 12px;
font-size: 12px;
border: none;
color: #fff;
&--receive,
&--use {
color: #fff;
&.theme-red {
background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}
&.theme-orange {
background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
&.theme-blue {
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}
&.theme-purple {
background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}
&.theme-green {
background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}
}
.status-text {
font-size: 12px;
color: #6b7280;
padding: 4px 8px;
}
}
}
&__status {
font-size: 12px;
color: #999;
padding: 4px 8px;
}
// 状态遮罩
&__mask {
.status-overlay {
position: absolute;
top: 0;
left: 0;
@@ -202,52 +182,15 @@
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
z-index: 10;
&__mask-text {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 4px 12px;
border-radius: 12px;
font-size: 14px;
font-weight: 500;
}
}
// 优惠券列表容器
.coupon-list {
padding: 16px;
&__title {
font-size: 18px;
font-weight: 600;
color: #333;
margin-bottom: 16px;
}
&__empty {
text-align: center;
padding: 40px 20px;
color: #999;
font-size: 14px;
}
}
// 优惠券横向滚动容器
.coupon-scroll {
display: flex;
padding: 16px;
gap: 8px;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
&::-webkit-scrollbar {
display: none;
}
.coupon-card {
flex: 0 0 240px;
margin-bottom: 0;
.status-badge {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 4px 12px;
border-radius: 12px;
font-size: 14px;
font-weight: 500;
}
}
}