Browse Source

修改 配送员数量

master
wangfukang 4 weeks ago
parent
commit
72d734d909
  1. 62
      package1/group/groupBuyList.vue

62
package1/group/groupBuyList.vue

@ -118,7 +118,17 @@
<uni-load-more :status="loadStatus" @change="onChange" />
</view>
<view class="zaixian">
当前2000名配送员在线
<view class="zaixian-total">当前{{onlineWorkerTotal}}名配送员在线</view>
<view class="zaixian-divider"></view>
<swiper class="zaixian-swiper" vertical circular :autoplay="onlineWorkerAreaList.length > 1"
:interval="onlineWorkerInterval" :duration="onlineWorkerDuration">
<swiper-item v-if="onlineWorkerAreaList.length === 0">
<view class="zaixian-item">暂无在线区域数据</view>
</swiper-item>
<swiper-item v-for="(item,index) in onlineWorkerAreaList" :key="index">
<view class="zaixian-item">{{item.areaName}} {{item.onlineWorkerCount}}人在线</view>
</swiper-item>
</swiper>
</view>
<view style="width: 100%;height: 120rpx;"></view>
</view>
@ -207,7 +217,11 @@
url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/14b93d4bce134b3db4b42b13b6993e6c.png',
index:10
}],
menuButtonInfo:{}
menuButtonInfo:{},
onlineWorkerTotal:0,
onlineWorkerAreaList:[],
onlineWorkerInterval:2500,
onlineWorkerDuration:500
}
},
components: {
@ -248,6 +262,7 @@
this.getEatType();
this.getShopArea();
this.getShopList();
this.getOnlineWorkerCountByCanteenArea();
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
@ -327,6 +342,19 @@
}
}).catch((res) => {})
},
getOnlineWorkerCountByCanteenArea(){
let that = this
that.tui.request("/worker/getOnlineWorkerByArea", "GET", {parentId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => {
if (res.code == 200) {
const list = Array.isArray(res.result) ? res.result : []
that.onlineWorkerAreaList = list
that.onlineWorkerTotal = list.reduce((sum, item) => {
const count = Number(item.onlineWorkerCount || 0)
return sum + (isNaN(count) ? 0 : count)
}, 0)
}
}).catch(() => {})
},
getShopList(){
this.loadStatus = 'loading'
if(this.searchSale){
@ -637,9 +665,35 @@
height: 76rpx;
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
border-radius: 76rpx;
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
padding: 0 24rpx;
box-sizing: border-box;
text-align: center;
line-height: normal;
}
.zaixian-total{
font-size: 26rpx;
line-height: 76rpx;
font-weight: bold;
white-space: nowrap;
}
.zaixian-divider{
width: 2rpx;
height: 36rpx;
background: rgba(0, 35, 28, 0.2);
margin: 0 18rpx;
}
.zaixian-swiper{
flex: 1;
height: 76rpx;
}
.zaixian-item{
height: 76rpx;
line-height: 76rpx;
font-size: 24rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
Loading…
Cancel
Save