<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 v-html="footerRecord.footerRecordNo"></p>
        <p v-html="footerRecord.footerTip"></p>
        <p v-if="footerRecord.tips1">{{ footerRecord.tips1 }}</p>
        <p v-if="footerRecord.tips2">{{ footerRecord.tips2 }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
// import config from "@/apis/config";
export default {
  name: "Footer",
  data() {
    return {
    };
  },
  computed: {
    ...mapGetters(["footer", "links","footerRecord"]),
    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>
