list.vue
1.17 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
<template>
<div class="coupon-page">
<ScrollView class="scroll-view" :data="ufoList" :options="scrollOptions" v-if="ufoList.length">
<CouponItem :item="item" v-for="(item, index) in ufoList" :key ="index"></CouponItem>
</ScrollView>
<Empty v-else></Empty>
</div>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const {mapState} = createNamespacedHelpers('coupon/yoho');
import CouponItem from '../components/coupon-item';
import Empty from '../components/empty';
import ScrollView from '../components/scroll-view';
export default {
name: 'UfoCouponListPage',
computed: {
...mapState(['ufoList']),
},
data() {
return {
scrollOptions: {
directionLockThreshold: 0,
}
};
},
created() {
},
mounted() {
this.getList();
},
methods: {
getList() {
return this.$store.dispatch('coupon/yoho/fetchUfoList', {
limit: 100,
page: 1
});
}
},
components: {
ScrollView,
CouponItem,
Empty
}
};
</script>
<style lang="scss" scoped>
.coupon-page {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.scroll-view {
flex: 1;
}
}
</style>