| | |
| | | </div> |
| | | <div class="info-row"> |
| | | <div class="info-label">{{ $t('盈亏') }}</div> |
| | | <div class="info-value red"> |
| | | <div class="info-value" :class="getProfitClass(recordData.profit)"> |
| | | {{ recordData.profitPercent ? (recordData.profitPercent + '%') : '--%' }} |
| | | ({{ recordData.profit || '0.00' }}USDT) |
| | | </div> |
| | |
| | | }).catch(err => { |
| | | showToast(err.msg || err || t('申购失败')) |
| | | }) |
| | | } |
| | | |
| | | // 根据盈亏值返回对应的样式类 |
| | | const getProfitClass = (profit) => { |
| | | if (!profit && profit !== 0) return '' |
| | | const profitNum = parseFloat(profit) |
| | | if (profitNum > 0) { |
| | | return 'green' |
| | | } else if (profitNum < 0) { |
| | | return 'red' |
| | | } |
| | | return '' |
| | | } |
| | | |
| | | // 卖出 |
| | |
| | | &.red { |
| | | color: #f43368; |
| | | } |
| | | |
| | | &.green { |
| | | color: #06CDA5; |
| | | } |
| | | } |
| | | } |
| | | |