Compare commits

...

4 Commits

Author SHA1 Message Date
tianyi d8e90fcb00 11 1 week ago
tianyi f41bf3cda9 11 1 week ago
tianyi f4a9bf008b 11 1 week ago
tianyi 47711a7790 11 1 week ago
  1. 54
      components/tab-bar/tab-bar.vue
  2. 20
      package2/shop/orderDetail.vue

54
components/tab-bar/tab-bar.vue

@ -1,6 +1,15 @@
<template> <template>
<view class="tabbar-box"> <view class="tabbar-box">
<view class="bar-box" @click="clickBar(index)" v-for="(item,index) in tabList" :key="index" :class="item.shaking?'shaking':''"> <view class="bar-box" @click="clickBar(index)" v-for="(item,index) in tabList" :key="index" :class="item.shaking?'shaking':''">
<view class="red-dot" v-if="index == 0 && indexZhipaiCount > 0">
{{indexZhipaiCount}}
</view>
<view class="red-dot" v-if="index == 1 && indexWorkerCount > 0">
{{indexWorkerCount}}
</view>
<view class="red-dot" v-if="index == 4 && indexMyCount > 0">
{{indexMyCount}}
</view>
<view class="img-box" v-if="index != 2"> <view class="img-box" v-if="index != 2">
<img :src="item.isCheck?item.tabIconSelect:item.tabIcon" alt="" /> <img :src="item.isCheck?item.tabIconSelect:item.tabIcon" alt="" />
</view> </view>
@ -48,7 +57,10 @@
tabIconSelect: '/static/images/tabbar/wode.png', tabIconSelect: '/static/images/tabbar/wode.png',
isCheck: false, isCheck: false,
shaking:false shaking:false
}] }],
indexZhipaiCount:0,
indexWorkerCount:0,
indexMyCount:0
} }
}, },
props: { props: {
@ -78,6 +90,7 @@
methods: { methods: {
//tab //tab
clickBar(index) { clickBar(index) {
this.getWorkerCounts()
for (let i = 0; i < this.tabList.length; i++) { for (let i = 0; i < this.tabList.length; i++) {
if (index == i) { if (index == i) {
this.$emit('tab-index', i); this.$emit('tab-index', i);
@ -95,6 +108,32 @@
this.$forceUpdate() this.$forceUpdate()
} }
} }
},
getWorkerCounts(){
if(!uni.getStorageSync('worker')){
return;
}
let that = this
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
for(let i = 0;i<res.result.length;i++){
if(res.result[i].status == 0){
this.indexZhipaiCount = Number(res.result[i].orderCount)
}else if(res.result[i].status == 1 || res.result[i].status == 2){
this.indexWorkerCount += Number(res.result[i].orderCount)
}else{
this.indexMyCount = Number(res.result[i].orderCount)
}
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
} }
} }
} }
@ -118,6 +157,19 @@
.bar-box { .bar-box {
height: 100%; height: 100%;
flex: 1; flex: 1;
position: relative;
}
.red-dot{
width: 15px;
height: 15px;
border-radius: 15px;
line-height: 15px;
text-align: center;
color: #fff;
position: absolute;
top: 5px;
right: 10px;
background: red;
} }
.img-box { .img-box {

20
package2/shop/orderDetail.vue

@ -11,21 +11,21 @@
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="box1" style="display: flex;"> <view class="box1" style="display: flex;font-size: 14px;font-weight: 700;">
<text>#0001</text> <text>#0001</text>
<text>期望送达</text> <text>期望送达</text>
<text>明天 06:30</text> <text>明天 06:30</text>
<text>待消费</text> <text>待消费</text>
</view> </view>
<view class="box1" style="display: flex;"> <view class="box1" style="display: flex;height: 50px;line-height: 50px;padding: 0 10px;">
<view class=""> <view style="border: 1px solid #48D1CC;height: 25px;line-height: 25px;padding: 0 10px;border-radius: 10px;margin-top: auto;margin-bottom: auto;color: #48D1CC;font-weight: 700;">
配送 配送订单
<!-- 自取 --> <!-- 自取订单 -->
</view> </view>
<view class=""> <view style="display: flex;flex: 1;padding-left: 10px;">
<text>张三 16521011101</text> <text style="flex: 1;">配送员张三</text>
<view class=""> <view class="">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png" alt="" style="width: 30px;height: 30px;margin-top: 10px;" />
</view> </view>
</view> </view>
</view> </view>
@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<view class=""> <view class="">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png" alt="" style="width: 30px;height: 30px;margin-top: 10px;" />
</view> </view>
</view> </view>
</view> </view>
@ -136,7 +136,7 @@
text-align: center; text-align: center;
} }
.content{ .content{
margin: -100rpx auto; margin: -140rpx auto;
} }
.box1 { .box1 {
width: 95%; width: 95%;

Loading…
Cancel
Save