From 58484f1b61f4f0178afa1f4facf488c6db7a10d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Tue, 9 Nov 2021 19:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E9=80=89=E4=B8=AD=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/navigation/search/searchPage.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue index f7f09cd..3fe0722 100644 --- a/pages/navigation/search/searchPage.vue +++ b/pages/navigation/search/searchPage.vue @@ -341,7 +341,7 @@ export default { }; }, onPageScroll(e) { - console.log(e) + console.log(e); this.scrollTop = e.scrollTop; }, onLoad(val) { @@ -464,13 +464,21 @@ export default { // 点击确定进行筛选 sortConfim() { // 处理品牌(多选 - this.params.brandId = []; + if (!this.params.brandId) { + this.params.brandId = []; + } else { + this.params.brandId = [this.params.brandId]; + } + + // 如果选中品牌 赋值 this.selectedWay["brand"].forEach((item) => { if (item.__selected) { this.params.brandId.push(item.value); } }); - this.params.brandId = this.params.brandId.join("@"); + + this.params.brandId = this.params.brandId.join("@") || this.params.brandId; + // 处理分类 (单选) if (this.selectedWay["categoryId"][0]) { this.params.categoryId = this.selectedWay["categoryId"][0].value; @@ -501,7 +509,7 @@ export default { this.sortParams = { pageNumber: 1, pageSize: 10, - categoryId:this.routerVal.category || '' + categoryId: this.routerVal.category || "", }; this.sortPopup = false; this.initSortGoods(); @@ -510,9 +518,9 @@ export default { this.params = { pageNumber: 1, pageSize: 10, - categoryId:this.routerVal.category || '', - order: 'desc', - sort: 'releaseTime' + categoryId: this.routerVal.category || "", + order: "desc", + sort: "releaseTime", }; this.goodsList = []; this.loadData();