list.vue
2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<template>
<div style="height: 100%;">
<div style="background-color: #f0f0f0;height: 100%;">
<div class="head"></div>
<Scroll :data="ufoList" :options="scrollOptions" v-if="ufoList.length">
<CouponItem :item="item" v-for="(item, index) in ufoList" :key ="index"></CouponItem>
</Scroll>
<Empty v-else></Empty>
</div>
</div>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const {mapState} = createNamespacedHelpers('coupon/yoho');
import CouponItem from '../components/coupon-item';
import Empty from '../components/empty';
import {Scroll} from 'cube-ui';
export default {
name: 'UfoCouponListPage',
computed: {
...mapState(['ufoList']),
},
asyncData({store, router}) {
return store.dispatch('coupon/yoho/fetchUfoList', {
limit: 20,
page: 1
});
},
data() {
return {
scrollOptions: {
directionLockThreshold: 0
}
};
},
created() {
},
mounted() {
},
methods: {
},
components: {
Scroll,
CouponItem,
Empty
}
};
</script>
<style lang="scss" scoped>
.head {
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;
}
.tab-item + .tab-item {
border-left: 1px solid #e0e0e0;
}
.cube-tab_active {
color: #444 !important;
}
.cube-scroll-wrapper {
padding-top: 20px;
}
</style>