|
|
@@ -3,19 +3,19 @@
|
|
|
<app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
|
|
|
<app-view class="g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar title="挂牌" @back="closed" />
|
|
|
+ <app-navbar title="$t('operation.listing')" @back="closed" />
|
|
|
</template>
|
|
|
<component :is="Price" v-bind="{ goodsCode }" />
|
|
|
<component :is="Forex" v-bind="{ goodsCode, showMore: false }" @price-click="onPriceClick" />
|
|
|
<Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
|
<CellGroup inset>
|
|
|
- <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格">
|
|
|
+ <Field name="OrderPrice" :rules="formRules.OrderPrice" :label="$t('quote.transfer.price')">
|
|
|
<template #input>
|
|
|
<Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
|
|
|
:auto-fixed="false" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
|
|
|
+ <Field name="OrderQty" :rules="formRules.OrderQty" :label="$t('quote.transfer.qty')">
|
|
|
<template #input>
|
|
|
<div class="g-qty-group">
|
|
|
<div class="g-qty-group__stepper">
|
|
|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</Field>
|
|
|
- <Field label="可用资金">
|
|
|
+ <Field :label="$t('quote.avaiableMoney')">
|
|
|
<template #input>
|
|
|
<span>{{ accountStore.currentAccount.avaiableMoney?.toFixed(2) }}</span>
|
|
|
</template>
|
|
|
@@ -39,11 +39,11 @@
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer">
|
|
|
<Button block square type="danger" @click="formRef?.submit"
|
|
|
- v-if="buyOrSell === BuyOrSell.Buy && !quote?.iscannotbuy">订立买入</Button>
|
|
|
+ v-if="buyOrSell === BuyOrSell.Buy && !quote?.iscannotbuy">{{ $t('quote.orderbuy') }}</Button>
|
|
|
<Button block square color="#199e00"
|
|
|
:disabled="!formData.OrderQty || !enableqty || (formData.OrderQty > enableqty)"
|
|
|
@click="formRef?.submit" v-if="buyOrSell === BuyOrSell.Sell">
|
|
|
- <span>转让卖出</span>
|
|
|
+ <span>{{ $t('quote.transfersell') }}</span>
|
|
|
<span v-if="enableqty">(≤{{ enableqty }})</span>
|
|
|
</Button>
|
|
|
</div>
|
|
|
@@ -59,10 +59,10 @@ import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { useAccountStore, useFuturesStore } from '@/stores'
|
|
|
-import AppModal from '@/components/base/modal/index.vue'
|
|
|
+import { useAccountStore, useFuturesStore, i18n } from '@/stores'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { EPriceMode, EValidType, EListingSelectType, EBuildType, EDelistingType } from '@/constants/client'
|
|
|
+import AppModal from '@/components/base/modal/index.vue'
|
|
|
|
|
|
const Price = defineAsyncComponent(() => import('@mobile/components/modules/quote/price/index.vue'))
|
|
|
const Forex = defineAsyncComponent(() => import('@mobile/components/modules/quote/forex/index.vue'))
|
|
|
@@ -78,6 +78,7 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
const accountStore = useAccountStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
@@ -105,13 +106,13 @@ const { dataList, run: getMineTradePositionExs } = useRequest(queryMineTradePosi
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
OrderPrice: [{
|
|
|
- message: '请输入价格',
|
|
|
+ message: t('quote.transfer.tips1'),
|
|
|
validator: () => {
|
|
|
return !!formData.OrderPrice
|
|
|
}
|
|
|
}],
|
|
|
OrderQty: [{
|
|
|
- message: '请输入数量',
|
|
|
+ message: t('quote.transfer.tips2'),
|
|
|
validator: () => {
|
|
|
return !!formData.OrderQty
|
|
|
}
|
|
|
@@ -147,7 +148,7 @@ const onSubmit = () => {
|
|
|
fullloading((hideLoading) => {
|
|
|
formSubmit().then(() => {
|
|
|
hideLoading()
|
|
|
- dialog('提交成功').then(() => closed(true))
|
|
|
+ dialog(t('quote.transfer.tips3')).then(() => closed(true))
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|