From e9e5e20df418e903f6ae55dba7a700f37870e0f4 Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Wed, 15 Jul 2026 17:53:25 +0800 Subject: [PATCH] 1 --- components/tab-bar/delivery.vue | 365 +++++++++++++++++++++++++++++--- 1 file changed, 340 insertions(+), 25 deletions(-) diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index 916b3ee..cfb9bfc 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -21,46 +21,66 @@ - - - {{'#' + item.numberCode}} + + + {{'#' + item.numberCode}} + {{item.createTime | formatISOTime}} - - {{item.createTime | formatISOTime}} - + + {{item.status == 0?'待支付':item.status == 2?'待接单-不要出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake != 1)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} - - {{item.status == 0?'待支付':item.status == 2?'待配送员接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} + + + 预约配送 + + 要求送达:{{getDeliveryMustFinishTime(item) | formatISOTime}} - - - 商品 {{item.goodsNum}} + + + 商品 + 共{{item.goodsNum}}件 - - - {{item1.productName}} + + + {{item1.productName}} + {{item1.specs | delNode}} - + {{'X' + item1.quantity}} - + {{'¥'+ item1.price}} - - - {{item.deliveryType == 1?'配送':item.isPack == 1?'自取-打包':item.isPack == 0?'自取-堂食':'自取'}} + + 餐盒费 + ¥{{formatMoney(item.packageFee)}} + + + 合计 + ¥{{getOrderTotalAmount(item)}} + + + 备注 + {{getOrderRemark(item)}} + + + + {{(item.deliveryType == 1 && item.orderType != 3)?'普通配送单':(item.deliveryType == 1 && item.orderType == 3)?'面对面配送单':(item.isPack == 1 && item.otherOrder == null)?'自取-打包':(item.isPack == 0 && item.otherOrder == null)?'自取-堂食':'到店消费'}} - - 拼 + + 拼团详情 - - - 已出餐 + + + 出餐 + + 面对面配送单需要一块出餐--点击拼团详情按钮并出餐 + @@ -154,6 +174,11 @@ value: 10, checked: true }, + { + name: '待配送接单', + value: 3, + checked: false + }, { name: '待消费', value: 2, @@ -207,6 +232,16 @@ const minutes = date.getMinutes().toString().padStart(2, '0'); const seconds = date.getSeconds().toString().padStart(2, '0'); return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + }, + delNode(data) { + if (data == null || data === '') return ''; + let str = ''; + if (typeof data === 'object') { + str = JSON.stringify(data); + } else { + str = String(data); + } + return str.replace(/[{}"]/g, ''); } }, methods: { @@ -217,6 +252,47 @@ } this.getList() }, + isAppointmentDelivery(item) { + const deliveryInfo = this.getDeliveryInfo(item) + return item && item.deliveryType == 1 && (item.appointmentDelivery == 1 || deliveryInfo.appointmentDelivery == 1) + }, + getDeliveryInfo(item) { + return item && item.deliveryInfo ? item.deliveryInfo : {} + }, + getDeliveryMustFinishTime(item) { + if (!item || item.deliveryType != 1) return '' + const deliveryInfo = this.getDeliveryInfo(item) + return deliveryInfo.mustFinishTime || item.mustFinishTime || '' + }, + shouldShowPackageFee(order) { + return !!order && (order.deliveryType == 1 || order.isPack == 1) + }, + formatMoney(value) { + return this.toNumber(value).toFixed(2) + }, + toNumber(value) { + let amount = parseFloat(value) + return isNaN(amount) ? 0 : amount + }, + getOrderRemark(item) { + if (!item) return '' + return item.remark || (item.mallOrder && item.mallOrder.remark) || '' + }, + canShowMealServingButton(item) { + if (!item || item.status != 3 || !this.isEmptyShopMakeTime(item.shopMakeTime)) return false + return item.deliveryType == 1 || (item.deliveryType == 2 && item.userRequireMake == 1) + }, + isFaceDeliveryOrder(item) { + return !!item && item.deliveryType == 1 && item.orderType == 3 + }, + getOrderTotalAmount(order) { + if (!order) return this.formatMoney(0) + const goodsList = Array.isArray(order.goodsList) ? order.goodsList : [] + const goodsAmount = goodsList.reduce((total, goods) => { + return total + this.toNumber(goods.price) * this.toNumber(goods.quantity) + }, 0) + return this.formatMoney(goodsAmount + this.toNumber(order.packageFee)) + }, onReachPage(){ if (this.searchForm.pageNum >= this.totalPages) return; this.searchForm.pageNum++; @@ -434,16 +510,255 @@ border-radius: 20rpx; padding: 20rpx 20rpx 0; } + .order-head { + display: flex; + align-items: flex-start; + padding-bottom: 18rpx; + border-bottom: 1px solid #eef2ef; + } + + .order-main { + flex: 1; + min-width: 0; + } + + .order-code { + display: inline-block; + height: 42rpx; + line-height: 42rpx; + padding: 0 16rpx; + margin-bottom: 8rpx; + border-radius: 999rpx; + background: #00231C; + color: #E3FF96; + font-size: 28rpx; + font-weight: 700; + } + + .order-time { + color: #7a8582; + font-size: 24rpx; + } + + .order-status { + margin-left: 20rpx; + padding: 8rpx 16rpx; + border-radius: 999rpx; + background: rgba(255, 107, 53, 0.1); + color: #ff6b35; + font-size: 26rpx; + font-weight: 700; + white-space: nowrap; + } + + .delivery-info-row { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 12rpx; + padding: 16rpx 0 0; + } + + .appointment-delivery-tag { + height: 44rpx; + line-height: 44rpx; + padding: 0 16rpx; + border-radius: 14rpx; + background: linear-gradient(135deg, #ff8f1f 0%, #ff6a3d 100%); + color: #fff; + font-size: 22rpx; + font-weight: 800; + box-shadow: 0 8rpx 18rpx rgba(255, 106, 61, 0.16); + } + + .delivery-required-time { + height: 44rpx; + line-height: 44rpx; + padding: 0 16rpx; + border-radius: 14rpx; + background: rgba(166, 255, 234, 0.36); + color: #0b6b5a; + font-size: 22rpx; + font-weight: 800; + } + + .goods-box { + padding: 22rpx 0 16rpx; + } + + .goods-title { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12rpx; + font-size: 30rpx; + font-weight: 700; + } + + .goods-count { + padding: 4rpx 14rpx; + border-radius: 999rpx; + background: #f1f5f2; + color: #52736b; + font-size: 24rpx; + font-weight: 700; + } + + .goods-count-important { + background: linear-gradient(90deg, #FFE8D6, #FFF5E9); + color: #ff4d00; + } + + .goods-row { + display: flex; + align-items: center; + min-height: 46rpx; + line-height: 1.35; + color: #253b35; + } + + .goods-name { + flex: 1; + padding-right: 16rpx; + font-size: 26rpx; + } + + .goods-spec { + margin-top: 4rpx; + color: #7a8582; + font-size: 22rpx; + line-height: 30rpx; + } + + .goods-quantity { + width: 92rpx; + text-align: center; + color: #52736b; + font-weight: 700; + } + + .goods-quantity-important { + display: flex; + justify-content: center; + align-items: center; + height: 42rpx; + border-radius: 14rpx; + background: linear-gradient(90deg, #FF4500, #FFA07A); + color: #fff; + font-size: 28rpx; + } + + .goods-price { + width: 120rpx; + text-align: right; + color: #00231C; + font-weight: 700; + } + + .order-fee-row { + display: flex; + justify-content: space-between; + margin: 0 0 10rpx; + padding-top: 16rpx; + border-top: 1px dashed #e4ebe7; + color: #52736b; + font-size: 24rpx; + font-weight: 700; + } + + .order-total-row { + display: flex; + justify-content: space-between; + margin: 0 0 18rpx; + color: #00231C; + font-size: 30rpx; + font-weight: 900; + } + + .remark-box { + display: flex; + margin: 0 0 18rpx; + padding: 18rpx; + border: 1px solid rgba(255, 107, 53, 0.22); + border-radius: 18rpx; + background: linear-gradient(90deg, rgba(255, 246, 235, 1), rgba(255, 251, 243, 1)); + } + + .remark-label { + flex-shrink: 0; + height: 40rpx; + line-height: 40rpx; + margin-right: 14rpx; + padding: 0 12rpx; + border-radius: 10rpx; + background: #ff6b35; + color: #fff; + font-size: 24rpx; + font-weight: 700; + } + + .remark-content { + flex: 1; + color: #9a3d00; + font-size: 28rpx; + font-weight: 700; + line-height: 40rpx; + word-break: break-all; + } + + .order-footer { + display: flex; + align-items: center; + min-height: 80rpx; + border-top: 1px solid #eef2ef; + } + + .delivery-tag { + width: auto; + height: 44rpx; + line-height: 44rpx; + margin-right: 20rpx; + padding: 0 14rpx; + border-radius: 12rpx; + background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); + color: #00231C; + font-weight: 700; + } + + .footer-space { + flex: 1; + } + + .meal-btn { + margin: 0 0 0 20rpx; + } + .btn{ + background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1)); + padding:0 10rpx; + height: 50rpx; + border-radius: 14rpx; + line-height: 50rpx; + text-align: center; + font-weight: 700; + margin-top: 20rpx; + } .pinzi{ margin: 20rpx 0; background: linear-gradient(90deg, #FF4500, #FFA07A); - width: 40rpx; + width: 120rpx; height: 40rpx; line-height: 40rpx; text-align: center; border-radius: 10rpx; color: #fff; } + .face-delivery-tip { + padding: 0 0 18rpx; + color: #ff2d2d; + font-size: 24rpx; + font-weight: 800; + line-height: 34rpx; + } .guize-list { width: 100%; padding: 20rpx;