From 7f9f037e7ec185310a8f52134342c64667de5cd2 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 6 Apr 2026 15:08:06 +0800 Subject: [PATCH] 0 --- components/tab-bar/delivery.vue | 242 ++++++++++++++++++++++++++------ 1 file changed, 198 insertions(+), 44 deletions(-) diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index 2ab7596..8d4545b 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -27,12 +27,26 @@ + + + + 饭团 + + + + 快递 + + + + 跑腿 + + | - 设置规则 + 接单规则 - + 已上线 @@ -41,44 +55,41 @@ - + - #021 + #样式要改{{item.numberCode}} - - 代买饭 - - - 立即送达(10:30前) + + ({{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达) - - 备注:不要葱,不要香菜 + 备注:{{item.remark}} - - 取件方式(3件) + 取件方式({{item.allCount != null ? item.allCount : 0}}件) - + + 取件码取件{{item.getCodes}} + - 手机尾号 + 手机尾号:{{item.phoneNumber}} @@ -103,14 +114,14 @@ alt="" style="width: 50rpx;height: 50rpx;" /> - 沁园春第三食堂A20窗口 + {{item.shopName}} - 18829382718 + {{item.shopAddress}} - @@ -121,14 +132,14 @@ alt="" style="width: 50rpx;height: 50rpx;" /> - 11号宿舍楼610 + {{item.receiverName}} - 18829382718 + {{item.receiverAddress}} - @@ -142,20 +153,25 @@ 配送佣金 - + 超大/超重 - ¥5.00 (包含¥2平台佣金) + ¥{{item.deliveryFee}} (包含¥{{item.deliveryFeeMarketplace}}平台佣金) - - + + 用户申请退款中 + + + + @@ -253,8 +269,20 @@ + + + + + 订单详情 商家退款中 不能操作 + + + {{item.productName}} {{item.specs}} * {{item.quantity}} + + + + - + @@ -269,8 +297,20 @@ tab1Checked: 'daiqu', menuButtonInfo: {}, isArea: false, + searchForm:{ + status: 1, + pageNum:1, + pageSize: 10, + order:'', + regionId:'', + deliveryType: null, + workerId: uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '' + }, waimaRuleList: [], + tab1Checked1:'', + deliveryItem:[], selectRuleList: [], + totalPages:1, paotuiRuleList: [], lineStatus: [{ title: '上线', @@ -290,19 +330,79 @@ }, onReachBottom() { - if (this.searchForm.pageNumber >= this.totalPages) return; + if (this.searchForm.pageNum >= this.totalPages) return; // this.status = 'loading'; - this.searchForm.pageNumber++; - this.getShopList(); - + this.searchForm.pageNum++; + this.getDelivery(); + }, + filters: { + formatHourMinute(value) { + if (!value) return ''; + + 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}`; + } }, methods: { init() { console.log("配送初始化") this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.isOnLine = uni.getStorageSync('worker').isOnLine + if(uni.getStorageSync('area')){ + this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id; + } + this.getDelivery() this.$forceUpdate() }, + chooseType(type){ + if(this.tab1Checked1 == type){ + this.tab1Checked1 = '' + this.searchForm.deliveryType = null + }else{ + this.tab1Checked1 = type; + if(type == 'fantuan'){ + this.searchForm.deliveryType = 1 + }else if(type == 'kuaidi'){ + this.searchForm.deliveryType = 2 + }else if(type == 'paotui'){ + this.searchForm.deliveryType = 3 + } + } + this.searchForm.pageNum = 1 + this.getDelivery() + this.$forceUpdate(); + }, + getDelivery(){ + let that = this + this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { + that.loadStatus = 'nomore'; + if (res.code == 200) { + that.deliveryItem = res.result.records; + if (that.searchForm.pageNum == 1) { + that.deliveryItem = res.result.records; + } else { + that.deliveryItem = [...that.deliveryItem, ...res.result.records] + } + that.totalPages = res.result.pages; // pages = 总页数 + that.$forceUpdate(); + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + }, //查看大图 largeImg(img) { this.bigImg = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/00b1f011787c4549bbea650d95a4eb39.png' @@ -443,16 +543,60 @@ checkArea() { this.isArea = !this.isArea }, + changeStatus(item,status){ + let url = '' + if(status == 2){ + url = "/mall/delivery/pickup" + }else{ + url = "/mall/delivery/complete" + } + let that = this + that.tui.request(url, "POST", {deliveryId:item.id,workerId:item.workerId}, false, true).then((res) => { + if (res.code == 200) { + that.tui.toast(res.message); + that.searchForm.pageNum = 1 + that.getDelivery() + that.$forceUpdate(); + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + }, checkTab1(type) { this.tab1Checked = type + if(type == 'daiqu'){ + this.searchForm.status = 1 + }else{ + this.searchForm.status = 2 + } + this.searchForm.pageNum = 1 + this.getDelivery() + }, + makeCall(phone){ + uni.makePhoneCall({ + phoneNumber: phone + }); }, changeOnline(value) { let url = '' - if (value == 0) { - url = '/worker/onLine' - } else { - url = '/worker/offLine' + if(this.isOnLine == value){ + if (value == 0) { + url = '/worker/offLine' + value = 1 + } else { + url = '/worker/onLine' + value = 0 + } + }else{ + if (value == 0) { + url = '/worker/onLine' + } else { + url = '/worker/offLine' + } } + this.tui.request(url, "POST", { id: uni.getStorageSync('worker').workerId }, false, true).then((res) => { @@ -727,7 +871,17 @@ width: 140rpx; height: 50rpx; border-radius: 50rpx; - margin-right: 20rpx; + margin-right: 15rpx; + padding-left: 10rpx; + } + .guize-box1{ + font-size: 20rpx; + font-weight: 700; + text-align: center; + width: 140rpx; + height: 50rpx; + border-radius: 50rpx; + margin-right: 15rpx; padding-left: 10rpx; } \ No newline at end of file