<template>
  <div>
    <el-form ref="supplierDataField" size="small" :model="supplierData" label-width="130px" @submit.native.prevent>
      <el-tabs type="border-card" v-model="activeName">
        <el-tab-pane label="基本信息" name="detail">
          <div class="section">
            <div class="title">邀请人</div>
            <el-row :gutter="24" class="mt20">
              <el-col :span="12">
                <el-form-item label="邀请人：">
                  <div class="user-content" v-if="supplierData.inviteUser">
                    <div class="user-avatar">
                      <img :src="supplierData.inviteUser.avatar || moren" />
                    </div>
                    <div class="user-info">
                      <div class="nickname">{{ supplierData.inviteUser.nickname }}</div>
                      <div class="agent-type-text">
                        <el-tag type="info" effect="dark" size="small">{{ supplierData.inviteUser.uid }}</el-tag>
                      </div>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="title">基础信息</div>
            <el-row :gutter="24" class="mt20">
              <el-col :span="12">
                <el-form-item label="供应商名称：">
                  <el-input :value="supplierData.supplier_name" readonly disabled />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="供应商地址：">
                  <el-input :value="supplierData.detailed_address" readonly disabled />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系人姓名：">
                  <el-input type="text" :value="supplierData.name" readonly disabled />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系电话：">
                  <el-input :value="supplierData.phone" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="供应商邮箱：">
                  <el-input :value="supplierData.email" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="排序：">
                  <el-input :value="supplierData.sort" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="状态：">
                  <el-input :value="supplierData.is_show == 1 ? '开启' : '关闭'" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="商品审核：">
                  <el-input :value="supplierData.is_examine == 1 ? '需要审核' : '无需审核'" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="备注：">
                  <el-input type="textarea" :value="supplierData.mark" readonly disabled :maxlength="250" autosize :rows="5" resize="none" />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-tab-pane>
        <el-tab-pane label="账号信息" name="account">
          <div class="section">
            <div class="title">账号密码</div>
            <el-row :gutter="24" class="mt20">
              <el-col :span="12">
                <el-form-item label="商户账号：">
                  <el-input type="text" :value="supplierData.supplier_account" readonly disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="登陆密码：">
                  <el-input type="password" :value="supplierData.supplier_password" readonly disabled/>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-tab-pane>
      </el-tabs>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    supplierData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      activeName: 'detail',
    };
  },
  filters: {},
  methods: {},
};
</script>
<style lang="scss" scoped>
.selWidth{
  margin-bottom: 10px!important;
}
.user-content{
  --user-content-height-: 80px;

  height: var(--user-content-height-);
  width: 100%;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  .user-avatar{
    height: var(--user-content-height-);
    width: var(--user-content-height-);
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    img{
      height: 80%!important;
      width: 80%!important;
      border-radius: 50% !important;
    }
  }
  .user-info{
    max-width: calc(100% - var(--user-content-height-));
    height: var(--user-content-height-);
    display: inline-flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    .nickname{
      width: 100%;
      height: 25px;
      line-height: 25px;
      text-align: left;
      font-size: 15px;
      font-weight: bold;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: flex-start;
      align-items: center;
      .user-id{
        color: #fff;
        background-color: #409eff;
        border-color: #409eff;
        height: 18px;
        line-height: 20px;
        font-size: 13px;
        padding: 0 5px;
        border-radius: 5px;
        margin-left: 10px;
        width: max-content!important;
      }
    }
    .user-id{
      width: 100%;
      text-align: left;
      font-size: 13px;
      line-height: calc(var(--user-content-height- * 35%));
    }
  }
}
</style>
