|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<app-view class="listing-goods-detail g-layout g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="quote ? quote.goodscode : '交易'">
|
|
|
+ <app-navbar :title="quote ? quote.goodscode : t('tabbar.trade')">
|
|
|
<template #right>
|
|
|
<img :src="'./img/icons/chart.svg'" @click="navigateToGoodsChart" />
|
|
|
</template>
|
|
|
@@ -12,13 +12,13 @@
|
|
|
<div class="trade-panel__right">
|
|
|
<app-submitbar>
|
|
|
<Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'default'" size="small" block
|
|
|
- @click="formData.BuyOrSell = BuyOrSell.Buy">买入</Button>
|
|
|
+ @click="formData.BuyOrSell = BuyOrSell.Buy">{{ $t('quote.buy') }}</Button>
|
|
|
<Button :type="formData.BuyOrSell === BuyOrSell.Sell ? 'danger' : 'default'" size="small" block
|
|
|
- @click="formData.BuyOrSell = BuyOrSell.Sell">卖出</Button>
|
|
|
+ @click="formData.BuyOrSell = BuyOrSell.Sell">{{ $t('quote.sell') }}</Button>
|
|
|
</app-submitbar>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
|
<CellGroup inset>
|
|
|
- <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格" label-align="top">
|
|
|
+ <Field name="OrderPrice" :rules="formRules.OrderPrice" :label="t('quote.goods.orderprice')" label-align="top">
|
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderPrice" :min="0"
|
|
|
:decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
|
|
|
@@ -26,7 +26,7 @@
|
|
|
</Field>
|
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
|
- <Field label="数量" label-align="top" :rules="formRules.OrderQty">
|
|
|
+ <Field :label="t('quote.goods.orderqty')" label-align="top" :rules="formRules.OrderQty">
|
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderQty" :min="0"
|
|
|
:decimal-length="baseAccount?.currencydecimalplace" />
|
|
|
@@ -34,7 +34,7 @@
|
|
|
</Field>
|
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
|
- <Cell :title="formData.BuyOrSell === BuyOrSell.Buy ? '预估支付' : '预估获取'"
|
|
|
+ <Cell :title="formData.BuyOrSell === BuyOrSell.Buy ? t('digital.prepayment') : t('digital.preacquisition')"
|
|
|
:label="formatDecimal(calculations.estimatedAmount, quoteAccount?.currencydecimalplace)" />
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
@@ -43,19 +43,19 @@
|
|
|
<app-block class="trade-info" v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
|
<ul>
|
|
|
<li>
|
|
|
- <span class="text-small">预估手续费</span>
|
|
|
+ <span class="text-small">{{ $t('digital.buyEstimatedFee') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.buyEstimatedFee, quoteAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <span class="text-small">可用余额</span>
|
|
|
+ <span class="text-small">{{ $t('digital.maxBalance') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.maxBalance, quoteAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <span class="text-small">可买数量</span>
|
|
|
+ <span class="text-small">{{ $t('digital.canbuymax') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.maxBuyQty, baseAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
@@ -65,19 +65,19 @@
|
|
|
<app-block class="trade-info" v-if="formData.BuyOrSell === BuyOrSell.Sell">
|
|
|
<ul>
|
|
|
<li>
|
|
|
- <span class="text-small">预估手续费</span>
|
|
|
+ <span class="text-small">{{ $t('digital.sellEstimatedFee') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.sellEstimatedFee, quoteAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <span class="text-small">可获金额</span>
|
|
|
+ <span class="text-small">{{ $t('digital.cangetamount') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.maxAmount, quoteAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <span class="text-small">可卖数量</span>
|
|
|
+ <span class="text-small">{{ $t('digital.cansellmax') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.maxSellQty, baseAccount?.currencydecimalplace) }}
|
|
|
</span>
|
|
|
@@ -190,13 +190,13 @@ const calculations = computed(() => {
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
OrderPrice: [{
|
|
|
- message: '请输入价格',
|
|
|
+ message: t('quote.goods.pleaseenterorderprice'),
|
|
|
validator: () => {
|
|
|
return Number(formData.OrderPrice) > 0
|
|
|
}
|
|
|
}],
|
|
|
OrderQty: [{
|
|
|
- message: '请输入数量',
|
|
|
+ message: t('quote.goods.pleaseenterorderqty'),
|
|
|
validator: () => Number(formData.OrderQty) > 0
|
|
|
}],
|
|
|
}
|
|
|
@@ -224,14 +224,14 @@ const onSubmit = () => {
|
|
|
digitalOrder({
|
|
|
data: formData
|
|
|
}).then(() => {
|
|
|
- hideLoading('提交成功', 'success')
|
|
|
+ hideLoading(t('common.submitsuccess'), 'success')
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
showDialog({
|
|
|
- message: '请先激活资金账户'
|
|
|
+ message: t('digital.tipps20')
|
|
|
}).then(() => {
|
|
|
activeTab.value = 1
|
|
|
})
|