fix(uniapp): 移除购物车右滑删除消除红线,优化地址吸底按钮与订单赠品划线展示及阶梯促销

This commit is contained in:
pikachu1995@126.com
2026-11-10 15:22:50 +08:00
parent 869975b3c3
commit 0a4db7b6f4
8 changed files with 238 additions and 85 deletions

View File

@@ -68,9 +68,11 @@
:key="goodsIndex">
<u-image border-radius="6" width="131rpx" height="131rpx" mode="aspectFill"
:src="getOrderItemImage(goods, order, goodsIndex)"></u-image>
<text v-if="isGiftItem(goods)" class="gift-corner-badge">赠</text>
</view>
<view class="goods-info">
<view v-if="order.orderItems.length <= 1" class="goods-title u-line-2">
<text v-if="isGiftItem(order.orderItems[0])" class="gift-badge">赠品</text>
{{ order.groupName }}</view>
<view v-if="order.orderItems.length <= 1" class="goods-price">
¥{{unitPrice(order.flowPrice) }}
@@ -444,6 +446,11 @@ async function confirmCancelAfterSale() {
}
}
function isGiftItem(goods: any) {
if (!goods) return false
return goods.promotionType === 'GIFT' || (Number(goods.flowPrice) === 0 && goods.promotionType === 'GIFT')
}
function onAfterSaleExpress(order: any) {
const sku = (order?.orderItems && order.orderItems[0]) || {}
storage.setAfterSaleData({ ...order, ...sku, storeName: order.storeName })
@@ -692,6 +699,7 @@ function reBuy(order: any) {
height: 131rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
position: relative;
}
.goods-info {
@@ -803,4 +811,30 @@ function reBuy(order: any) {
border-color: $light-color !important;
background-color: #ffffff !important;
}
.gift-corner-badge {
position: absolute;
top: 0;
left: 0;
background: #ff4d4f;
color: #fff;
font-size: 18rpx;
padding: 2rpx 8rpx;
border-top-left-radius: 6rpx;
border-bottom-right-radius: 6rpx;
z-index: 2;
line-height: 1.2;
}
.gift-badge {
display: inline-block;
background: #ff4d4f;
color: #fff;
font-size: 20rpx;
line-height: 28rpx;
padding: 0 10rpx;
border-radius: 6rpx;
margin-right: 8rpx;
vertical-align: middle;
}
</style>

View File

@@ -108,8 +108,14 @@
</view>
<view class="goods-body">
<view class="goods-info" @click="gotoGoodsDetail(sku)">
<view class="goods-title u-line-2">{{ sku.goodsName }}</view>
<view class="goods-price">
<view class="goods-title u-line-2">
<text v-if="isGiftItem(sku)" class="gift-badge">赠品</text>
{{ sku.goodsName }}
</view>
<view class="goods-price" v-if="isGiftItem(sku)">
<text class="gift-original-price">¥{{ unitPrice(sku.goodsPrice) }}</text>
</view>
<view class="goods-price" v-else>
¥{{unitPrice(sku.goodsPrice) }}
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="!isECouponOrder && !isAppointmentOrderFlag && sku.isRefund && sku.isRefund !== 'NO_REFUND'">
@@ -122,6 +128,7 @@
<view>x{{ sku.num }}</view>
</view>
<view class="after-sale-btn" v-if="canShowSkuAfterSale(sku)" @click.stop="onSkuAfterSale(sku)">退款/售后</view>
<view class="gift-tip" v-else-if="isGiftItem(sku)">随单赠送</view>
</view>
</view>
</view>
@@ -631,7 +638,13 @@ function canApplySkuAfterSale(sku: any) {
return false
}
function isGiftItem(sku: any) {
if (!sku) return false
return sku.promotionType === 'GIFT' || (Number(sku.flowPrice) === 0 && sku.promotionType === 'GIFT')
}
function canShowSkuAfterSale(sku: any) {
if (isGiftItem(sku)) return false
if (isECouponOrder.value) return false
if (!order.value?.sn || Number(order.value.flowPrice) === 0) return false
if (isAppointmentOrderFlag.value && !appointmentAllow.value.afterSale) return false
@@ -1178,4 +1191,28 @@ page,
flex:2;
}
}
.gift-badge {
display: inline-block;
background: #ff4d4f;
color: #fff;
font-size: 20rpx;
line-height: 28rpx;
padding: 0 10rpx;
border-radius: 6rpx;
margin-right: 8rpx;
vertical-align: middle;
}
.gift-original-price {
color: #999;
font-size: 26rpx;
text-decoration: line-through;
font-weight: normal;
}
.gift-tip {
font-size: 22rpx;
color: #999;
margin-top: 8rpx;
text-align: right;
}
</style>