<template>
  <div class="container">
    <div class="top-box">
      <headers></headers>

      <div class="ny-banner">
        <img src="../../assets/gw/ny-banner.jpg" alt="">
      </div>
    </div>
    <!-- new -->
    <div class="navigation">
      <div class="content">
        <div class="left"> <img src="../../assets/gw/home.png" alt="">
          <p><a href="/gw">首页</a><i class="el-icon-arrow-right"></i> <span href="">教学团队</span></p>
        </div>
        <div class="right">
          <div class="nav-item" v-for="(item, index) in nav" v-bind:class="[index === currentActive ? 'active' : '']"
            @click="getCurrentActive(index)">
            {{ item.categoryName }}
          </div>
        </div>
      </div>
    </div>
    <div class="about-conts">

      <!-- 教学成果 -->
      <div class="ayptjs" v-if="currentActive == 1">
        <div class="tt">教学成果</div>
        <div class="ayptjs-list">
          <div class="item" v-for="(item, index) in teachingAchievements" :key="index" @click="showDetails(item)">
            <div class="img">
              <img :src="imgurl + item.contentImg" alt="">
              <!-- <img src="../../assets/gw/Snipaste_2024-07-23_22-51-23.jpg" alt=""> -->
            </div>
            <div class="text">
              <div class="tts">{{ item.contentTitle }}</div>
              <div class="desc">
                <div class="desc" v-html="item.summary"></div>
              </div>
            </div>
            <div class="more">
              <div class="xian"></div>
              <p>查看详情</p>
            </div>
          </div>
        </div>
      </div>

      <!-- 教学团队 -->
      <div class="team" v-if="currentActive == 0">
        <div class="tt">教学团队</div>
        <div class="team-list">
          <div v-html="teachingTeam[0].contentDetail"></div>
<!--          <div class="item" v-for="(item, index) in teachingTeam" :key="index">-->
<!--            <div class="img">-->
<!--              <img :src="imgurl + item.contentImg" alt="" class="imgWO">-->
<!--            </div>-->
<!--            <div class="tts">{{ item.contentTitle }}</div>-->
<!--          </div>-->
        </div>
      </div>

      <!-- main -->
      <!-- 详情数据穿透 -->
        <div class="team" v-if="currentActive == 999 && isShowDetails">
          <div class="neirong" v-html="detailsContent"></div>
        </div>

        <div>
          <page-util :page-size="8" :category-id="categoryId" @event-message="handleDataFromPage" />
        </div>

    </div>
    <footers></footers>
  </div>
</template>

<script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.min.css";
import { getPageData, getPageColumn } from "@/api/officialWebsite/getPageData";
import footers from '@/views/officialWebsite/Components/footer.vue'
import headers from '@/views/officialWebsite/Components/header.vue'
import PageUtil from "@/views/officialWebsite/Components/page"

export default {
  components: {
    headers,
    footers,
    Swiper,
    SwiperSlide,
    PageUtil,
  },
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data() {
    return {
      imgurl: process.env.VUE_APP_BASE_API,
      pageContextList: [],
      teachingAchievements: [],
      detailsContent:"",
      teachingTeam: [],
      nav: [
        // { name: '教学团队' },
        // { name: '教学成果' },
      ],
      currentActive: 0,
      isMounted: false,
      categoryId: "0"
    }
  },
  created() {
    // 页面加载完毕调用
    this.initPageData();
  },
  computed: {

  },

  methods: {
    showDetails(value){
      this.isShowDetails = true;
      this.currentActive = 999;
      this.detailsContent = value.contentDetail;
    },
    // 触发导航
    getCurrentActive(value) {
      if (this.currentActive == value) {
        return
      }
      this.currentActive = value
      this.isShowDetails = false;
      if (value === 1){
        this.categoryId = this.nav[value].id
      }
    },
    initPageData() {

      let routeParam = {
        "categoryId": this.$route.query.id,
        "pageNum": 1,
        "pageSize": 10
      }
      getPageColumn(routeParam).then(response => {
        response.data.forEach(cloumnItem => {
          this.nav.push(cloumnItem);

          //教学团队
          if (cloumnItem.id == "1816773589098172416") {
            cloumnItem.children.list.forEach(element => {
              this.teachingAchievements.push(element);
            });
          }
          //教学团队
          if (cloumnItem.id == "1816773517664980992") {
            cloumnItem.children.list.forEach(element => {
              this.teachingTeam.push(element);
            });
          }





          // cloumnItem.categoryName
        });
      });

    },
    handleDataFromPage(data){
      if (this.currentActive !== 0){
        this.teachingAchievements = data
      }
      // if (this.currentActive === 2 || this.currentActive == 4){
      //   this.nav[this.currentActive].children.list = data
      // }
      // if (this.currentActive === 5){
      //   this.noticeList = data
      // }
    },
  }

}
</script>

