<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">
      <div class="page-title">设备认证</div>

      <div class="device-list">
        <div class="device" @click="toEdit">
          <div class="name">
            <span class="label">设备名称 1：</span>
            <span class="content">B-BEAUTY童颜皮肤管理（海宁店）</span>
          </div>
          <div class="status success">
            <span class="label">状态：</span>
            <span class="content">认证中</span>
          </div>
        </div>
        <div class="device">
          <div class="name">
            <span class="label">设备名称 1：</span>
            <span class="content">B-BEAUTY童颜皮肤管理（海宁店）</span>
          </div>
          <div class="status warning">
            <span class="label">状态：</span>
            <span class="content">认证通过</span>
          </div>
        </div>
        <div class="device">
          <div class="name">
            <span class="label">设备名称 1：</span>
            <span class="content">B-BEAUTY童颜皮肤管理（海宁店）</span>
          </div>
          <div class="status danger">
            <span class="label">状态：</span>
            <span class="content">认证未通过</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  layout: 'app',
  computed: {
    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  },
  methods: {
    toEdit() {
      this.$router.push(`${this.routePrefix}/record/device/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;
    }

    .device-list {
      .device {
        position: relative;
        padding: 36px 0 12px;
        border-bottom: 1px solid #c2c2c2;
        cursor: pointer;

        .name {
          margin-bottom: 8px;
        }

        .label {
          font-size: 18px;
          color: #666;
        }

        .content {
          font-size: 18px;
          color: #282828;
        }
        .status {
          &.success {
            .content {
              color: #f3920d;
            }
          }
          &.warning {
            .content {
              color: #1890ff;
            }
          }
          &.danger {
            .content {
              color: #f94b4b;
            }
          }
        }

        &::after {
          content: '';
          position: absolute;
          right: 0;
          top: 50%;
          transform: translateY(-50%);
          display: block;
          width: 20px;
          height: 20px;
          background: url(https://static.caimei365.com/www/authentic/pc/icon-detail-more.png)
            no-repeat center;
          background-size: 18px;
        }
      }
    }
  }
}
</style>
