1
|
<template>
|
1
|
<template>
|
2
|
<div style="height: 100%">
|
2
|
<div style="height: 100%">
|
3
|
<div class="head"></div>
|
3
|
<div class="head"></div>
|
4
|
- <TabBar class="tab-container"
|
|
|
5
|
- v-model="selectLabel"
|
|
|
6
|
- ref="tabNav"
|
|
|
7
|
- >
|
|
|
8
|
- <Tab class="tab-item" v-for="(item, index) in tabLabels" :label="item.label" :key="item.label"></Tab>
|
|
|
9
|
- </TabBar>
|
4
|
+ <ClassicTabs v-model="selectLabel" :data="tabLabels" @filter="onFilterChange"></ClassicTabs>
|
10
|
|
5
|
|
11
|
<div class="tab-slide-container">
|
6
|
<div class="tab-slide-container">
|
12
|
<Slide
|
7
|
<Slide
|
|
@@ -19,23 +14,30 @@ |
|
@@ -19,23 +14,30 @@ |
19
|
@scroll="scroll"
|
14
|
@scroll="scroll"
|
20
|
@change="changePage"
|
15
|
@change="changePage"
|
21
|
>
|
16
|
>
|
22
|
- <SlideItem style="background-color: #F0F0F0;">
|
17
|
+ <SlideItem style="background-color: #f0f0f0;">
|
23
|
<ExchangeBox></ExchangeBox>
|
18
|
<ExchangeBox></ExchangeBox>
|
|
|
19
|
+
|
|
|
20
|
+ <div class="filter-wrapper" v-if="show">
|
|
|
21
|
+ <div class="filter-mask"></div>
|
|
|
22
|
+ <FilterBar :list="filterList" class="filter"></FilterBar>
|
|
|
23
|
+ </div>
|
|
|
24
|
+
|
24
|
<div class="head"></div>
|
25
|
<div class="head"></div>
|
25
|
- <Scroll :data="yohoList.notuse" :options="scrollOptions" v-if="yohoList.notuse.length" style="padding: 20px">
|
26
|
+
|
|
|
27
|
+ <Scroll :data="yohoList.notuse" :options="scrollOptions" v-if="yohoList.notuse.length">
|
26
|
<CouponItem :item="item" v-for="(item, index) in yohoList.notuse" :key ="index"></CouponItem>
|
28
|
<CouponItem :item="item" v-for="(item, index) in yohoList.notuse" :key ="index"></CouponItem>
|
27
|
</Scroll>
|
29
|
</Scroll>
|
28
|
<Empty v-else></Empty>
|
30
|
<Empty v-else></Empty>
|
29
|
</SlideItem>
|
31
|
</SlideItem>
|
30
|
|
32
|
|
31
|
- <SlideItem style="background-color: #F0F0F0;">
|
33
|
+ <SlideItem style="background-color: #f0f0f0;">
|
32
|
<Scroll :data="yohoList.use" :options="scrollOptions" v-if="yohoList.use.length">
|
34
|
<Scroll :data="yohoList.use" :options="scrollOptions" v-if="yohoList.use.length">
|
33
|
<CouponItem :item="item" v-for="(item, index) in yohoList.use" :key ="index" v-if="yohoList.use.length"></CouponItem>
|
35
|
<CouponItem :item="item" v-for="(item, index) in yohoList.use" :key ="index" v-if="yohoList.use.length"></CouponItem>
|
34
|
</Scroll>
|
36
|
</Scroll>
|
35
|
<Empty v-else></Empty>
|
37
|
<Empty v-else></Empty>
|
36
|
</SlideItem>
|
38
|
</SlideItem>
|
37
|
|
39
|
|
38
|
- <SlideItem style="background-color: #F0F0F0;">
|
40
|
+ <SlideItem style="background-color: #f0f0f0;">
|
39
|
<Scroll :data="yohoList.overtime" :options="scrollOptions" v-if="yohoList.overtime.length">
|
41
|
<Scroll :data="yohoList.overtime" :options="scrollOptions" v-if="yohoList.overtime.length">
|
40
|
<CouponItem :item="item" v-for="(item, index) in yohoList.overtime" :key ="index" v-if="yohoList.overtime.length"></CouponItem>
|
42
|
<CouponItem :item="item" v-for="(item, index) in yohoList.overtime" :key ="index" v-if="yohoList.overtime.length"></CouponItem>
|
41
|
</Scroll>
|
43
|
</Scroll>
|
|
@@ -89,13 +91,16 @@ export default { |
|
@@ -89,13 +91,16 @@ export default { |
89
|
tabLabels: [
|
91
|
tabLabels: [
|
90
|
{
|
92
|
{
|
91
|
label: '未使用',
|
93
|
label: '未使用',
|
92
|
- type: TYPE.notuse
|
94
|
+ type: TYPE.notuse,
|
|
|
95
|
+ filter: true
|
93
|
}, {
|
96
|
}, {
|
94
|
label: '已使用',
|
97
|
label: '已使用',
|
95
|
- type: TYPE.use
|
98
|
+ type: TYPE.use,
|
|
|
99
|
+ filter: false
|
96
|
}, {
|
100
|
}, {
|
97
|
label: '已失效',
|
101
|
label: '已失效',
|
98
|
- type: TYPE.overtime
|
102
|
+ type: TYPE.overtime,
|
|
|
103
|
+ filter: false
|
99
|
}
|
104
|
}
|
100
|
],
|
105
|
],
|
101
|
scrollOptions: {
|
106
|
scrollOptions: {
|
|
@@ -105,7 +110,8 @@ export default { |
|
@@ -105,7 +110,8 @@ export default { |
105
|
listenScroll: true,
|
110
|
listenScroll: true,
|
106
|
probeType: 3,
|
111
|
probeType: 3,
|
107
|
directionLockThreshold: 0
|
112
|
directionLockThreshold: 0
|
108
|
- }
|
113
|
+ },
|
|
|
114
|
+ show: false
|
109
|
};
|
115
|
};
|
110
|
},
|
116
|
},
|
111
|
created() {
|
117
|
created() {
|
|
@@ -114,17 +120,6 @@ export default { |
|
@@ -114,17 +120,6 @@ export default { |
114
|
this.getNum();
|
120
|
this.getNum();
|
115
|
},
|
121
|
},
|
116
|
methods: {
|
122
|
methods: {
|
117
|
- tabCls(item) {
|
|
|
118
|
- return ['filter-btn-box'];
|
|
|
119
|
- },
|
|
|
120
|
- scroll(pos) {
|
|
|
121
|
- // const x = Math.abs(pos.x)
|
|
|
122
|
- // const tabItemWidth = this.$refs.tabNav.$el.clientWidth
|
|
|
123
|
- // const slideScrollerWidth = this.$refs.slide.slide.scrollerWidth
|
|
|
124
|
- // const deltaX = x / slideScrollerWidth * tabItemWidth
|
|
|
125
|
- // this.$refs.tabNav.setSliderTransform(deltaX);
|
|
|
126
|
- },
|
|
|
127
|
-
|
|
|
128
|
changePage(current) {
|
123
|
changePage(current) {
|
129
|
this.selectLabel = this.tabLabels[current].label;
|
124
|
this.selectLabel = this.tabLabels[current].label;
|
130
|
this.selectType = this.tabLabels[current].type;
|
125
|
this.selectType = this.tabLabels[current].type;
|
|
@@ -137,9 +132,15 @@ export default { |
|
@@ -137,9 +132,15 @@ export default { |
137
|
page: 1
|
132
|
page: 1
|
138
|
});
|
133
|
});
|
139
|
},
|
134
|
},
|
|
|
135
|
+ scroll() {
|
140
|
|
136
|
|
|
|
137
|
+ },
|
141
|
getNum() {
|
138
|
getNum() {
|
142
|
return this.$store.dispatch('coupon/yoho/fetchYohoNum', {});
|
139
|
return this.$store.dispatch('coupon/yoho/fetchYohoNum', {});
|
|
|
140
|
+ },
|
|
|
141
|
+
|
|
|
142
|
+ onFilterChange(show) {
|
|
|
143
|
+ this.show = show;
|
143
|
}
|
144
|
}
|
144
|
},
|
145
|
},
|
145
|
components: {
|
146
|
components: {
|
|
@@ -164,69 +165,28 @@ export default { |
|
@@ -164,69 +165,28 @@ export default { |
164
|
height: 90px;
|
165
|
height: 90px;
|
165
|
}
|
166
|
}
|
166
|
|
167
|
|
167
|
- .coupon-wrapper {
|
|
|
168
|
- height: 200px;
|
|
|
169
|
- padding-top: 20px;
|
|
|
170
|
- padding-left: 20px;
|
|
|
171
|
- padding-right: 20px;
|
|
|
172
|
- background: #f0f0f0;
|
|
|
173
|
- box-sizing: content-box;
|
|
|
174
|
- }
|
|
|
175
|
-
|
|
|
176
|
- .coupon-item {
|
|
|
177
|
- width: 100%;
|
|
|
178
|
- height: 100%;
|
|
|
179
|
- background: white;
|
|
|
180
|
- border-radius: 10px;
|
|
|
181
|
- }
|
|
|
182
|
-
|
|
|
183
|
- .mask {
|
|
|
184
|
- width: 100%;
|
|
|
185
|
- height: 100%;
|
|
|
186
|
- position: absolute;
|
|
|
187
|
- background: rgba(0, 0, 0, 0.4);
|
|
|
188
|
- }
|
|
|
189
|
-
|
|
|
190
|
- .list-wrapper {
|
|
|
191
|
- overflow: hidden;
|
|
|
192
|
-
|
|
|
193
|
- li {
|
|
|
194
|
- padding: 15px 10px;
|
|
|
195
|
- background-color: white;
|
|
|
196
|
- border-radius: 10px;
|
|
|
197
|
- }
|
|
|
198
|
- }
|
|
|
199
|
-
|
|
|
200
|
.tab-slide-container {
|
168
|
.tab-slide-container {
|
201
|
- /*position: fixed;*/
|
|
|
202
|
- /*left: 0;*/
|
|
|
203
|
- /*right: 0;*/
|
|
|
204
|
- /*bottom: 0;*/
|
|
|
205
|
height: 100%;
|
169
|
height: 100%;
|
206
|
}
|
170
|
}
|
207
|
|
171
|
|
208
|
- .tab-container {
|
|
|
209
|
- height: 90px;
|
|
|
210
|
- background-color: white;
|
|
|
211
|
- border-bottom: 1px solid #e0e0e0;
|
|
|
212
|
- }
|
|
|
213
|
-
|
|
|
214
|
- .tab-item {
|
|
|
215
|
- line-height: 60px;
|
|
|
216
|
- text-align: center;
|
|
|
217
|
- font-size: 28px;
|
|
|
218
|
- color: #b0b0b0;
|
172
|
+ .cube-scroll-wrapper {
|
|
|
173
|
+ padding-top: 20px;
|
219
|
}
|
174
|
}
|
220
|
|
175
|
|
221
|
- .tab-item + .tab-item {
|
|
|
222
|
- border-left: 1px solid #e0e0e0;
|
176
|
+ .filter-wrapper {
|
|
|
177
|
+ width: calc(100% / 3);
|
|
|
178
|
+ height: 100%;
|
|
|
179
|
+ position: fixed;
|
|
|
180
|
+ z-index: 4;
|
223
|
}
|
181
|
}
|
224
|
|
182
|
|
225
|
- .cube-tab_active {
|
|
|
226
|
- color: #444 !important;
|
183
|
+ .filter {
|
|
|
184
|
+ position: absolute;
|
|
|
185
|
+ top: 0;
|
227
|
}
|
186
|
}
|
228
|
|
187
|
|
229
|
- .cube-scroll-wrapper {
|
|
|
230
|
- padding-top: 20px;
|
188
|
+ .filter-mask {
|
|
|
189
|
+ height: 100%;
|
|
|
190
|
+ background-color: rgba(0, 0, 0, 0.4);
|
231
|
}
|
191
|
}
|
232
|
</style> |
192
|
</style> |