<style scoped>
/* .container {
  background: #F5F5F5;
} */
.bj {
  background: #F5F5F5;
}

.top-box {
  width: 100%;
  /* height: 1000px; */
  /* background: url(''); */
  /* background-size: cover; */
  /* 背景图片铺满盒子 */
  /* background-repeat: no-repeat; */
  /* 禁止背景图片重复 */
  position: relative;
}

.tab-box {
  width: 100%;
  box-sizing: border-box;
  padding: 20px 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #005375;
  font-weight: bold;
  font-size: 18px;
  color: #FFFFFF;
  /* position: absolute; */
  z-index: 3;

}

.d-s {
  display: flex;
  align-items: center;
}

.logo-box {
  width: 50px;
  height: 50px;
  background: #fff;
}

.logo-size {
  font-weight: 800;
  font-size: 24px;
  color: #FFFFFF;
  margin-left: 20px;

}

.x-x {
  margin-right: 20px;
  cursor: pointer;
}

.ny-banner {
  width: 100%;
}

.ny-banner img {
  width: 100%;
}

.navigation {
  width: 100%;
  height: 60px;
  background: #FFFFFF;
  border-radius: 0px 0px 0px 0px;
  border-bottom: 1px solid #EEEEEE;
}

.navigation .content {
  width: 80%;
  margin: 0 auto;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.navigation .content .left {
  width: 30%;
  display: flex;

  align-items: center
}

.navigation img {

  width: 15px;
  margin-right: 10px;
}

.navigation p {

  /* margin-top: 5px; */
  color: #999;
}

.navigation span {

  color: #999;
}

.navigation span:last-child {
  font-weight: 700;
  color: #005375;
}

.navigation .content .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  align-items: center
}

.navigation .content .right .nav-item {
  width: 200px;
  display: flex;
  height: 60px;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}

.navigation .content .right .active {
  border-bottom: 3px solid #005375;
  color: #005375;
  font-weight: bold;
}

.about-conts {
  width: 80%;
  margin: 80px auto;
  padding: 30px 0;
}

.about-conts .about-conts-item1 {
  padding: 30px 2%;
  width: 76%;
  margin: 0 auto;
  background-color: #fff;
}

.about-conts .ayptjs {
  padding: 30px 0;
  width: 80%;
  margin: 0 auto;
}

.about-conts .ayptjs .tt {
  display: flex;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  color: #333333;
  margin-bottom: 60px;
}

.about-conts .ayptjs-list {
  display: flex;
  flex-wrap: wrap;
}

.about-conts .ayptjs-list .item {
  width: 23%;
  height: 211px;
  /* overflow: hidden; */
  margin-right: 2%;
  position: relative;
  margin-bottom: 60px;
  cursor: pointer;
}

.about-conts .ayptjs-list .item .img {
  position: absolute;
  width: 100%;
  height: 211px;
  z-index: 2;
  top: 0;
  transition: 0.5s ease;
}

.about-conts .ayptjs-list .item .img img {
  width: 100%;
  height: 211px;
  position: absolute;
  z-index: 2;
}

.about-conts .ayptjs-list .item .text {
  position: absolute;
  width: 94%;
  height: 191px;
  z-index: 3;
  background: linear-gradient(180deg, rgba(0, 83, 117, 0) 0%, #005375 100%);
  display: flex;
  padding: 0 3%;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
  top: 0;
  transition: 0.5s ease;
  padding-bottom: 20px;
  ;
}

.about-conts .ayptjs-list .item .text .tts {
  font-weight: bold;
  font-size: 20px;
  color: #FFFFFF;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 15px;
  padding-bottom: 15px;
  transition: 0.5s ease;
}

.about-conts .ayptjs-list .item .text .desc {
  overflow: hidden;
  /** 隐藏超出的内容 **/
  word-break: break-all;
  text-overflow: ellipsis;
  /** 多行 **/
  display: -webkit-box;
  /** 对象作为伸缩盒子模型显示 **/
  -webkit-box-orient: vertical;
  /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  -webkit-line-clamp: 2;
  /** 显示的行数 **/
  line-height: 28px;
  font-size: 16px;
  /* display: none; */
  transition: 0.5s ease;
  margin-bottom: -85px;
  /* padding-bottom: 20px; */
}

.about-conts .ayptjs-list .item:hover .img::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 10px;
  width: 100%;
  height: 211px;
  z-index: 1;
  /* background-color: #f0f; */
  filter: blur(10px);
  background: rgba(0, 83, 117, 0.7);
}

