Handy_Cao 1 mese fa
parent
commit
13e5ed415f

+ 6 - 5
src/packages/digital/views/contract/components/account/index.vue

@@ -12,25 +12,25 @@
                 <tr>
                     <td colspan="2">
                         <span class="text-small">账户权益(USDT)</span>
-                        <span>{{ taAccount.balance }}</span>
+                        <span>{{ formatDecimal(taAccount.balance) }}</span>
                     </td>
                     <td>
                         <span class="text-small">浮动盈亏</span>
-                        <span>{{ taAccount.closepl }}</span>
+                        <span>{{ formatDecimal(taAccount.closepl) }}</span>
                     </td>
                 </tr>
                 <tr>
                     <td>
                         <span class="text-small">可用(USDT)</span>
-                        <span>{{ taAccount.currentbalance }}</span>
+                        <span>{{ formatDecimal(taAccount.currentbalance) }}</span>
                     </td>
                     <td>
                         <span class="text-small">占用(USDT)</span>
-                        <span>{{ taAccount.usedmargin }}</span>
+                        <span>{{ formatDecimal(taAccount.usedmargin) }}</span>
                     </td>
                     <td>
                         <span class="text-small">冻结(USDT)</span>
-                        <span>{{ taAccount.freezeMargin }}</span>
+                        <span>{{ formatDecimal(taAccount.freezeMargin) }}</span>
                     </td>
                 </tr>
             </tbody>
@@ -42,6 +42,7 @@
 import { useNavigation } from '@mobile/router/navigation'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { computed } from 'vue'
+import { formatDecimal } from '@/filters'
 
 const props = defineProps({
     goodsId: {

+ 2 - 0
src/packages/digital/views/contract/components/order/cancel/index.vue

@@ -10,6 +10,7 @@ import { Dialog } from 'vant'
 import { useCancelOrder } from '@/business/trade'
 import { handleRequestBigNumber } from '@/filters'
 import { fullloading } from '@/utils/vant'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     selectedRow: {
@@ -19,6 +20,7 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['closed'])
+const { global: { t }} = i18n
 
 const { cancelSubmit, formData } = useCancelOrder()
 const pullRefreshRef = shallowRef()

+ 5 - 3
src/packages/digital/views/contract/components/position/index.vue

@@ -11,7 +11,7 @@
                     </tr>
                 </tbody>
             </table>
-            <table cellspacing="0" cellpadding="0" v-for="(item, index) in orderComputedList" :key="index">
+            <table cellspacing="0" cellpadding="0" v-for="(item, index) in dataList" :key="index">
                 <tbody>
                     <tr>
                         <th colspan="2">
@@ -93,7 +93,7 @@ import { getCurrencyName } from '@/constants/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppSelect from '@mobile/components/base/select/index.vue'
 
-defineProps({
+const props = defineProps({
     goodsId: Number
 })
 
@@ -112,11 +112,13 @@ const componentMap = new Map<string, unknown>([
 const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
 const pullRefreshRef = shallowRef()
 
-const { getSBYJMyOrders, $toRefs, calRiskRate, calReturnRate, calUseMargin } = useSBYJOrderStore()
+const { getSBYJMyOrders, getOrderListByGoodsId, $toRefs, calRiskRate, calReturnRate, calUseMargin } = useSBYJOrderStore()
 const { orderComputedList, loading, error } = $toRefs()
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
 
+const dataList = props.goodsId ? getOrderListByGoodsId(props.goodsId) : orderComputedList
+
 // 平仓
 const closePosition = (row: Model.SBYJMyOrderRsp) => {
     selectedRow.value = row

+ 2 - 2
src/packages/digital/views/contract/goods/chart/index.vue

@@ -51,10 +51,10 @@
             <goods-chart v-bind="{ theme: 'Dark', goodsCode: quote.goodscode }" />
             <Row class="g-layout-block g-layout-block--inset" gutter="10">
                 <Col span="12">
-                <Button type="success" block @click="routerBack">买入</Button>
+                <Button type="success" block @click="routerBack">开多</Button>
                 </Col>
                 <Col span="12">
-                <Button type="danger" block @click="routerBack">卖出</Button>
+                <Button type="danger" block @click="routerBack">开空</Button>
                 </Col>
             </Row>
         </template>

+ 4 - 4
src/packages/digital/views/contract/goods/detail/index.vue

@@ -5,7 +5,7 @@
                 <template #footer>
                     <Cell>
                         <template #title>
-                            <b>{{ quote?.goodscode }}</b>
+                            <b>{{ quote?.goodscode }}/{{ quote?.goodsname }}</b>
                         </template>
                         <template #label>
                             <span>{{ quote?.presettle }}</span>
@@ -37,7 +37,7 @@
         </Row>
         <Form ref="formRef" class="g-form__container">
             <CellGroup inset>
-                <Field label="限单价" is-link>
+                <Field label="方式" is-link>
                     <template #input>
                         <app-select v-model="formData.PriceMode" :options="options" />
                     </template>
@@ -54,7 +54,7 @@
                         <app-stepper v-model="formData.OrderQty" min="0.0" :auto-fixed="false" integer />
                     </template>
                 </Field>
-                <Cell title="开仓价值" :value="openAmount" />
+                <Cell title="开仓价值" :value="formatDecimal(openAmount)" />
             </CellGroup>
             <CellGroup>
                 <Cell title="可用余额" :value="calculations.availableBalance" />
@@ -85,7 +85,7 @@
 import { shallowRef, computed, onMounted } from 'vue'
 import { Form, Button, CellGroup, Field, Cell, Tab, Tabs, FieldRule, Col, Row } from 'vant'
 import { EPriceMode, EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
-import { parsePercent } from '@/filters'
+import { formatDecimal, parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { useFuturesStore, useSBYJOrderStore } from '@/stores'
 import { fullloading, dialog } from '@/utils/vant'

+ 3 - 3
src/packages/digital/views/contract/goods/list/index.vue

@@ -46,12 +46,12 @@
                                     </td>
                                     <td>
                                         <div class="table-cell">
-                                            <span :class="item.bidColor">
-                                                {{ handleNumberValue(item.bid) }}
-                                            </span>
                                             <span :class="item.askColor">
                                                 {{ handleNumberValue(item.ask) }}
                                             </span>
+                                            <span :class="item.bidColor">
+                                                {{ handleNumberValue(item.bid) }}
+                                            </span>
                                         </div>
                                     </td>
                                     <td>