306132416@qq.com 4 år sedan
förälder
incheckning
088b76eb60
1 ändrade filer med 23 tillägg och 5 borttagningar
  1. 23 5
      components/foot-tabs/footTabs.vue

+ 23 - 5
components/foot-tabs/footTabs.vue

@@ -7,11 +7,15 @@
         :key="i"
         @tap="click(i, menu.pagePath)"
       >
-        <uni-transition mode-class="fade" show="true" v-if="selectedIndex == i">
-          <img :src="menu.selectedIconPath" />
+        <uni-transition mode-class="slide-right" show="true" v-show="selectedIndex == i">
+			<!-- <view :animation="animationData" v-show="selectedIndex == i"> -->
+				   <image :src="menu.selectedIconPath" mode="aspectFill"></image>
+			<!-- </view> -->
         </uni-transition>
-        <uni-transition mode-class="fade" show="true" v-else>
-          <img :src="menu.iconPath" />
+        <uni-transition mode-class="slide-left" show="true" v-show="selectedIndex != i">
+			<!-- <view :animation="animationData"  v-show="selectedIndex != i"> -->
+				   <image :src="menu.iconPath" mode="aspectFill"></image>
+			<!-- </view> -->
         </uni-transition>
       </div>
     </div>
@@ -34,7 +38,7 @@
     justify-content: space-around;
     .menu_icon {
       transition: all 0.5s;
-      img {
+      image {
         width: 60rpx;
         height: 60rpx;
         border-radius: 100rpx;
@@ -49,6 +53,7 @@ export default {
     return {
       selectedIndex: getApp().globalData.selectedIndex,
       showselected: false,
+	  animationData: {},
       menus: [
         {
           pagePath: "pages/index/index",
@@ -65,6 +70,19 @@ export default {
       ],
     };
   },
+  // onShow() {
+  // 	    var animation = uni.createAnimation({
+  // 	      duration: 2000,
+  // 	        timingFunction: 'ease',
+  // 	    })
+  // 	    this.animation = animation
+  // 	    animation.scale(2,2).rotate(45).step()
+  // 	    this.animationData = animation.export()
+  // 	    setTimeout(function() {
+  // 	      animation.translate(30).step()
+  // 	      this.animationData = animation.export()
+  // 	    }.bind(this), 1000)
+  // },
   methods: {
     click(index, src) {
       var pages = getCurrentPages(); //获取加载的页面