<template>
  <div class="list">
    <div class="line-box flex">
      <div class="line"></div>
    </div>
    <div class="item" @click="selectItem(index)" :class="{'active': index == status}" v-for="(item, index) in statusText" :key="index">
      <div class="top flex">
        <div>{{ item }}</div>
      </div>
      <img class="check" src="/img/user/check.png" alt="极度证券">
    </div>
    <div class="btn-box flex">
      <div class="btn ltn" @click="reset">
        <!-- 重置 -->
        {{ $t('common.l44') }}
      </div>
      <div class="btn rtn" @click="submit">
        <!-- 确认 -->
        {{ $t('common.l3') }}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['status1'],
  data () {
    return {
      status: '',
      statusText: {
        // '1': '未支付',
        // '2': '待审核',
        // '3': '已驳回',
        // '4': '处理中',
        // '5': '已撤销',
        // '100': '已完成',
        '1': this.$t('ajax.201'),
        '2': this.$t('ajax.350'),
        '3': this.$t('ajax.408'),
        '4': this.$t('ajax.401'),
        '5': this.$t('ajax.404'),
        '100': this.$t('ajax.403'),
      },
    }
  },
  created () {
    this.status = this.status1
  },
  methods: {
    selectItem(item) {
      this.status = item
    },
    submit() {
      this.$emit('success', this.status)
    },
    reset() {
      this.status = ''
    }
  }
}
</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;
  .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;
      .check {
        display: block;
      }
    }
  }
  .top {
    column-gap: 6px;
  }
  .check {
    width: 13px;
    display: none;
  }
}
.btn-box {
  column-gap: 11px;
  padding-top: 18px;
  .btn {
    flex: 1;
    line-height: 38px;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
  }
  .ltn {
    border: 1px solid #DEDEDE;
  }
  .rtn {
    border: 1px solid #000000;
    background-color: #000000;
    color: #fff;
  }
}
</style>