Commit 9b5ac1ca658f22c3fa175000637d41314df224e6
1 parent
dce67cb7
分销小店 分类没有更多
Showing
2 changed files
with
26 additions
and
22 deletions
packageC/pages/goods/distributionCategoryList/index.js
@@ -250,8 +250,7 @@ Page({ | @@ -250,8 +250,7 @@ Page({ | ||
250 | 250 | ||
251 | //获取分类 | 251 | //获取分类 |
252 | async getGoodsCategoris() { | 252 | async getGoodsCategoris() { |
253 | - // if(this.data.is_no_more)return false; | ||
254 | - // if(this.data.isLoading)return false; | 253 | + |
255 | let { currentData } = this.data; | 254 | let { currentData } = this.data; |
256 | let Plurl = `/api/weshop/users/distribut/listmyshopCat`; | 255 | let Plurl = `/api/weshop/users/distribut/listmyshopCat`; |
257 | const categoris = await e.promiseGet(Plurl, { | 256 | const categoris = await e.promiseGet(Plurl, { |
@@ -385,8 +384,6 @@ Page({ | @@ -385,8 +384,6 @@ Page({ | ||
385 | arr.push(ob); | 384 | arr.push(ob); |
386 | } | 385 | } |
387 | 386 | ||
388 | - | ||
389 | - | ||
390 | s.setData({ groups: arr }); | 387 | s.setData({ groups: arr }); |
391 | //console.log(s.data.groups) | 388 | //console.log(s.data.groups) |
392 | } | 389 | } |
@@ -599,6 +596,12 @@ Page({ | @@ -599,6 +596,12 @@ Page({ | ||
599 | get_next_cate(index) { | 596 | get_next_cate(index) { |
600 | if(this.data.isLoading) return false; | 597 | if(this.data.isLoading) return false; |
601 | index = index + 1; | 598 | index = index + 1; |
599 | + if(index==this.data.catelist.length){ | ||
600 | + this.setData({ | ||
601 | + is_none:1 | ||
602 | + }) | ||
603 | + return false; | ||
604 | + } | ||
602 | let nex_cat_id = this.data.catelist[index].id; | 605 | let nex_cat_id = this.data.catelist[index].id; |
603 | this.setData({ | 606 | this.setData({ |
604 | cat_id: nex_cat_id, | 607 | cat_id: nex_cat_id, |
@@ -650,23 +653,23 @@ Page({ | @@ -650,23 +653,23 @@ Page({ | ||
650 | }, | 653 | }, |
651 | touchend(e) { | 654 | touchend(e) { |
652 | var th=this; | 655 | var th=this; |
653 | - setTimeout(function () { | 656 | + let {select_classify_on}=th.data; |
657 | + setTimeout(function () { | ||
654 | if(!th.data.car_scroll){ | 658 | if(!th.data.car_scroll){ |
655 | - clearInterval(th.data.timer); | ||
656 | - th.get_next_cate(th.data.select_classify_on); | 659 | + console.log('df'); |
660 | + th.get_next_cate(select_classify_on); | ||
657 | return false; | 661 | return false; |
658 | } | 662 | } |
659 | 663 | ||
660 | if(!startY) return false; | 664 | if(!startY) return false; |
661 | endY = e.changedTouches[0].clientY; | 665 | endY = e.changedTouches[0].clientY; |
662 | moveDistance = startY - endY; | 666 | moveDistance = startY - endY; |
663 | - if(moveDistance<0){ | 667 | + if(moveDistance<=0){ |
664 | isReachBt=0; | 668 | isReachBt=0; |
665 | return false; | 669 | return false; |
666 | } | 670 | } |
667 | if (th.data.is_no_more && moveDistance >= 10 && isReachBt > 0) { | 671 | if (th.data.is_no_more && moveDistance >= 10 && isReachBt > 0) { |
668 | - clearInterval(th.data.timer); | ||
669 | - th.get_next_cate(th.data.select_classify_on); | 672 | + th.get_next_cate(select_classify_on); |
670 | } | 673 | } |
671 | },50) | 674 | },50) |
672 | 675 |
packageC/pages/goods/distributionCategoryList/index.wxml
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <view class="search-img left"> | 12 | <view class="search-img left"> |
13 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | 13 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> |
14 | </view> | 14 | </view> |
15 | - <input class="search-cont" autoFocus bindconfirm="search" bindinput="getInput" placeholder="请输入您所搜索的商品" type="text"></input> | 15 | + <input class="search-cont" bindconfirm="search" bindinput="getInput" placeholder="请输入您所搜索的商品" type="text"></input> |
16 | </view> | 16 | </view> |
17 | <view class="c-red fs26" bindtap="search">搜索</view> | 17 | <view class="c-red fs26" bindtap="search">搜索</view> |
18 | </view> | 18 | </view> |
@@ -95,10 +95,8 @@ | @@ -95,10 +95,8 @@ | ||
95 | <!-- 显示商品列表开始 --> | 95 | <!-- 显示商品列表开始 --> |
96 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> | 96 | <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> |
97 | <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> | 97 | <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> |
98 | - <scroll-view wx:if="{{is_get}}" scroll-y scroll-top="{{scrollTop}}" | ||
99 | - bindscroll="bd_scroll" | ||
100 | - bindtouchstart="touchstart" bindtouchend="touchend" bindscrolltolower='scrollLower' lower-threshold="200" style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:140rpx;bottom:0;rigth:0;left:26%;width:73%;"> | ||
101 | - <!--<view class="null" style="width:100%;height:1px;"></view>--> | 98 | + <scroll-view wx:if="{{is_get}}" scroll-y scroll-top="{{scrollTop}}" bindscroll="bd_scroll" bindtouchstart="touchstart" bindtouchend="touchend" bindscrolltolower='scrollLower' lower-threshold="200" style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:140rpx;bottom:0;rigth:0;left:26%;width:73%;"> |
99 | + <!-- <view class="null" style="width:100%;height:1px;"></view> --> | ||
102 | <!-- goodslist --> | 100 | <!-- goodslist --> |
103 | <view class="choice_list" style="height:{{requestData.length?'100%':''}}"> | 101 | <view class="choice_list" style="height:{{requestData.length?'100%':''}}"> |
104 | <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="{{item.id}}"> | 102 | <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="{{item.id}}"> |
@@ -118,10 +116,10 @@ | @@ -118,10 +116,10 @@ | ||
118 | <view class="comment flex jc_sb"> | 116 | <view class="comment flex jc_sb"> |
119 | <view class="word-line xc-ash">¥{{item.market_price}}</view> | 117 | <view class="word-line xc-ash">¥{{item.market_price}}</view> |
120 | </view> | 118 | </view> |
121 | - <view class="fs24 c-a flex jc_sb"> | ||
122 | - <text class="money c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> | ||
123 | - <text>评论{{item.comment_count}}</text> | ||
124 | - </view> | 119 | + <view class="fs24 c-a flex jc_sb"> |
120 | + <text class="money c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> | ||
121 | + <text>评论{{item.comment_count}}</text> | ||
122 | + </view> | ||
125 | </block> | 123 | </block> |
126 | <block wx:else> | 124 | <block wx:else> |
127 | <!-- 商品价格,先判断下是否有等级价 --> | 125 | <!-- 商品价格,先判断下是否有等级价 --> |
@@ -151,7 +149,7 @@ | @@ -151,7 +149,7 @@ | ||
151 | <view class="word-line xc-ash">¥{{item.market_price}}</view> | 149 | <view class="word-line xc-ash">¥{{item.market_price}}</view> |
152 | </view> | 150 | </view> |
153 | <view class="fs24 c-a flex jc_sb"> | 151 | <view class="fs24 c-a flex jc_sb"> |
154 | - <text class="c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> | 152 | + <text class="c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> |
155 | <text>评论{{item.comment_count}}</text> | 153 | <text>评论{{item.comment_count}}</text> |
156 | </view> | 154 | </view> |
157 | </block> | 155 | </block> |
@@ -174,7 +172,7 @@ | @@ -174,7 +172,7 @@ | ||
174 | </view> | 172 | </view> |
175 | </view> | 173 | </view> |
176 | <view class="fs24 c-a flex jc_sb"> | 174 | <view class="fs24 c-a flex jc_sb"> |
177 | - <text class="c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> | 175 | + <text class="c-red">分成金额:{{filter.toFix(item.commission,2)}}</text> |
178 | <text>评论{{item.comment_count}}</text> | 176 | <text>评论{{item.comment_count}}</text> |
179 | </view> | 177 | </view> |
180 | </block> | 178 | </block> |
@@ -206,10 +204,13 @@ | @@ -206,10 +204,13 @@ | ||
206 | </view> | 204 | </view> |
207 | </navigator> | 205 | </navigator> |
208 | <!-- 暂无更多 --> | 206 | <!-- 暂无更多 --> |
209 | - <view id="morelb" wx:if="{{is_no_more&&!is_none&&requestData.length}}" style="color:c-red; height: 60rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;"> | 207 | + <view id="morelb" wx:if="{{is_no_more&&!is_none&&requestData.length}}" style="color:c-red; height: 60rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;"> |
210 | <text style="font-size:32rpx;color:red;margin-right:10rpx" class="iconfont icon-arrowup"></text> | 208 | <text style="font-size:32rpx;color:red;margin-right:10rpx" class="iconfont icon-arrowup"></text> |
211 | <text style="color:#999">向上拉继续浏览下一个类别</text> | 209 | <text style="color:#999">向上拉继续浏览下一个类别</text> |
210 | + | ||
212 | </view> | 211 | </view> |
212 | + <view wx:if="{{is_none}}" style="color:#999; height: 60rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;">没有更多了</view> | ||
213 | + | ||
213 | </view> | 214 | </view> |
214 | <view class="no-data" wx:if="{{requestData.length==0}}"> | 215 | <view class="no-data" wx:if="{{requestData.length==0}}"> |
215 | <!-- <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> --> | 216 | <!-- <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> --> |