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