<template>
  <div id="app">
    <div class="banner">
      <img src="../../assets/image/gxq_banner.png" />
    </div>

    <div class="activity-container notice-wrap">
      <div class="header-line">
        <h3>通知公告</h3>
        <span>NOTICE</span>
        <a class="view-more" @click="goNotice">查看更多</a>
      </div>

      <div class="notices-box">
        <div class="lastest">
          <div class="lastest-mark">
            TOP
          </div>
          <p class="lastest-title" @click="handleNoticeClick()">{{noticeList[0].title}}</p>
          <p class="lastest-date">{{noticeList[0].startTimeTip}}</p>
        </div>
        <ul class="notice-list">
          <li v-for="(item,index) in noticeList" @click="handleNoticeClick()"><span class="title">{{item.title}}</span><span class="date">{{item.startTimeTip}}</span></li>
        </ul>
      </div>
    </div>

    <div class="home-activity">
      <div class="activity-container">
        <div class="header-line">
          <h3>评审活动</h3> <span>ACTIVITY</span> <div class="more">
            <a class="view-more" @click="goActivity">查看更多</a> <span class="count">
            </span>
          </div>
        </div>
        <div class="activities">
            <div class="activity" v-for="(item,index) in activityList" @click="handleActivityClick()">
              <div>
                <div class="img-box">
                <span class="state" style="background: rgb(8, 203, 203); visibility: visible;">{{item.statusTip}}</span>
                  <span class="time">{{item.timeTip}}</span>
                </div>
                <div class="infos">
                  <p class="actName">{{item.name}}</p> <p></p> <p class="actOrganizer">
                    <span class="organizer">
                      {{item.organizer}}
                    </span>
                    <span>主办</span>
                  </p>
                </div>
              </div>
            </div>
          </div>
      </div>
    </div>

    <div class="home-activity">
      <div class="activity-container">
        <div class="header-line">
          <h3>往届回顾</h3> <span>REVIEW</span>
          <div class="more">
            <a href="./activity.html" class="view-more">查看更多</a>
          <span class="count">
            </span>
          </div>
        </div>
        <div class="activities">
          <div class="activity" v-for="(item,index) in finishAcList" @click="handleActivityClick()">
            <div>
              <div class="img-box">
                <span class="state" style="background: rgb(168, 170, 169); visibility: visible;">{{item.statusTip}}</span>
                <span class="time">{{item.timeTip}}</span>
              </div>
              <div class="infos">
                <p></p>
                <p class="actName">{{item.name}}</p>
                <p></p>
                <p class="actOrganizer">
                  <span class="organizer">
                    {{item.organizer}}
                  </span>
                  <span>主办</span>
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>
<script>
  import headers from '@/components/smart-class/headers'
  import indexNoticeList from '@/static/indexNoticeList.json'
  import indexActivityList from '@/static/reviewAcList.json'
  import indexFinishActivityList from '@/static/finishAcList.json'
  export default {
    components: {
      headers
    },
    data() {
      return {
        noticeList: [],
        activityList:[]
      }
    },
    created() {
      this.noticeList = indexNoticeList.list;
      this.activityList = indexActivityList.data.list;
      this.finishAcList = indexFinishActivityList.data.list;
    },
    methods: {
      handleNoticeClick() {
        this.$router.push('noticeDetails');
        this.$eventBus.$emit("activeIndex", 1);
      },
      handleActivityClick() {
        this.$router.push('activityDetails');
        this.$eventBus.$emit("activeIndex", 2);
      },
      goNotice() {
        this.$router.push('notice');
        this.$eventBus.$emit("activeIndex", 1);
      },
      goActivity() {
        this.$router.push('reviewActivity');
        this.$eventBus.$emit("activeIndex", 2);
      }

    },
    mounted() {
    }
  }
