Skip to content

Commit

Permalink
首页
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobinwu committed May 3, 2017
1 parent 5110530 commit ef1b20a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
11 changes: 10 additions & 1 deletion pages/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,26 @@ Page({
},
//点击分类
cateClick: function(e){
if(e.currentTarget.dataset.index){}
this.scrollLeftChange(e.currentTarget.dataset.index);
this.setData({
currentIndex: e.currentTarget.dataset.index
});
},
//滑动产品swiper
productSwiperScroll: function(e){
this.scrollLeftChange(e.detail.current);
this.setData({
currentIndex: e.detail.current
});
},
//分类滚动条位置变化
scrollLeftChange: function(index){
var winWidth = wx.getSystemInfoSync().windowWidth;
var rpx = 750/winWidth;
this.setData({
scrollLeft: index * 168 / rpx
});
},
//点击营销位
saleTap: function(e){
console.log(e);
Expand Down

0 comments on commit ef1b20a

Please sign in to comment.