|
|
@@ -2,47 +2,58 @@
|
|
|
<app-view class="listing-goods-detail g-layout g-form">
|
|
|
<template #header>
|
|
|
<app-navbar :title="quote ? quote.goodscode : t('tabbar.trade')">
|
|
|
- <template #right>
|
|
|
- <img :src="'./img/icons/chart.svg'" @click="navigateToGoodsChart" />
|
|
|
- </template>
|
|
|
- </app-navbar>
|
|
|
- </template>
|
|
|
- <div class="trade-panel">
|
|
|
- <spread v-bind="{ quote }" />
|
|
|
- <div class="trade-panel__right">
|
|
|
- <app-submitbar>
|
|
|
- <Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'default'" size="small" block
|
|
|
- @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">{{ $t('quote.sell') }}</Button>
|
|
|
- </app-submitbar>
|
|
|
- <Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
|
+ <template #footer v-if="quote">
|
|
|
<CellGroup inset>
|
|
|
- <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" />
|
|
|
+ <Cell>
|
|
|
+ <template #title>
|
|
|
+ <h3 :class="quote.lastColor">
|
|
|
+ <span>{{ handleNumberValue(quote.last.toFixed(quote.decimalplace)) }}</span>
|
|
|
+ </h3>
|
|
|
+ <span :class="quote.lastColor">{{ parsePercent(quote.change, 2, true) }}</span>
|
|
|
</template>
|
|
|
- </Field>
|
|
|
- </CellGroup>
|
|
|
- <CellGroup inset>
|
|
|
- <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" />
|
|
|
+ <template #right-icon>
|
|
|
+ <img :src="'./img/icons/chart.svg'" @click="navigateToGoodsChart" />
|
|
|
</template>
|
|
|
- </Field>
|
|
|
+ </Cell>
|
|
|
</CellGroup>
|
|
|
- <CellGroup inset>
|
|
|
- <Cell :title="formData.BuyOrSell === BuyOrSell.Buy ? t('digital.prepayment') : t('digital.preacquisition')"
|
|
|
- :label="formatDecimal(calculations.estimatedAmount, quoteAccount?.currencydecimalplace)" />
|
|
|
- </CellGroup>
|
|
|
- </Form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ </app-navbar>
|
|
|
+ </template>
|
|
|
+ <spread v-bind="{ quote }" v-if="quote" />
|
|
|
+ <app-submitbar>
|
|
|
+ <Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'default'" size="small" block
|
|
|
+ @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">{{ $t('quote.sell') }}</Button>
|
|
|
+ </app-submitbar>
|
|
|
+ <Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
|
+ <CellGroup inset>
|
|
|
+ <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" />
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ </CellGroup>
|
|
|
+ <CellGroup inset>
|
|
|
+ <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" />
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ </CellGroup>
|
|
|
+ </Form>
|
|
|
<app-block class="trade-info" v-if="formData.BuyOrSell === BuyOrSell.Buy">
|
|
|
<ul>
|
|
|
<li>
|
|
|
+ <span class="text-small">{{ t('digital.prepayment') }}</span>
|
|
|
+ <span>
|
|
|
+ {{ formatDecimal(calculations.estimatedAmount, quoteAccount?.currencydecimalplace) }}
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
<span class="text-small">{{ $t('digital.buyEstimatedFee') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.buyEstimatedFee, quoteAccount?.currencydecimalplace) }}
|
|
|
@@ -65,6 +76,12 @@
|
|
|
<app-block class="trade-info" v-if="formData.BuyOrSell === BuyOrSell.Sell">
|
|
|
<ul>
|
|
|
<li>
|
|
|
+ <span class="text-small">{{ t('digital.preacquisition') }}</span>
|
|
|
+ <span>
|
|
|
+ {{ formatDecimal(calculations.estimatedAmount, quoteAccount?.currencydecimalplace) }}
|
|
|
+ </span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
<span class="text-small">{{ $t('digital.sellEstimatedFee') }}</span>
|
|
|
<span>
|
|
|
{{ formatDecimal(calculations.sellEstimatedFee, quoteAccount?.currencydecimalplace) }}
|
|
|
@@ -107,7 +124,7 @@
|
|
|
import { shallowRef, reactive, computed, onMounted, onUnmounted, onActivated } from 'vue'
|
|
|
import { Form, Button, CellGroup, Field, Cell, Tab, Tabs, FormInstance, showDialog, FieldRule } from 'vant'
|
|
|
import { fullloading } from '@/utils/vant'
|
|
|
-import { formatDecimal } from '@/filters'
|
|
|
+import { formatDecimal, handleNumberValue, parsePercent } from '@/filters'
|
|
|
import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EValidType } from '@/constants/client'
|
|
|
import { BuyOrSell, PriceMode } from '@/constants/order'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|