|
@@ -41,11 +41,11 @@
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
<!-- 市价 -->
|
|
<!-- 市价 -->
|
|
|
- <Field label="价格" v-if="formData.PriceMode === PriceMode.Market">
|
|
|
|
|
|
|
+ <!-- <Field label="价格" v-if="formData.PriceMode === PriceMode.Market">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<span>{{ handleNumberValue(marketPrice) }}</span>
|
|
<span>{{ handleNumberValue(marketPrice) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- </Field>
|
|
|
|
|
|
|
+ </Field> -->
|
|
|
<!-- 允许成交范围 -->
|
|
<!-- 允许成交范围 -->
|
|
|
<Field name="MarketMaxSub" label="允许成交范围" v-if="formData.PriceMode === PriceMode.Market">
|
|
<Field name="MarketMaxSub" label="允许成交范围" v-if="formData.PriceMode === PriceMode.Market">
|
|
|
<template #input>
|
|
<template #input>
|
|
@@ -57,7 +57,7 @@
|
|
|
<Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格" v-if="formData.PriceMode === PriceMode.Limit">
|
|
<Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格" v-if="formData.PriceMode === PriceMode.Limit">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
|
|
<Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
|
|
|
- :auto-fixed="false" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
|
|
|
|
|
|
|
+ :auto-fixed="false" :decimal-length="decimalplace" :step="decimalvalue" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
<!-- <Field name="SlPrice" :rules="formRules.SlPrice"
|
|
<!-- <Field name="SlPrice" :rules="formRules.SlPrice"
|
|
@@ -67,7 +67,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<Stepper v-model="formData.SlPrice" :disabled="!sl" theme="round" button-size="22" allow-empty
|
|
<Stepper v-model="formData.SlPrice" :disabled="!sl" theme="round" button-size="22" allow-empty
|
|
|
- :default-value="0" :min="0" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
|
|
|
|
|
|
|
+ :default-value="0" :min="0" :decimal-length="decimalplace" :step="decimalvalue" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field> -->
|
|
</Field> -->
|
|
|
<!-- <Field name="SpPrice" :rules="formRules.SpPrice"
|
|
<!-- <Field name="SpPrice" :rules="formRules.SpPrice"
|
|
@@ -77,7 +77,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<Stepper v-model="formData.SpPrice" :disabled="!sp" theme="round" button-size="22" allow-empty
|
|
<Stepper v-model="formData.SpPrice" :disabled="!sp" theme="round" button-size="22" allow-empty
|
|
|
- :default-value="0" :min="0" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
|
|
|
|
|
|
|
+ :default-value="0" :min="0" :decimal-length="decimalplace" :step="decimalvalue" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field> -->
|
|
</Field> -->
|
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy || quote?.tradeproperty !== 2">
|
|
<template v-if="formData.BuyOrSell === BuyOrSell.Buy || quote?.tradeproperty !== 2">
|
|
@@ -131,9 +131,8 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { useFuturesStore, useAccountStore, usePositionStore } from '@/stores'
|
|
import { useFuturesStore, useAccountStore, usePositionStore } from '@/stores'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
-import { handleNumberValue } from '@/filters'
|
|
|
|
|
import { shallowRef, onMounted, computed, defineAsyncComponent } from 'vue'
|
|
import { shallowRef, onMounted, computed, defineAsyncComponent } from 'vue'
|
|
|
-import { Form, Field, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox, CellGroup } from 'vant'
|
|
|
|
|
|
|
+import { Form, Field, Button, FieldRule, FormInstance, Radio, RadioGroup, CellGroup } from 'vant'
|
|
|
import { useOrder } from '@/business/trade'
|
|
import { useOrder } from '@/business/trade'
|
|
|
import { BuyOrSell, getBuyOrSellList, BuildType, getPricemode2List, PriceMode } from '@/constants/order'
|
|
import { BuyOrSell, getBuyOrSellList, BuildType, getPricemode2List, PriceMode } from '@/constants/order'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
@@ -162,6 +161,12 @@ const formRef = shallowRef<FormInstance>()
|
|
|
const { formData, formSubmit } = useOrder()
|
|
const { formData, formSubmit } = useOrder()
|
|
|
|
|
|
|
|
const quote = futuresStore.getGoodsQuote(props.goodsCode)
|
|
const quote = futuresStore.getGoodsQuote(props.goodsCode)
|
|
|
|
|
+// 小数位以及步进值
|
|
|
|
|
+const { decimalplace = 0.0 } = quote.value ?? {}
|
|
|
|
|
+const quoteminunit = quote.value?.quoteminunit ?? 1.0
|
|
|
|
|
+const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
|
|
|
|
|
+
|
|
|
|
|
+// 计算市价
|
|
|
const marketPrice = computed(() => {
|
|
const marketPrice = computed(() => {
|
|
|
const { ask = 0, bid = 0 } = quote.value ?? {}
|
|
const { ask = 0, bid = 0 } = quote.value ?? {}
|
|
|
return formData.BuyOrSell === BuyOrSell.Buy ? ask : bid
|
|
return formData.BuyOrSell === BuyOrSell.Buy ? ask : bid
|