Commit 99308f058ef24c3816dff5b6bac0fdc56eb8255b
1 parent
792332be
添加回滚到顶部
Showing
2 changed files
with
10 additions
and
9 deletions
pages/goods/categoryList/categoryList.js
| ... | ... | @@ -68,12 +68,11 @@ Page({ |
| 68 | 68 | }, |
| 69 | 69 | onLoad: function(tt) { |
| 70 | 70 | var that = this; |
| 71 | - | |
| 71 | + clearInterval(that.data.timer); | |
| 72 | + that.setData({ countDownNum: 3, stylePage: 1 }); | |
| 73 | + | |
| 72 | 74 | const res = wx.getSystemInfoSync(), |
| 73 | 75 | letters = this.data.letters; |
| 74 | - | |
| 75 | - | |
| 76 | - | |
| 77 | 76 | this.setData({ |
| 78 | 77 | abc: t.globalData.heigth-88-88-16, |
| 79 | 78 | windowHeight: res.windowHeight, |
| ... | ... | @@ -152,7 +151,6 @@ Page({ |
| 152 | 151 | |
| 153 | 152 | onShow:function(){ |
| 154 | 153 | var that=this; |
| 155 | - | |
| 156 | 154 | //this.requestFirstCategoris(); |
| 157 | 155 | if(getApp().globalData.user_id) getApp().requestCardNum(); |
| 158 | 156 | getApp().getConfig2(function (e) { |
| ... | ... | @@ -372,6 +370,7 @@ Page({ |
| 372 | 370 | |
| 373 | 371 | //------------手指滑动------------------ |
| 374 | 372 | touchmove(e) { |
| 373 | + console.log("手指滑动") | |
| 375 | 374 | const x = e.touches[0].clientX, |
| 376 | 375 | y = e.touches[0].clientY, |
| 377 | 376 | lettersPosition = this.data.lettersPosition, |
| ... | ... | @@ -533,7 +532,7 @@ Page({ |
| 533 | 532 | // 新的版本分类点击一级分类 |
| 534 | 533 | click_classify:function(e){ |
| 535 | 534 | clearInterval(this.data.timer); |
| 536 | - this.setData({ countDownNum:3 ,stylePage:1}); | |
| 535 | + this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0}); | |
| 537 | 536 | this.data.ishaf_three = 0; |
| 538 | 537 | var indexs = e.currentTarget.dataset.index; |
| 539 | 538 | var name = e.currentTarget.dataset.name; |
| ... | ... | @@ -694,7 +693,9 @@ Page({ |
| 694 | 693 | data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: 1, is_recommend: 1 }, |
| 695 | 694 | success: function (e) { |
| 696 | 695 | console.log(e.data.data.pageData) |
| 697 | - | |
| 696 | + s.setData({ | |
| 697 | + dataLength: e.data.data.pageData.length, | |
| 698 | + }); | |
| 698 | 699 | if (e.data.data.pageData.length > 0) { |
| 699 | 700 | s.setData({ |
| 700 | 701 | msgStatus: false, | ... | ... |
pages/goods/categoryList/categoryList.wxml
| ... | ... | @@ -376,11 +376,11 @@ |
| 376 | 376 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> |
| 377 | 377 | |
| 378 | 378 | <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> |
| 379 | - <scroll-view scroll-y bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;"> | |
| 379 | + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;"> | |
| 380 | 380 | <view class="null" style="width:100%;height:1px;"></view> |
| 381 | 381 | <!-- goodslist --> |
| 382 | 382 | <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> |
| 383 | - <navigator class="choice_item" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" wx:key="{{index}}"> | |
| 383 | + <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> | |
| 384 | 384 | <view class="img-wrap"> |
| 385 | 385 | <image src="{{item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> |
| 386 | 386 | </view> | ... | ... |