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 {
width: 300px;
height:300px;
}
.img_logo {
width: 300px;
height:300px;
}
/*旋转图标*/
.img_circle {
width: 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.效果图

weex splash页面的更多相关文章
- Android 手机卫士1--实现splash页面
1.minSdkVersion.targetSdkVersion.maxSdkVersion.target API level四个数值到底有什么区别? minSdkVersion, maxSdkVer ...
- Xamarin.Android splash页面瞬间响应_避免APP启动闪白屏
Application和Activity中的onCreate都进行了优化,基本没有耗时操作,但是启动应用之后还是会闪现一下白色背景,然后才进入Splash页面,对比了一下QQ.微信.微博等客户端,点击 ...
- 项目Splash页面的开发与设计
项目Splash页面的开发与设计 首先建立一个安卓的项目,然后修改manifest.xml文件,修改应用程序的logo和显示名称,效果图如下: 对应的代码如下: 1 <?xml version= ...
- Android之Splash页面
在继上个任务没有解决之后,心灰意冷之后,现在的我在跟着视频学习开发一个手机卫士的软件.在写自己的笔记之前,我先来展示一下我的结果. 下面我来总结一下我跟随视频学习到的知识点: 一.代码的组织结构: 1 ...
- 【手机安全卫士01】项目Splash页面的开发与设计
首先建立一个安卓的项目,然后修改manifest.xml文件,修改应用程序的logo和显示名称,效果图如下: 对应的代码如下: <?xml version="1.0" enc ...
- Splash页面跳转主页面,去掉主页面标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE); // 去除标题,必须在setContentView之前调用
- Xamarin.Android之Splash的几种简单实现
对现在的APP软件来说,基本上都会有一个Splash页面,类似大家常说的欢迎页面.启动界面之类的. 正常来说这个页面都会有一些相关的信息,比如一些理念,Logo,版本信息等 下面就来看看在Xamari ...
- Android 项目实战--手机卫士(实现splash)
从今天开始根据之前学习的android的基础知识,实战一下,实现一个简单功能的android手机卫士 本文地址:http://www.cnblogs.com/wuyudong/p/5899283.ht ...
- Android Splash界面支持用户点击 直接进入主界面
转载请注明出处:http://blog.csdn.net/lmj623565791/article/details/23613403 现在大部分APP都有Splash界面,下面列一下Splash页面的 ...
随机推荐
- Python9-封装-day26(大年初三)
class Room: def __init__(self,name,length,width): self.__name = name self.__length = length self.__w ...
- LeetCode(98) Validate Binary Search Tree
题目 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined ...
- ios开发中关闭textview控件的虚拟键盘
在ios开发中,textfield控件在点击的时候出现虚拟键盘,关掉虚拟键盘可以通过虚拟键盘中的done button和点击view中的任意地方来关闭虚拟键盘. 1.第一种方法是textfield控件 ...
- luogu1129 [ZJOI2007]矩阵游戏
其实,只用考虑某一行能否放到某一行就行了 #include <iostream> #include <cstring> #include <cstdio> usin ...
- kali-set
Set 简介 开源的社会工程学利用套件,通常结合metasploit(部分)来使用 更改 /etc/setoolkit下的配置文件 set_config BLEEDING_EDGE="Fal ...
- 大数据学习——sql练习
1. 现有如下的建表语句和数据: 建表语句 create table student(Sno int,Sname string,Sex string,Sage int,Sdept string)row ...
- 4A. Just a Hook
4A. Just a Hook Time Limit: 2000ms Case Time Limit: 2000ms Memory Limit: 32768KB 64-bit integer IO ...
- 【JavaScript 1—基础知识点】:宏观概述
导读:JavaScript是一门新的(也可以说是旧的或者半新语言),里面有很多的知识点都能和已有的知识产生共鸣.但是,虽然简单,相同点也有很多,也有不同点.我脑袋也不好使,所以对于我来说,还是有必要再 ...
- C/C++ 位操作
C/C++对位操作有如下方法: <1>位操作运算符(注意:下面几个运算符不改变原来的变量的值,只是获得运算的结果即一个新值) 按位取反:~ 位与:& 位或:| 位异或:^ 左移位运 ...
- CSS相对布局和绝对布局
relative 相对布局,正常的,从上到下.绝对布局absolute,就像不占位置,透明了一样,会和别的重合