<template>
  <div class="list">
    <div class="line-box flex">
      <div class="line"></div>
    </div>
    <div class="item" @click="selectItem('USD')" :class="{'active': currency == 'USD'}">
      <div class="top flex">
        <van-image
          width="20"
          height="20"
          round
          fit="cover"
          src="/img/user/usd.png?14"
        />
        <div>
          <!-- 美元 -->
          {{ $t('common.l20') }}
        </div>
      </div>
      <img v-if="currency == 'USD'" class="check" src="/img/user/check.png" alt="极度证券">
    </div>
    <div class="item" @click="selectItem('CNY')" :class="{'active': currency == 'CNY'}">
      <div class="top flex">
        <van-image
          width="20"
          height="20"
          round
          fit="cover"
          src="/img/user/CN.png"
        />
        <div>
          <!-- 人民币 -->
          {{ $t('common.l21') }}
        </div>
      </div>
      <img v-if="currency == 'CNY'" class="check" src="/img/user/check.png" alt="极度证券">
    </div>
    <div class="item" @click="selectItem('HKD')" :class="{'active': currency == 'HKD'}">
      <div class="top flex">
        <van-image
          width="20"
          height="20"
          round
          fit="cover"
          src="/img/user/HK.png"
        />
        <div>
          <!-- 港币 -->
          {{ $t('common.l22') }}
        </div>
      </div>
      <img v-if="currency == 'HKD'" class="check" src="/img/user/check.png" alt="极度证券">
    </div>
  </div>
</template>
<script>
export default {
  props: ['currency'],
  data () {
    return {
      
    }
  },
  methods: {
    selectItem(item) {
      this.$emit('success', item)
    }
  }
}
</script>
<style lang="less" scoped>
.line-box {
  justify-content: center;
  margin-bottom: 28px;
  .line {
    width: 36px;
    height: 4px;
    background: #E7E7E7;
    border-radius: 2px;
  }
}
.list {
  padding: 15px 18px 46px;
  .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    height: 50px;
    font-size: 15px;
    color: #000000;
    padding: 0 20px;
    &.active {
      border-radius: 6px;
      border: 1px solid #858585;
    }
  }
  .top {
    column-gap: 6px;
  }
  .check {
    width: 13px;
  }
}
</style>