From 60c8bb4d978bca274dcb0d3445da2adc5a9a4b7f Mon Sep 17 00:00:00 2001 From: Esdese <2114339600@qq.com> Date: Thu, 8 Sep 2022 14:01:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/varComm/index.js | 2 +- pages/varComm/pages/carModels/index.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/varComm/index.js b/pages/varComm/index.js index b6f0374..4451498 100644 --- a/pages/varComm/index.js +++ b/pages/varComm/index.js @@ -13,7 +13,7 @@ Page({ }) } else { this.getTabBar().init(); - if (this.data.active == 2 || this.data.active == 3) { + if (this.data.active == 2 || this.data.active == 3 ||this.data.active == 1) { this.reLoad() } } diff --git a/pages/varComm/pages/carModels/index.js b/pages/varComm/pages/carModels/index.js index ac57eda..8150552 100644 --- a/pages/varComm/pages/carModels/index.js +++ b/pages/varComm/pages/carModels/index.js @@ -46,16 +46,19 @@ Component({ }) return } - wx.setStorageSync('modelsData', this.data.boxArr) - if(wx.getStorageSync('sBrand').length<1){ - wx.setStorageSync('sBrand', this.data.sBrand) + let sBrand = [] + for(let i of this.data.boxArr){ + if(i) sBrand.push(i.brand) + } + wx.setStorageSync('modelsData', this.data.boxArr) + wx.setStorageSync('sBrand', sBrand) wx.navigateTo({ url: `/contrastPackages/carModelsRatio/index`, }) }, onChange(event) { - let sBrand = [] + // let sBrand = [] const {detail} = event const result = [] if(detail.length>6){ @@ -68,13 +71,11 @@ Component({ for(let i of detail){ let x = JSON.parse(i) result.push(x) - sBrand.push(x.brand) } result.length = 6 this.setData({ result:detail, boxArr:result, - sBrand, }) }, del(e) {