<template>
  <div id="trans-1">
    <van-row>
      <van-col span="24" class="main">
        <list-1 :list="list" @detail="detail"></list-1>
      </van-col>
    </van-row>
  </div>
</template>

<script>
import list1 from '../market/parts/list-2.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
export default {
  name: 'trans-1',
  props: {},
  components: {
    list1,
  },
  data: function () {
    return {
      list: [],
      limit: 4,
    };
  },
  async created() {
    await this.search();
  },
  methods: {
    ...patenttrans(['query']),
    async search({ skip = 0, limit = this.limit, ...info } = {}) {
      let res = await this.query({ skip, limit, status: '2', ...info });
      if (this.$checkRes(res)) {
        this.$set(this, `list`, res.data);
      }
    },
    detail(data) {
      this.$router.push({ path: '/patent/market/transDetail', query: { id: data._id } });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped></style>
