diff --git a/pages/index/index.vue b/pages/index/index.vue index 7803d8b..711507c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -49,7 +49,7 @@ - 拼团 + 饭团 @@ -161,22 +161,40 @@ - - @@ -224,19 +242,19 @@ - + - 送达时间:02-02 18:02 + 送达时间:{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }} - #021 + #{{item.numberCode != null ? item.numberCode : ''}} - 王继酸辣粉 + {{item.shopName != null ? item.shopName : ''}} - 脆 + 祥 @@ -247,23 +265,27 @@ - 第三师堂A02窗口 + {{item.shopAddress != null ? item.shopAddress : ''}} - 1000m + - + - 11号楼310 + {{item.receiverAddress != null ? item.receiverAddress : ''}} - 2.1km + @@ -278,374 +300,14 @@ - ¥5.00 - (包含¥2平台佣金) - - - - 备注:一共有3个快递哦,普通快递没有超重和超大的,辛苦了! - - - - - - - - - 送达时间:02-02 18:02 - - - - 取件码:1-2-9830 - - - 3个 - - - - - - - - - 王继酸辣粉 - - 详 - - - - - - - - - - - 第三师堂A02窗口 - - - 1000m - - - - - - - - - - 11号楼310 - - - 2.1km - - - - - - - - - 配送佣金 - - 超大/超重 - - - - ¥5.00 - (包含¥2平台佣金) - - - - - - - - - - 送达时间:02-02 18:02 - - - - 取件码:1-2-9830 - - - 3个 - - - - - - - - - 王继酸辣粉 - - 详 - - - - - - - - - - - 第三师堂A02窗口 - - - 1000m - - - - - - - - - - 11号楼310 - - - 2.1km - - - - + ¥{{(item.deliveryFee + item.deliveryFeeMarketplace).toFixed(2)}} + (包含¥{{item.deliveryFeeMarketplace}}平台佣金) - - - 配送佣金 - - 超大/超重 - - - - ¥5.00 - (包含¥2平台佣金) - + + 备注:{{item.remark}} - - - - - - - - 送达时间:02-02 18:02 - - - - 取件码:1-2-9830 - - - 3个 - - - - - - - - - 王继酸辣粉 - - 详 - - - - - - - - - - - 第三师堂A02窗口 - - - 1000m - - - - - - - - - - 11号楼310 - - - 2.1km - - - - - - - - - 配送佣金 - - 超大/超重 - - - - ¥5.00 - (包含¥2平台佣金) - - - - - - - - - - 送达时间:02-02 18:02 - - - - 取件码:1-2-9830 - - - 3个 - - - - - - - - - 王继酸辣粉 - - 详 - - - - - - - - - - - 第三师堂A02窗口 - - - 1000m - - - - - - - - - - 11号楼310 - - - 2.1km - - - - - - - - - 配送佣金 - - 超大/超重 - - - - ¥5.00 - (包含¥2平台佣金) - - - - - - - - - - 送达时间:02-02 18:02 - - - - 取件码:1-2-9830 - - - 3个 - - - - - - - - - 王继酸辣粉 - - 详 - - - - - - - - - - - 第三师堂A02窗口 - - - 1000m - - - - - - - - - - 11号楼310 - - - 2.1km - - - - - - - - - 配送佣金 - - 超大/超重 - - - - ¥5.00 - (包含¥2平台佣金) - - - + @@ -791,7 +453,8 @@ areaName:'', indicatorDots: false, autoplay: true, - interval: 4000, + deliveryItem:[] +, interval: 4000, duration: 1000, latitude: 39.909, // 默认纬度,可以设为用户当前位置或配送员位置 longitude: 116.39742, // 默认经度 @@ -811,10 +474,25 @@ }], dataList: [], areaList:[], + waimaiCount:0, + kuaidiCount:0, + paotuiCount:0, + zhipaiCount:0, + searchForm:{ + hallOnly: true, + status: 0, + pageNum:1, + regionId:JSON.parse(uni.getStorageSync('area')).id, + deliveryType: 1, + waimaiData: [], + workerId: uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '', + kuaidiData: [] + }, checked:'daimaifan', navBarHeight: 0, menuListOffsetTop: 0, lastScrollTop: 0, + worker:null, isSwitching: true, yongjin:false, isArea: false, @@ -836,6 +514,17 @@ postList, myCenter }, + filters: { + formatHourMinute(value) { + if (!value) return ''; + // 使用原生 Date 处理 + return new Date(value).toLocaleTimeString('zh-CN', { + hour: '2-digit', + minute: '2-digit', + hour12: false + }); + } + }, onPageScroll(e) { const scrollTop = e.scrollTop; const isScrollingUp = scrollTop < this.lastScrollTop; @@ -857,8 +546,36 @@ } }, onLoad() { + let worker = uni.getStorageSync('worker') + if(worker != '' && worker != undefined && worker != null){ + this.worker = worker + } // 获取用户当前位置 this.getUserLocation(); + if(uni.getStorageSync('waimaiData')){ + let waimailist = uni.getStorageSync('waimaiData') + if(waimailist.length > 0){ + for(let a = 0;a 0){ + for(let a = 0;a { this.isSwitching = false; }, 400); }, + getOrder(item,index){ + let data = { + groupId:item.groupId ? item.groupId : '', + deliveryId:item.id, + workerId:uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '', + regionId:JSON.parse(uni.getStorageSync('area')).id + } + let that = this + this.tui.request("/mall/delivery/accept", "POST",data, false, true).then((res) => { + that.loadStatus = 'nomore'; + 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 + } + that.$forceUpdate(); + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + }, getDelivery(){ - + let that = this + this.tui.request("/mall/delivery/page", "POST", this.searchForm, false, false).then((res) => { + that.loadStatus = 'nomore'; + if (res.code == 200) { + that.deliveryItem = res.result.records; + if(res.result.orderCount != null){ + for(let i =0;i {}); }, checkTab(index) { for (let i = 0; i < this.menuList.length; i++) { @@ -1004,8 +778,23 @@ }, checkTab(type){ this.checked = type + if(type == 'waimai'){ + this.searchForm.deliveryType = 1 + }else if(type == 'kuaidi'){ + this.searchForm.deliveryType = 2 + }else if(type == 'paotui'){ + this.searchForm.deliveryType = 3 + }else if(type == 'zhipai'){ + this.searchForm.deliveryType = 4 + } + this.getDelivery() this.$forceUpdate() }, + makeCall(phone){ + uni.makePhoneCall({ + phoneNumber: phone + }); + }, // 获取配送员位置,这里假设使用WebSocket getDeliveryLocation() { // WebSocket连接,需要时放开 @@ -1420,13 +1209,14 @@ } .daoda-time { - width: 284rpx; + width: 200rpx; height: 48rpx; font-size: 24rpx; + padding-left: 10rpx; font-weight: 700; border-radius: 10rpx; line-height: 48rpx; - text-align: center; + text-align: left; background: rgba(166, 255, 234, 0.3); margin: 20rpx 0 20rpx 20rpx; } @@ -1447,7 +1237,7 @@ background-size: 100%; position: absolute; top: -60rpx; - right: 40rpx; + right: 10rpx; text-align: center; line-height: 90rpx; font-weight: 900; @@ -1545,12 +1335,12 @@ } .qu-left { - width: 50%; + width: 80%; padding-left: 10rpx; } .qu-right { - width: 50%; + width: 20%; text-align: right; padding-right: 10rpx; font-weight: 700;