Commit f54d1d8826b81aea6675c49feb846b0885c49f5c

Authored by xianghenggang
1 parent 63d3aa4de7

旋转

Showing 4 changed files with 34 additions and 5 deletions

littleApp_child/pages/childcare_knowledge/childcare_knowledge.js View file @ f54d1d8
... ... @@ -12,7 +12,9 @@
12 12 var app = getApp()
13 13  
14 14 var pageLimit=15
15   -
  15 +var animation1 = wx.createAnimation({
  16 + duration:1000
  17 +})
16 18 Page({
17 19 data: {
18 20 list: [
... ... @@ -33,6 +35,7 @@
33 35 titles: [],//"日常护理", "营养美食", "疾病护理", "亲子互动", "言传身教"
34 36 category:'',
35 37 current_index:0,
  38 + animationData:{},
36 39 swiperHeight:0
37 40 },
38 41 onLoad: function (e) {
... ... @@ -81,7 +84,17 @@
81 84 list: [],
82 85  
83 86 })
84   -
  87 + animation1 = wx.createAnimation({
  88 + duration: 1000
  89 + })
  90 + animation1.rotate(720).step()
  91 +
  92 + this.setData({
  93 + animationData: animation1.export()
  94 + })
  95 +
  96 +
  97 +
85 98 networkUtil.showLoading()
86 99 // 网络请求,重新请求一遍数据
87 100 this.requestData();
88 101  
89 102  
... ... @@ -144,9 +157,25 @@
144 157 list:arr,
145 158 hasMore: hasMore
146 159 })
  160 + // var that = this;
  161 + setTimeout(function () {
  162 + animation1.rotate(0).step({ duration: 0, transformOrigin: "50%,50%", timingFunction: 'linear' })
  163 + self.setData({
  164 + animationData: animation1.export()
  165 + })
  166 + }, 300)
  167 +
147 168 },function(res){
148 169 isRefresh = false
  170 + setTimeout(function () {
  171 + animation1.rotate(0).step({ duration: 0, transformOrigin: "50%,50%", timingFunction: 'linear' })
  172 + self.setData({
  173 + animationData: animation1.export()
  174 + })
  175 + }, 300)
149 176 })
  177 +
  178 +
150 179 },
151 180 // 文章点赞
152 181 articleLike: function (e){
littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml View file @ f54d1d8
... ... @@ -43,7 +43,7 @@
43 43  
44 44 </view>
45 45 </view>
46   - <image class="icon_refresh" src="../../source/group2.png" bindtap="refesh"></image>
  46 + <image animation="{{animationData}}" class="icon_refresh" src="../../source/group2.png" bindtap="refesh"></image>
47 47  
48 48 </view>
littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss View file @ f54d1d8
... ... @@ -111,7 +111,7 @@
111 111 .zar_box {
112 112 display: flex;
113 113 margin-left:-5px;
114   -
  114 + width: 50px;
115 115 }
116 116  
117 117 .zar_img {
littleApp_child/utils/network_util.js View file @ f54d1d8
... ... @@ -2,7 +2,7 @@
2 2 // 测试用户‘花雪莲’,手机号15928512992,验证码666666
3 3  
4 4 // 0测试环境 1正式环境 2演示环境 3衡水
5   -var Builing_Release_AppStore = 1
  5 +var Builing_Release_AppStore = 0
6 6 // 获取服务器地址
7 7 function kServerBaseUrl() {
8 8 switch (Builing_Release_AppStore) {