diff --git a/pages/index/category.vue b/pages/index/category.vue index 863fafa..3a5daf0 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -6,8 +6,12 @@ - + :class="[ + { 'menu-item-active': index === state.activeMenu && state.themeType == '' }, + { [state.themeType + 'vv']: index === state.activeMenu && state.themeType } + ]" + @tap="onMenu(index)"> + {{ item.name }} @@ -25,7 +29,7 @@ :activeMenu="state.activeMenu" /> + :activeMenu="state.activeMenu" :vl="state.themeType" /> { state.activeMenu = val; if (state.style === 'second_one' && secondRef.value) { - secondRef.value.onFilterItem(state.categoryList[state.activeMenu].children[0].id); + secondRef.value.onFilterItem(state.categoryList[state.activeMenu].children[0].id,0); } if (state.style === 'first_one' || state.style === 'first_two') { state.pagination.pageNo = 1; @@ -153,6 +158,9 @@ \ No newline at end of file diff --git a/pages/index/components/second-second.vue b/pages/index/components/second-second.vue index 2e71a4f..97ada20 100644 --- a/pages/index/components/second-second.vue +++ b/pages/index/components/second-second.vue @@ -3,7 +3,11 @@ - {{item.name}} @@ -42,7 +46,11 @@ - 去购买 + 去购买 @@ -89,6 +97,10 @@ default: () => ({}), }, activeMenu: [Number, String], + vl: { + type: String, + default:'' + }, }); const state = reactive({ @@ -106,14 +118,17 @@ iconStatus: false, // true - 单列布局;false - 双列布局 keyword: '', categoryId: 0, - loadStatus: '' + loadStatus: '', + currItem:0 }); // 清空列表 function emptyList() { state.pagination.list = []; } - const onFilterItem = (id) => { + const onFilterItem = (id,index) => { + console.log(index,"indexindex") + state.currItem = index // 清空 + 加载数据 emptyList(); getList(id); @@ -166,6 +181,24 @@