码迷,mamicode.com
首页 > 微信 > 详细

微信小程序--动画animation

时间:2019-01-23 17:14:15      阅读:1298      评论:0      收藏:0      [点我收藏+]

标签:view   lag   span   item   min   -name   rand   info   name   

js:
list:[],
contentflag:false
 
this.animation = wx.createAnimation({
duration: 500,
timingFunction: ‘linear‘,
})
 
//
var systemInfo = wx.getSystemInfoSync();
var px = systemInfo.windowWidth;
this.animation.translateX(-px).step()
this.setData({
  animation: this.animation.export()
});
 
//下拉刷新
bottomhd() {
  var _this = this;
  //调接口
},
//获取失败
err() {
  var _this = this;
  var systemInfo = wx.getSystemInfoSync();
  var px = systemInfo.windowWidth;
  this.animation.translateX(px).step();
  _this.setData({
    animation: this.animation.export(),
  })
},
 
if (res.data.data.list.length < 10) {
  _this.setData({
    contentflag: true
  });
}
 
var id = e.currentTarget.dataset.id;
 
wxml:
<view  animation="{{animation}}">
  <scroll-view scroll-y class=‘brandcontent‘ bindscrolltolower="bottomhd">
    <view wx:for="{{list}}" wx:for-index="index" wx:for-item="item" data-id="{{item.code}}" data-name="{{item.name}}" bindtap=‘getid‘>{{item.name}}</view>
    <view wx:if="{{contentflag}}">已经到底了</view>
  </scroll-view>
</view>

微信小程序--动画animation

标签:view   lag   span   item   min   -name   rand   info   name   

原文地址:https://www.cnblogs.com/Super-scarlett/p/10309411.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!