diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index 1af08b9..4ed1ca7 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -35,16 +35,22 @@ - - + + 饭团 - + 快递 - + 跑腿 @@ -64,7 +70,7 @@ - + {{item.numberCode.length>14 ?'多订单':item.numberCode}} @@ -73,10 +79,12 @@ style="height: 40rpx;line-height: 40rpx;background: rgba(255, 233, 89, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;"> 外卖 - + 代取快递 - + 代跑腿 @@ -98,14 +106,16 @@ 取件码{{item.getCodes}} - + 手机尾号:{{item.phoneNumber}} - + - + {{item.receiverName}} - + {{item.receiverAddress}} @@ -163,10 +173,10 @@ - + - + 配送佣金 @@ -175,7 +185,8 @@ - ¥{{item.deliveryFee}} (包含¥{{item.deliveryFeeMarketplace}}平台佣金) + ¥{{item.deliveryFee}} (包含¥{{item.deliveryFeeMarketplace}}平台佣金) @@ -187,13 +198,19 @@ - + - - + + @@ -201,7 +218,8 @@ - + 设置指派单规则 @@ -214,14 +232,17 @@ 外卖规则 - + 全选 - - + + + @@ -249,14 +270,17 @@ 跑腿规则 - + 全选 - - + + + @@ -299,20 +323,41 @@ - - - - - 订单详情 + + + + + 商品详情 + 请核对商品规格和数量 - - {{item.productName}} {{item.specs}} * {{item.quantity}} + + + + + + + + {{item1.productName}} + + + 规格 + {{item1.specs | delNode}} + + + + x{{item1.quantity}} + 数量 + + + + + 暂无商品详情 - + - + @@ -321,31 +366,31 @@ export default { data() { return { - isOnLine:1, - bigImg:'', + isOnLine: 1, + bigImg: '', zhipaiCheck: false, tab1Checked: 'daiqu', menuButtonInfo: {}, isArea: false, latitude: 39.909, // 默认纬度,可以设为用户当前位置或配送员位置 longitude: 116.39742, // 默认经度 - productData:{}, - searchForm:{ + productData: {}, + searchForm: { status: 1, - pageNum:1, + pageNum: 1, pageSize: 10, - order:'', - regionId:'', + order: '', + regionId: '', deliveryType: null, workerId: uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '' }, waimaRuleList: [], - tab1Checked1:'', - pageData:[], - deliveryItem:[], - deliveryItem1:[], + tab1Checked1: '', + pageData: [], + deliveryItem: [], + deliveryItem1: [], selectRuleList: [], - totalPages:1, + totalPages: 1, paotuiRuleList: [], lineStatus: [{ title: '上线', @@ -371,23 +416,40 @@ 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}`; - } + 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}`; + }, + delNode(data) { + // 1. 统一转为字符串 + let str; + if (typeof data === 'object' && data !== null) { + // 对象或数组 → JSON 字符串 + str = JSON.stringify(data); + } else if (typeof data === 'string') { + str = data; + } else { + // 其他类型(数字、布尔等)先转字符串 + str = String(data); + } + + // 2. 删除所有大括号 { } 和双引号 " + const result = str.replace(/[{}"]/g, ''); + return result; + } }, methods: { init() { @@ -398,29 +460,32 @@ console.log("配送初始化") this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.isOnLine = uni.getStorageSync('worker').isOnLine - if(uni.getStorageSync('area')){ + if (uni.getStorageSync('area')) { this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id; } - if(uni.getStorageSync('worker')){ + if (uni.getStorageSync('worker')) { this.searchForm.workerId = uni.getStorageSync('worker').workerId } this.$forceUpdate() this.getDelivery() - + }, // 获取用户位置 getUserLocation(item) { let that = this; uni.getLocation({ type: 'gcj02', - isHighAccuracy:true, + isHighAccuracy: true, success: (res) => { console.log('位置', res) that.latitude = res.latitude; that.longitude = res.longitude; - - that.tui.request('/worker/admin/editLocation', "POST", {workerId:item.workerId,geolocation:that.latitude + ',' + that.longitude}, false, false,true).then((res) => { - + + that.tui.request('/worker/admin/editLocation', "POST", { + workerId: item.workerId, + geolocation: that.latitude + ',' + that.longitude + }, false, false, true).then((res) => { + }).catch((res) => {}); }, fail: (err) => { @@ -428,23 +493,23 @@ } }); }, - onReachPage(){ + onReachPage() { console.log("11111") if (this.searchForm.pageNum >= this.totalPages) return; this.searchForm.pageNum++; this.getDelivery(); }, - chooseType(type){ - if(this.tab1Checked1 == type){ + chooseType(type) { + if (this.tab1Checked1 == type) { this.tab1Checked1 = '' this.searchForm.deliveryType = null - }else{ + } else { this.tab1Checked1 = type; - if(type == 'fantuan'){ + if (type == 'fantuan') { this.searchForm.deliveryType = 1 - }else if(type == 'kuaidi'){ + } else if (type == 'kuaidi') { this.searchForm.deliveryType = 2 - }else if(type == 'paotui'){ + } else if (type == 'paotui') { this.searchForm.deliveryType = 3 } } @@ -453,33 +518,33 @@ 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; + // 直接解析 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(){ + getDelivery() { let that = this - console.log('1111',uni.getStorageSync('worker')) + console.log('1111', uni.getStorageSync('worker')) this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => { that.loadStatus = 'nomore'; if (res.code == 200) { - if(this.searchForm.status == 1){ + if (this.searchForm.status == 1) { if (that.searchForm.pageNum == 1) { that.deliveryItem1 = res.result.records; } else { that.deliveryItem1 = [...that.deliveryItem1, ...res.result.records] } that.pageData = that.deliveryItem1 - }else{ + } else { if (that.searchForm.pageNum == 1) { that.deliveryItem = res.result.records; } else { @@ -487,11 +552,11 @@ } that.pageData = that.deliveryItem } - + that.totalPages = res.result.pages; // pages = 总页数 that.$forceUpdate(); } else { - that.tui.toast(res.message,1000); + that.tui.toast(res.message, 1000); return; } uni.hideLoading(); @@ -505,23 +570,23 @@ zhipaiChange(e) { this.zhipaiCheck = e.detail.value }, - checkVoucher(index,type) { - if (type == 'waimai'){ + checkVoucher(index, type) { + if (type == 'waimai') { this.waimaRuleList[index].isChecked = !this.waimaRuleList[index].isChecked - }else{ + } else { this.paotuiRuleList[index].isChecked = !this.paotuiRuleList[index].isChecked } }, - productDetail(item){ + productDetail(item) { this.productData = item.goodsList; this.$refs.productPopup.open() }, - buchong(){ + buchong() { this.$refs.carPopup.close() uni.navigateTo({ - url:'/package1/myCenter/partTimeJobRegister' + url: '/package1/myCenter/partTimeJobRegister' }) - + }, selectRule(item) { //TODO 这里应该改成 复选,选中的遍历再放进来 @@ -533,26 +598,26 @@ this.selectRuleList = [] this.waimaiData = [] this.kuaidiData = [] - for(let i=0;i { @@ -569,9 +634,9 @@ let worker = uni.getStorageSync('worker') || {}; // 避免取不到时出错 worker.getPushOrder = that.zhipaiCheck ? 1 : 0; uni.setStorageSync('worker', worker); - uni.setStorageSync('waimaiData',that.waimaiData) - uni.setStorageSync('kuaidiData',that.kuaidiData) - if(that.zhipaiCheck == false){ + uni.setStorageSync('waimaiData', that.waimaiData) + uni.setStorageSync('kuaidiData', that.kuaidiData) + if (that.zhipaiCheck == false) { uni.removeStorageSync('waimaiData') uni.removeStorageSync('kuaidiData') } @@ -589,20 +654,20 @@ uni.hideLoading(); }); }, - allCheck(type){ + allCheck(type) { let data = [] - if(type=='waimai'){ + if (type == 'waimai') { data = this.waimaRuleList - }else{ + } else { data = this.paotuiRuleList } - for(let i=0;i item.orderType == 0); @@ -624,10 +689,10 @@ if (paotuiList.length > 0) { that.paotuiRuleList = paotuiList; } - + that.$forceUpdate(); } - this.zhipaiCheck = uni.getStorageSync('worker').getPushOrder==1?true:false + this.zhipaiCheck = uni.getStorageSync('worker').getPushOrder == 1 ? true : false /* if(uni.getStorageSync('waimaiData')){ let waimaiData = uni.getStorageSync('waimaiData') for(let i=0;i {}) @@ -668,32 +733,36 @@ checkArea() { this.isArea = !this.isArea }, - changeStatus(index,item,status){ + changeStatus(index, item, status) { let regionId = JSON.parse(uni.getStorageSync('area')).id let url = '' - if(status == 2){ + if (status == 2) { url = "/mall/delivery/pickup" - }else if(status == 3){ + } else if (status == 3) { url = "/mall/delivery/complete" - }else if(status == 1){ + } else if (status == 1) { url = "/mall/delivery/arriveShop" } let that = this - + this.getUserLocation(item) - that.tui.request(url, "POST", {regionId:regionId,deliveryId:item.id,workerId:item.workerId}, false, true).then((res) => { + that.tui.request(url, "POST", { + regionId: regionId, + deliveryId: item.id, + workerId: item.workerId + }, false, true).then((res) => { if (res.code == 200) { - if(status == 2 || status == 3){ + if (status == 2 || status == 3) { that.pageData.splice(index, 1) - }else{ + } else { that.pageData[index].arriveTime = "qq" } - that.tui.toast(res.message,200); + that.tui.toast(res.message, 200); /* that.searchForm.pageNum = 1 that.getDelivery() */ that.$forceUpdate(); } else { - that.tui.toast(res.message,200); + that.tui.toast(res.message, 200); return; } uni.hideLoading(); @@ -701,22 +770,22 @@ }, checkTab1(type) { this.tab1Checked = type - if(type == 'daiqu'){ + if (type == 'daiqu') { this.searchForm.status = 1 - }else{ + } else { this.searchForm.status = 2 } this.searchForm.pageNum = 1 this.getDelivery() }, - makeCall(phone){ + makeCall(phone) { uni.makePhoneCall({ phoneNumber: phone }); }, changeOnline(value) { let url = '' - if(this.isOnLine == value){ + if (this.isOnLine == value) { if (value == 0) { url = '/worker/offLine' value = 1 @@ -724,14 +793,14 @@ url = '/worker/onLine' value = 0 } - }else{ + } else { if (value == 0) { url = '/worker/offLine' } else { url = '/worker/onLine' } } - + this.tui.request(url, "POST", { id: uni.getStorageSync('worker').workerId }, false, true).then((res) => { @@ -740,9 +809,9 @@ worker.isOnLine = value; this.isOnLine = value uni.setStorageSync('worker', worker); - this.tui.toast(res.message,1000) + this.tui.toast(res.message, 1000) } else { - this.tui.toast(res.message,1000) + this.tui.toast(res.message, 1000) } }) @@ -759,7 +828,7 @@ if (res.code == 200) { } else { - this.tui.toast(res.message,1000) + this.tui.toast(res.message, 1000) } }) @@ -772,7 +841,7 @@ } - \ No newline at end of file diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index 41f60b3..12caf49 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -197,7 +197,7 @@ background: rgba(255, 255, 255, 1); margin: 0 auto; display: flex; - z-index: 9; + z-index: 998; border-top: 1px solid #eee; border-top-left-radius: 60rpx; border-top-right-radius: 60rpx; diff --git a/package1/group/groupBuySingle.vue b/package1/group/groupBuySingle.vue index 2cc54de..0a70c22 100644 --- a/package1/group/groupBuySingle.vue +++ b/package1/group/groupBuySingle.vue @@ -822,8 +822,7 @@ methods: { // 页面touchmove事件:吸顶后阻止页面整体滑动(让goods-list接管滚动) onPageTouchMove(e) { - // 吸顶状态下不需要额外处理,scroll-view会自己处理 - console.log(e) + }, // goods-list滚动事件:检测分类切换 + 滚回顶部取消吸顶 onGoodsListScroll(e) { @@ -905,7 +904,7 @@ if (this.productItem[i].sellBeginTime != '' && this.productItem[i].sellEndTime != '') { let isEndTime = this.isWithinBusinessHours(this.productItem[i].sellBeginTime, this .productItem[i].sellEndTime) - console.log(isEndTime) + this.productItem[i].status = isEndTime ? 0 : 1 } if (that.productItem[i].isMoreBuy == 1) { @@ -1034,9 +1033,7 @@ }); } } - } catch (e) { - console.log(e); - } + } catch (e) {} } this.isPintuan = true; @@ -1169,9 +1166,7 @@ }); } } - } catch (e) { - console.log(e); - } + } catch (e) {} } if (index == 'pintuan') { @@ -1454,7 +1449,6 @@ const startMinutes = parseTime(begin); const endMinutes = parseTime(end); - console.log(currentMinutes + ',' + startMinutes + ',' + endMinutes) // 判断是否在区间内(包含端点) return currentMinutes >= startMinutes && currentMinutes <= endMinutes; @@ -1501,9 +1495,9 @@ }, goDetail(type) { if (type == 'goodsDetail') { - uni.navigateTo({ - url: '/package1/goods/goodsDetail' - }) + // uni.navigateTo({ + // url: '/package1/goods/goodsDetail' + // }) } else if (type == 'shopDetail') { uni.navigateTo({ url: '/package1/group/groupBuyDetail?item=' + JSON.stringify(this.shopItem) diff --git a/package1/order/returnOrder.vue b/package1/order/returnOrder.vue index 2e6cf54..66fd9f0 100644 --- a/package1/order/returnOrder.vue +++ b/package1/order/returnOrder.vue @@ -890,8 +890,7 @@ background: #fff; max-height: 1200rpx; width: 100%; - border-top-left-radius: 20rpx; - border-top-right-radius: 20rpx; + border-radius: 20rpx; padding: 20rpx; overflow: scroll; } diff --git a/package1/runErrand/runErrand.vue b/package1/runErrand/runErrand.vue index 056d825..f329ed6 100644 --- a/package1/runErrand/runErrand.vue +++ b/package1/runErrand/runErrand.vue @@ -207,41 +207,39 @@ 订单备注 - + - - - - - 优惠券 - - - -¥{{selectedCoupon.discountAmount.toFixed(2)}} - - - 有 {{availableCoupons.length}} 张可用 - - - 无可用券 + + + 优惠券 + + + -¥{{selectedCoupon.discountAmount.toFixed(2)}} + + + 有 {{availableCoupons.length}} 张可用 + + + 无可用券 + + - - - - - {{isKuaidi?'代取配送费':'跑腿费'}} + + + {{isKuaidi?'代取配送费':'跑腿费'}} + + + ¥{{deliveryFeeCalc.toFixed(2)}} + - - ¥{{deliveryFeeCalc.toFixed(2)}} + + + 合计 + ¥{{totalAmountCalc.toFixed(2)}} - - - 合计 - ¥{{totalAmountCalc.toFixed(2)}} - - diff --git a/package2/shop/merchantCenter.vue b/package2/shop/merchantCenter.vue index 1ed3004..9c761cd 100644 --- a/package2/shop/merchantCenter.vue +++ b/package2/shop/merchantCenter.vue @@ -17,7 +17,7 @@ - {{shop.shopName}} + {{shop.shopName == undefined ?"":shop.shopName}} {{businessStatus == '1'?'暂停营业':'正常营业'}} diff --git a/package2/shop/orderDetail.vue b/package2/shop/orderDetail.vue index a450fc8..f09928d 100644 --- a/package2/shop/orderDetail.vue +++ b/package2/shop/orderDetail.vue @@ -13,8 +13,8 @@ - {{'#'+data.numberCode}} - 期望送达 + {{'#'+data.numberCode}} + 期望送达 明天 06:30 {{data.status == 0?'待支付':data.status == 2?'待配送员接单':(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime == null) || (data.status == 3 && data.deliveryType == 2 && data.userRequireMake == 1)?'待出餐':(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime != null)?'待取货':(data.status == 3 && data.deliveryType == 2)?'待消费':data.status == 4?'待送达':data.status == 5?'已完成':data.status == 7?'待同意退款':data.status == 8?'已退款':data.status == 6?'已取消':data.status == 11?'售后中':data.status == 12?'已售后':""}} @@ -25,8 +25,8 @@ {{data.deliveryType == 2?'自取订单':'配送订单'}} - 配送员:{{data.deliveryInfo.workerName}} - + 配送员:{{(data.deliveryInfo.workerName == 'null' || !data.deliveryInfo.workerName) ?"":data.deliveryInfo.workerName}} + @@ -122,7 +122,7 @@ {{data.receiverPhone}} - + 团购信息 diff --git a/package2/shop/shopOrderList.vue b/package2/shop/shopOrderList.vue index 5edf0c6..7a5e96f 100644 --- a/package2/shop/shopOrderList.vue +++ b/package2/shop/shopOrderList.vue @@ -17,23 +17,24 @@ {{ item.name }} - + - + {{'#' + item.numberCode}} - + {{item.createTime | formatISOTime}} - {{item.status == 0?'待支付':item.status == 2?'待配送员接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} + {{item.status == 0?'待支付':item.status == 2?'待配送员接单':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake == 1)?'待出餐':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null)?'待取货':(item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null) || (item.status == 3 && item.deliveryType == 2 && item.userRequireMake != 1)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} @@ -56,7 +57,7 @@ {{item.deliveryType == 1?'配送':'自取'}} - + @@ -155,13 +156,13 @@ checked: true }, { - name: '待消费', - value: 2, + name: '待出餐', + value: 13, checked: false }, { - name: '待出餐', - value: 13, + name: '待退/售后', + value: 7, checked: false }, { @@ -180,8 +181,8 @@ checked: false }, { - name: '待退款', - value: 7, + name: '待消费', + value: 2, checked: false }, { @@ -253,7 +254,12 @@ } else { that.orderList = [...that.orderList, ...res.result.records] } + for (let i = 0; i < that.orderList.length; i++) { + if (that.currentIndex == 7) { + that.orderList[i].goodsList = that.orderList[i].items + } + console.log('哈哈哈哈哈1',that.orderList) that.orderList[i].goodsNum = 0 for (let m = 0; m < that.orderList[i].goodsList.length; m++) { that.orderList[i].goodsNum += that.orderList[i].goodsList[m].quantity @@ -315,7 +321,13 @@ } }); }, - goDetail(id) { + goDetail(item) { + let id = "" + if(this.currentIndex == 7){ + id = item.mallOrder.id + }else{ + id = item.id + } uni.navigateTo({ url: '/package2/shop/orderDetail?id=' + id }) diff --git a/pages/index/index.vue b/pages/index/index.vue index 63ca172..43ca821 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1044,7 +1044,6 @@ } } } - console.log('50000',that.adList) that.deliveryItem = res.result.records; if (res.result.orderCount != null) { for (let i = 0; i < res.result.orderCount.length; i++) { @@ -2107,7 +2106,7 @@ .order-page { width: 95%; position: relative; - height: 200rpx; + height: auto; border-radius: 32rpx; border: 1px solid rgba(166, 255, 234, 0.78); background: rgba(255, 255, 255, 0.74); @@ -2192,17 +2191,18 @@ .qu-text { display: flex; flex: 1; - height: 50rpx; + height: auto; line-height: 50rpx; color: #40534d; + width: 90%; } .qu-left { width: 80%; padding-left: 10rpx; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + word-wrap: break-word; + word-break: break-all; + white-space: normal; } .qu-right { @@ -2481,7 +2481,7 @@ text-align: center; background: rgba(166, 255, 234, 0.62); padding: 0 20rpx; - margin-left: -10rpx; + margin-left: -14rpx; font-weight: 700; border-top-right-radius: 40rpx; border-bottom-right-radius: 40rpx;