From a2d14e175371d07ad3fe5b0106ae91648eb1b0db Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Sat, 18 Apr 2026 11:12:20 +0800 Subject: [PATCH] 11 --- package2/shop/merchantCenter.vue | 47 ++++++++--- package2/shop/orderDetail.vue | 35 ++++++++- package2/shop/shopOrderList.vue | 131 +++++++++++++++++++------------ 3 files changed, 151 insertions(+), 62 deletions(-) diff --git a/package2/shop/merchantCenter.vue b/package2/shop/merchantCenter.vue index eea22e1..1cbedbf 100644 --- a/package2/shop/merchantCenter.vue +++ b/package2/shop/merchantCenter.vue @@ -33,7 +33,7 @@ - 0 + {{daichucan}} 待出餐 @@ -41,7 +41,7 @@ - 0 + {{daiquhuo}} 待取货 @@ -49,7 +49,7 @@ - 0 + {{daisongda}} 待送达 @@ -59,7 +59,7 @@ - 0 + {{daixiaofei}} 待消费 @@ -67,7 +67,7 @@ - 0 + {{shopData.refundCount == undefined?0:shopData.refundCount}} 待退款/售后 @@ -75,7 +75,7 @@ - 0 + {{shopData.pendingBadReviewCount == undefined?0:shopData.pendingBadReviewCount}} 待回复差评 @@ -97,7 +97,7 @@ - 0 + {{shopData.orderRevenueAndCount.count}} 今日订单 @@ -105,7 +105,7 @@ - 0 + {{shopData.orderRevenueAndCount.amount}} 营业额 @@ -178,7 +178,12 @@ return { menuButtonInfo: {}, businessStatus:1, - shop:{} + shop:{}, + shopData:{}, + daixiaofei:0, + daichucan:0, + daiquhuo:0, + daisongda:0 } }, onShow() { @@ -186,8 +191,32 @@ }, onLoad(option) { this.getBusinessStatus() + this.getData() }, methods: { + getData(){ + this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => { + if (res.code == 200) { + this.shopData = res.result + for(let i=0;i {}) + }, //获取营业状态 getBusinessStatus(){ this.tui.request("/app/shoptakeaway/getByShopId", "GET", { diff --git a/package2/shop/orderDetail.vue b/package2/shop/orderDetail.vue index 3384313..bfe5fb3 100644 --- a/package2/shop/orderDetail.vue +++ b/package2/shop/orderDetail.vue @@ -17,7 +17,7 @@ 期望送达 明天 06:30 - {{data.status == 0?'待支付':data.status == 1?' 待成团':data.status == 2?'待消费':data.status == 3?'待接单':data.status == 4?'待取货':data.status == 5?'待送达':data.status == 6?'已完成':data.status == 7?'待退款':data.status == 8?'已退款':data.status == 9?'已取消':data.status == 11?'售后中':data.status == 12?'已售后':""}} + {{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?'已售后':""}} @@ -138,8 +138,8 @@ 打印小票 - - 取消订单 + + 已出餐 @@ -192,6 +192,35 @@ uni.hideLoading(); }).catch((res) => {}); }, + mealServing(item){ + let that = this + uni.showModal({ + title: '提示', + content: '确定要出餐吗?', + success: function (res) { + if (res.confirm) { + let data = {} + let url = '' + if(item.deliveryType == 2){ //自取单 + url = '/mall/order/complete' + }else if(item.deliveryType == 1){ //外卖单 + url = '/mall/order/shopMakeTime' + } + that.tui.request(url, "post", { + orderId:item.id + }, false, true).then((res) => { + if (res.code == 200) { + this.back() + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + } + } + }); + }, makeCall(phone){ uni.makePhoneCall({ phoneNumber: phone diff --git a/package2/shop/shopOrderList.vue b/package2/shop/shopOrderList.vue index 5c78aa9..330cc76 100644 --- a/package2/shop/shopOrderList.vue +++ b/package2/shop/shopOrderList.vue @@ -16,7 +16,8 @@ :scroll-with-animation="true"> + :class="{ 'active': currentIndex == item.value }" + @click="handleStatusClick(item.value,item.value)"> {{ item.name }} @@ -28,16 +29,16 @@ {{'#' + item.numberCode}} - {{item.createTime | formatISOTime}} + {{item.createTime | formatISOTime}} - {{item.status == 0?'待支付':item.status == 1?' 待成团':item.status == 2?'待消费':item.status == 3?'待接单':item.status == 4?'待取货':item.status == 5?'待送达':item.status == 6?'已完成':item.status == 7?'待退款':item.status == 8?'已退款':item.status == 9?'已取消':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 == 2)?'待消费':item.status == 4?'待送达':item.status == 5?'已完成':item.status == 7?'待同意退款':item.status == 8?'已退款':item.status == 6?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}} - 商品 {{item.goodsNum}} 已出餐 + 商品 {{item.goodsNum}} @@ -51,6 +52,12 @@ + + + + 已出餐 + + @@ -60,31 +67,22 @@ data() { return { loadStatus: 'more', - searchForm:{ - pageNum:1, - pageSize:10, - shopName:'', - searchStatus:10, - shopId:uni.getStorageSync('shopId'), - regionId:JSON.parse(uni.getStorageSync('area')).id + searchForm: { + pageNum: 1, + pageSize: 10, + shopName: '', + searchStatus: 10, + shopId: uni.getStorageSync('shopId'), + regionId: JSON.parse(uni.getStorageSync('area')).id }, totalPages: 1, - orderList:[], + orderList: [], currentIndex: 10, menuButtonInfo: {}, statusList: [{ name: '全部', value: 10, checked: true - },{ - name: '待支付', - value: 0, - checked: true - }, - { - name: '待成团', - value: 1, - checked: false }, { name: '待消费', @@ -92,8 +90,8 @@ checked: false }, { - name: '待接单', - value: 3, + name: '待出餐', + value: 13, checked: false }, { @@ -125,16 +123,6 @@ name: '已取消', value: 9, checked: false - }, - { - name: '售后中', - value: 11, - checked: false - }, - { - name: '已售后', - value: 12, - checked: false } ] } @@ -145,33 +133,47 @@ this.searchForm.pageNum++; this.getOrderList(); }, - filters:{ + filters: { formatISOTime(isoString) { - const date = new Date(isoString); - const year = date.getFullYear(); - const month = (date.getMonth() + 1).toString().padStart(2, '0'); - const day = date.getDate().toString().padStart(2, '0'); - const hours = date.getHours().toString().padStart(2, '0'); - const minutes = date.getMinutes().toString().padStart(2, '0'); - const seconds = date.getSeconds().toString().padStart(2, '0'); - return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + const date = new Date(isoString); + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + const seconds = date.getSeconds().toString().padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; } }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() }, onLoad(option) { - if(option.index){ + if (option.index) { this.searchForm.searchStatus = option.index this.currentIndex = option.index } this.getList() }, methods: { - getList(){ + getList() { this.loadStatus = 'loading' let that = this - that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => { + let url = '' + let data = { + linkId: uni.getStorageSync('shopId'), + pageNum: this.searchForm.pageNum, + pageSize: 10, + statusList: [0, 3], + regionId: JSON.parse(uni.getStorageSync('area')).regionId + } + if (this.currentIndex == 11) { + url = "/mall/refund/page" + } else { + url = "/mall/order/page" + } + that.tui.request(url, "POST", this.currentIndex == 11 ? data : this.searchForm, false, false).then(( + res) => { that.loadStatus = 'nomore'; if (res.code == 200) { if (that.searchForm.pageNum == 1) { @@ -179,9 +181,9 @@ } else { that.orderList = [...that.orderList, ...res.result.records] } - for(let i=0;i {}); }, - goDetail(id){ + mealServing(item){ + let that = this + uni.showModal({ + title: '提示', + content: '确定要出餐吗?', + success: function (res) { + if (res.confirm) { + let data = {} + let url = '' + if(item.deliveryType == 2){ //自取单 + url = '/mall/order/complete' + }else if(item.deliveryType == 1){ //外卖单 + url = '/mall/order/shopMakeTime' + } + that.tui.request(url, "post", { + orderId:item.id + }, false, true).then((res) => { + if (res.code == 200) { + that.getList() + } else { + that.tui.toast(res.message); + return; + } + uni.hideLoading(); + }).catch((res) => {}); + } + } + }); + }, + goDetail(id) { uni.navigateTo({ - url:'/package2/shop/orderDetail?id=' + id + url: '/package2/shop/orderDetail?id=' + id }) }, - handleStatusClick(index,value) { + handleStatusClick(index, value) { if (this.currentIndex === index) return; this.currentIndex = index; this.searchForm.searchStatus = value