<template>
  <div class="club-device 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>
      <el-form :model="formData" :rules="rules">
        <el-form-item label="设备名称：">
          <el-select
            v-model="formData.deviceName"
            filterable
            allow-create
            placeholder="请输入新设备名称或选择已有设备"
          >
            <el-option label="中国" :value="1"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="mobile" label="设备图片:">
          <br />
          <el-input v-show="false"></el-input>
          <SimpleUploadImage :limit="1" />
        </el-form-item>
        <el-form-item label="所属品牌:">
          <el-select v-model="formData.deviceName" placeholder="请选择品牌">
            <el-option label="中国" :value="1"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="mobile" label="购买渠道:">
          <el-input placeholder="请输入购买渠道"></el-input>
        </el-form-item>
        <el-form-item prop="mobile" label="发票:">
          <br />
          <el-input v-show="false"></el-input>
          <SimpleUploadImage :limit="1" />
        </el-form-item>
        <el-form-item prop="mobile" label="设备SN码:">
          <el-input placeholder="请输入设备SN码"></el-input>
        </el-form-item>
        <el-form-item prop="mobile" label="设备参数:">
          <br />
          <div class="device-param-list">
            <span class="add-param">添加参数</span>
            <template v-for="i in 3">
              <div :key="i">
                <div class="param flex justify-between mb-4">
                  <el-input placeholder="例如：品牌" class="mr-2"></el-input>
                  <el-input placeholder="请输入参数信息"></el-input>
                  <span class="remove el-icon-close"></span>
                </div>
              </div>
            </template>
          </div>
        </el-form-item>
      </el-form>
      <div class="control flex flex-col items-center">
        <div class="button submit flex justify-center items-center">提交</div>
      </div>
    </div>
  </div>
</template>

<script>
import SimpleUploadImage from '@/components/SimpleUploadImage'
import { mapGetters } from 'vuex'
export default {
  layout: 'app',
  components: {
    SimpleUploadImage,
  },
  data() {
    return {
      formData: {
        deviceName: '',
      },
      rules: {},
    }
  },
  computed: {
    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  },
}
</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;
    }

    .el-select {
      width: 100%;
    }
    .control {
      margin-top: 62px;
      .button {
        width: 295px;
        height: 50px;

        cursor: pointer;

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

    .device-param-list {
      position: relative;
      .add-param {
        position: absolute;
        cursor: pointer;
        top: -40px;
        right: 0;
        text-decoration: underline;
        font-size: 14px;
        @include themify($themes) {
          color: themed('color');
        }
      }

      .param {
        position: relative;
        .remove {
          position: absolute;
          right: 0;
          top: 0;
          width: 20px;
          height: 20px;
          background: #f94b4b;
          border-radius: 2px;
          cursor: pointer;
          color: #fff;
          font-size: 14px;
          text-align: center;
          line-height: 20px;
        }
      }
    }
  }
}
</style>
