<template>
  <div class="page">
    <div class="page-top flex flex-col justify-center items-center">
      <img class="logo" :src="supplierInfo.logo" />
      <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
    </div>
    <div class="page-content">
      <template v-if="true">
        <div class="page-title">机构认证</div>
        <div class="row">
          <div class="col">机构名称：</div>
          <div class="col">机构名称</div>
        </div>
        <div class="row">
          <div class="col">联系电话：</div>
          <div class="col">15889586666</div>
        </div>
        <div class="row">
          <div class="col">所在地区：</div>
          <div class="col">广东省深圳市福田区上步南路锦峰大厦A座</div>
        </div>
        <div class="row">
          <div class="col">所在位置：</div>
          <div class="col">广东省深圳市福田区上步南路锦峰大厦A座</div>
        </div>
        <div class="row">
          <div class="col max-width">logo：</div>
          <div class="col">
            <el-image
              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
            ></el-image>
          </div>
        </div>
        <div class="row">
          <div class="col max-width">logo：</div>
          <div class="col">
            <el-image
              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
            ></el-image>
            <el-image
              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
            ></el-image>
            <el-image
              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
            ></el-image>
          </div>
        </div>
        <div class="row">
          <div class="col">机构类型：</div>
          <div class="col">医美</div>
        </div>
        <div class="row">
          <div class="col">医美类型：</div>
          <div class="col">诊所</div>
        </div>
        <div class="row">
          <div class="col">员工人数：</div>
          <div class="col">12</div>
        </div>
        <div class="row">
          <div class="col">状态：</div>
          <div class="col">认证中</div>
        </div>

        <div class="control flex flex-col items-center">
          <div
            class="button edit flex justify-center items-center mb-2"
            @click="onEdit"
          >
            编辑
          </div>
          <div
            class="button search flex justify-center items-center"
            @click="onToDeviceList"
          >
            查看认证设备
          </div>
        </div>
      </template>
      <template v-else>
        <SimpleEmpty name="icon-club-empty.png" description="暂无机构认证~" />
      </template>
    </div>
  </div>
</template>

<script>
import SimpleEmpty from '@/components/SimpleEmpty'
import { mapGetters } from 'vuex'
export default {
  layout: 'app',
  components: {
    SimpleEmpty,
  },
  computed: {
    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  },
  methods: {
    onToDeviceList() {
      this.$router.push(`${this.routePrefix}/record/device`)
    },
    onEdit() {
      this.$router.push(`${this.routePrefix}/record/club/edit`)
    },
  },
}
</script>

<style lang="scss" scoped>
@media screen and (min-width: 768px) {
  .page {
    background: #fff;
  }

  .page-top {
    height: 360px;
    @include themify($themes) {
      background: themed('banner-club-register');
      background-size: auto 360px;
    }
    .logo {
      display: block;
      width: 120px;
      height: 120px;
      border-radius: 50%;
      background: #fff;
    }
    .name {
      font-size: 30px;
      color: #fff;
    }
  }
  .page-content {
    width: 700px;
    margin: 0 auto;
    overflow: hidden;
    min-height: calc(100vh - 80px - 80px - 360px);
    box-sizing: border-box;
    padding-bottom: 40px;

    .page-title {
      font-size: 24px;
      font-weight: bold;
      text-align: center;
      padding: 40px 0;
    }

    .row {
      display: flex;
      justify-content: flex-start;
      align-items: flex-start;
      font-size: 18px;
      margin: 24px 0;

      .col {
        &:first-child {
          width: 90px;
          color: #666;
        }

        &:last-child {
          color: #282828;
        }
      }

      .el-image {
        width: 120px;
        height: 120px;
        margin-right: 12px;
      }
    }

    .control {
      margin-top: 62px;
      .button {
        width: 295px;
        height: 50px;

        cursor: pointer;

        &.edit {
          @include themify($themes) {
            border: 1px solid themed('color');
            color: themed('color');
          }
        }

        &.search {
          @include themify($themes) {
            background-color: themed('color');
            color: #fff;
          }
        }
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .page {
    background: #fff;
  }

  .page-top {
    height: 46vw;
    @include themify($themes) {
      background: themed('banner-home-h5');
      background-size: auto 46vw;
    }
    .logo {
      display: block;
      width: 14.8vw;
      height: 14.8vw;
      border-radius: 50%;
      background: #fff;
    }
    .name {
      font-size: 4vw;
      color: #fff;
    }
  }

  .page-content {
    box-sizing: border-box;
    padding: 8vw 7.2vw;

    .page-title {
      font-size: 4.2vw;
      font-weight: bold;
      text-align: center;
      margin-bottom: 8vw;
      color: #282828;
    }

    .row {
      display: flex;
      justify-content: flex-start;
      align-items: flex-start;
      font-size: 3.4vw;
      margin-bottom: 5.6vw;
      flex-wrap: wrap;

      .col {
        &:first-child {
          width: 17vw;
          color: #666;

          &.max-width {
            width: 100% !important;
            margin-bottom: 2.6vw;
          }
        }

        &:last-child {
          color: #282828;
        }
      }

      .el-image {
        width: 25.6vw;
        height: 25.6vw;
      }
    }

    .control {
      margin-top: 22.8vw;
      .button {
        width: 100%;
        height: 12vw;

        cursor: pointer;

        &.edit {
          @include themify($themes) {
            border: 1px solid themed('color');
            color: themed('color');
          }
        }

        &.search {
          @include themify($themes) {
            background-color: themed('color');
            color: #fff;
          }
        }
      }
    }
  }
}
</style>
