Просмотр исходного кода

[ 花店端 ] [ 89 ] 点击花材分类行进入该分类绑定的花材列表应该与菜单的“花材列表”区分开。 (解决)

wangn 5 лет назад
Родитель
Сommit
ed094d416b
2 измененных файлов с 9 добавлено и 4 удалено
  1. 6 1
      hd/src/pages/layout/slider/index.vue
  2. 3 3
      hd/src/views/item/list.vue

+ 6 - 1
hd/src/pages/layout/slider/index.vue

@@ -91,8 +91,13 @@ export default {
 			}
 		},
 		pageSubTo(item, index) {
+			if(index==5){
+        this.$router.push('/item-class/1');
+      }
 			this.subIndex = index;
-			this.$router.push(item.path);
+      this.$nextTick(()=>{
+			  this.$router.push(item.path);
+      })
 		}
 	}
 };

+ 3 - 3
hd/src/views/item/list.vue

@@ -337,18 +337,18 @@ export default {
       this.getAllClass()
     },
     onLoad ({ ctx, app }) {
-
+      let showPage = 1
       if (this.$route.query.classId) {
         this.classId = Number(this.$route.query.classId)
         this.className = this.$route.query.className
         this.tabsData[0].text = this.className
-        
+        showPage = 0
       }
 
       this.app = app
 
       let getItem = () => {
-        return this.$service.product.list({ classId: this.classId,showPage:1 })
+        return this.$service.product.list({ classId: this.classId,showPage })
       }
       ctx.service({
         page: getItem