From 467128613dd6a43e48d53c82acbfb23ace5b49f1 Mon Sep 17 00:00:00 2001 From: mullins <476823686@qq.com> Date: Sat, 23 May 2020 16:17:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E9=80=89=E9=80=BB=E8=BE=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HMFilterDropdown/HMFilterDropdown.vue | 10 ++++------ src/pages/index/index.vue | 8 +++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/HMFilterDropdown/HMFilterDropdown.vue b/src/components/HMFilterDropdown/HMFilterDropdown.vue index 4ff0931..6aa5ff0 100644 --- a/src/components/HMFilterDropdown/HMFilterDropdown.vue +++ b/src/components/HMFilterDropdown/HMFilterDropdown.vue @@ -330,7 +330,6 @@ export default { // 选中筛选类label-UI状态 selectFilterLabel (page_index, box_index, label_index) { const findIndex = this.activeMenuArr[page_index][box_index].indexOf(label_index) - console.log('select', page_index, box_index, label_index, findIndex) const data = this.filterData[page_index].submenu const selected = this.selectedData[`${data[box_index].value}`] if (findIndex > -1) { @@ -338,9 +337,8 @@ export default { this.subData[page_index].submenu[box_index].submenu[label_index].selected = false for (let i = 0; i < selected.length; i++) { if (selected[i] === data[box_index].submenu[label_index].value) { - console.log('dd', this.selectedData[`${data[box_index].value}`], selected) - this.selectedData[`${data[box_index].value}`] = selected.slice(1, 1) - console.log('dd2', this.selectedData[`${data[box_index].value}`], selected) + selected.splice(i, 1) + this.selectedData[`${data[box_index].value}`] = selected } } } else { @@ -350,10 +348,10 @@ export default { this.selectedData[`${data[box_index].value}`] = [] this.selectedData[`${data[box_index].value}`].push(data[box_index].submenu[label_index].value) } else { + // console.log('---', data, this.filterData, this.selectedData) this.selectedData[`${data[box_index].value}`].push(data[box_index].submenu[label_index].value) } // this.selectedData[`${data[box_index].value}`].push(data[box_index][label_index]) - console.log('---', data, this.filterData, this.selectedData) } this.$forceUpdate() }, @@ -375,7 +373,7 @@ export default { }, // 菜单开关 togglePage (index) { - if (index == this.showPage) { + if (index === this.showPage) { this.hidePageLayer(true) this.hideMask() this.showPage = -1 diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index d7c5d98..fe6031e 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -178,6 +178,13 @@ export default { search (e) { const { on, value, selectedData } = e let params = {} + console.log('dddd-1', params, selectedData) + for (const key in selectedData) { + if (selectedData.hasOwnProperty(key)) { + selectedData[key] = selectedData[key].toString() + } + } + console.log('dddd-2', params, selectedData) if (on[0] === 1) { // 若点击全部 this.searchText = '' @@ -186,7 +193,6 @@ export default { for (let i = 1; i <= on.length; i++) { // on[0]是全部 if (on[i] === 1) { // 若该选项被选中 if (this.categoryList[i].value === 'filter') { - console.log('dddd', params, selectedData) params = { ...selectedData, ...params -- 2.0.0