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,12 +68,11 @@ Page({ | ||
| 68 | }, | 68 | }, |
| 69 | onLoad: function(tt) { | 69 | onLoad: function(tt) { |
| 70 | var that = this; | 70 | var that = this; |
| 71 | - | 71 | + clearInterval(that.data.timer); |
| 72 | + that.setData({ countDownNum: 3, stylePage: 1 }); | ||
| 73 | + | ||
| 72 | const res = wx.getSystemInfoSync(), | 74 | const res = wx.getSystemInfoSync(), |
| 73 | letters = this.data.letters; | 75 | letters = this.data.letters; |
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | this.setData({ | 76 | this.setData({ |
| 78 | abc: t.globalData.heigth-88-88-16, | 77 | abc: t.globalData.heigth-88-88-16, |
| 79 | windowHeight: res.windowHeight, | 78 | windowHeight: res.windowHeight, |
| @@ -152,7 +151,6 @@ Page({ | @@ -152,7 +151,6 @@ Page({ | ||
| 152 | 151 | ||
| 153 | onShow:function(){ | 152 | onShow:function(){ |
| 154 | var that=this; | 153 | var that=this; |
| 155 | - | ||
| 156 | //this.requestFirstCategoris(); | 154 | //this.requestFirstCategoris(); |
| 157 | if(getApp().globalData.user_id) getApp().requestCardNum(); | 155 | if(getApp().globalData.user_id) getApp().requestCardNum(); |
| 158 | getApp().getConfig2(function (e) { | 156 | getApp().getConfig2(function (e) { |
| @@ -372,6 +370,7 @@ Page({ | @@ -372,6 +370,7 @@ Page({ | ||
| 372 | 370 | ||
| 373 | //------------手指滑动------------------ | 371 | //------------手指滑动------------------ |
| 374 | touchmove(e) { | 372 | touchmove(e) { |
| 373 | + console.log("手指滑动") | ||
| 375 | const x = e.touches[0].clientX, | 374 | const x = e.touches[0].clientX, |
| 376 | y = e.touches[0].clientY, | 375 | y = e.touches[0].clientY, |
| 377 | lettersPosition = this.data.lettersPosition, | 376 | lettersPosition = this.data.lettersPosition, |
| @@ -533,7 +532,7 @@ Page({ | @@ -533,7 +532,7 @@ Page({ | ||
| 533 | // 新的版本分类点击一级分类 | 532 | // 新的版本分类点击一级分类 |
| 534 | click_classify:function(e){ | 533 | click_classify:function(e){ |
| 535 | clearInterval(this.data.timer); | 534 | clearInterval(this.data.timer); |
| 536 | - this.setData({ countDownNum:3 ,stylePage:1}); | 535 | + this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0}); |
| 537 | this.data.ishaf_three = 0; | 536 | this.data.ishaf_three = 0; |
| 538 | var indexs = e.currentTarget.dataset.index; | 537 | var indexs = e.currentTarget.dataset.index; |
| 539 | var name = e.currentTarget.dataset.name; | 538 | var name = e.currentTarget.dataset.name; |
| @@ -694,7 +693,9 @@ Page({ | @@ -694,7 +693,9 @@ Page({ | ||
| 694 | 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 }, | 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 | success: function (e) { | 694 | success: function (e) { |
| 696 | console.log(e.data.data.pageData) | 695 | console.log(e.data.data.pageData) |
| 697 | - | 696 | + s.setData({ |
| 697 | + dataLength: e.data.data.pageData.length, | ||
| 698 | + }); | ||
| 698 | if (e.data.data.pageData.length > 0) { | 699 | if (e.data.data.pageData.length > 0) { |
| 699 | s.setData({ | 700 | s.setData({ |
| 700 | msgStatus: false, | 701 | msgStatus: false, |
pages/goods/categoryList/categoryList.wxml
| @@ -376,11 +376,11 @@ | @@ -376,11 +376,11 @@ | ||
| 376 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> | 376 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> |
| 377 | 377 | ||
| 378 | <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> | 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 | <view class="null" style="width:100%;height:1px;"></view> | 380 | <view class="null" style="width:100%;height:1px;"></view> |
| 381 | <!-- goodslist --> | 381 | <!-- goodslist --> |
| 382 | <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> | 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 | <view class="img-wrap"> | 384 | <view class="img-wrap"> |
| 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> | 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 | </view> | 386 | </view> |