<template>
  <div>
    <banner-tab
      :data="bannerTabData"
      @changeTab="changeTab"
    ></banner-tab>
    <apply v-show="activeIndex == 0" :data="content"></apply>
    <support v-show="activeIndex == 1" :data="content"></support>
  </div>
</template>
<script>
import cAction from '@action'
import bannerTab from '@/components/news/tab/bannerTab.vue'
import apply from './components/apply.vue'
import support from './components/support.vue'
export default {
  components: {
    apply,
    bannerTab,
    support
  },
  data() {
    return {
      bannerTabData: {
        menu: ['有关申请', '费用与资助'],
        imgUrl: 'https://zws-imgs-pub.ezijing.com/static/public/d94d3b94c95674ebc6d1932b3322cb14.png'
      },
      activeIndex: 0,
      content: {
        module0: '',
        module1: '',
        module2: '',
        module3: '',
        module4: ''
      }
    }
  },
  mounted() {
    // this.getData()
  }, 
  methods: {
    changeTab(index) {
      this.activeIndex = index
    },
    // getData() {
    //   const requestType = ['申请条件', '申请流程', '常见问题', '学费', '贷款']
    //   requestType.map((item, index) => {
    //     this.request(item, index)
    //   })
    // },
    // request(name, index) {
    //   cAction.reportAction.getContent(name).then(json => {
    //     if (json !== null) {
    //       this.content[`module${index}`] = json[0].content
    //     }
    //   }).catch(e => { this.$message.error(e.message) }).finally(() => {})
    // }
  },
}
</script>
<style lang="scss" scoped>
.center97{
  width: 970px;
  margin: 0 auto;
}
.top-nav{
  .center97{
    position: relative;
  }
  img{
    width: 100%;
    display: block;
  }
  .menu{
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    li{
      width: 128px;
      line-height: 36px;
      text-align: center;
      color: #fff;
      font-size: 16px;
      margin-right: 2px;
      cursor: pointer;
      background: #BF0927;
      &.active{
        background: #fff;
        color: #C70025;
      }
    }
  }
}
</style>
