From ba89afe8d03eb78b88f2579434da00b92b78295d Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Wed, 8 Apr 2026 18:05:46 +0800 Subject: [PATCH] 11 --- package1/myCenter/merchantCenter.vue | 27 +++-- package1/myCenter/shopOrderList.vue | 159 ++++++++++++++++++--------- 2 files changed, 123 insertions(+), 63 deletions(-) diff --git a/package1/myCenter/merchantCenter.vue b/package1/myCenter/merchantCenter.vue index 40a5790..cd5f0d7 100644 --- a/package1/myCenter/merchantCenter.vue +++ b/package1/myCenter/merchantCenter.vue @@ -12,11 +12,11 @@ - + - 老王的店 + {{shop.shopName}} {{businessStatus == '1'?'暂停营业':'正常营业'}} @@ -30,7 +30,7 @@ - + 0 @@ -38,33 +38,33 @@ 待接单 - + 0 - 待发货 + 待取货 - + 0 - 待商家送达 + 待送达 - + 0 - 待顾客自取 + 待消费 - + 0 @@ -176,6 +176,7 @@ return { menuButtonInfo: {}, businessStatus:1, + shop:{} } }, onShow() { @@ -191,6 +192,8 @@ shopId: uni.getStorageSync('shopId') }, false, true).then((res) => { if (res.code == 200) { + this.shop = res.result + this.shop.shopIcon = uni.getStorageSync('shopIcon') this.businessStatus = res.result.status } else { this.tui.toast(res.message) @@ -223,14 +226,14 @@ }); }, - goDetail(type) { + goDetail(type,index) { let url = '' switch (type) { case 'tj': url = '/package1/myCenter/dataStatistics' break; case 'db': - url = '/package1/order/orderDetail' + url = '/package1/myCenter/shopOrderList?index=' + index break; case 'sp': url = '/package1/myCenter/goodsList' diff --git a/package1/myCenter/shopOrderList.vue b/package1/myCenter/shopOrderList.vue index 74cd40b..39d0d71 100644 --- a/package1/myCenter/shopOrderList.vue +++ b/package1/myCenter/shopOrderList.vue @@ -15,66 +15,38 @@ :scroll-with-animation="true"> + :class="{ 'active': currentIndex === index }" @click="handleStatusClick(index,item.value)"> {{ item.name }} - + - #0001 + {{'#' + item.numberCode}} - 2026-02-28 16:08 已退款 + {{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?'已售后':""}} - 商品 1 已出餐 + 商品 {{item.goodsNum}} 已出餐 - + - 鱼香肉丝 + {{item1.productName}} - X1 + {{'X' + item1.quantity}} - ¥5.00 - - - - - - - - #0001 - - - 2026-02-28 16:08 已退款 - - - 已关闭 - - - - - 商品 1 - - - - 鱼香肉丝 - - - X1 - - - ¥5.00 + {{'¥'+ item1.price}} @@ -86,66 +58,151 @@ export default { data() { return { + loadStatus: 'more', + searchForm:{ + pageNum:1, + pageSize:10, + shopName:'', + searchStatus:10, + shopId:uni.getStorageSync('shopId'), + regionId:JSON.parse(uni.getStorageSync('area')).id + }, + totalPages: 1, + orderList:[], currentIndex: 0, menuButtonInfo: {}, statusList: [{ - name: '待接单', + name: '全部', + value: 10, + checked: true + },{ + name: '待支付', value: 0, checked: true }, { - name: '待发货', + name: '待成团', value: 1, checked: false }, { - name: '待退款', + name: '待消费', value: 2, checked: false }, { - name: '待售后', + name: '待接单', value: 3, checked: false }, { - name: '已发货', + name: '待取货', value: 4, checked: false }, { - name: '已完成', + name: '待送达', value: 5, checked: false }, { - name: '已取消', + name: '已完成', value: 6, checked: false }, { - name: '已售后', + name: '待退款', value: 7, checked: false + }, + { + name: '已退款', + value: 8, + checked: false + }, + { + name: '已取消', + value: 9, + checked: false + }, + { + name: '售后中', + value: 11, + checked: false + }, + { + name: '已售后', + value: 12, + checked: false } ] } }, + onReachBottom() { + if (this.searchForm.pageNum >= this.totalPages) return; + // this.status = 'loading'; + this.searchForm.pageNum++; + this.getOrderList(); + }, + 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}`; + } + }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() }, onLoad(option) { - + if(option.index){ + this.searchForm.searchStatus = option.index + this.currentIndex = option.index + } + this.getList() }, methods: { - goDetail(){ + getList(){ + this.loadStatus = 'loading' + let that = this + that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => { + that.loadStatus = 'nomore'; + if (res.code == 200) { + if (that.searchForm.pageNum == 1) { + that.orderList = res.result.records; + } else { + that.orderList = [...that.orderList, ...res.result.records] + } + for(let i=0;i {}); + }, + goDetail(id){ uni.navigateTo({ - url:'/package1/order/orderDetail' + url:'/package1/order/orderDetail?id=' + id }) }, - handleStatusClick(index) { + handleStatusClick(index,value) { if (this.currentIndex === index) return; this.currentIndex = index; + this.searchForm.searchStatus = value + this.getList() }, back() { uni.navigateBack()