首页 > 微信 > 详细

微信小程序--动画animation

时间:2019-01-23 16:08:01      阅读:380      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!