<template>
  <view class="item-box">
    <view class="tripartite-item" v-for="(item,index) in tripartite">
      <view v-if="item.type===1">
        <item-title label="担保人信息" :line-type="index===0?1:3"></item-title>
        <view class="item-line">
          <identity-item @onShowImg="onShowImg"  :identity-two="item.identity_two" :identity-one="item.identity_one"></identity-item>
        </view>
        <item-text label="姓名" :value="item.name" key-str="name" :type-keys="typeKeys"></item-text>
        <item-text label="身份证" :value="item.id_number" key-str="id_number" :type-keys="typeKeys"></item-text>
        <view class="ban-item" v-for="(bank,bankIndex) in item.bank_data">
          <item-title :label="'银行卡信息('+(bankIndex+1)+')'" :title-type="2"></item-title>
          <item-text label="账户姓名" :value="bank.name"></item-text>
          <item-text label="银行卡号" :value="bank.bank_num"></item-text>
          <item-text label="所属银行" :value="bank.bank_name"></item-text>
        </view>

      </view>
      <view v-else>
        <item-title label="担保企业信息" :line-type="index===0?1:3"></item-title>
        <item-text label="企业名称" :value="item.name" key-str="name" :type-keys="typeKeys"></item-text>
        <item-text label="营业执照编号" :value="item.id_number" key-str="id_number" :type-keys="typeKeys"></item-text>
        <item-img label="营业执照" @onShowImg="onShowImg" :value="item.identity_one" key-str="identity_one" :type-keys="typeKeys"></item-img>
        <view class="ban-item" v-for="(bank,bankIndex) in item.bank_data">
          <item-title :label="'银行卡信息('+(bankIndex+1)+')'" :title-type="2"></item-title>
          <item-text label="账户姓名" :value="bank.name"></item-text>
          <item-text label="银行卡号" :value="bank.bank_num"></item-text>
          <item-text label="所属银行" :value="bank.bank_name"></item-text>
        </view>
      </view>

    </view>

  </view>
</template>

<script>
import ItemText from "@/pages-task/task-info/module/item-text";
import ItemTitle from "@/pages-task/task-info/module/item-title";
import IdentityItem from "@/pages-task/task-info/module/identity-item";
import ItemImg from "@/pages-task/task-info/module/item-img";

export default {
  name: "task-tripartite",
  components: {ItemImg, IdentityItem, ItemText, ItemTitle},
  props: {
    tripartite: {
      default: []
    },
    typeKeys: {
      default: []
    }
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {

  },
  methods: {
    onShowImg(img){
      this.$emit('onShowImg',img)
    }
  }
}
</script>

<style scoped lang="scss">
@import "@/static/css/task-info/item";
</style>
