<template>
  <div class="box">
    <div class="wrap">
      <div>
        <div class="tit">全国服务站点</div>
        <div class="content">
          <div>
            <div
              class="item"
              v-for="(value, key, index) in state.platformInfo"
              :key="index"
            >
              <div>{{ value.name }}</div>
              <p v-for="item in value.children" :key="item.code">
                <a :href="item.domain" target="_blank" v-if="item.domain">{{
                  item.name
                }}</a>
              </p>
            </div>
          </div>
        </div>
        <div class="more" v-if="state.platformInfo.length > 15">查看更多</div>
      </div>
    </div>
    <webFooter style="width: 100%"></webFooter>
  </div>
</template>

<script setup>
import request from "@/utils/request";
import { onMounted, reactive } from "vue";
import webFooter from "@/components/webFooter/index.vue";
function platform() {
  return request({
    url: "/v1/sys/platform",
  });
}

const state = reactive({
  platformInfo: {},
});

function getInfo() {
  const res = {
    code: 200,
    message: "ok",
    data: {
      340000: {
        name: "安徽省",
        code: "340000",
        domain: "",
        children: [
          {
            name: "合肥市",
            code: "340100",
            domain: "https://www.casshare.com",
            children: null,
          },
        ],
      },
    },
  };
  //   platform().then((res) => {
  // console.log(res);
  state.platformInfo = res.data;
  //   });
}
getInfo();
</script>

<style lang="scss" scoped>
.box {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  .wrap {
    width: 100%;
    height: 100%;
    background-image: url(./img/index8-bg1.png);
    background-size: 100% 50%;
    background-repeat: no-repeat;
    background-position: center bottom;
    & > div {
      flex: 1;
      height: 100%;
      width: 1000px;
      margin: 0 auto;
      padding: 10px 0;
      box-sizing: border-box;
      display: flex;
      display: -webkit-flex;
      align-items: center;
      justify-content: space-evenly;
      flex-direction: column;
    }
    .tit {
      text-align: center;
      font-size: 30px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #333333;
    }
    .content {
      font-size: 16px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #333333;
      display: flex;
      display: -webkit-flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      & > div {
        overflow: hidden;
        flex: 1;
      }

      .item {
        width: 66px;
        float: left;
        a {
          color: #0054ff;
        }
        p {
          font-size: 14px;
          font-family: Source Han Sans CN;
          font-weight: 500;
          color: #666666;
        }
      }
    }
    .more {
      width: 150px;
      height: 46px;
      line-height: 44px;
      border: 1px solid #0054ff;
      font-size: 16px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #0054ff;
      text-align: center;
      user-select: none;
      cursor: pointer;
      &:hover {
        opacity: 0.7;
      }
    }
  }
}
</style>
