tianyi 2 weeks ago
parent
commit
888f8e49a3
  1. 273
      components/tab-bar/delivery.vue

273
components/tab-bar/delivery.vue

@ -86,67 +86,44 @@
</scroll-view>
<!-- 拼团详情弹窗 -->
<uni-popup ref="pintuanPopup" background-color="#fff">
<view class="guize-list">
<view v-for="(item,index) in tuanzhangOrder" :key="index">
<view style="height: 80rpx;line-height: 80rpx;font-size: 36rpx;font-weight: 700;">
订单{{index + 1}}
<view class="group-popup" @touchmove.stop>
<view class="group-popup-header">
<view>
<view class="group-popup-title">拼团详情</view>
<view class="group-popup-subtitle">{{tuanzhangOrder.length}}个订单 {{groupOrderCheck && (groupOrderCheck.deliveryType == 1 && groupOrderCheck.orderType == 3) ? ',可一并出餐' :''}}</view>
</view>
<view class="">
<view class="dingdan">
<view class="pt-title">
配送信息
</view>
<view style="display:flex">
<view style="width:300rpx;">
配送编号
</view>
<view class="pituan-text">
{{item.numberCode}}
</view>
</view>
<view style="display:flex">
<view style="width:300rpx;">
订单号
</view>
<view class="pituan-text">
{{item.id}}
</view>
</view>
<view style="display:flex">
<view style="width:300rpx;">
订单时间
</view>
<view class="pituan-text">
{{item.createTime | formatISOTime}}
</view>
</view>
<view class="group-popup-close" @tap="$refs.pintuanPopup.close()">×</view>
</view>
<scroll-view scroll-y class="group-popup-scroll" :class="{ 'group-popup-scroll-with-footer': canShowBatchMealServingButton(groupOrderCheck) }">
<view class="group-order-card" v-for="(item,index) in tuanzhangOrder" :key="index">
<view class="group-order-head">
<view class="group-order-code">订单-{{item.numberCode || item.id}}</view>
<view class="group-order-status">{{getStatusText(item)}}</view>
</view>
<view class="dingdan" v-for="(item1,index1) in item.goodsList" :key="index1">
<view class="pt-title">
商品信息
</view>
<view style="display: flex;font-weight: 700;">
<view style="flex:1">
商品名{{item1.productName}}
</view>
<view style="width:100rpx;">
X{{item1.quantity}}
</view>
<view style="width:220rpx;text-align: right;padding-right:20rpx;">
{{item1.price}}
</view>
</view>
<view class="group-info-row">
<text>订单号</text>
<text>{{item.id}}</text>
</view>
<view class="dingdan">
<view style="text-align: right;padding-right: 20rpx;color: #777;">
餐盒费{{item.packageFee}} 配送费{{item.deliveryFee}}
</view>
<view style="text-align: right;padding-right: 20rpx;font-size: 28rpx;font-weight: 700;color: red;">
总计{{item.totalAmount}}
<view class="group-info-row">
<text>订单时间</text>
<text>{{item.createTime | formatISOTime}}</text>
</view>
<view class="group-goods-list">
<view class="group-goods-row" v-for="(item1,index1) in item.goodsList" :key="index1">
<view class="group-goods-name">{{item1.productName}}</view>
<view class="group-goods-num">X{{item1.quantity}}</view>
<view class="group-goods-price">{{item1.price}}</view>
</view>
</view>
<view class="group-fee-row">
餐盒费{{item.packageFee || 0}} 配送费{{item.deliveryFee || 0}}
</view>
<!-- <view class="group-total-row">总计{{item.totalAmount || 0}}</view> -->
</view>
<view class="group-popup-empty" v-if="tuanzhangOrder.length == 0">暂无拼团订单</view>
</scroll-view>
<view class="group-popup-footer" v-if="canShowBatchMealServingButton(groupOrderCheck)">
<view class="group-all-meal-btn" @tap="batchMealServing">已全部出餐</view>
</view>
</view>
</uni-popup>
@ -157,6 +134,7 @@
export default {
data() {
return {
groupOrderCheck:{},
tuanzhangOrder:[],
searchForm:{
pageNum:1,
@ -250,6 +228,8 @@
this.searchForm.searchStatus = index
this.currentIndex = index
}
this.searchForm.pageNum = 1
this.orderList = []
this.getList()
},
isAppointmentDelivery(item) {
@ -270,6 +250,10 @@
formatMoney(value) {
return this.toNumber(value).toFixed(2)
},
getStatusText(item) {
if (!item) return ''
return 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?'已售后':''
},
toNumber(value) {
let amount = parseFloat(value)
return isNaN(amount) ? 0 : amount
@ -301,6 +285,9 @@
this.searchForm.pageNum++;
this.getList();
},
canShowBatchMealServingButton(item) {
return this.isFaceDeliveryOrder(item) && this.canShowMealServingButton(item)
},
mealServing(item){
let that = this
uni.showModal({
@ -334,7 +321,8 @@
});
},
getGroupOrders(id){
this.NB.sendRequest("/mall/order/selectAllOrderByOrderId/"+id, {}, false, 'GET', 'application/json').then((res) => {
this.groupOrderCheck = id
this.NB.sendRequest("/mall/order/selectAllOrderByOrderId/"+id.id, {}, false, 'GET', 'application/json').then((res) => {
if (res.code == 200) {
this.tuanzhangOrder = res.result;
this.$refs.pintuanPopup.open()
@ -394,6 +382,40 @@
uni.hideLoading();
}).catch((res) => {});
},
batchMealServing() {
if (!this.canShowBatchMealServingButton(this.groupOrderCheck)) {
this.tui.toast('当前订单不可出餐')
return
}
const orderIdList = (Array.isArray(this.tuanzhangOrder) ? this.tuanzhangOrder : [])
.map(item => this.getOrderId(item))
.filter(id => !!id)
if (orderIdList.length == 0) {
this.tui.toast('未找到拼团订单')
return
}
let that = this
uni.showModal({
title: '提示',
content: '确定全部出餐吗?',
success: function (res) {
if (!res.confirm) return
that.tui.request('/mall/order/shopMakeTimeBatch', 'POST', {
orderIdList: orderIdList
}, false, false).then((res) => {
if (res.code == 200) {
that.$refs.pintuanPopup.close()
that.searchForm.pageNum = 1
that.getList()
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
}
})
},
goDetail(id){
uni.navigateTo({
url:'/pages/shop/orderDetail?id=' + id
@ -787,6 +809,145 @@
.uni-popup__wrapper{
border-radius: 20rpx !important;
}
.group-popup {
width: 660rpx;
max-height: 880rpx;
padding: 28rpx 24rpx 32rpx;
box-sizing: border-box;
border-radius: 32rpx;
background: #f7faf8;
box-shadow: 0 24rpx 60rpx rgba(0, 35, 28, 0.22);
}
.group-popup-header {
display: flex;
align-items: center;
padding-bottom: 22rpx;
}
.group-popup-title {
color: #00231C;
font-size: 36rpx;
font-weight: 900;
line-height: 48rpx;
}
.group-popup-subtitle {
margin-top: 6rpx;
color: red;
font-size: 24rpx;
}
.group-popup-close {
width: 56rpx;
height: 56rpx;
margin-left: auto;
border-radius: 56rpx;
background: #fff;
color: #7a8582;
font-size: 42rpx;
line-height: 50rpx;
text-align: center;
}
.group-popup-scroll {
max-height: 690rpx;
height: 690rpx;
}
.group-popup-scroll-with-footer {
max-height: 600rpx;
height: 600rpx;
}
.group-popup-footer {
padding-top: 18rpx;
}
.group-all-meal-btn {
height: 72rpx;
line-height: 72rpx;
border-radius: 18rpx;
background: linear-gradient(90deg, #FF4500, #FFA07A);
color: #fff;
font-size: 28rpx;
font-weight: 900;
text-align: center;
}
.group-order-card {
margin-bottom: 18rpx;
padding: 22rpx;
border-radius: 24rpx;
background: #fff;
box-shadow: 0 10rpx 26rpx rgba(0, 35, 28, 0.08);
}
.group-order-head {
display: flex;
align-items: center;
padding-bottom: 16rpx;
border-bottom: 1px solid #eef2ef;
}
.group-order-code {
flex: 1;
color: #00231C;
font-size: 32rpx;
font-weight: 900;
}
.group-order-status {
padding: 6rpx 14rpx;
border-radius: 999rpx;
background: rgba(255, 107, 53, 0.1);
color: #ff6b35;
font-size: 24rpx;
font-weight: 800;
}
.group-info-row {
display: flex;
justify-content: space-between;
padding-top: 14rpx;
color: #6b7773;
font-size: 24rpx;
line-height: 34rpx;
}
.group-info-row text:last-child {
color: #00231C;
font-weight: 700;
}
.group-goods-list {
margin-top: 16rpx;
padding: 12rpx 0;
border-top: 1px dashed #e4ebe7;
border-bottom: 1px dashed #e4ebe7;
}
.group-goods-row {
display: flex;
align-items: center;
min-height: 46rpx;
color: #00231C;
font-size: 26rpx;
font-weight: 700;
}
.group-goods-name {
flex: 1;
padding-right: 12rpx;
}
.group-goods-num {
width: 80rpx;
text-align: center;
}
.group-goods-price {
width: 120rpx;
text-align: right;
}
.group-fee-row {
margin-top: 14rpx;
color: #7a8582;
text-align: right;
}
.group-total-row {
margin-top: 8rpx;
color: red;
font-size: 30rpx;
font-weight: 900;
text-align: right;
}
.group-popup-empty {
padding: 80rpx 20rpx;
color: #7a8582;
text-align: center;
}
.pituan-text{
flex:1;
text-align:right;

Loading…
Cancel
Save