shish 4 лет назад
Родитель
Сommit
8324e903d9
1 измененных файлов с 7 добавлено и 10 удалено
  1. 7 10
      hdPad/src/pages/home/components/rightItem.vue

+ 7 - 10
hdPad/src/pages/home/components/rightItem.vue

@@ -40,7 +40,7 @@ export default {
         return {
             classData:[],
             categoryId: '',
-            totalItemData:[],
+            allItemInfo:[],
             itemInfoList:[],
             currentJobType:'bill',
             currentJobId:0
@@ -92,15 +92,12 @@ export default {
             let { data } =  await showClass()
             this.classData = data
             this.categoryId = this.classData[0].id
-            this.getShowList()
+            let { data:{list} } =  await showList()
+            this.allItemInfo = list
+            this.showCatItem()
         },
-        async getShowList(){
-            let { data:{list} } =  await showList({})
-            this.totalItemData = list
-            this.updateCurrentShop()
-        },
-        updateCurrentShop(){
-            this.itemInfoList = this.totalItemData[this.categoryId]
+        showCatItem(){
+            this.itemInfoList = this.allItemInfo[this.categoryId]
         },
         changeCategory(item){
             this.$util.hitRemind()
@@ -108,7 +105,7 @@ export default {
                 return false
             }
             this.categoryId = item.id
-            this.updateCurrentShop()
+            this.showCatItem()
         }
     }
 }