From 9940c89a6b45a2838357591586ac9bca895fd7c7 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 6 Apr 2026 15:08:27 +0800 Subject: [PATCH] 0 --- pages/index/index.vue | 89 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 19 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 6a03538..b2b3dbe 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,7 +2,6 @@ - @@ -67,7 +66,7 @@ @@ -477,6 +487,7 @@ waimaiCount:0, kuaidiCount:0, paotuiCount:0, + productData:[], zhipaiCount:0, searchForm:{ hallOnly: true, @@ -497,6 +508,8 @@ lastScrollTop: 0, worker:null, isSwitching: true, + indexZhipaiCount:0, + indexWorkerCount:0, getAreaData:{}, putAreaData:{}, yongjin:false, @@ -516,12 +529,20 @@ filters: { formatHourMinute(value) { if (!value) return ''; - // 使用原生 Date 处理 - return new Date(value).toLocaleTimeString('zh-CN', { - hour: '2-digit', - minute: '2-digit', - hour12: false - }); + + const date = new Date(value); + + // 获取日 (getDate),并补齐0 + const day = String(date.getDate()).padStart(2, '0'); + + // 获取小时 (getHours),并补齐0 + const hour = String(date.getHours()).padStart(2, '0'); + + // 获取分钟 (getMinutes),并补齐0 + const minute = String(date.getMinutes()).padStart(2, '0'); + + // 拼接格式:日-日-时:分 + return `${day}-${hour}:${minute}`; } }, onPageScroll(e) { @@ -596,6 +617,7 @@ } this.getDelivery(); this.getShopArea(); + this.getWorkerCounts(); } // 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 const info = uni.getSystemInfoSync(); @@ -619,6 +641,10 @@ // 400ms后解除锁(动画200ms,预留200ms缓冲) setTimeout(() => { this.isSwitching = false; }, 400); }, + productDetail(item){ + this.productData = item.goodsList; + this.$refs.productPopup.open() + }, getOrder(item,index){ let data = { groupId:item.groupId ? item.groupId : '', @@ -632,15 +658,16 @@ if (res.code == 200) { that.deliveryItem.splice(index,1) that.tui.toast(res.message); - if(item.deliveryType == 1){ - that.waimaiCount -= 1 - }else if(item.deliveryType == 2){ - that.kuaidiCount -= 1 - }else if(item.deliveryType == 3){ - that.paotuiCount -= 1 - } if(item.workerId != null && item.workerId != undefined && item.workerId != ''){ that.zhipaiCount -= 1 + }else{ + if(item.deliveryType == 1){ + that.waimaiCount -= 1 + }else if(item.deliveryType == 2){ + that.kuaidiCount -= 1 + }else if(item.deliveryType == 3){ + that.paotuiCount -= 1 + } } that.$forceUpdate(); } else { @@ -678,6 +705,30 @@ uni.hideLoading(); }).catch((res) => {}); }, + 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 {}); + }, checkTab(index) { for (let i = 0; i < this.menuList.length; i++) { this.menuList[i].checked = (i === index); @@ -1214,7 +1265,7 @@ } .daoda-time { - width: 200rpx; + width: 242rpx; height: 48rpx; font-size: 24rpx; padding-left: 10rpx;