<template>
  <div>
    <div class="com">
      <div class="title">
        <!-- 结束跟单 -->
        {{ $t('follow.l36') }}
      </div>
      <div class="col flex">
        <div class="lab">
          <!-- 总盈亏 -->
          {{ $t('follow.l37') }}
        </div>
        <div class="amount">
          {{ info.profit > 0 ? '+' : '' }} {{ $numToThousand(info.profit) }} USD
        </div>
      </div>
      <div class="col flex">
        <div class="lab">
          <!-- 预计分润金额 -->
          {{ $t('follow.l38') }}
        </div>
        <div class="amount">
          {{ info.expert_profit > 0 ? '+' : '' }} {{ $numToThousand(info.expert_profit) }} USD
        </div>
      </div>
      <div class="col flex">
        <div class="lab">
          <!-- 预计收款金额 -->
          {{ $t('follow.l39') }}
        </div>
        <div class="amount down">
          {{ $numToThousand($bigDecimal.subtract(info.profit, info.expert_profit)) }} USD
        </div>
      </div>
      <div class="box">
        <div class="text">
          <span class="span">*</span>{{ $t('follow.l40') }}
          <!-- *结束跟单会立刻使用市价平仓，若当前尚未开市，则将在开市时使用市价平仓，并在扣除分润金额后自动结算。 -->
        </div>
        <div>
          <!-- 由于平仓时可能产生价格波动，交易盈亏、分润金额以及结算金额可能与展示不一致。 -->
          <i class="el-icon-info span"></i>{{ $t('follow.l41') }}
        </div>
      </div>
    </div>
    <div class="btns flex">
      <div class="btn" @click="updateFollow">
        <!-- 确认 -->
        {{ $t('common.l3') }}
      </div>
    </div>
  </div>
</template>
<script>
import { updateFollow } from "@/api/copy";
export default {
  props: ['info'],
  methods: {
    updateFollow() {
      var data = {
        eid: this.info.eid,
        status: 0,
      }
      this.fullscreenLoading = true
      updateFollow(data).then(() => {
        this.$notify({
          // message: '操作成功',
          message: this.$t('common.l52'),
          type: 'success'
        });
        this.$emit('success')
      }).catch(() => {
      }).finally(() => {
        this.fullscreenLoading = false
      })
    },
  }
}
</script>
<style lang="less" scoped>
.com {
  padding: 20px 16px 10px;
  .title {
    font-weight: 600;
    font-size: 16px;
    padding-bottom: 7px;
  }
}
.col {
  padding-top: 20px;
  justify-content: space-between;
  .lab {
    color: #B6B6B6;
    opacity: 0.88;
  }
}
.box {
  margin-top: 23px;
  border-top: 1px solid #F6F6F6;
  color: rgba(182, 182, 182, 0.88);
  padding: 4px 0 16px;
  line-height: 22px;
  .text {
    padding-top: 12px;
  }
  .span {
    color: #F6465D;
  }
}
.btns {
  padding: 0 13px 10px;
}
.btn {
  flex: 1;
  background-color: #000;
  line-height: 50px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}
</style>