|
|
<template>
|
|
|
<div style="height: 100%">
|
|
|
<div class="head"></div>
|
|
|
<TabBar class="tab-container"
|
|
|
v-model="selectLabel"
|
|
|
ref="tabNav"
|
|
|
>
|
|
|
<Tab class="tab-item" v-for="(item, index) in tabLabels" :label="item.label" :key="item.label"></Tab>
|
|
|
</TabBar>
|
|
|
<ClassicTabs v-model="selectLabel" :data="tabLabels" @filter="onFilterChange"></ClassicTabs>
|
|
|
|
|
|
<div class="tab-slide-container">
|
|
|
<Slide
|
...
|
...
|
@@ -19,23 +14,30 @@ |
|
|
@scroll="scroll"
|
|
|
@change="changePage"
|
|
|
>
|
|
|
<SlideItem style="background-color: #F0F0F0;">
|
|
|
<SlideItem style="background-color: #f0f0f0;">
|
|
|
<ExchangeBox></ExchangeBox>
|
|
|
|
|
|
<div class="filter-wrapper" v-if="show">
|
|
|
<div class="filter-mask"></div>
|
|
|
<FilterBar :list="filterList" class="filter"></FilterBar>
|
|
|
</div>
|
|
|
|
|
|
<div class="head"></div>
|
|
|
<Scroll :data="yohoList.notuse" :options="scrollOptions" v-if="yohoList.notuse.length" style="padding: 20px">
|
|
|
|
|
|
<Scroll :data="yohoList.notuse" :options="scrollOptions" v-if="yohoList.notuse.length">
|
|
|
<CouponItem :item="item" v-for="(item, index) in yohoList.notuse" :key ="index"></CouponItem>
|
|
|
</Scroll>
|
|
|
<Empty v-else></Empty>
|
|
|
</SlideItem>
|
|
|
|
|
|
<SlideItem style="background-color: #F0F0F0;">
|
|
|
<SlideItem style="background-color: #f0f0f0;">
|
|
|
<Scroll :data="yohoList.use" :options="scrollOptions" v-if="yohoList.use.length">
|
|
|
<CouponItem :item="item" v-for="(item, index) in yohoList.use" :key ="index" v-if="yohoList.use.length"></CouponItem>
|
|
|
</Scroll>
|
|
|
<Empty v-else></Empty>
|
|
|
</SlideItem>
|
|
|
|
|
|
<SlideItem style="background-color: #F0F0F0;">
|
|
|
<SlideItem style="background-color: #f0f0f0;">
|
|
|
<Scroll :data="yohoList.overtime" :options="scrollOptions" v-if="yohoList.overtime.length">
|
|
|
<CouponItem :item="item" v-for="(item, index) in yohoList.overtime" :key ="index" v-if="yohoList.overtime.length"></CouponItem>
|
|
|
</Scroll>
|
...
|
...
|
@@ -89,13 +91,16 @@ export default { |
|
|
tabLabels: [
|
|
|
{
|
|
|
label: '未使用',
|
|
|
type: TYPE.notuse
|
|
|
type: TYPE.notuse,
|
|
|
filter: true
|
|
|
}, {
|
|
|
label: '已使用',
|
|
|
type: TYPE.use
|
|
|
type: TYPE.use,
|
|
|
filter: false
|
|
|
}, {
|
|
|
label: '已失效',
|
|
|
type: TYPE.overtime
|
|
|
type: TYPE.overtime,
|
|
|
filter: false
|
|
|
}
|
|
|
],
|
|
|
scrollOptions: {
|
...
|
...
|
@@ -105,7 +110,8 @@ export default { |
|
|
listenScroll: true,
|
|
|
probeType: 3,
|
|
|
directionLockThreshold: 0
|
|
|
}
|
|
|
},
|
|
|
show: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
...
|
...
|
@@ -114,17 +120,6 @@ export default { |
|
|
this.getNum();
|
|
|
},
|
|
|
methods: {
|
|
|
tabCls(item) {
|
|
|
return ['filter-btn-box'];
|
|
|
},
|
|
|
scroll(pos) {
|
|
|
// const x = Math.abs(pos.x)
|
|
|
// const tabItemWidth = this.$refs.tabNav.$el.clientWidth
|
|
|
// const slideScrollerWidth = this.$refs.slide.slide.scrollerWidth
|
|
|
// const deltaX = x / slideScrollerWidth * tabItemWidth
|
|
|
// this.$refs.tabNav.setSliderTransform(deltaX);
|
|
|
},
|
|
|
|
|
|
changePage(current) {
|
|
|
this.selectLabel = this.tabLabels[current].label;
|
|
|
this.selectType = this.tabLabels[current].type;
|
...
|
...
|
@@ -137,9 +132,15 @@ export default { |
|
|
page: 1
|
|
|
});
|
|
|
},
|
|
|
scroll() {
|
|
|
|
|
|
},
|
|
|
getNum() {
|
|
|
return this.$store.dispatch('coupon/yoho/fetchYohoNum', {});
|
|
|
},
|
|
|
|
|
|
onFilterChange(show) {
|
|
|
this.show = show;
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
@@ -164,69 +165,28 @@ export default { |
|
|
height: 90px;
|
|
|
}
|
|
|
|
|
|
.coupon-wrapper {
|
|
|
height: 200px;
|
|
|
padding-top: 20px;
|
|
|
padding-left: 20px;
|
|
|
padding-right: 20px;
|
|
|
background: #f0f0f0;
|
|
|
box-sizing: content-box;
|
|
|
}
|
|
|
|
|
|
.coupon-item {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background: white;
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
|
|
|
.mask {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
position: absolute;
|
|
|
background: rgba(0, 0, 0, 0.4);
|
|
|
}
|
|
|
|
|
|
.list-wrapper {
|
|
|
overflow: hidden;
|
|
|
|
|
|
li {
|
|
|
padding: 15px 10px;
|
|
|
background-color: white;
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.tab-slide-container {
|
|
|
/*position: fixed;*/
|
|
|
/*left: 0;*/
|
|
|
/*right: 0;*/
|
|
|
/*bottom: 0;*/
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
.tab-container {
|
|
|
height: 90px;
|
|
|
background-color: white;
|
|
|
border-bottom: 1px solid #e0e0e0;
|
|
|
}
|
|
|
|
|
|
.tab-item {
|
|
|
line-height: 60px;
|
|
|
text-align: center;
|
|
|
font-size: 28px;
|
|
|
color: #b0b0b0;
|
|
|
.cube-scroll-wrapper {
|
|
|
padding-top: 20px;
|
|
|
}
|
|
|
|
|
|
.tab-item + .tab-item {
|
|
|
border-left: 1px solid #e0e0e0;
|
|
|
.filter-wrapper {
|
|
|
width: calc(100% / 3);
|
|
|
height: 100%;
|
|
|
position: fixed;
|
|
|
z-index: 4;
|
|
|
}
|
|
|
|
|
|
.cube-tab_active {
|
|
|
color: #444 !important;
|
|
|
.filter {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
}
|
|
|
|
|
|
.cube-scroll-wrapper {
|
|
|
padding-top: 20px;
|
|
|
.filter-mask {
|
|
|
height: 100%;
|
|
|
background-color: rgba(0, 0, 0, 0.4);
|
|
|
}
|
|
|
</style> |
...
|
...
|
|