<template>
  <div class="footer">
    <div class="container">
      <div class="footer__header">
        <div class="title">友情链接：</div>
        <div class="links">
          <a
            v-for="(item, index) in showList(links)"
            :key="index"
            :href="item.url ? item.url : 'javascript:;'"
            target="_blank"
            >{{ item.name }}</a
          >
        </div>
      </div>

      <div class="footer__body">
        <p v-for="(item, index) in footer" :key="index">{{ item.name }}</p>
      </div>

      <div class="footer__footer">
        <p>
          Copyright©2016-2022 广东省祥粤建设职业培训学校 版权所有
          <a href="https://beian.miit.gov.cn/" target="_blank">
            粤ICP备15087219号-2</a
          >
        </p>
        <p>技术支持：广东中正教育科技有限公司</p>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "Footer",
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["footer", "links"]),
    showList: function () {
      return function (list) {
        let showList = [];
        if (list) {
          showList = list.filter((item) => {
            return item.status == 1;
          });
        }
        return showList;
      };
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.footer {
  background: #f8fafc;

  &__header {
    .title {
      height: 40px;
      line-height: 40px;
      font-size: 12px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #999999;
      border-bottom: 1px solid #eeeeee;
    }

    .links {
      padding-bottom: 14px;
      border-bottom: 1px solid #eeeeee;

      a {
        line-height: 14px;
        display: inline-block;
        margin-top: 14px;
        margin-right: 40px;
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #999999;
      }
    }
  }

  &__body {
    padding: 14px 0;
    p {
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #999999;
      line-height: 24px;
    }
  }

  &__footer {
    padding: 22px 0;
    p {
      text-align: center;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #999999;
      line-height: 24px;
    }

    a {
      color: #999999;
    }
  }
}
</style>
