sell-list.vue 2.67 KB
<!--
 * @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>