tianyi 5 days ago
parent
commit
7a6d05bb58
  1. 36
      components/tab-bar/delivery.vue
  2. 2457
      components/worker/delivery.vue
  3. 130
      components/worker/tab-bar.vue

36
components/tab-bar/delivery.vue

@ -296,7 +296,10 @@
handleStartDateChange(e) { handleStartDateChange(e) {
const value = e.detail.value const value = e.detail.value
if (this.searchForm.endDate && value > this.searchForm.endDate) { if (this.searchForm.endDate && value > this.searchForm.endDate) {
this.tui.toast('开始日期不能晚于结束日期') uni.showToast({
title: '开始日期不能晚于结束日期',
icon: 'none'
})
return return
} }
this.searchForm.startDate = value this.searchForm.startDate = value
@ -305,7 +308,10 @@
handleEndDateChange(e) { handleEndDateChange(e) {
const value = e.detail.value const value = e.detail.value
if (this.searchForm.startDate && value < this.searchForm.startDate) { if (this.searchForm.startDate && value < this.searchForm.startDate) {
this.tui.toast('结束日期不能早于开始日期') uni.showToast({
title: '结束日期不能早于开始日期',
icon: 'none'
})
return return
} }
this.searchForm.endDate = value this.searchForm.endDate = value
@ -429,7 +435,10 @@
that.totalPages = res.result.pages; // pages = that.totalPages = res.result.pages; // pages =
that.$forceUpdate(); that.$forceUpdate();
} else { } else {
that.tui.toast(res.message); uni.showToast({
title: res.message,
icon: 'none'
})
return; return;
} }
uni.hideLoading(); uni.hideLoading();
@ -437,14 +446,20 @@
}, },
batchMealServing() { batchMealServing() {
if (!this.canShowBatchMealServingButton(this.groupOrderCheck)) { if (!this.canShowBatchMealServingButton(this.groupOrderCheck)) {
this.tui.toast('当前订单不可出餐') uni.showToast({
title: '当前订单不可出餐',
icon: 'none'
})
return return
} }
const orderIdList = (Array.isArray(this.tuanzhangOrder) ? this.tuanzhangOrder : []) const orderIdList = (Array.isArray(this.tuanzhangOrder) ? this.tuanzhangOrder : [])
.map(item => this.getOrderId(item)) .map(item => this.getOrderId(item))
.filter(id => !!id) .filter(id => !!id)
if (orderIdList.length == 0) { if (orderIdList.length == 0) {
this.tui.toast('未找到拼团订单') uni.showToast({
title: '未找到拼团订单',
icon: 'none'
})
return return
} }
let that = this let that = this
@ -453,19 +468,22 @@
content: '确定全部出餐吗?', content: '确定全部出餐吗?',
success: function (res) { success: function (res) {
if (!res.confirm) return if (!res.confirm) return
that.tui.request('/mall/order/shopMakeTimeBatch', 'POST', { that.NB.sendRequest("/mall/order/shopMakeTimeBatch", {
orderIdList: orderIdList orderIdList: orderIdList
}, false, false).then((res) => { }, false, 'POST', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.$refs.pintuanPopup.close() that.$refs.pintuanPopup.close()
that.searchForm.pageNum = 1 that.searchForm.pageNum = 1
that.getList() that.getList()
} else { } else {
that.tui.toast(res.message) uni.showToast({
title: res.message,
icon: 'none'
})
return return
} }
uni.hideLoading() uni.hideLoading()
}).catch((res) => {}) })
} }
}) })
}, },

2457
components/worker/delivery.vue

File diff suppressed because it is too large

130
components/worker/tab-bar.vue

@ -0,0 +1,130 @@
<template>
<view class="tabbar-box">
<view class="bar-box" @click="clickBar(index)" v-for="(item,index) in tabList" :key="index">
<view class="img-box">
<image :src="item.isCheck?item.tabIconSelect:item.tabIcon" alt="" />
</view>
<view class="text-box" :style="{color:item.isCheck?'#48D1CC':'#000'}">
{{item.tabName}}
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabList: [{
tabName: '抢单大厅',
tabIcon: '/static/image/inventory.png',
tabIconSelect: '/static/image/inventory-sel.png',
isCheck: true
}, {
tabName: '配送中',
tabIcon: '/static/image/billing.png',
tabIconSelect: '/static/image/billing-sel.png',
isCheck: false
}, {
tabName: '我的',
tabIcon: '/static/image/staff.png',
tabIconSelect: '/static/image/staff-sel.png',
isCheck: false
}]
}
},
props: {
//
width: {
type: Number,
default: true
},
//tab
currentIndex: {
type: Number,
default: 0
}
},
watch: {
//currentIndex
currentIndex(newVal) {
for (let i = 0; i < this.tabList.length; i++) {
if (newVal == i) {
this.tabList[i].isCheck = true
} else {
this.tabList[i].isCheck = false
}
}
}
},
methods: {
//tab
clickBar(index) {
for (let i = 0; i < this.tabList.length; i++) {
if (index == i) {
this.$emit('tab-index', i);
this.tabList[i].isCheck = true
} else {
this.tabList[i].isCheck = false
this.$forceUpdate()
}
}
}
}
}
</script>
<style>
.tabbar-box {
width: 100%;
position: fixed;
bottom: 0;
height: 150rpx;
background: rgba(255, 255, 255, 1);
margin: 0 auto;
display: flex;
z-index: 999;
border-top: 1px solid #eee;
border-top-left-radius: 60rpx;
border-top-right-radius: 60rpx;
}
.bar-box {
height: 100%;
flex: 1;
}
.img-box {
width: 50rpx;
height: 50rpx;
margin: 20rpx auto 10rpx;
cursor: pointer;
display: block;
transition: all 0.3s;
transform-origin: center center;
user-select: none;
}
.img-box image{
width: 50rpx;
height: 50rpx;
background-size: 100%;
}
.big-img-box image{
width: 80%;
height: 90%;
background-size: 100%;
margin: -20rpx 0 0 10%;
}
.text-box {
text-align: center;
font-size: 20rpx;
font-family: 'PingFang HK';
font-weight: bold;
}
.big-img-box{
width: 100%;
height: 100%;
}
</style>
Loading…
Cancel
Save