<template>
  <div id="index">
    <trial-detail
      :info="info"
      :nativeList="nativeList"
      @onsave="nativeClick"
      :display="display"
      :userInfos="userInfos"
      :userList="userList"
      :userListTotal="userListTotal"
      :adminList="adminList"
      :adminListTotal="adminListTotal"
      :alreadyList="alreadyList"
      :alreadyListTotal="alreadyListTotal"
      :notList="notList"
      :notListTotal="notListTotal"
      :JiaoyiList="JiaoyiList"
      :JiaoyiTotal="JiaoyiTotal"
      :alreadyTwoList="alreadyTwoList"
      :alreadyTwoListTotal="alreadyTwoListTotal"
      :notTwoList="notTwoList"
      :notTwoListTotal="notTwoListTotal"
      :JiaoyiTwoList="JiaoyiTwoList"
      :JiaoyiTwoListTotal="JiaoyiTwoListTotal"
    ></trial-detail>
  </div>
</template>

<script>
import trialDetail from '@/components/trial/index.vue';
import { createNamespacedHelpers, mapGetters } from 'vuex';
const { mapActions: mapSite } = createNamespacedHelpers('site');
export default {
  name: 'index',
  props: {},
  components: {
    trialDetail,
  },
  data: () => ({
    info: {},
    nativeList: [
      {
        name: '基本信息',
      },
      {
        name: '用户管理',
      },
      {
        name: '我的审核',
      },
      {
        name: '统计信息',
      },
      {
        name: '注销账号',
      },
    ],
    display: 'first',
    // 基本信息
    userInfos: {
      name: '外审管理员',
      cardnumber: '220182199603257019',
      addr: '吉林省长春市朝阳区力旺广场B座16楼1608',
    },
    userList: [
      {
        name: '测试人员',
        img_path: require('@/assets/getImage.jpg'),
        role: '外审管理员',
        is_qy: '法人',
        phone: '0431-123456',
      },
      {
        name: '三条数据',
        img_path: require('@/assets/getImage.jpg'),
        role: '外审管理员',
        is_qy: '法人',
        phone: '0431-123456',
      },
    ],
    userListTotal: 1,
    adminList: [
      {
        name: '测试人员',
        img_path: require('@/assets/getImage.jpg'),
        role: '外审管理员',
        is_qy: '法人',
        phone: '0431-123456',
      },
      {
        name: '三条数据',
        img_path: require('@/assets/getImage.jpg'),
        role: '外审管理员',
        is_qy: '法人',
        phone: '0431-123456',
      },
    ],
    adminListTotal: 1,
    alreadyList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '产品名称',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    alreadyListTotal: 1,
    notList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '产品名称',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    notListTotal: 1,
    JiaoyiList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '产品名称',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    JiaoyiTotal: 1,
    alreadyTwoList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '产品名称',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    alreadyTwoListTotal: 1,
    notTwoList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '产品名称',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    notTwoListTotal: 1,
    JiaoyiTwoList: [
      {
        image: require('@/assets/getImage.jpg'),
        name: '我的供给',
        totaltype: '服务',
        price: '1000',
        priceunit: '元/台',
      },
    ],
    JiaoyiTwoListTotal: 1,
  }),
  created() {
    this.searchSite();
  },
  computed: {},
  methods: {
    ...mapSite(['showInfo']),
    // 查询站点信息
    async searchSite() {
      let res = await this.showInfo();
      let object = JSON.parse(JSON.stringify(res.data));
      if (object) {
        this.$set(this, `info`, res.data);
      } else {
        this.$message.error(res.errmsg ? res.errmsg : 'error');
      }
    },
    async nativeClick({ name }) {
      // console.log(name);
      if (name === '基本信息') {
        this.display = 'first';
      } else if (name === '用户管理') {
        this.display = 'second';
      } else if (name === '我的审核') {
        this.display = 'third';
      } else if (name === '统计信息') {
        this.display = 'fourth';
      } else {
        this.display = 'fivth';
      }
    },
  },
};
</script>

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