li.shaoyi 1 개월 전
부모
커밋
bb97e2d3b3

+ 3 - 3
src/packages/digital/views/contract/components/position/detail/close/index.vue

@@ -10,20 +10,20 @@
                     <Cell title="持仓单号" :value="selectedItem.tradeid" />
                     <Cell title="代码/名称" :value="`${selectedItem.goodscode}/${selectedItem.goodsname}`" />
                     <Cell title="持仓方向" :value="getBuyOrSellName(selectedItem.buyorsell)" />
-                    <Cell title="持仓价格(USDT)" :value="round(selectedItem.holderprice, selectedItem.decimalplace)" />
+                    <Cell title="持仓价格(USDT)" :value="selectedItem.holderprice.toFixed(selectedItem.decimalplace)" />
                     <Cell title="持仓量" :value="selectedItem.holderqty" />
                     <Cell title="冻结量" :value="selectedItem.freezeqty" />
                     <Cell title="行情价格" :value="floatingPL.lastPrice">
                         <template #value>
                             <span :class="floatingPL.lastPriceClass">
-                                {{ round(floatingPL.lastPrice, selectedItem.decimalplace) }}
+                                {{ floatingPL.lastPrice.toFixed(selectedItem.decimalplace) }}
                             </span>
                         </template>
                     </Cell>
                     <Cell title="浮动盈亏">
                         <template #value>
                             <span :class="floatingPL.profitLossClass">
-                                {{ round(floatingPL.profitLoss, selectedItem.decimalplace) }}
+                                {{ floatingPL.profitLoss.toFixed(selectedItem.decimalplace) }}
                             </span>
                         </template>
                     </Cell>

+ 1 - 2
src/packages/digital/views/contract/components/position/detail/index.vue

@@ -23,7 +23,7 @@
                             <td colspan="3">
                                 <span class="text-small">浮动盈亏({{ getGoodsCurrencyItemName(item.currencyid) }})</span>
                                 <span :class="item.profitLossClass">
-                                    {{ round(item.profitLoss, item.decimalplace) }}
+                                    {{ item.profitLoss.toFixed(item.decimalplace) }}
                                 </span>
                             </td>
                         </tr>
@@ -74,7 +74,6 @@
 <script lang="ts" setup>
 import { shallowRef, PropType, defineAsyncComponent, computed } from 'vue'
 import { Button } from 'vant'
-import { round } from 'lodash'
 import { formatDate } from '@/filters'
 import { getBuyOrSellName, getGoodsCurrencyItemName } from '@/constants/order'
 import { useRequest } from '@/hooks/request'

+ 2 - 3
src/packages/digital/views/contract/components/position/list/close/index.vue

@@ -15,14 +15,14 @@
                     <Cell title="行情价格">
                         <template #value>
                             <span :class="selectedRow.lastPriceClass">
-                                {{ round(selectedRow.lastPrice, selectedRow.decimalplace) }}
+                                {{ selectedRow.lastPrice.toFixed(selectedRow.decimalplace) }}
                             </span>
                         </template>
                     </Cell>
                     <Cell title="浮动盈亏">
                         <template #value>
                             <span :class="selectedRow.profitLossClass">
-                                {{ round(selectedRow.profitLoss, selectedRow.decimalplace) }}
+                                {{ selectedRow.profitLoss.toFixed(selectedRow.decimalplace) }}
                             </span>
                         </template>
                     </Cell>
@@ -57,7 +57,6 @@
 <script lang="ts" setup>
 import { shallowRef, PropType, onMounted, computed } from 'vue'
 import { CellGroup, Cell, Button, FieldRule, Form, Field, FormInstance } from 'vant'
-import { round } from 'lodash'
 import { dialog, fullloading } from '@/utils/vant'
 import { getBuyOrSellName, BuyOrSell, getPricemode2List } from '@/constants/order'
 import { useOrder } from '@/business/trade'

+ 1 - 2
src/packages/digital/views/contract/components/position/list/index.vue

@@ -15,7 +15,7 @@
                     <td colspan="2">
                         <span class="text-small">浮动盈亏({{ getGoodsCurrencyItemName(item.currencyid) }})</span>
                         <span :class="item.profitLossClass">
-                            {{ round(item.profitLoss, item.decimalplace) }}
+                            {{ item.profitLoss.toFixed(item.decimalplace) }}
                         </span>
                     </td>
                     <td>
@@ -69,7 +69,6 @@
 <script lang="ts" setup>
 import { PropType, shallowRef, defineAsyncComponent, computed } from 'vue'
 import { Button, Icon } from 'vant'
-import { round } from 'lodash'
 import { useComponent } from '@/hooks/component'
 import { getBuyOrSellName, getGoodsCurrencyItemName } from '@/constants/order'
 import { usePositionStore } from '@/stores'

+ 8 - 5
src/packages/digital/views/wallet/components/contract/index.vue

@@ -17,25 +17,27 @@
                     <tr>
                         <td colspan="2">
                             <span class="text-small">账户权益(USDT)</span>
-                            <span>{{ item.balance }}</span>
+                            <span>{{ item.balance.toFixed(item.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">浮动盈亏</span>
-                            <span>{{ item.profitLoss }}</span>
+                            <span :class="handlePriceColor(item.profitLoss)">
+                                {{ item.profitLoss.toFixed(item.currencydecimalplace) }}
+                            </span>
                         </td>
                     </tr>
                     <tr>
                         <td>
                             <span class="text-small">可用(USDT)</span>
-                            <span>{{ item.avaiableBalance }}</span>
+                            <span>{{ item.avaiableBalance.toFixed(item.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">占用(USDT)</span>
-                            <span>{{ item.usedmargin }}</span>
+                            <span>{{ item.usedmargin.toFixed(item.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">冻结(USDT)</span>
-                            <span>{{ item.freezemargin }}</span>
+                            <span>{{ item.freezemargin.toFixed(item.currencydecimalplace) }}</span>
                         </td>
                     </tr>
                 </tbody>
@@ -46,6 +48,7 @@
 
 <script lang="ts" setup>
 import { Icon } from 'vant'
+import { handlePriceColor } from '@/filters'
 import { useAccountStore } from '@/stores'
 
 const emit = defineEmits(['click'])