DESKTOP-SYIYI\Dell 7 лет назад
Родитель
Сommit
7205b1a2b6
2 измененных файлов с 8 добавлено и 5 удалено
  1. 7 4
      src/components/main/home/homeTabs.vue
  2. 1 1
      src/lib/api.js

+ 7 - 4
src/components/main/home/homeTabs.vue

@@ -62,18 +62,21 @@
                                 nativeOnClick={ () => nativeClickHandler(index, item)}>{ item.name}</TabItem>
             })
 
+            let showTable = this.tabs.length >= 2;
+            let tabDisplay = showTable ? "block" : "none";
+            let containerPaddingTop = showTable ? "170px" : "84px";
+
             return (
                     <div>
                         <div v-document_title>熊猫美妆</div>
                         <Search isScroll={this.isScroll}></Search>
-                        <div>
+                        <div style={{display: tabDisplay}}>
                             <div class="list_tab" style={{position: 'fixed'}}>
                                 <Tab style={{width: 150 * this.tabs.length + "px", background: "#fff"}}
                                      customBarWidth="150px">{top_tabs}</Tab>
                             </div>
                         </div>
-                        <div class="list_container">
-
+                        <div class="list_container" style={{paddingTop: containerPaddingTop}}>
                             <router-view></router-view>
                         </div>
                     </div>
@@ -107,7 +110,7 @@
     }
 
     .list_container {
-        padding-top: 170px;
+
         padding-bottom: 101px;
         background: #f9f9f9;
     }

+ 1 - 1
src/lib/api.js

@@ -73,7 +73,7 @@ class Api {
     }
 
     static homeTabs() {
-        return this.host() + "/mobile/index.php?act=index&op=tabs&client_type=ajax"
+        return this.host() + "/mobile/index.php?act=mshop&op=tabs&client_type=ajax"
     }
 
     static login(mobile, code) {