From bc9fc33f626126eaf55065f404445aee547cab2c Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Thu, 23 Apr 2026 17:05:36 +0800 Subject: [PATCH] 11 --- components/tab-bar/delivery.vue | 22 +++++++++++++++++++--- components/tab-bar/tab-bar.vue | 5 +++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index 6fa2969..c861328 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -79,7 +79,9 @@ 代跑腿 - ({{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达) + + {{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达 + @@ -370,7 +372,7 @@ const minute = String(date.getMinutes()).padStart(2, '0'); // 拼接格式:日-日-时:分 - return `${day}-${hour}:${minute}`; + return `${day}日${hour}:${minute}`; } }, methods: { @@ -408,6 +410,20 @@ this.getDelivery() 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)或 剩余时间不到10分钟(0 < diffMs < 600000) + return diffMs <= 0 || diffMs < 10 * 60 * 1000; + }, getDelivery(){ let that = this this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { @@ -756,7 +772,7 @@ } .maotou { - width: 90rpx; + width: 280rpx; background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/a1584a13e9db4b6fbcc66890219d0018.png') no-repeat; height: 90rpx; background-size: 100%; diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index 40091ba..a9ca84a 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -120,6 +120,11 @@ this.indexWorkerCount = 0 this.indexMyCount = 0 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) => { if (res.code == 200) { if(res.result != null){