<template>
  <div>
    <el-form
      inline
      class="dialog-info"
      label-width="110px"
    >
      <div class="block-title">
        会员信息
      </div>
      <el-form-item label="会员类型">
        {{ typeInfo.name }}
      </el-form-item>
      <el-form-item label="姓名">
        {{ info.name }}
      </el-form-item>
      <el-form-item label="联系方式">
        {{ info.phone }}
      </el-form-item>
      <el-form-item label="住址">
        {{ info.address }}
      </el-form-item>
      <el-form-item label="证件类型">
        {{ info.papers_type | paperType }}
      </el-form-item>
      <el-form-item label="证件号码">
        {{ info.papers_id }}
      </el-form-item>
      <el-form-item label="生效时间">
        {{ info.starttime | formatDate }}
      </el-form-item>
      <el-form-item label="截止时间">
        {{ info.endtime | formatDate }}
      </el-form-item>
      <div class="block-title">
        通关方式
      </div>
      <el-form-item
        v-if="typeInfo.iccard_check"
        label="IC卡号">
        {{ info.iccard.card_no }}
      </el-form-item>
      <el-form-item
        v-if="typeInfo.idcard_check"
        label="身份证号">
        {{ info.idcard.idcard_no }}
      </el-form-item>
      <el-form-item
        v-if="typeInfo.face_check"
        label="照片">
        <img
          class="portrait"
          :src="`data:image/jpeg;base64,${info.face.face_img}`"
          alt="">
      </el-form-item>
      <el-form-item
        v-if="typeInfo.fingerprint_check"
        label="指纹">
        <img
          class="portrait"
          :src="`data:image/jpeg;base64,${info.finger.finger_pic}`"
          alt="">
      </el-form-item>
    </el-form>
    <div class="dialog-btn-wrap">
      <el-button
        @click="submit"
        type="primary">
        确定激活
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    typeInfo: {
      type: Object,
      default: () => {}
    },
    info: {
      type: Object,
      default: () => {}
    }
  },
  data () {
    return {
      visible: false
    }
  },
  methods: {
    handleClose () {
      this.$parent.handleClose()
    },
    submit () {
      this.$emit('submit')
      this.handleClose()
    }
  }
}
</script>
