<template>
  <div class="li">
    <div class="top flex">
      <div class="tag">
        <!-- 合约交易 -->
        {{ $t('inform.l4') }}
      </div>
      <div class="title" v-if="item.content.action == 'openEntrust'">
        <!-- 挂单成功 -->
        {{ $t('inform.l5') }}
      </div>
      <div class="title" v-if="item.content.action == 'deleteEntrust'">
        <!-- 删除挂单成功 -->
        {{ $t('inform.l34') }}
      </div>
      <div class="title" v-if="item.content.action == 'updateEntrust'">
        <!-- 更新挂单成功 -->
        {{ $t('inform.l6') }}
      </div>
    </div>
    <div class="row">
      <div class="label">
        <!-- 交易品种 -->
        {{ $t('inform.l7') }}
      </div>
      <div class="text">{{item.content.symbol}}</div>
    </div>
    <div class="row" v-if="item.content.action != 'deleteEntrust'">
      <div class="label">
        <!-- 交易类型 -->
        {{ $t('account.l43') }}
      </div>
      <div class="text">{{orderPtions[item.content.cmd]}}</div>
    </div>
    <div class="row">
      <div class="label">
        <!-- 交易价格 -->
        {{ $t('inform.l8') }}
      </div>
      <div class="text">{{$handleDigits2(Number(item.content.price))}}</div>
    </div>
    <div class="row" v-if="item.content.volume">
      <div class="label">
        <!-- 交易数量 -->
        {{ $t('inform.l9') }}
      </div>
      <div class="text">{{$bigDecimal.divide(item.content.volume, 100, 2)}} lots</div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['item'],
  data () {
    return {
      orderPtions: {
        // '2': '低价买入',
        // '3': '高价卖出',
        // '4': '高价买入',
        // '5': '低价卖出',
        '2': this.$t('exchange.l7'),
        '3': this.$t('exchange.l8'),
        '4': this.$t('exchange.l9'),
        '5': this.$t('exchange.l10'),
      },
    }
  }
}
</script>
<style lang="less" scoped>
.tag {
  border: 1px solid rgba(77, 127, 255, 0.25);
  color: #4D7FFF;
}
</style>