• weex splash页面


    1.Splash.vue

    <!-- splash页面 -->
    <template>
      <div class="wrap" @focus="rotate" @load="rotate">
        <!-- logo图标 -->
        <div class="logo_wrap">
          <image class="img_logo" :src="splash_logo" @click="rotate" />
        </div>
        <!-- 旋转动画 -->
        <div id="animation" style="transform-origin:center center" ref="anim">
          <image class="img_circle" @focus="rotate" :src="splash_circle" @click="rotate" />
        </div>
      </div>
    </template>
    
    <style scoped>
      .wrap{
        align-items: center;
        justify-content: center;
        background-color: #000;
      }
      /*logo图标*/
      .logo_wrap {
         300px;
        height:300px;
      }
      .img_logo {
         300px;
        height:300px;
      }
      /*旋转图标*/
      .img_circle {
         400px;
        height:400px;
        align-items: center;
        justify-content: center;
      }
    </style>
    
    <script>
      // 动画模块
      const animation = weex.requireModule('animation');
      // 弹窗
      const modal = weex.requireModule('modal');
    
      export default {
        data() {
          return {
            splash_circle:'//duqian291902259.github.io/dusan/oair/splash_circle.png',
            splash_logo:'//gw.alicdn.com/tps/i2/TB1DpsmMpXXXXabaXXX20ySQVXX-512-512.png_400x400.jpg',
            current_rotate: 0,
            current_scale: 1
          }
        },
        mounted() {
           this.rotate();
        },
        methods: {
          goSite() {
            // 页面跳转
            this.$router.push({path:'/login'});
          },
          // 动画
          anim(styles, timingFunction, duration, callback) {
            var anim = this.$refs.anim;
            // 动画效果
            animation.transition(anim, {
              styles: styles,
              duration: duration, //ms
              timingFunction: timingFunction,
              needLayout:false,
              delay: 0 //ms
            }, callback);
          },
          // 旋转
          rotate() {
            var self = this;
            self.current_rotate += 30;
            self.anim({
              transform: 'rotate(' + self.current_rotate + 'deg)'
            }, 'ease-in-out', 100, function() {
              if (self.current_rotate === 360) {
                self.current_rotate = 0;
                // 页面跳转
                self.goSite();
              }else if (self.current_rotate === 180){
                self.scale();
              }else{
                self.rotate();
              }
            });
          },
          // 缩放
          scale() {
            var self = this;
            self.current_scale = 0.3;
            self.anim({
              transform: 'scale(' + self.current_scale + ')'
            }, 'linear', 500, function() {
                self.current_scale =1;
                // 调用旋转
                self.rotate();
            });
          }
        }
      };
    </script>
    

    2.效果图

  • 相关阅读:
    MySQL常用维护管理工具 枫
    sql触发器 枫
    MySQL函数大全 枫
    使用Cscope阅读Linux源码 枫
    ASP.NET文件下载,直接向客户端输出文件 枫
    网站设计数据库集群和数据库垂直分割,水平分割,库表散列 枫
    西点成品分类 枫
    asp函数列表 枫
    [笔记]一道C语言面试题:实现 itoa() 函数
    [笔记]Arduino平台使用US100超声波测距模块的电平模式测距实验
  • 原文地址:https://www.cnblogs.com/crazycode2/p/8213502.html
Copyright © 2020-2023  润新知