Handy_Cao преди 1 месец
родител
ревизия
b4cfd75477
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/packages/digital/views/contract/components/position/close/index.vue

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

@@ -92,8 +92,8 @@ const maxQty = computed(() => {
 const closepl = computed(() => {
     const { holderQty, buyOrSell, holderAmount } = props.selectedRow.tHDetailEx
     const { agreeUnit } = props.selectedRow
-    const { presettle = 0, last = 0 } = quote.value ?? {}
-    const price = last || presettle // 没有最新价取昨结价
+    const { presettle = 0, ask = 0, bid = 0 } = quote.value ?? {}
+    const price = (buyOrSell === BuyOrSell.Buy ? ask : bid) || presettle // 没有最新价取昨结价
     // 计算市值 = 现价 * 数量 * 合约单位
     const marketValue = price ? price * holderQty * agreeUnit : 0