<template>
  <div class="committee">
    <div class="jg"></div>
    <!-- 内容区域 -->
    <div class="ex-content">
      <div class="con-left">
        <div class="head">
          <div class="letter">
            <span>{{ titleN }}</span>
          </div>
          <div class="jg"></div>
          <div class="txt">
            <h3>{{ title }}</h3>
            <span></span>
            <h4>{{ titleEN }}</h4>
          </div>
        </div>
        <div class="body">
          <div
            class="body-tip"
            v-for="(item, index) in bodyList"
            :key="item.title"
            @click="tipClick(index)"
            :class="{ action: current === index }"
          >
            {{ item.title }}
          </div>
        </div>
      </div>
      <div class="con-main">
        <div>
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
import {mapState, mapMutations } from 'vuex'

import Xhcontent from "../components/xhcontent";

export default {
  name: "Committee",
  metaInfo: {
    title: "委员会成员",
  },
  components: {
    Xhcontent,
  },
  data() {
    return {
      info: {},
      list: {},
      bodyList: [
        { title: "入会须知", path: "apply"},
        { title: "入会申请", path: "apply" },
        { title: "请求表下载", path: "load" },
        { title: "成员单位", path: "mem" },
        { title: "邀请函", path: "invitation" },
      ],
      titleN: "M",
      title: "委员会成员",
      titleEN: "Committee members ",
      // current: 1
    };
  },
  created() {
  },
  computed: {
    ...mapState(['current'])
  },
  methods: {
    ...mapMutations(['changeCurrent']),
    tipClick(index) {
      if(index === 0){
        index = 1
      }
      this.changeCurrent(index)
      this.$router.push(this.bodyList[index]).catch(err => { return})
      console.log(this.current)
    }
  },
};
</script>


<style lang="scss" scoped>
.jg {
  height: 10px;
}
.ex-content {
  width: 1234px;
  margin: 0 auto;
  background-color: #f5f5f5;
  display: flex;
  justify-content: space-between;
  .con-left {
    width: 265px;
    background-color: #f5f5f5;
    min-height: 400px;
  }
  .head {
    background: url("../assets/guoqi.jpg") no-repeat;
    width: 265px;
    height: 137px;
    margin: 0 0 20px;
    padding: 35px 0 0;
    background-color: #cb3301;
    display: flex;
    justify-content: center;
    .letter {
      width: 56px;
      height: 106px;
      color: white;
      font-size: 80px;
      line-height: 80px;
      display: flex;
      justify-content: end;
      span {
        padding-top: 30px;
      }
      margin-right: 10px;
    }
    .txt {
      width: 120px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      color: white;
      h3 {
        font-size: 20px;
        margin: 0;
      }
      span {
        height: 10px;
      }
      h4 {
        font-size: 24px;
        margin: 0;
      }
    }
  }
  .body {
    width: 263px;
    .body-tip {
      height: 50px;
      line-height: 50px;
      font-size: 16px;
      background-color: #fff;
      padding: 0 0 0 67px;
      margin-bottom: 5px;
      position: relative;
      box-shadow: 0px 0px 2px #ebebeb;
      cursor: pointer;
      &:nth-child(2), &:nth-child(3) {
         padding: 0 0 0 105px;
      }
    }
    .action {
      background-color: #96311c;
      font-weight: bold;
      color: #fff;
    }
  }
  .con-main {
    width: 858px;
    // min-height: 700px;
    background-color: #fff;
    padding: 15px 40px;
  }
}
</style>
