|
@@ -4,7 +4,7 @@
|
|
<u-tabs-swiper ref="uTabs" active-color="red" :list="tabsList" bar-width="100" :current="current" @change="tabsChange" :is-scroll="false"
|
|
<u-tabs-swiper ref="uTabs" active-color="red" :list="tabsList" bar-width="100" :current="current" @change="tabsChange" :is-scroll="false"
|
|
swiperWidth="750"></u-tabs-swiper>
|
|
swiperWidth="750"></u-tabs-swiper>
|
|
</view>
|
|
</view>
|
|
- <swiper style="height: calc(100% - 40px);" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
|
|
|
|
|
+ <swiper style="height: calc(100% - 40px);" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
<swiper-item class="swiper-item" v-for="(item, index) in tabsList" :key="index">
|
|
<swiper-item class="swiper-item" v-for="(item, index) in tabsList" :key="index">
|
|
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
|
|
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
|
|
<couponTpl :list="couponList"></couponTpl>
|
|
<couponTpl :list="couponList"></couponTpl>
|
|
@@ -44,7 +44,7 @@
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
pageNo:1,
|
|
pageNo:1,
|
|
- pageSize:15,
|
|
|
|
|
|
+ pageSize:10,
|
|
count:0
|
|
count:0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -57,6 +57,8 @@
|
|
this.swiperCurrent = 0
|
|
this.swiperCurrent = 0
|
|
this.count = 0
|
|
this.count = 0
|
|
this.couponList = []
|
|
this.couponList = []
|
|
|
|
+ this.pageNo = 1
|
|
|
|
+ this.status = 'loading'
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
// tabs通知swiper切换
|
|
// tabs通知swiper切换
|
|
@@ -64,12 +66,21 @@
|
|
this.swiperCurrent = index;
|
|
this.swiperCurrent = index;
|
|
this.couponList = []
|
|
this.couponList = []
|
|
this.count = 0
|
|
this.count = 0
|
|
|
|
+ this.pageNo = 1
|
|
|
|
+ this.status = 'loading'
|
|
},
|
|
},
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
transition(e) {
|
|
transition(e) {
|
|
let dx = e.detail.dx;
|
|
let dx = e.detail.dx;
|
|
this.$refs.uTabs.setDx(dx);
|
|
this.$refs.uTabs.setDx(dx);
|
|
},
|
|
},
|
|
|
|
+ swiperChange(event){
|
|
|
|
+ console.log(event.detail)
|
|
|
|
+ this.couponList = []
|
|
|
|
+ this.count = 0
|
|
|
|
+ this.pageNo = 1
|
|
|
|
+ this.status = 'loading'
|
|
|
|
+ },
|
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
animationfinish(e) {
|
|
animationfinish(e) {
|
|
@@ -77,13 +88,10 @@
|
|
this.$refs.uTabs.setFinishCurrent(current);
|
|
this.$refs.uTabs.setFinishCurrent(current);
|
|
this.swiperCurrent = current;
|
|
this.swiperCurrent = current;
|
|
this.current = current;
|
|
this.current = current;
|
|
- this.couponList = []
|
|
|
|
- this.count = 0
|
|
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
// 获取优惠卷列表
|
|
// 获取优惠卷列表
|
|
getList(){
|
|
getList(){
|
|
- this.status = 'loading'
|
|
|
|
let item = this.tabsList[this.swiperCurrent]
|
|
let item = this.tabsList[this.swiperCurrent]
|
|
let params = {
|
|
let params = {
|
|
pageNo: this.pageNo,
|
|
pageNo: this.pageNo,
|