Handy_Cao 2 年之前
父節點
當前提交
c0b0c14ef2

+ 24 - 7
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -26,7 +26,7 @@
             </Field>
             <Field label="挂牌价格" v-if="priceMove === 2">
                 <template #input>
-                    <span>{{ selectedRow.orderprice }}</span>
+                    <span :class="quote?.lastColor">{{ selectedRow.pricemode === 3 ? (selectedRow.marketmaxsub+(quote?.last ?? 0.0)).toFixed(goods?.decimalplace ?? 2.0) : selectedRow.orderprice }}</span>
                 </template>
             </Field>
             <Field label="挂牌价格" v-if="selectedRow.pricemode === 3">
@@ -131,6 +131,8 @@ const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
 const goods = computed(() => futuresStore.getGoods(props.selectedRow.goodsid) ) 
 /// 默认价格为挂牌价格
 formData.OrderPrice = props.selectedRow.orderprice ?? 0.0
+/// 商品价格
+const quote = futuresStore.getGoodsQuote(props.item?.refgoodsid ?? 0)
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
@@ -176,15 +178,30 @@ const calculateDelistingAmount = () => {
     if (margin.value?.infoc) {
         const { MarginAlgorithm, MarketMarginValue } = margin.value?.infoc
         const { OrderQty = 0 } = formData
-        const { OrderPrice = 0.0 } = formData
         const { agreeunit = 0 } = goods.value ?? {}
-        /// 按比例
-        if (MarginAlgorithm === 1) {
-            permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
+        const { marketmaxsub } = props.selectedRow
+        // 浮动价
+        if (props.selectedRow.pricemode === 3) {
+            if (MarginAlgorithm === 1) {
+                /// 价格*数量*合约单位*保证金比例
+                permargin.value = ((quote.value?.last ?? 0.0)+(marketmaxsub))*OrderQty*agreeunit*MarketMarginValue
+            } else {
+                /// 数量*保证金值
+                permargin.value = OrderQty*MarketMarginValue
+            }
+            amount.value = OrderQty*((quote.value?.last ?? 0.0)+(marketmaxsub))*agreeunit
         } else {
-            permargin.value = OrderPrice*MarketMarginValue
+            const { OrderPrice = 0.0 } = formData
+            /// 按比例
+            if (MarginAlgorithm === 1) {
+                /// 价格*数量*合约单位*保证金比例
+                permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
+            } else {
+                /// 数量*保证金值
+                permargin.value = OrderQty*MarketMarginValue
+            }
+            amount.value = OrderQty*OrderPrice*agreeunit
         }
-        amount.value = OrderQty*OrderPrice*agreeunit
     }
 }
 

+ 1 - 0
src/packages/pc/views/market/trade/swap/detail/order/delisting/index.vue

@@ -140,6 +140,7 @@ const calculateDelistingAmount = () => {
         const { OrderQty = 0 } = formData
         const { agreeunit = 0 } = goods.value ?? {}
         const { marketmaxsub } = props.selectedRow
+        // 浮动价
         if (props.selectedRow.pricemode === 3) {
             if (MarginAlgorithm === 1) {
                 /// 价格*数量*合约单位*保证金比例