</script>
<style scoped>
  html, body, #app {
    height: 100% !important;
    user-select: none;
  }

  .activity-container {
    width: 1200px;
    margin: 0 auto;
  }

  .notice-wrap {
    height: 300px;
    margin-top: 30px;
  }

  .header-line {
    height: 16px;
    font-size: 16px;
    line-height: 16px
  }

    .header-line h3 {
      float: left;
      padding-left: 10px;
      border-left: 4px solid #41b6ba;
      color: #333
    }

    .header-line span {
      float: left;
      margin-left: 8px;
      color: #cbb;
      font-size: 14px;
      height: 16px
    }

    .header-line a {
      float: right;
      color: #666;
      font-size: 14px
    }
  .banner {
    margin-top:50px;
  }
   .banner  img {
    width: 100%;
    min-width: 1280px;
    background-color: #e5e9f2;
    height: 640px
    }
  .notice-wrap .notices-box {
    height: 240px;
  }

    .notice-wrap .notices-box .lastest {
      cursor: pointer;
      margin-top: 15px;
      margin-right: 60px;
      height: 220px;
      width: 520px;
      float: left;
    }

      .notice-wrap .notices-box .lastest .lastest-mark {
        margin-top: 25px;
        text-align: center;
        line-height: 28px;
        width: 64px;
        height: 28px;
        background-color: #41b6ba;
        color: #fff;
        font-size: 24px;
        font-family: Arial;
      }

      .notice-wrap .notices-box .lastest .lastest-title {
        padding-top: 12px;
        clear: both;
        color: #444;
        font-size: 26px;
        font-weight: bold;
      }

      .notice-wrap .notices-box .lastest .lastest-date {
        padding-top: 20px;
        color: #999;
        font-size: 18px;
        font-family: Arial;
      }

    .notice-wrap .notices-box .notice-list {
      width: 620px;
      float: left;
    }

      .notice-wrap .notices-box .notice-list li {
        list-style-type: disc;
        padding: 10px 0 10px 8px;
        font-size: 14px;
        color: #41b6ba;
        cursor: pointer;
      }

        .notice-wrap .notices-box .notice-list li .date {
          color: #999;
          float: right;
        }

        .notice-wrap .notices-box .notice-list li:first-child {
          margin-top: 10px;
        }

        .notice-wrap .notices-box .notice-list li .title {
          display: inline-block;
          color: #444;
          font-size: 14px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          width: 350px;
          vertical-align: top;
        }

          .notice-wrap .notices-box .notice-list li .title:hover {
            color: #20a0ff;
          }
.home-activity .activities {
    min-height: 300px;
    overflow: hidden
}

.home-activity .activities .activity {
    margin-top: 30px;
    margin-right: 25px;
    margin-bottom: 30px;
    width: 383px;
    float: left;
    cursor: pointer;
    border: 1px solid #ddd;
    box-sizing: border-box
}

.home-activity .activities .activity:hover {
    box-shadow: 0 26px 40px -24px rgba(0,36,100,.3);
    transform: translateY(-6px);
    transition: all .3s ease 0s
}

.home-activity .activities .activity:nth-child(3n) {
    margin-right: 0
}

.img-box {
    height: 210px;
    position:relative;
    background:url(../../assets/image/cover.png);
    background-size:cover;
    display:flex;
    flex-direction:row;
    justify-content:center;
    align-items:center;
}

.img-box .state {
    padding: 5px 8px;
    position: absolute;
    left: 0;
    top: 0px;
    z-index: 1;
    background-color: #13ce66;
    color: #fff
}

.img-box .time {
    margin-top:130px;
    z-index: 1;
    color: #dbd8d8;
    font-size:18px;
    font-weight:bold;
}

.img-box img {
    width: 382px;
    height: 210px;
    position: absolute;
    left: 0;
    top: -21px;
    padding-top: 1px
}

.infos {
    background-color: #fff
}

.infos .actName {
    color: #444;
    font-size: 16px;
    padding: 20px 10px 10px 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 280px
}

.infos .actOrganizer {
    color: #999;
    font-size: 14px;
    padding-left: 20px;
    padding-bottom: 20px
}

.infos .actTime {
    color: #aaa;
    font-size: 14px;
    padding-left: 20px;
    padding-bottom: 10px
}

.view-more {
    text-decoration: none;
    float: right
}
</style>
