From 185309613a4143ffabbaca2d47c99afee05fe909 Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Sat, 18 Apr 2026 11:13:13 +0800 Subject: [PATCH] 11 --- pages/index/index.vue | 151 ++++++++++++++++++------------------- pages/shop/orderDetail.vue | 35 ++++++++- 2 files changed, 106 insertions(+), 80 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 972c6d9..b0eac84 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -30,25 +30,25 @@ - + - 0 + {{daichucan}} - 待接单 + 待出餐 - + - 0 + {{daiquhuo}} 待取货 - + - 0 + {{daisongda}} 待送达 @@ -56,33 +56,25 @@ - + - 0 + {{daixiaofei}} 待消费 - + - 0 + {{shopData.refundCount == undefined?0:shopData.refundCount}} - 待退款 - - - - - 0 - - - 待售后 + 待退款/售后 - 0 + {{shopData.pendingBadReviewCount == undefined?0:shopData.pendingBadReviewCount}} 待回复差评 @@ -104,7 +96,7 @@ - 0 + {{shopData.orderRevenueAndCount.count}} 今日订单 @@ -112,7 +104,7 @@ - 0 + {{shopData.orderRevenueAndCount.amount}} 营业额 @@ -219,6 +211,11 @@ shop:{}, areaList:[], shopList: [], + shopData:{}, + daixiaofei:0, + daichucan:0, + daiquhuo:0, + daisongda:0 } }, components: { @@ -228,6 +225,7 @@ }, onShow() { this.indexInit() + this.getData() }, onLoad() { @@ -245,29 +243,6 @@ this.checkArea() } }, - //切换店铺 - onActionItemClick(item) { - if(this.type == 'wuliu'){ - this.current = item.id - this.name = item.companyName - }else{ - this.current = item.shop.id - this.name = item.shopName - this.shopOwnerPhone = item.shopOwnerPhone - } - if (!this.shopName) return this.tui.toast('请输入新店铺名称', 2000) - this.tui.request("/app/shop/modifyShopNameById", "put", { - id: this.shopId, - shopName: this.shopName - }, false, true).then((res) => { - if (res.code === 200) { - this.getList() - this.onPopupClose() - } else { - this.tui.toast(res.message) - } - }) - }, checkArea(){ this.NB.sendRequest("/auth/getShopByUser", {}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { if (res.code == 200) { @@ -378,43 +353,65 @@ url: url }) }, + getData(){ + that.NB.sendRequest("/mall/order/countByShop/"+uni.getStorageSync('shopId'), {}, true, 'GET', 'application/x-www-form-urlencoded').then((res) => { + if (res.code == 200) { + this.shopData = res.result + for(let i=0;i {}) + }, //扫一扫功能 scanCodeAdd() { let that = this; uni.scanCode({ success: (res) => { if (res.scanType == "QR_CODE") { //二维码 - console.log('二维码',res) - // let shopId = base.decode(res.result.split(',')[1]) - // if (shopId == uni.getStorageSync('shopId').substring('10', '12')) { - // that.productId = base.decode(res.result.split(',')[0]) - // that.toggle('bottom', base.decode(res.result.split(',')[0])); + let shopId = res.result.split('@@')[1] + if (shopId == uni.getStorageSync('shopId')) { + let productId = res.result.split('@@')[0] + uni.showModal({ + title: '提示', + content: '确定要核销该订单吗?', + success: function (res1) { + if (res1.confirm) { + that.NB.sendRequest("/mall/order/complete", { + orderId: productId + }, true, 'post', 'application/x-www-form-urlencoded').then((res) => { + if (res.code == 200) { + uni.showToast({ + title: '核销成功', + icon: 'none' + }) + } else { + that.tui.toast(res.message) + } + uni.hideLoading() + }).catch((res) => {}) + } + } + }); - // } else { - // that.tui.toast('您的店铺中暂无该商品!') - // } - } else { - console.log('条形码',res) - // that.NB.sendRequest("/app/product/getByBarcode", "POST", { - // barcode: res.result - // }, false, true).then((res1) => { - // if (res1.code == 200) { - // that.productId = res1.result[0].id - // if (res1.result == '') { - // that.tui.toast('您的店铺中暂无该商品!') - // } else { - // that.toggle('bottom', res1.result[0].id); - - // } - - // } else { - // that.tui.toast(res.message) - // } - // }).catch((res) => { - // that.tui.toast(res) - // }) + + } else { + that.tui.toast('未查询到此订单信息,请核实!') + } } - }, fail: (res) => { uni.showToast({ @@ -425,7 +422,7 @@ }) }, //底部tab切换组件状态改变 - changeIndex(index) { + changeIndex(index,type) { let that = this; this.lastIndex = this.currentIndex this.currentIndex = index @@ -434,7 +431,7 @@ this.indexInit() break; case 1: - that.$refs.deLivery.init() + that.$refs.deLivery.init(type) break; case 2: that.$refs.myCenter.init() diff --git a/pages/shop/orderDetail.vue b/pages/shop/orderDetail.vue index b729866..958d64b 100644 --- a/pages/shop/orderDetail.vue +++ b/pages/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 @@ 打印小票 - - 取消订单 + + 已出餐 @@ -191,6 +191,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