tianyi 3 days ago
parent
commit
bc9fc33f62
  1. 22
      components/tab-bar/delivery.vue
  2. 5
      components/tab-bar/tab-bar.vue

22
components/tab-bar/delivery.vue

@ -79,7 +79,9 @@
<view v-if="item.deliveryType == 3" style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;"> <view v-if="item.deliveryType == 3" style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
代跑腿 代跑腿
</view> </view>
{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达 <view class="" :style="{'color':shouldNotify(item.mustFinishTime)?'red':''}">
{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达
</view>
</view> </view>
<view class="" v-if="item.remark != '' && item.remark != null" <view class="" v-if="item.remark != '' && item.remark != null"
style="background: #f5f5f5;height: 80rpx;line-height: 80rpx;font-weight: 500;padding: 0 20rpx;border-radius: 20rpx;"> style="background: #f5f5f5;height: 80rpx;line-height: 80rpx;font-weight: 500;padding: 0 20rpx;border-radius: 20rpx;">
@ -370,7 +372,7 @@
const minute = String(date.getMinutes()).padStart(2, '0'); const minute = String(date.getMinutes()).padStart(2, '0');
// --: // --:
return `${day}-${hour}:${minute}`; return `${day}${hour}:${minute}`;
} }
}, },
methods: { methods: {
@ -408,6 +410,20 @@
this.getDelivery() this.getDelivery()
this.$forceUpdate(); this.$forceUpdate();
}, },
shouldNotify(mustFinishTimeStr) {
// ISO 8601
const targetTime = new Date(mustFinishTimeStr);
//
if (isNaN(targetTime.getTime())) {
throw new Error('Invalid date format: ' + mustFinishTimeStr);
}
const currentTime = new Date();
const diffMs = targetTime - currentTime; //
// diffMs <= 0 100 < diffMs < 600000
return diffMs <= 0 || diffMs < 10 * 60 * 1000;
},
getDelivery(){ getDelivery(){
let that = this let that = this
this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => {
@ -756,7 +772,7 @@
} }
.maotou { .maotou {
width: 90rpx; width: 280rpx;
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/a1584a13e9db4b6fbcc66890219d0018.png') no-repeat; background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/a1584a13e9db4b6fbcc66890219d0018.png') no-repeat;
height: 90rpx; height: 90rpx;
background-size: 100%; background-size: 100%;

5
components/tab-bar/tab-bar.vue

@ -120,6 +120,11 @@
this.indexWorkerCount = 0 this.indexWorkerCount = 0
this.indexMyCount = 0 this.indexMyCount = 0
let that = this let that = this
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
if(!shopId && !worker){
return
}
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => { this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.result != null){ if(res.result != null){

Loading…
Cancel
Save