.about-conts .ayptjs-list .item:hover .text .desc {
  margin-bottom: 0;
}

.about-conts .ayptjs-list .item:hover .text {
  top: -30px
}

.about-conts .ayptjs-list .item:hover .img {
  top: -30px
}

.about-conts .ayptjs-list .item .more {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #005375;
  font-size: 18px;
  position: absolute;
  bottom: -10px;
  display: none;
}

.about-conts .ayptjs-list .item:hover .more {
  display: flex;
}

.about-conts .ayptjs-list .item .more .xian {

  width: 70%;
  height: 1px;
  /* left: 0; */
  background-color: #005375;
}

.about-conts .ayptjs-list .item .more p {
  width: 30%;
  text-align: right
}


.about-conts .team {
  padding: 30px 0;
  width: 80%;
  margin: 0 auto;
}

.about-conts .team .tt {
  display: flex;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  color: #333333;
  margin-bottom: 60px;
}

.about-conts .team .team-list {
  display: flex;
  flex-wrap: wrap;
  width: 80%;
  margin: 0 auto;
  justify-content: center;
}

.about-conts .team .team-list .item {
  width: 16%;
  margin: 20px 2%;
  text-align: center
}

.about-conts .team .team-list .item .img {
  width: 100%;
  height: 150px;
  margin-bottom: 20px;
  overflow: hidden
}

.about-conts .team .team-list .item .img img {
  width: 100%;
  height: 150px;
}

.about-conts .team .team-list .item .tts {
  font-size: 20px;
  color: #333333;
}

.index-footer {
  background: #383838;
  padding-top: 30px;
}

.index-footer .footer {
  width: 80%;
  margin: 0 auto;
}

.index-footer .footer .logo {
  display: flex;
  justify-content: space-between;
  /* align-items: center; */
}

.index-footer .footer .logo .footer-contact {}

.index-footer .footer .logo .footer-contact .p {
  display: inline-block;
  display: flex;
  float: left;
  margin-left: 50px;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  /* justify-content: flex-end; */
}

.index-footer .footer .logo .footer-contact .p img {
  margin-right: 10px;
}

.index-footer .footer .logo .footer-contact .p:nth-child(3) {
  width: 100%;
  clear: both;
  margin-top: 20px;
}

.index-footer .footer .footer-nav {
  display: flex;
  margin-top: 20px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.index-footer .footer .footer-nav .footer-nav-item {
  width: 9%;
  margin-right: 1%;
}

.index-footer .footer .footer-nav .footer-nav-item:last-child {
  margin-right: 0;
}

.index-footer .footer .footer-nav .footer-nav-item .tt {

  font-weight: 500;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 18px;
  position: relative;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.index-footer .footer .footer-nav .footer-nav-item .tt::after {
  content: "";
  width: 20px;
  height: 2px;
  background: #005375;
  border-radius: 0px 0px 0px 0px;
  position: absolute;
  bottom: 0;
  left: 0;
}

.index-footer .footer .footer-nav .footer-nav-item a {
  text-decoration: none;

  font-weight: 500;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 16px;
  display: block;
  margin-bottom: 15px;
}

.index-footer .footer .footer-nav .footer-nav-item a:last-child {
  margin-bottom: 0;
}

.index-footer .footer .web_icp {
  display: flex;
  margin-top: 50px;
  height: 80px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.index-footer .footer .web_icp a {
  text-decoration: none;

  font-weight: 500;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 16px;
  margin-right: 30px;
}

.index-footer .footer .web_icp .right {
  display: flex;
  align-items: center;
  justify-content: flex-end
}

.index-footer .footer .web_icp .right div {
  margin-right: 25px;

  font-weight: 500;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 18px;

}
</style>
