From d4e7245d1a10231f73993b9cab332cdbc67a0146 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Sat, 19 Oct 2024 14:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle_b/pages/local_order_search/index.vue | 146 ++++++++++---------- 1 file changed, 76 insertions(+), 70 deletions(-) diff --git a/bundle_b/pages/local_order_search/index.vue b/bundle_b/pages/local_order_search/index.vue index e299d93..4c1e3b7 100644 --- a/bundle_b/pages/local_order_search/index.vue +++ b/bundle_b/pages/local_order_search/index.vue @@ -1,58 +1,64 @@ @@ -83,47 +89,47 @@ }; }, onLoad(options) { - const {lstore_id} = this.$Route.query + const { + lstore_id + } = this.$Route.query if (lstore_id) { this.lstore_id = lstore_id - this.$nextTick(() => { - this.onRefresh() - }) } }, methods: { search(e) { this.keyword = e - this.orderType = '' - this.mescroll.resetUpScroll() - }, - - onRefresh() { this.mescroll.resetUpScroll() }, upCallback(page) { - let pageNum = page.num; // 页码, 默认从1开始 - let pageSize = page.size; // 页长, 默认每页10条 let { keyword, lstore_id - } = this; - localOrderList({ - page_size: pageSize, - page_no: pageNum, - keyword, - lstore_id, - }).then(({ - data - }) => { - let curPageData = data.list; - let curPageLen = curPageData.length; - let hasNext = !!data.more; - if (page.num == 1) this.orderList = []; - this.orderList = this.orderList.concat(curPageData); - this.mescroll.endSuccess(curPageLen, hasNext); - }) + } = this + + if (keyword) { + let pageNum = page.num; // 页码, 默认从1开始 + let pageSize = page.size; // 页长, 默认每页10条 + + localOrderList({ + page_size: pageSize, + page_no: pageNum, + keyword, + lstore_id, + }).then(({ + data + }) => { + let curPageData = data.list; + let curPageLen = curPageData.length; + let hasNext = !!data.more; + if (page.num == 1) this.orderList = []; + this.orderList = this.orderList.concat(curPageData); + this.mescroll.endSuccess(curPageLen, hasNext); + }) + } else { + this.mescroll.endSuccess(0, false); + } } }, computed: {