<template>
  <div class="page">
    <div class="page-top flex flex-col justify-center items-center">
      <img class="logo" src="https://picsum.photos/200/200" />
      <span class="name mt-2">上海品辉医疗科技有限公司</span>
    </div>
    <div class="page-content">
      <!-- 搜索区域 -->
      <div class="search">
        <simple-search />
      </div>
      <!-- 地区选择 -->
      <div class="city bg-red-300">地区选择</div>
      <!-- 标题 -->
      <div class="title flex justify-between px-4 pt-8 pb-8 md:px-0">
        <div>距你最近...</div>
        <div>共<span>30</span>家机构</div>
      </div>
      <!-- 列表 -->
      <div class="list">
        <div class="section flex justify-between mb-4">
          <img class="cover" src="https://picsum.photos/400/400" />
          <div class="info">
            <div class="name">丽颜科美复兴广场店</div>
            <div class="mobile">0755-25777189</div>
            <div class="address">
              上海市黄浦区马当路388号复兴广场夜丽秀夜丽秀
            </div>
            <div class="distance">9999km</div>
          </div>
        </div>
        <div class="section flex justify-between mb-4">
          <img class="cover" src="https://picsum.photos/400/400" />
          <div class="info">
            <div class="name">丽颜科美复兴广场店</div>
            <div class="mobile">0755-25777189</div>
            <div class="address">
              上海市黄浦区马当路388号复兴广场夜丽秀夜丽秀
            </div>
            <div class="distance">9999km</div>
          </div>
        </div>
        <div class="section flex justify-between mb-4">
          <img class="cover" src="https://picsum.photos/400/400" />
          <div class="info">
            <div class="name">丽颜科美复兴广场店</div>
            <div class="mobile">0755-25777189</div>
            <div class="address">
              上海市黄浦区马当路388号复兴广场夜丽秀夜丽秀
            </div>
            <div class="distance">9999km</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  layout: 'app',
}
</script>

<style scoped lang="scss">
// pc 端
@media screen and (min-width: 768px) {
  .page {
    min-height: calc(100vh - 80px - 80px);
    background-color: #fff;
  }
  .page-top {
    height: 420px;
    background: url(https://static.caimei365.com/www/authentic/pc/bg-club.png);
    background-size: auto 420px;
    .logo {
      display: block;
      width: 120px;
      height: 120px;
      border-radius: 50%;
    }
    .name {
      font-size: 30px;
      color: #fff;
    }
  }
  .page-content {
    width: 1200px;
    margin: 0 auto;
    position: relative;
    .search {
      display: none;
    }

    .city {
      padding-top: 12vw;
      display: none;
    }

    .title {
      font-size: 16px;
      color: #404040;

      span {
        color: #bc1724;
      }
    }

    .list {
      display: flex;
      align-items: center;
      justify-content: space-between;

      .section {
        width: 390px;
        height: 108px;
        background-color: #f3f5f6;
        border-radius: 4px;
        box-sizing: border-box;
        padding: 12px;
        cursor: pointer;
        transition: all 0.4s;
        &:hover {
          box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
        }

        .cover {
          display: block;
          width: 84px;
          height: 84px;
        }
        .info {
          position: relative;
          margin-left: 12px;
          .name {
            font-size: 16px;
            color: #101010;
            font-weight: bold;
            margin-bottom: 16px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
          }
          .mobile,
          .address {
            width: 268px;
            position: relative;
            font-size: 14px;
            color: #404040;
            padding-left: 24px;
            line-height: 24px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            &::after {
              content: '';
              display: block;
              width: 16px;
              height: 16px;
              position: absolute;
              left: 0;
              top: 50%;
              transform: translateY(-50%);
              background-size: 16px;
              background-repeat: no-repeat;
            }
          }
          .mobile {
            &::after {
              background-image: url(https://static.caimei365.com/www/authentic/pc/icon-phone.png);
            }
          }
          .address {
            &::after {
              background-image: url(https://static.caimei365.com/www/authentic/pc/icon-address.png);
            }
          }

          .distance {
            position: absolute;
            font-size: 12px;
            color: #404040;
            top: 2px;
            right: 0;
          }
        }
      }
    }
  }
}

// 移动 端
@media screen and (max-width: 768px) {
  .page-top {
    height: 46vw;
    background: url(https://static.caimei365.com/www/authentic/h5/bg-club.png);
    background-size: auto 46vw;
    .logo {
      display: block;
      width: 14.8vw;
      height: 14.8vw;
      border-radius: 50%;
    }
    .name {
      font-size: 4vw;
      color: #fff;
    }
  }
  .page-content {
    position: relative;
    .search {
      position: absolute;
      left: 50%;
      top: 0;
      transform: translate(-50%, -50%);
    }

    .city {
      padding-top: 12vw;
    }

    .title {
      font-size: 3.4vw;
      color: #404040;

      span {
        color: #bc1724;
      }
    }

    .list {
      display: flex;
      align-items: center;
      flex-direction: column;

      .section {
        width: 93.6vw;
        height: 26vw;
        background-color: #f3f5f6;
        border-radius: 4px;
        box-sizing: border-box;
        padding: 3.2vw;

        .cover {
          display: block;
          width: 19.6vw;
          height: 19.6vw;
        }
        .info {
          position: relative;
          margin-left: 3.2vw;
          .name {
            font-size: 4vw;
            color: #101010;
            font-weight: bold;
            margin-bottom: 4vw;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
          }
          .mobile,
          .address {
            width: 66vw;
            position: relative;
            font-size: 3vw;
            color: #404040;
            padding-left: 5vw;
            line-height: 5vw;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            &::after {
              content: '';
              display: block;
              width: 4vw;
              height: 4vw;
              position: absolute;
              left: 0;
              top: 50%;
              transform: translateY(-50%);
              background-size: 4vw 4vw;
              background-repeat: no-repeat;
            }
          }
          .mobile {
            &::after {
              background-image: url(https://static.caimei365.com/www/authentic/h5/icon-phone.png);
            }
          }
          .address {
            &::after {
              background-image: url(https://static.caimei365.com/www/authentic/h5/icon-address.png);
            }
          }

          .distance {
            position: absolute;
            font-size: 3vw;
            color: #404040;
            top: 0.8vw;
            right: 0;
          }
        }
      }
    }
  }
}
</style>
