wangn 5 лет назад
Родитель
Сommit
e7b3a9c83c

+ 5 - 16
mallApp/src/components/app-tabbar.vue

@@ -1,19 +1,8 @@
 <template>
   <view class="tabbar_box">
-    <view
-      class="tabBarItem"
-      v-for="(item, index) in tabList"
-      :key="index"
-      @click="switchTab(index, item)"
-    >
-      <image
-        :src="currentTabIndex == index ? item.selectedIconPath : item.iconPath"
-        class="icon_tab"
-      ></image>
-      <view
-        class="title"
-        :style="[currentTabIndex == index ? {'color': tintColor} : {'color': color}]"
-      >{{item.text}}</view>
+    <view class="tabBarItem" v-for="(item, index) in tabList" :key="index" @click="switchTab(index, item)">
+      <image :src="current == index ? item.selectedIconPath : item.iconPath" class="icon_tab"></image>
+      <view class="title" :style="[current == index ? {'color': tintColor} : {'color': color}]">{{item.text}}</view>
     </view>
   </view>
 </template>
@@ -65,11 +54,11 @@ export default {
   },
   methods: {
     switchTab (index, item) {
-      this.currentTabIndex = index
+      this.currentTabIndex = this.current
       uni.switchTab({
         url: item.pagePath
       })
-      this.$emit('click', index)
+      // this.$emit('click', index)
     }
   },
 }

+ 1 - 4
mallApp/src/pages/home/category.vue

@@ -66,10 +66,7 @@
         <!--内容部分 end -->
       </scroll-view>
     </block>
-    <tab-bar
-      :current="1"
-      @click="tabClick"
-    ></tab-bar>
+    <tab-bar :current="1"></tab-bar>
   </div>
 </template>
 

+ 1 - 4
mallApp/src/pages/home/course.vue

@@ -25,10 +25,7 @@
         </view>
       </block>
     </scroll-view>
-    <tab-bar
-      :current="2"
-      @click="tabClick"
-    ></tab-bar>
+    <tab-bar :current="2"></tab-bar>
   </view>
 </template>
 

+ 1 - 4
mallApp/src/pages/home/index.vue

@@ -22,10 +22,7 @@
       </div>
     </block>
     <app-trademark />
-    <tab-bar
-      :current="0"
-      @click="tabClick"
-    ></tab-bar>
+    <tab-bar :current="0"></tab-bar>
   </div>
 </template>
 <script>

+ 1 - 4
mallApp/src/pages/home/shop.vue

@@ -65,10 +65,7 @@
       :info="newUserGift"
       :introUserId="option.introUserId"
     />
-    <tab-bar
-      :current="3"
-      @click="tabClick"
-    ></tab-bar>
+    <tab-bar :current="3" ></tab-bar>
   </div>
 </template>
 

+ 1 - 4
mallApp/src/pages/home/user.vue

@@ -143,10 +143,7 @@
     />
     <app-trademark />
     <go-login :show.sync="loginShow" />
-    <tab-bar
-      :current="4"
-      @click="tabClick"
-    ></tab-bar>
+    <tab-bar :current="4"></tab-bar>
   </div>
 </template>