From 55bff8f10082360de43911ee1447cbeec5c0b346 Mon Sep 17 00:00:00 2001 From: 77 <270260644@qq.com> Date: Wed, 13 Nov 2024 17:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=88=86=E7=B1=BB=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E9=A2=98=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/category.vue | 80 ++++++++++++++++++++++-- pages/index/components/second-second.vue | 41 ++++++++++-- 2 files changed, 111 insertions(+), 10 deletions(-) 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 @@