From ef3334f2e7ebf7567f1a490bfe80716816ca8b66 Mon Sep 17 00:00:00 2001 From: liudan <18634735655@163.com> Date: Tue, 30 May 2023 17:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/category/item.vue | 22 ++++++++++++++++++---- pages/index/category/one-catgory.vue | 20 ++++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/pages/index/category/item.vue b/pages/index/category/item.vue index d0ed28c..48b2b27 100644 --- a/pages/index/category/item.vue +++ b/pages/index/category/item.vue @@ -15,9 +15,9 @@ {{ item.name }} @@ -61,6 +61,10 @@ export default { scroll:{ type: Boolean, default: true + }, + isIndex:{ + type:Boolean, + default:true, } }, computed: { @@ -74,6 +78,7 @@ export default { } // let data = this.$tools.splitData(this.list, this.oneRowNum * 1); // let data = this.list + console.log(data,"999999") return data; } } @@ -88,6 +93,15 @@ export default { path: path, query: query }); + }, + getjump(item,index){ + console.log(item,index) + // if(this.isIndex){ + // this.$tools.routerTo(val) + // }else{ + this.$emit("catagory",item) + // } + } } }; @@ -107,7 +121,7 @@ export default { } .menu-tab-box { .tab-list { - font-size: 26rpx; + font-size: 22rpx; font-weight: 500; color: rgba(51, 51, 51, 1); margin: 20rpx 0; diff --git a/pages/index/category/one-catgory.vue b/pages/index/category/one-catgory.vue index e6fdfdf..5962053 100644 --- a/pages/index/category/one-catgory.vue +++ b/pages/index/category/one-catgory.vue @@ -2,15 +2,16 @@ - - + + - + {{scroll?'展':"收"}} @@ -74,7 +75,7 @@ export default { return { scroll:true, listId: 0, - categoryData: {}, + categoryData: [], categoryID: 0, //分类id isEmpty: false, currentPage: 1, @@ -99,6 +100,12 @@ export default { }, methods: { + catagoryClick(i){ + let index = this.categoryData.findIndex(item=>{ + return item.name==i.name + }) + this.onType(index) + }, zhankai(){ this.scroll=!this.scroll }, @@ -140,6 +147,7 @@ export default { }, onType(index) { + console.log(index,typeof(index)) this.listId = index; this.categoryID = this.categoryData[index].id; this.goodsList = [];