|
|
@@ -18,19 +18,21 @@
|
|
|
</RadioGroup>
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field name="OrderPrice" :rules="formRules.OrderPrice" :label="$t('quote.swap.orderprice1')" v-if="priceMove === 2">
|
|
|
+ <Field name="OrderPrice" :rules="formRules.OrderPrice" :label="$t('quote.swap.orderprice1')"
|
|
|
+ v-if="priceMove === 2">
|
|
|
<template #input>
|
|
|
<div class="g-qty-group__stepper">
|
|
|
<Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :auto-fixed="false"
|
|
|
- :step="0.01" @change="calculateListingAmount"/>
|
|
|
+ :step="0.01" @change="calculateListingAmount" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field name="MarketMaxSub" :rules="formRules.MarketMaxSub" :label="$t('quote.swap.marketmaxsub')" v-if="priceMove === 3">
|
|
|
+ <Field name="MarketMaxSub" :rules="formRules.MarketMaxSub" :label="$t('quote.swap.marketmaxsub')"
|
|
|
+ v-if="priceMove === 3">
|
|
|
<template #input>
|
|
|
<div class="g-qty-group__stepper">
|
|
|
- <Stepper v-model="formData.MarketMaxSub" theme="round" :max="maxspread" :min="minspread" button-size="22" :auto-fixed="true"
|
|
|
- :step="0.01" @change="calculateListingAmount" integer/>
|
|
|
+ <Stepper v-model="formData.MarketMaxSub" theme="round" :max="maxspread" :min="minspread"
|
|
|
+ button-size="22" :auto-fixed="true" :step="0.01" @change="calculateListingAmount" integer />
|
|
|
</div>
|
|
|
</template>
|
|
|
</Field>
|
|
|
@@ -38,8 +40,8 @@
|
|
|
<template #input>
|
|
|
<div class="g-qty-group">
|
|
|
<div class="g-qty-group__stepper">
|
|
|
- <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0"
|
|
|
- :step="qtyStep" integer @change="calculateListingAmount"/>
|
|
|
+ <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
|
|
|
+ integer @change="calculateListingAmount" />
|
|
|
</div>
|
|
|
<RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
|
|
|
<Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
|
|
|
@@ -53,7 +55,7 @@
|
|
|
<span :class="quote?.lastColor">{{ formatDecimal(estimateprice) }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field :label="$t('quote.swap.referenceprice')" v-if="priceMove === 2">
|
|
|
+ <Field :label="$t('quote.swap.referenceprice')" v-if="priceMove === 2">
|
|
|
<template #input>
|
|
|
<span :class="quote?.lastColor">{{ quote?.last ?? 0.0 }}</span>
|
|
|
</template>
|
|
|
@@ -87,15 +89,16 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, PropType, computed } from 'vue'
|
|
|
-import { Form, FormInstance, Button, FieldRule, Field, Tab, Tabs, Stepper, Radio, RadioGroup } from 'vant'
|
|
|
+import { Form, FormInstance, Button, FieldRule, Field, Tab, Tabs, Radio, RadioGroup } from 'vant'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryTjmdTodayAccountMargin } from '@/services/api/swap'
|
|
|
-import { useAccountStore, useFuturesStore, useUserStore, i18n} from '@/stores'
|
|
|
+import { useAccountStore, useFuturesStore, useUserStore, i18n } from '@/stores'
|
|
|
import { formatDecimal } from '@/filters'
|
|
|
import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
|
|
|
import AppPopup from '@mobile/components/base/popup/index.vue'
|
|
|
+import Stepper from '@mobile/components/base/stepper/index.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
|
item: {
|
|
|
@@ -115,7 +118,7 @@ const userStore = useUserStore()
|
|
|
// 数量步长列表
|
|
|
const qtyStepList = [1, 5, 10, 20, 30, 50]
|
|
|
// 数量步长
|
|
|
-const qtyStep = shallowRef(qtyStepList[0])
|
|
|
+const qtyStep = shallowRef(qtyStepList[0])
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const showModal = shallowRef(true)
|
|
|
const refresh = shallowRef(true) // 是否刷新父组件数据
|
|
|
@@ -132,9 +135,9 @@ const quote = futuresStore.getGoodsQuote(props.item.refgoodsid) ?? {}
|
|
|
/// 保证金参数设置
|
|
|
const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
|
|
|
/// 商品信息
|
|
|
-const goods = computed(() => futuresStore.getGoods(props.item.goodsid) )
|
|
|
+const goods = computed(() => futuresStore.getGoods(props.item.goodsid))
|
|
|
/// 上下点差范围
|
|
|
-const { maxspread = 1000, minspread = -1000, marketid, goodsid } = futuresStore.getGoods(props.item.goodsid) ?? {}
|
|
|
+const { maxspread = 1000, minspread = -1000, marketid, goodsid } = futuresStore.getGoods(props.item.goodsid) ?? {}
|
|
|
/// 估算价
|
|
|
const estimateprice = shallowRef(quote.value?.last ?? 0.0)
|
|
|
/// 买卖方向
|
|
|
@@ -166,26 +169,26 @@ const calculateListingAmount = () => {
|
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
|
/// 按比例
|
|
|
if (MarginAlgorithm === 1) {
|
|
|
- permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
|
|
|
+ permargin.value = OrderPrice * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
|
- amount.value = OrderQty*OrderPrice*agreeunit
|
|
|
+ amount.value = OrderQty * OrderPrice * agreeunit
|
|
|
} else {
|
|
|
const last = futuresStore.getQuotePrice(props.item.refgoodscode)
|
|
|
const basic = formData.MarketMaxSub ?? 0.0
|
|
|
/// 浮动估算价价
|
|
|
- estimateprice.value = basic+last.value
|
|
|
+ estimateprice.value = basic + last.value
|
|
|
const { MarginAlgorithm, MarketMarginValue } = margin.value?.infoc
|
|
|
const { OrderQty = 0 } = formData
|
|
|
const { agreeunit = 0 } = goods.value ?? {}
|
|
|
/// 按比例
|
|
|
if (MarginAlgorithm === 1) {
|
|
|
- permargin.value = estimateprice.value*OrderQty*agreeunit*MarketMarginValue
|
|
|
+ permargin.value = estimateprice.value * OrderQty * agreeunit * MarketMarginValue
|
|
|
} else {
|
|
|
- permargin.value = OrderQty*MarketMarginValue
|
|
|
+ permargin.value = OrderQty * MarketMarginValue
|
|
|
}
|
|
|
- amount.value = OrderQty*estimateprice.value*agreeunit
|
|
|
+ amount.value = OrderQty * estimateprice.value * agreeunit
|
|
|
}
|
|
|
}
|
|
|
}
|