li.shaoyi 1 місяць тому
батько
коміт
0fd90a2a99
1 змінених файлів з 9 додано та 7 видалено
  1. 9 7
      src/packages/digital/views/contract/detail/index.vue

+ 9 - 7
src/packages/digital/views/contract/detail/index.vue

@@ -14,29 +14,31 @@
                     <tr>
                         <td>
                             <span class="text-small">账户权益(USDT)</span>
-                            <span>{{ accountItem.balance }}</span>
+                            <span>{{ accountItem.balance.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">浮动盈亏</span>
-                            <span>{{ formatDecimal(accountItem.profitLoss) }}</span>
+                            <span :class="handlePriceColor(accountItem.profitLoss)">{{ accountItem.profitLoss.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">风险率</span>
-                            <span :class="accountItem.hazardRatioColor">{{ parsePercent(accountItem.hazardRatio) }}</span>
+                            <span :class="accountItem.hazardRatioColor">
+                                {{ parsePercent(accountItem.hazardRatio) }}
+                            </span>
                         </td>
                     </tr>
                     <tr>
                         <td>
                             <span class="text-small">可用(USDT)</span>
-                            <span>{{ accountItem.avaiableBalance }}</span>
+                            <span>{{ accountItem.avaiableBalance.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">占用(USDT)</span>
-                            <span>{{ accountItem.usedmargin }}</span>
+                            <span>{{ accountItem.usedmargin.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">冻结(USDT)</span>
-                            <span>{{ accountItem.freezeMargin }}</span>
+                            <span>{{ accountItem.freezeMargin.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                     </tr>
                 </tbody>
@@ -70,7 +72,7 @@
 <script lang="ts" setup>
 import { shallowRef, computed } from 'vue'
 import { Cell, CellGroup, Tab, Tabs, Grid, GridItem, ActionSheet } from 'vant'
-import { formatDecimal,parsePercent } from '@/filters'
+import { handlePriceColor, parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import ContractOrder from '../components/order/index.vue'