<!--
 * @Author: jiangzaicheng jiangzaicheng_jzc@163.com
 * @Date: 2022-07-07 16:13:13
 * @LastEditors: jiangzaicheng jiangzaicheng_jzc@163.com
 * @LastEditTime: 2022-07-13 19:05:41
 * @FilePath: \mcep-h5\src\components\common\Bottom.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
  <!-- <div> -->
  <div class="roolsolt">
    <div class="rarle">
      <tatle-bar :tatle="tatleName"></tatle-bar>
    </div>
    <van-row type="flex" class="CardRules">
      <van-col span="24">拍摄您的二代身份证原件,请确保图片清晰,四角完整</van-col>
    </van-row>
    <van-row type="flex" class="Card">

      <van-col span="12">
        <van-uploader :after-read="afterRead" :max-size="4 * 1024 * 1024" @oversize="onOversize" capture="camera" class="uploader">
          <img class="id-card" v-if="flag==0" src="../../assets/images/idcardpeople.png" >
          <img class="id-card" v-if="flag==1" :src="headImg">
        </van-uploader>
      </van-col>

      <van-col span="12">
        <van-uploader :after-read="afterRead2" :max-size="4 * 1024 * 1024" @oversize="onOversize" capture="camera" class="uploader">
          <img class="id-card" v-if="flag2==0" src="../../assets/images/idcardcountry.png" >
          <img class="id-card" v-if="flag2==1" :src="headImg2">
        </van-uploader>
      </van-col>

    </van-row>
    <van-row type="flex" class="CardName">
      <van-col span="12">拍摄人像面</van-col>
      <van-col span="12">拍摄国徽面</van-col>
    </van-row>
    <van-row type="flex" class="position">
      <van-col span="24">拍摄人注意事项</van-col>
    </van-row>
    <van-row type="flex" class="RuleCard">
      <van-col span="8"><img class="idcardp" src="../../assets/images/idcardpeople.png"></van-col>
      <van-col span="8"><img class="idcardp" src="../../assets/images/idcardpeople.png"></van-col>
      <van-col span="8"><img class="idcardp" src="../../assets/images/idcardpeople.png"></van-col>
    </van-row>
    <van-row type="flex" class="CardRule">
      <van-col span="8">四角完整</van-col>
      <van-col span="8">无明显高光</van-col>
      <van-col span="8">照片清晰</van-col>
    </van-row>
    <van-form style="margin-top:4%" @submit="volick()">
      <van-field v-model="pointCard" name="身份证号" label="身份证号" placeholder="身份证号"
                 :rules="[{ required: true, message: '请填写身份证号' }]" />
      <van-field v-model="name" name="姓名" label="姓名" placeholder="姓名" :rules="[{ required: true, message: '请填写姓名' }]" />
      <div style="margin: 16px;">
        <van-button class="vbutton" style="background-color: #3672F1; border-radius: 5px; "  block type="info" native-type="submit">下一步</van-button>
      </div>
    </van-form>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator";
import eventBus from "@/services/goBackEntity"
/*
* title
*/
@Component({
  name: "Recognition"
})
export default class Recognition extends Vue {
  //身份证号
  pointCard: string = "23232111978221";
  //姓名
  name: string = "";
  onOversize:any="3M";
  //实名认证
  tatleName = "实名认证"
  flag=0
  flag2=0
  headImg=""
  headImg2=""
  //button
  volick(){
    eventBus.$emit("idcard",this.pointCard);
    console.log(this.pointCard+"r")
    eventBus.$emit("name",this.name);


    this.$router.push({
      name: `Agreement`,
    })
  }
  afterRead(file:any) {
    this.flag=1
    this.headImg=file.content
    console.log(file.content);
  }
  afterRead2(file:any) {
    this.flag2=1
    this.headImg2=file.content
    console.log(file.content);
  }
  people() {

  }

}
</script>
<style scoped lang="scss">
.CardRules {
  font-size: 12px;
  color: #F59A23;
  text-align: center;
  margin-top: 5%;
}

.id-card {
  width: 85%;
}

.CardName {
  margin-top: 2%;
  text-align: center;
  font-size: 14px;
}

.Card {
  text-align: center;
  margin-top: 5%;
}

.position {
  margin-top: 7%;
  margin-left: 5%;
  font-size: 14px;
}

.idcardp {
  width: 85%;
}

.RuleCard {
  margin-left: 5%;
  margin-top: 2%;
}

.CardRule {
  text-align: center;
  margin-left: 2%;
  margin-top: 2%;
  font-size: 14px;
  color: #999999;
}
.vbutton{
  border-radius: 4%;
}
</style>