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>
<LayoutApp :show-back="true" title="二手" class="list-wrapper">
<LayoutScroll
ref="scrolllist"
@pulling-up="fetchSkupList(isMore)"
v-if="skupList.list.length"
class="list-scroll-bg"
>
<SecondList :list="skupList.list"></SecondList>
</LayoutScroll>
</LayoutApp>
</template>
<script>
import SecondList from "./components/second-list";
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers("second/skupList");
export default {
name: 'UfoSecondListPage',
components: {
SecondList
},
data() {
return {
}
},
computed: {
...mapState(["skupList", "isMore"])
},
methods: {
...mapActions(["fetchSecondSkupList"]),
async fetchSkupList(isMore) {
if (this.isMore) {
await this.fetchSecondSkupList({ isReset: false });
}
}
},
activated() {
this.fetchSecondSkupList({ isReset: true });
}
};
</script>
<style lang="scss" scoped>
.list-wrapper {
/deep/ .layout-context {
display: flex;
flex-direction: column;
}
.empty {
flex: 1;
}
}
.list-scroll-bg {
background-color: #f5f5f5;
flex: 1;
}
</style>