<template>
  <div id="index">
    <admin-frame :useTop="false" :usePage="false" :useNav="false">
      <template v-slot:info>
        <van-button v-for="(i, index) in menu" :key="`menu-${index}`" @click="$router.push(i.router)">{{ i.label }}</van-button>
      </template>
    </admin-frame>
  </div>
</template>

<script>
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions: personal } = createNamespacedHelpers('personal');
export default {
  name: 'index',
  props: {},
  components: {
    adminFrame,
  },
  data: function () {
    return {
      menu: [
        {
          label: '专利超市-专利检索',
          router: '/market/patentInfo/index',
        },
        {
          label: '专利超市-专利转让',
          router: '/market/transfer/index',
        },
        {
          label: '专利超市-专利需求',
          router: '/market/demand/index',
        },
        {
          label: '专利超市-专利导航',
          router: '/market/navigation/index',
        },
        {
          label: '咨询服务-政策资讯',
          router: '/service/notice/index',
        },
        {
          label: '咨询服务-法律法规',
          router: '/service/law/index',
        },
        {
          label: '咨询服务-专利维权',
          router: '/service/dimension/index',
        },
        {
          label: '咨询服务-交流互动',
          router: '/service/interflow/index',
        },
        {
          label: '个人中心-我的消息',
          router: '/patent/index',
        },
        {
          label: '个人中心-我的申请',
          router: '/patent/index',
        },
        {
          label: '个人中心-我的专利',
          router: '/patent/index',
        },
        {
          label: '个人中心-我的交易',
          router: '/patent/index',
        },
        {
          label: '个人中心-个人设置',
          router: '/account/index',
        },
      ],
    };
  },
  async created() {
    await this.search();
  },
  methods: {
    ...personal({ personalCreate: 'create' }),
    search({ skip = 0, limit = this.limit, ...info } = {}) {},
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

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