From 16bd2006a032a270f8ecc229eb8c3992e2bf5e5a Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Wed, 6 Nov 2024 17:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=AC=E5=9C=B0=E7=94=9F?= =?UTF-8?q?=E6=B4=BB=E5=95=86=E5=AE=B6=E8=B4=A6=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle_b/pages/local_shop/local_bill.vue | 32 ++-- .../pages/local_shop/local_bill_order.vue | 149 +++++++++++++++++- 2 files changed, 164 insertions(+), 17 deletions(-) diff --git a/bundle_b/pages/local_shop/local_bill.vue b/bundle_b/pages/local_shop/local_bill.vue index 073451a..ffcfceb 100644 --- a/bundle_b/pages/local_shop/local_bill.vue +++ b/bundle_b/pages/local_shop/local_bill.vue @@ -38,7 +38,7 @@ 营业额(元) - @@ -46,14 +46,12 @@ 共交易笔数 - + {{info.count_trade}} 成功交易笔数 - + {{info.success_trade}} @@ -67,9 +65,8 @@ - {{lstore_id}} - + @@ -89,7 +86,7 @@ day: '', report: 1, info: [], - filterDay: [] + filterDay: [], } }, onLoad(e) { @@ -97,12 +94,15 @@ this.lstore_id = e.lstore_id } - const date = new Date().getTime() - this.day = this.$u.date(date, 'yyyy-mm-d') - + this.setDate() this.getData() }, methods: { + setDate() { + const date = new Date().getTime() + this.day = this.$u.date(date, 'mm-d') + }, + async getData() { const {code, data} = await countData({ lstore_id: this.lstore_id, @@ -119,12 +119,14 @@ changeReport(type) { this.report = type this.filterDay = [] + + this.setDate() this.getData() }, // 获取日期 filterDate(e) { - this.day = e.startDate + this.day = `${e.startMonth}-${e.startDay}—${e.endMonth}-${e.endDay}` this.filterDay = { startDate: e.startDate, endDate: e.endDate @@ -211,5 +213,11 @@ align-items: center; padding: 20rpx; } + + .trade { + color: #FF2C3C; + font-size: 36rpx; + font-weight: bold; + } } \ No newline at end of file diff --git a/bundle_b/pages/local_shop/local_bill_order.vue b/bundle_b/pages/local_shop/local_bill_order.vue index e04c34b..1e3c653 100644 --- a/bundle_b/pages/local_shop/local_bill_order.vue +++ b/bundle_b/pages/local_shop/local_bill_order.vue @@ -1,6 +1,10 @@ @@ -41,6 +74,18 @@ tip: '暂无数据~', // 提示 fixed: true } + }, + showPopup: false, + filter: { + showStartTime: false, + startTime: '', + showEndTime: false, + endTime: '', + payType: [ + {id: 1, text: '线下支付'}, + {id: 2, text: '商品支付'}, + ], + selectPay: 0, } } }, @@ -55,13 +100,17 @@ }, async upCallback(page) { - let pageNum = page.num; // 页码, 默认从1开始 - let pageSize = page.size; // 页长, 默认每页10条 + const startTime = this.filter.startTime + const endTime = this.filter.endTime + const selectPay = this.filter.selectPay getLocalOrderList({ - page_size: pageSize, - page_no: pageNum, - lstore_id: this.lstore_id + page_size: page.size, + page_no: page.num, + lstore_id: this.lstore_id, + start_time: startTime, + end_time: endTime, + select_pay: selectPay, }).then(({ data }) => { @@ -73,6 +122,38 @@ this.mescroll.endSuccess(curPageLen, hasNext); }) }, + + confirmStartTime(e) { + this.filter.startTime = `${e.year}-${e.month}-${e.day}` + }, + + confirmEndTime(e) { + this.filter.endTime = `${e.year}-${e.month}-${e.day}` + + if (this.filter.endTime < this.filter.startTime) { + this.filter.endTime = '' + this.$toast({ + title: '结束日期不能小于开始日期' + }) + + return false + } + }, + + selectPayType(id) { + this.filter.selectPay = id + }, + + clearFilter() { + this.filter.startTime = '' + this.filter.endTime = '' + this.filter.selectPay = 0 + }, + + confirmFilter() { + this.showPopup = false + this.refresh() + } }, } @@ -85,6 +166,15 @@ .order { padding: 20rpx; + .all-order { + width: 200rpx; + background-color: #ccc; + border-radius: 40rpx; + text-align: center; + padding: 10rpx; + margin: 20rpx; + } + .list { background-color: #fff; border-radius: 20rpx; @@ -109,5 +199,54 @@ color: #000; } } + + .filter { + height: 100%; + padding: 20rpx; + position: relative; + + .grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 24rpx; + justify-content: space-between; + align-items: center; + } + + .time-block { + width: 200rpx; + text-align: center; + height: 60rpx; + line-height: 60rpx; + padding: 0; + background-color: #ccc; + border-radius: 10rpx; + color: #fff; + } + + .item { + background-color: #ccc; + padding: 10rpx 20rpx; + border-radius: 10rpx; + color: #fff; + } + + .border { + width: 40rpx; + height: 2rpx; + background-color: #ccc; + } + + .active { + background-color: #FF2C3C; + } + + .popup-btn-group { + position: absolute; + bottom: 20rpx; + left: 50%; + transform: translateX(-50%); + } + } } \ No newline at end of file