<template>
  <common-header />
  <div class="content">
    <div class="title">

      <div>学校 <span>艺术广场-专题艺术活动-</span><span>学校</span></div>
    </div>
    <div class="main">
      <div class="inp">
        <input v-model="keyword" type="text" placeholder="搜索关键字" />
        <span class="inp-sear" @click="getSchoolData"></span>
      </div>
      <div class="hd-list">
        <ul class="hd-content">
          <li class="hd" v-for="(item,index) in schoolData" :key="index">
            <img @click="toSchoolZp(item.yzc_id,item.sm_name)" class="hd-back" :src="https+item.yzc_img" alt="" />
            <div class="hd-des">
              <p>{{item.sm_name}}</p>
            </div>
          </li>

        </ul>

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

<script>
import {
  school_list
} from "./api";
import { download } from "~/utils/request";
import CommonHeader from "@/components/CommonHeader/index.vue";
export default {
  name: "index",
  components: {
    CommonHeader,
    download,
  },
  data() {
    return {
      schoolData: [],
      https: window.GLOBAL_CONFIG.api,


    };
  },
  methods: {
    //学校
    getSchoolData() {
      let data = {
        page: this.cur_page,
        limit: this.limit,
        keyword: this.keyword,
        yz_cate: this.activeZthdType,
        yz_hdjb: this.yz_hdjb,
        yz_status: this.yz_status,

      };

      school_list(data).then((res) => {
        this.schoolData = res.data.page_data;


      });
    },

    toSchoolZp(id, sm_name) {
      this.$router.push({
        name: "ysgc_schoolZp",
        params: { id: id },
        query: {
          sm_name: sm_name
        }
      });
    },

  },
  mounted() {
    if (this.$route.params.id != "") {
      this.yz_id = this.$route.params.id;
      this.getSchoolData();

    }
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: 100%;
  min-width: 1400px;
  margin: 0 auto;
  background-image: url("@/assets/img/zhjy/xq_bg.png");
  background-repeat: no-repeat;
}
.title {
  width: 100%;

  height: 60px;
  line-height: 60px;
  font-size: 18px;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  color: #050026;
  background: #ffffff;
  margin-bottom: 20px;
  box-shadow: 0px 1px 10px 0px rgba(17, 46, 74, 0.1);
  div {
    width: 1400px;

    margin: 0 auto;
    span:first-of-type {
      width: 56px;
      height: 20px;
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #949494;
      line-height: 20px;
      margin-left: 30px;
    }
    span:last-of-type {
      width: 56px;
      height: 20px;
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #000000;
      line-height: 20px;
    }
  }
}
.main {
  width: 1400px;
  margin: 0 auto;

  border-radius: 12px;
  padding: 30px;
  .inp {
    width: 497px;
    margin: 20px 0 25px 0;
    height: 50px;
    line-height: 50px;
    position: relative;
    input {
      background: #ffffff;
      border-radius: 8px;
      border: 1px solid #00a3ff;
      outline: none;
      width: 100%;
      height: 100%;
      padding-left: 17px;
      font-size: 16px;
    }
    .inp-sear {
      display: block;
      width: 26px;
      height: 26px;
      background: #00a3ff;
      border-radius: 6px;
      position: absolute;
      top: 12px;
      right: 15px;
      background-image: url("../../../assets/ysgc/search.png");
      background-size: 60%;
      background-position: center;
      background-repeat: no-repeat;
      cursor: pointer;
    }
  }
  .hd-list {
    width: 1440px;
    min-width: 1280px;
    margin: 0 auto;

    .hd-content {
      width: 100%;
      display: flex;

      flex-wrap: wrap;

      .hd {
        width: 332px;
        height: 274px;
        border-radius: 12px 12px 0px 0px;
        box-shadow: 0px 10px 24px 0px rgba(161, 153, 168, 0.18);
        position: relative;
        margin: 25px 13px;
        .hd-back {
          width: 332px;
          height: 195px;
          border-radius: 12px 12px 0px 0px;
        }
        .hd-des {
          width: 332px;
          height: 79px;
          padding: 11px;
          font-size: 16px;
          font-family: PingFangSC, PingFangSC-Medium;
          font-weight: 500;
          text-align: left;
          color: #050026;
        }
      }
    }
  }
}
</style>

