sell-list.vue
2.67 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
<!--
* @description: 同尺寸二手列表页
* @fileName: filter-list.vue
* @author: huzhiming
* @date: 2019-11-22 15:01:07
* @后台人员:
* @version: v1.0.0
* @path: 页面访问路径及参数说明 http://xianyu.yohobuy.com/xianyu/second/product/123/selllist.html
!-->
<template>
<LayoutApp :show-back="true" title="Nike AJ1 空军1号纯白经典休闲鞋…" class="second-filter-list-wrap">
<vFilterBar @change="filterChange" :data="filterDate"></vFilterBar>
<LayoutScroll
ref="scrolllist"
@pulling-up="fetchSkupList(isMore)"
v-if="filterList.length"
class="list-scroll-bg"
>
<SecondList :list="filterList"></SecondList>
</LayoutScroll>
<Filtrate ref="filtrate" :yasParams="{P_NAME: 'XY_UFOSearchList', TYPE_ID: 1}"></Filtrate>
</LayoutApp>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers("second");
import SecondList from "./components/second-list";
import vFilterBar from './components/filter-bar';
import Filtrate from './components/filter-list';
const filterDate = [{ key: '', text:'推荐', asc: null, allowSwitch: false },{ key: '', text:'价格', asc: true, allowSwitch: true }]
export default {
name: 'UfoSecondSellListPage',
watchQuery: [],
layouts: '',
head() {
return {
title: '',
meta: [{ hid: 'keywords', name: 'keywords', content: '' },{ hid: 'hid', name: 'description', content: '' }],
// link: [{ rel: 'stylesheet', href: '' }],
// script: [{ src: '' }]
}
},
mixins: [],
props: {
storage_id: Number
},
// 服务端渲染函数
async asyncData ({ isDev, route, store, env, params, query, req, res, redirect, error }) {
return {}
},
data() {
return {
filterDate
}
},
created() {},
mounted() {
this.fetchSameSizeSecondList({ isReset: true, storage_id: this.storage_id });
},
activated() {
},
deactivated() {},
// beforeRouteEnter (to, from, next) {},
// beforeRouteUpdate(to, from, next) {},
// beforeRouteLeave(to, from, next) {},
destroyed() {},
methods: {
...mapActions(["fetchSameSizeSecondList"]),
async fetchSkupList(isMore) {
if (this.isMore) {
await this.fetchSameSizeSecondList({ isReset: false, storage_id: this.storage_id });
}
},
filterChange(aa,ss) {
console.log(aa,ss);
}
},
computed: {
...mapState(["filterList", "isMore"])
},
watch: {},
components: {
vFilterBar,
SecondList,
Filtrate,
}
};
</script>
/* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */
<style rel='stylesheet/scss' lang='scss' scoped>
</style>