<template>
  <box title="产品概括">
    <ul>
      <li v-for="(item, index) in data.completions" :key="index">
        <img :src="iconUrl(item)" class="icon" />
        <div class="tag">{{ item.subject }}</div>
        <textarea placeholder="请输入" v-model="item.commit_answer"></textarea>
      </li>
    </ul>
  </box>
</template>

<script>
import Box from './Box.vue'
export default {
  components: { Box },
  props: {
    data: { type: Object }
  },
  data() {
    return {}
  },
  methods: {
    iconUrl(item) {
      const map = {
        product_overview_completion: 'https://webapp-pub.ezijing.com/x-training-new/products1.png',
        operation_mode_completion: 'https://webapp-pub.ezijing.com/x-training-new/products2.png',
        open_frequency_completion: 'https://webapp-pub.ezijing.com/x-training-new/products3.png',
        transaction_currency_completion: 'https://webapp-pub.ezijing.com/x-training-new/products4.png',
        fund_manager_completion: 'https://webapp-pub.ezijing.com/x-training-new/products5.png',
        fund_principal_completion: 'https://webapp-pub.ezijing.com/x-training-new/products6.png'
      }
      return map[item.tag]
    }
  }
}
</script>

<style lang="scss" scoped>
ul {
  padding-top: 27px;
  display: flex;
  flex-wrap: wrap;
  margin-right: -24px;
  li {
    margin-right: 18px;
    margin-bottom: 13px;
    width: 198px;
    height: 240px;
    background: #f1fcf9;
    border: 1px solid #b8ebde;
    border-radius: 12px;
    &:nth-child(2) {
      background: #ecfafc;
      border: 1px solid #b5ebeb;
      textarea {
        border-bottom: 1px solid #a5e1e9;
        color: #62c2d0;
      }
    }
    &:nth-child(3) {
      background: #fffdf0;
      border: 1px solid #f0eccb;
      margin-right: 0;
      textarea {
        border-bottom: 1px solid #dad396;
        color: #d9d292;
      }
    }
    &:nth-child(4) {
      background: #fdf8ee;
      border: 1px solid #ecd7aa;
      textarea {
        border-bottom: 1px solid #e2c485;
        color: #e2c485;
      }
    }
    &:nth-child(5) {
      background: #fcede9;
      border: 1px solid #f2c1b6;
      textarea {
        border-bottom: 1px solid #de9888;
        color: #de9888;
      }
    }
    &:nth-child(6) {
      background: #f1fcf9;
      border: 1px solid #b8ebde;
      margin-right: 0;
      textarea {
        border-bottom: 1px solid #7bc1af;
        color: #7bc1af;
      }
    }
    .icon {
      width: 82px;
      display: block;
      margin: 36px auto 18px;
    }
    .tag {
      text-align: center;
      font-size: 16px;
      color: #8e8e8e;
      line-height: 100%;
    }
    textarea {
      width: 150px;
      height: 43px;
      outline: none;
      resize: none;
      margin: 15px auto 0;
      display: block;
      border-bottom: 1px solid #7bc1af;
      background: none;
      color: #68b8a4;
      text-align: center;
      padding-top: 10px;
      &::-webkit-input-placeholder {
        font-size: 18px;
        color: #cacaca;
      }
    }
  }
}
</style>
