|
@@ -4,10 +4,10 @@
|
|
<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" @change="swiperChange" @animationfinish="animationfinish">
|
|
|
|
|
|
+ <swiper style="height: calc(100% - 50px);" :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="index==current?couponList:[]"></couponTpl>
|
|
<u-empty :text="noDataText" img-width="120" v-if="couponList.length==0 && status!='loading'" mode="list"></u-empty>
|
|
<u-empty :text="noDataText" img-width="120" v-if="couponList.length==0 && status!='loading'" mode="list"></u-empty>
|
|
<view style="padding: 20upx;">
|
|
<view style="padding: 20upx;">
|
|
<u-loadmore v-if="count>pageSize || status=='loading'" :status="status" />
|
|
<u-loadmore v-if="count>pageSize || status=='loading'" :status="status" />
|
|
@@ -63,8 +63,6 @@
|
|
// tabs通知swiper切换
|
|
// tabs通知swiper切换
|
|
tabsChange(index) {
|
|
tabsChange(index) {
|
|
this.swiperCurrent = index;
|
|
this.swiperCurrent = index;
|
|
- this.couponList = []
|
|
|
|
- this.status = 'loading'
|
|
|
|
},
|
|
},
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
transition(e) {
|
|
transition(e) {
|
|
@@ -80,10 +78,12 @@
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
animationfinish(e) {
|
|
animationfinish(e) {
|
|
let current = e.detail.current;
|
|
let current = e.detail.current;
|
|
- this.$refs.uTabs.setFinishCurrent(current);
|
|
|
|
- this.swiperCurrent = current;
|
|
|
|
- this.current = current;
|
|
|
|
- this.getList(1)
|
|
|
|
|
|
+ if (current != this.current) {
|
|
|
|
+ this.$refs.uTabs.setFinishCurrent(current);
|
|
|
|
+ this.swiperCurrent = current;
|
|
|
|
+ this.current = current;
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 获取优惠卷列表
|
|
// 获取优惠卷列表
|
|
getList(num){
|
|
getList(num){
|