代码地址如下:
http://www.demodashi.com/demo/14242.html

一、前期准备工作

软件环境:微信开发者工具

官方下载地址:https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html

1、基本需求。
  • 实现加载动画
  • 带动画(动画可做参靠,个人要是觉得不好看可以自定义动画)
2、案例目录结构

二、程序实现具体步骤

1.index.wxml代码
  1. <view class="tui-loading-row">
  2. <view class="tui-loading-cell">
  3. <view class="circle-line">
  4. <text></text>
  5. <text></text>
  6. <text></text>
  7. <text></text>
  8. <text></text>
  9. <text></text>
  10. <text></text>
  11. <text></text>
  12. </view>
  13. </view>
  14. <view class="tui-loading-cell">
  15. <view class="circle-line-spin">
  16. <text></text>
  17. <text></text>
  18. <text></text>
  19. <text></text>
  20. <text></text>
  21. <text></text>
  22. <text></text>
  23. <text></text>
  24. </view>
  25. </view>
  26. <view class="tui-loading-cell">
  27. <view class="circle-round">
  28. <text></text>
  29. <text></text>
  30. <text></text>
  31. <text></text>
  32. <text></text>
  33. <text></text>
  34. <text></text>
  35. <text></text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="tui-loading-row">
  40. <view class="tui-loading-cell">
  41. <view class="circle-round-fade">
  42. <text></text>
  43. <text></text>
  44. <text></text>
  45. <text></text>
  46. <text></text>
  47. <text></text>
  48. <text></text>
  49. <text></text>
  50. </view>
  51. </view>
  52. <view class="tui-loading-cell">
  53. <view class="line-square">
  54. <text></text>
  55. <text></text>
  56. <text></text>
  57. <text></text>
  58. <text></text>
  59. </view>
  60. </view>
  61. <view class="tui-loading-cell">
  62. <view class="line-round">
  63. <text></text>
  64. <text></text>
  65. <text></text>
  66. <text></text>
  67. <text></text>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="tui-loading-row">
  72. <view class="tui-loading-cell">
  73. <view class="line-bounce">
  74. <text></text>
  75. <text></text>
  76. <text></text>
  77. <text></text>
  78. <text></text>
  79. </view>
  80. </view>
  81. <view class="tui-loading-cell">
  82. <view class="loader-circle">
  83. </view>
  84. </view>
  85. <view class="tui-loading-cell">
  86. <view class="loading-circle">
  87. </view>
  88. </view>
  89. </view>
  90. <view class="tui-loading-row">
  91. <view class="tui-loading-cell">
  92. <view class="loading-sun">
  93. </view>
  94. </view>
  95. <view class="tui-loading-cell">
  96. <view class="loading-heart">
  97. </view>
  98. </view>
  99. <view class="tui-loading-cell">
  100. <view class="loading-spinner" style="background: url('../../src/images/load.png') no-repeat center top;">
  101. </view>
  102. </view>
  103. </view>
2.部分index.wxss代码
  1. .tui-loading-row{
  2. width: 100%;
  3. display: table;
  4. table-layout: fixed;
  5. }
  6. .tui-loading-cell{
  7. width: 100%;
  8. display: table-cell;
  9. text-align: center;
  10. }
  11. /*动画一:单个渐变 */
  12. .circle-line{
  13. width: 100px;
  14. height: 100px;
  15. display: inline-block;
  16. position: relative;
  17. }
  18. .circle-line text{
  19. display: block;
  20. width: 50%;
  21. height: 5px;
  22. opacity: .7;
  23. position: absolute;
  24. top: calc(50% - 2.5px);
  25. left: 0px;
  26. transform-origin: center right;
  27. animation: circle 1.5s linear infinite;
  28. }
  29. .circle-line text::before{
  30. content: '';
  31. display: block;
  32. width: 15px;
  33. height: 5px;
  34. position: absolute;
  35. top: 0;
  36. right: 10px;
  37. background-color: blue;
  38. }
  39. .circle-line text:nth-child(1){
  40. transform: rotate(0deg);
  41. animation-delay: 0.2s;
  42. }
  43. .circle-line text:nth-child(2){
  44. transform: rotate(45deg);
  45. animation-delay: 0.4s;
  46. }
  47. .circle-line text:nth-child(3){
  48. transform: rotate(90deg);
  49. animation-delay: 0.6s;
  50. }
  51. .circle-line text:nth-child(4){
  52. transform: rotate(135deg);
  53. animation-delay: 0.8s;
  54. }
  55. .circle-line text:nth-child(5){
  56. transform: rotate(180deg);
  57. animation-delay: 1s;
  58. }
  59. .circle-line text:nth-child(6){
  60. transform: rotate(225deg);
  61. animation-delay: 1.2s;
  62. }
  63. .circle-line text:nth-child(7){
  64. transform: rotate(270deg);
  65. animation-delay: 1.4s;
  66. }
  67. .circle-line text:nth-child(8){
  68. transform: rotate(315deg);
  69. animation-delay: 1.6s;
  70. }
  71. @keyframes circle {
  72. 0%{
  73. opacity: 0.05;
  74. }
  75. 100%{
  76. opacity: 0.9;
  77. }
  78. }
  79. /*动画二:整体旋转 */
  80. .circle-line-spin{
  81. width: 100px;
  82. height: 100px;
  83. display: inline-block;
  84. position: relative;
  85. animation: circle-line 1.5s linear infinite;
  86. }
  87. .circle-line-spin text{
  88. display: block;
  89. width: 50%;
  90. height: 5px;
  91. opacity: .7;
  92. position: absolute;
  93. top: calc(50% - 2.5px);
  94. left: 0px;
  95. transform-origin: center right;
  96. }
