<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>
      <el-form-item label="备注">
        {{ info.remark || '无' }}
      </el-form-item>
      <div class="block-title">
        通关方式
      </div>
      <el-form-item
        v-if="typeInfo.iccard_check"
        label="IC卡号">
        {{ info.iccard.cardNo }}
      </el-form-item>
      <el-form-item
        v-if="typeInfo.idcard_check"
        label="身份证号">
        {{ info.idcard.idcardNo }}
      </el-form-item>
      <el-form-item
        v-if="typeInfo.face_check && info.face"
        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 && info.finger"
        label="指纹">
        <img
          class="portrait"
          :src="`data:image/jpeg;base64,${info.finger.finger_pic}`"
          alt="">
      </el-form-item>
      <div class="block-title">
        交易信息
      </div>
      <el-form-item
        class="warning"
        label="交易总金额">
        <span class="strong">
          {{ info.total_money }}
        </span> 元
      </el-form-item>
      <el-form-item
        class="warning"
        label="付款方式">
        <span class="strong">
          {{ info.payChannel }}
        </span>
      </el-form-item>
    </el-form>
    <div class="dialog-btn-wrap">
      <el-button
        @click="submit"
        :disabled="submitDisable"
        type="primary">
        {{ submitDisable?'正在处理':'确定办理' }}
      </el-button>
    </div>
  </div>
</template>

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