Commit 6f663702 by 高淑倩

modify: 优惠券列表_swiperTab

parent 93215825
...@@ -35,9 +35,20 @@ wxService.page({ ...@@ -35,9 +35,20 @@ wxService.page({
//滑动切换 //滑动切换
swiperTab: function (e) { swiperTab: function (e) {
const {current} = e.detail const {current} = e.detail
if (this.data.currentTab == current) {
return false;
} else {
this.setData({ this.setData({
currentTab: current currentTab: current
}); })
}
// 可使用
if( current == 0 ){
this.getCouponList(1,10,1)
}else if( current == 1){
// 失效
this.getCouponList(1,10,0)
}
}, },
// 点击切换 // 点击切换
clickTab: function (e) { clickTab: function (e) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">已失效 ({{invalidTotalElements}})</view> <view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">已失效 ({{invalidTotalElements}})</view>
</view> </view>
<!--bindchange="swiperTab"--> <!--bindchange="swiperTab"-->
<swiper current="{{currentTab}}" duration="300"> <swiper current="{{currentTab}}" duration="300" bindchange="swiperTab">
<swiper-item> <swiper-item>
<scroll-view scroll-y wx:if="{{couponList.length}}"> <scroll-view scroll-y wx:if="{{couponList.length}}">
<view class='coupon-wrap'> <view class='coupon-wrap'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment