|
@@ -1,74 +1,106 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <app-view class="contract-goods-detail g-layout g-form" v-model:show="showModal">
|
|
|
|
|
|
|
+ <app-view class="contract-goods-detail g-form" v-model:show="showModal">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<app-navbar :title="quote ? `${quote.goodscode}/${goodsname}` : `${t('digital.spot-goods-detail')}`">
|
|
<app-navbar :title="quote ? `${quote.goodscode}/${goodsname}` : `${t('digital.spot-goods-detail')}`">
|
|
|
- <template #footer>
|
|
|
|
|
- <Cell>
|
|
|
|
|
- <template #title v-if="quote">
|
|
|
|
|
- <h3>
|
|
|
|
|
- <span>{{ quote.presettle }}</span>
|
|
|
|
|
- <span style="color: #999;font-size: 14px;margin-left: 2px;">{{ enumName }}</span>
|
|
|
|
|
- </h3>
|
|
|
|
|
- <span :class="quote.lastColor">{{ parsePercent(quote.change) }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #right-icon>
|
|
|
|
|
- <span @click="routerToChart">{{ $t('operation.chart') }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </Cell>
|
|
|
|
|
|
|
+ <template #footer v-if="quote">
|
|
|
|
|
+ <CellGroup inset>
|
|
|
|
|
+ <Cell>
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ <h3>
|
|
|
|
|
+ <span>{{ quote.presettle }}</span>
|
|
|
|
|
+ <span style="color: #999;font-size: 14px;margin-left: 4px;">{{ enumName }}</span>
|
|
|
|
|
+ </h3>
|
|
|
|
|
+ <span :class="quote.lastColor">{{ parsePercent(quote.change) }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #right-icon>
|
|
|
|
|
+ <img :src="'./img/icons/chart.svg'" @click="routerToChart" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ </CellGroup>
|
|
|
</template>
|
|
</template>
|
|
|
</app-navbar>
|
|
</app-navbar>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="contract-goods-detail__price g-layout-block g-layout-block--inset">
|
|
|
|
|
- <h3 :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</h3>
|
|
|
|
|
- <h3 :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</h3>
|
|
|
|
|
- </div>
|
|
|
|
|
- <Row class="g-layout-block g-layout-block--inset" gutter="10">
|
|
|
|
|
- <Col span="12">
|
|
|
|
|
- <Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'default'" size="small" block
|
|
|
|
|
- @click="buyOrSell(BuyOrSell.Buy)">{{ $t('digital.buy') }}</Button>
|
|
|
|
|
- </Col>
|
|
|
|
|
- <Col span="12">
|
|
|
|
|
- <Button :type="formData.BuyOrSell === BuyOrSell.Sell ? 'danger' : 'default'" size="small" block
|
|
|
|
|
- @click="buyOrSell(BuyOrSell.Sell)">{{ $t('digital.sell') }}</Button>
|
|
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
|
|
+ <app-block class="trade-panel" background>
|
|
|
|
|
+ <div class="trade-panel-item">
|
|
|
|
|
+ <h3 :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</h3>
|
|
|
|
|
+ <Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'default'"
|
|
|
|
|
+ :plain="formData.BuyOrSell !== BuyOrSell.Buy" size="small" block
|
|
|
|
|
+ @click="buyOrSell(BuyOrSell.Buy)">{{
|
|
|
|
|
+ $t('digital.buy') }}</Button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="trade-panel-item">
|
|
|
|
|
+ <h3 :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</h3>
|
|
|
|
|
+ <Button :type="formData.BuyOrSell === BuyOrSell.Sell ? 'danger' : 'default'"
|
|
|
|
|
+ :plain="formData.BuyOrSell !== BuyOrSell.Sell" size="small" block
|
|
|
|
|
+ @click="buyOrSell(BuyOrSell.Sell)">{{
|
|
|
|
|
+ $t('digital.sell') }}</Button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </app-block>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
<Form ref="formRef" class="g-form__container" @submit="onSubmit">
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Field :label="t('digital.pricemode')" is-link>
|
|
|
|
|
|
|
+ <Field :label="t('digital.pricemode')" label-align="top" arrow-direction="down" center is-link>
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<app-select v-model="formData.PriceMode" :options="options" />
|
|
<app-select v-model="formData.PriceMode" :options="options" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
|
|
+ </CellGroup>
|
|
|
|
|
+ <CellGroup inset>
|
|
|
<Field v-if="formData.PriceMode === PriceMode.Limit" name="OrderPrice" :rules="formRules.OrderPrice"
|
|
<Field v-if="formData.PriceMode === PriceMode.Limit" name="OrderPrice" :rules="formRules.OrderPrice"
|
|
|
- :label="t('digital.orderprice') + enumName">
|
|
|
|
|
|
|
+ :label="`${t('digital.orderprice')}(${enumName})`" label-align="top">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderPrice" :min="0" :decimal-length="quote?.decimalplace"
|
|
<app-stepper v-model="formData.OrderPrice" :min="0" :decimal-length="quote?.decimalplace"
|
|
|
:step="quote?.decimalvalue" />
|
|
:step="quote?.decimalvalue" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
- <Cell v-else :value="t('digital.optimal')" />
|
|
|
|
|
- <Field name="OrderQty" :rules="formRules.OrderQty" :label="t('quote.goods.orderqty')">
|
|
|
|
|
|
|
+ <Cell v-else :title="`${t('digital.orderprice')}(${enumName})`" :value="t('digital.optimal')" />
|
|
|
|
|
+ </CellGroup>
|
|
|
|
|
+ <CellGroup inset>
|
|
|
|
|
+ <Field name="OrderQty" :rules="formRules.OrderQty"
|
|
|
|
|
+ :label="`${t('quote.goods.orderqty')}(${quote?.goodscode})`" label-align="top">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<app-stepper v-model="formData.OrderQty" :min="0" />
|
|
<app-stepper v-model="formData.OrderQty" :min="0" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
- <Cell :title="t('digital.openAmount')" :value="formatDecimal(calculations.openAmount) + enumName" />
|
|
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Cell :title="t('digital.maxBalance')" :value="formatDecimal(calculations.maxBalance)" />
|
|
|
|
|
- <Cell :title="t('digital.maxBuyQty')"
|
|
|
|
|
- :value="handleNoneValue(formatDecimal(calculations.maxBuyQty, 0))" />
|
|
|
|
|
- <Cell :title="t('digital.buyEstimatedFee')" :value="formatDecimal(calculations.buyEstimatedFee)" />
|
|
|
|
|
|
|
+ <Cell :title="t('digital.openAmount')" :value="formatDecimal(calculations.openAmount) + enumName" />
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</Form>
|
|
</Form>
|
|
|
- <Row class="g-layout-block g-layout-block--inset">
|
|
|
|
|
- <Col span="24">
|
|
|
|
|
|
|
+ <app-block class="trade-info">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span class="text-small">
|
|
|
|
|
+ {{ t('digital.maxBalance') }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ {{ formatDecimal(calculations.maxBalance) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span class="text-small">
|
|
|
|
|
+ {{ t('digital.maxBuyQty') }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ {{ handleNoneValue(formatDecimal(calculations.maxBuyQty, 0)) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span class="text-small">
|
|
|
|
|
+ {{ t('digital.buyEstimatedFee') }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ {{ formatDecimal(calculations.buyEstimatedFee) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </app-block>
|
|
|
|
|
+ <app-submitbar>
|
|
|
<Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'danger'" block @click="formRef?.submit">
|
|
<Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'danger'" block @click="formRef?.submit">
|
|
|
- {{ formData.BuyOrSell === BuyOrSell.Buy ? $t('digital.buy') : $t('digital.sell') }}{{ quote?.goodscode }}
|
|
|
|
|
|
|
+ {{ formData.BuyOrSell === BuyOrSell.Buy ? $t('digital.buy') : $t('digital.sell') }}
|
|
|
|
|
+ {{ quote?.goodscode }}
|
|
|
</Button>
|
|
</Button>
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
- <Tabs v-model:active="tabIndex">
|
|
|
|
|
|
|
+ </app-submitbar>
|
|
|
|
|
+ <Tabs class="g-tabs" type="card" v-model:active="tabIndex" shrink>
|
|
|
<Tab :title="t('digital.position')">
|
|
<Tab :title="t('digital.position')">
|
|
|
<contract-position :params="{ goodsid: goodsId }" v-if="tabIndex === 0" />
|
|
<contract-position :params="{ goodsid: goodsId }" v-if="tabIndex === 0" />
|
|
|
</Tab>
|
|
</Tab>
|
|
@@ -84,7 +116,7 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, computed, onMounted, onActivated } from 'vue'
|
|
import { shallowRef, computed, onMounted, onActivated } from 'vue'
|
|
|
-import { Form, FormInstance, Button, CellGroup, Field, Cell, Tab, Tabs, FieldRule, Col, Row } from 'vant'
|
|
|
|
|
|
|
+import { Form, FormInstance, Button, CellGroup, Field, Cell, Tab, Tabs, FieldRule } from 'vant'
|
|
|
import { EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
|
|
import { EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
|
|
|
import { formatDecimal, handleNoneValue, handleNumberValue, parsePercent } from '@/filters'
|
|
import { formatDecimal, handleNoneValue, handleNumberValue, parsePercent } from '@/filters'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
@@ -94,6 +126,7 @@ import { useOrder } from '@/business/trade'
|
|
|
import { BuyOrSell, getGoodsCurrencyItemName, PriceMode } from '@/constants/order'
|
|
import { BuyOrSell, getGoodsCurrencyItemName, PriceMode } from '@/constants/order'
|
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
import AppStepper from '@mobile/components/base/stepper/index.vue'
|
|
import AppStepper from '@mobile/components/base/stepper/index.vue'
|
|
|
|
|
+import AppSubmitbar from '@mobile/components/base/submitbar/index.vue'
|
|
|
import ContractPosition from '../../components/position/detail/index.vue'
|
|
import ContractPosition from '../../components/position/detail/index.vue'
|
|
|
import ContractOrder from '../../components/order/list/index.vue'
|
|
import ContractOrder from '../../components/order/list/index.vue'
|
|
|
import ContractAccount from '../../components/account/index.vue'
|
|
import ContractAccount from '../../components/account/index.vue'
|