Commit f54d1d8826b81aea6675c49feb846b0885c49f5c
1 parent
63d3aa4de7
Exists in
master
and in
2 other branches
旋转
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
littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss
View file @
f54d1d8
littleApp_child/utils/network_util.js
View file @
f54d1d8