3.index.js逻辑代码
  1. 不需要就是这么任性

三、案例运行效果图

四、总结与备注

暂无微信小程序开发动感十足的加载动画--都在这里!

代码地址如下:
http://www.demodashi.com/demo/14242.html

注:本文著作权归作者,由demo大师代发,拒绝转载,转载需要作者授权

微信小程序开发动感十足的加载动画--都在这里!的更多相关文章

  1. 微信小程序开发——模板中加载html代码

    最新方法可以使用微信小程序提供的 rich-text (富文本)组件直接写解析html,详见 rich-text: <rich-text class='f13 c_9' nodes=" ...

  2. 微信小程序的图片懒加载

    在普通的web页面当中,我们都知道图片懒加载可以提升浏览器的加载速度.原理是图片用空或者占位图片进行显示,当屏幕移动到图片位置的时候,再把图片的地址换成它的地址.那么,在小程序当中呢,最近老大让看一下 ...

  3. 微信小程序web-view之动态加载html页面

    官方推出的web-view方便了很多开发人员. 我们在做的时候,经常会想到写一个小程序的page然后通过动态加载web-view的形式来完成其他功能页面的开发. 之前研究web-view的时候发现网上 ...

  4. 分享下自己写的一个微信小程序请求远程数据加载到页面的代码

    1  思路整理 就是页面加载完毕的时候  请求远程接口,然后把数据赋值给页面的变量 ,然后列表循环 2 js相关代码  我是改的 onload函数 /** * 生命周期函数--监听页面加载 */ on ...

  5. 微信小程序实现滚动分页加载更多

    参考网址:https://www.cnblogs.com/Smiled/p/8203306.html 1.wxml: <view class='myScroll' style='float:le ...

  6. 在应用中显示的图片很多情况不满足业务需求,我们需要动态根据图片的宽高进行缩放或加载中显示的缺省图片,这是我没就需要监听图片加载完成回调,来看看微信小程序怎么实现图片加载完成回调。

    <swiper-item> <image src="{{item.image}}" class="slide-image" mode=&quo ...

  7. 微信小程序交流群,欢迎加入,其中微信小程序开发群、Jenkins开发群是有问必答群

    微信小程序开发,请加群511389428,511389428 有问必答群:React开发,请加群523838207:523838207Jenkins开发,请加群155799363,155799363  ...

  8. 【微信小程序开发•系列文章六】生命周期和路由

    这篇文章理论的知识比较多一些,都是个人观点,描述有失妥当的地方希望读者指出. [微信小程序开发•系列文章一]入门 [微信小程序开发•系列文章二]视图层 [微信小程序开发•系列文章三]数据层 [微信小程 ...

  9. 微信小程序开发日记——高仿知乎日报(下)

    本人对知乎日报是情有独钟,看我的博客和github就知道了,写了几个不同技术类型的知乎日报APP 要做微信小程序首先要对html,css,js有一定的基础,还有对微信小程序的API也要非常熟悉 我将该 ...

随机推荐

  1. JDBC进阶之PreparedStatement执行SQL语句(MySQL)

    一.什么是PreparedStatement           参阅Java API文档,我们可以知道,PreparedStatement是Statement的子接口(如图所示),表示预编译的 SQ ...

  2. java单个方法达到了65536字节的限制

    可以使方法更小的一件事是关闭调试.打开调试时,每一行(带代码)都有一个标记该行的语句. 不.重构代码.没有方法应该那么久.永远. Write small methods! 说真的:任何IDE都会指导您 ...

  3. org-mode入门教程

    org-mode 入门教程By Z.H. Fu 切问录 www.fuzihao.org org-mode 入门教程 org-mode是Emacs提供的一个强大的编辑模式,可以用于做会议笔记以及制作各种 ...

  4. Git 学习(四)操作修改和版本穿梭

    Git 学习(四)操作修改和版本穿梭 之前的章节,已介绍了本地Git库创建.暂存区增.删.改,以及提交版本库:可回顾下命令操作: git add 和 git commit. 光有之前章节的操作,Git ...

  5. Android - 错误:&quot;No resource found that matches the given name android:Theme.Material&quot;

    Android - 错误:"No resource found that matches the given name android:Theme.Material" 本文地址:  ...

  6. Reverse Nodes in k-Group leetcode java

    题目: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list ...

  7. 【Type】类型 ParameterizedType

    Type 接口[重要] Type接口完整的定义: public interface java.lang.reflect.Type { /** * Returns a string describing ...

  8. 你对position的了解有多少?

    此文根据Steven Bradley的<How Well Do You Understand CSS Positioning?>所译,整个译文带有我自己的理解与思想,如果译得不好或不对之处 ...

  9. Java基础(六):继承

    1.继承的概念: 继承是java面向对象编程技术的一块基石,因为它允许创建分等级层次的类.继承就是子类继承父类的特征和行为,使得子类对象(实例)具有父类的实例域和方法,或子类从父类继承方法,使得子类具 ...

  10. 深入理解this和call、bind、apply对this的影响及用法

    首先看一道网易的面试题: var a = { a:"haha", getA:function(){ console.log(this.a); } } var b = { a:&qu ...