diff --git a/pages/index/index.vue b/pages/index/index.vue index 6cb7aed..1a4a770 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -26,19 +26,39 @@ - - - - - - 配送员正在赶往商家 + + + + + + + + + 待支付 + 等待配送员接单 + 待成团 + 配送员已接单 + 待消费 + 配送员已取货 + 订单已完成 + 等待同意退款 + 订单已取消 + 订单已退款 + 售后中 + 订单已售后 + + + 预计{{item.deliveryInfo.mustFinishTime | formatHourMinute }}送达 + + + + + - 预计12:03-12:30送达 - - - - - + + + @@ -473,7 +493,9 @@ autoplay: true, deliveryItem:[], interval: 4000, + onlineWorkerInterval:4000, duration: 1000, + onlineWorkerDuration:1000, latitude: 39.909, // 默认纬度,可以设为用户当前位置或配送员位置 longitude: 116.39742, // 默认经度 markers: [], // 标记点,可以包括配送员位置和用户位置 @@ -492,6 +514,7 @@ }], dataList: [], areaList:[], + orderLists:[], waimaiCount:0, kuaidiCount:0, paotuiCount:0, @@ -600,6 +623,7 @@ } // 获取用户当前位置 this.getUserLocation(); + this.getUserOrders(); // 建立WebSocket连接或定时请求获取配送员位置 this.getDeliveryLocation(); if(!uni.getStorageSync('area')){ @@ -785,6 +809,11 @@ url: url }) }, + goOrderDetail(item){ + uni.redirectTo({ + url: '/package1/order/orderDetail?id=' + item.id + }); + }, onClickArea(item){ uni.setStorageSync('area',JSON.stringify(item)) this.searchForm.regionId = item.id @@ -828,6 +857,20 @@ } }).catch((res) => {}) }, + getUserOrders(){ + let that = this + that.tui.request("/mall/order/getOrdersByUserId/"+ uni.getStorageSync('id'), "GET", {}, false, true).then((res) => { + if (res.code == 200) { + if(res.result != null){ + that.orderLists = res.result + that.$forceUpdate() + } + } else { + that.tui.toast(res.message) + return + } + }).catch((res) => {}) + }, searchOrder(type, value) { if (type == 'getarea') { if(this.searchForm.getAreaId == value.id){