微信小程序--動畫animation


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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM