|
|
@@ -38,7 +38,7 @@
|
|
|
</div>
|
|
|
<div class="market-detail__list">
|
|
|
<div class="g-order-list">
|
|
|
- <div class="g-order-list__box" v-for="(item, index) in orderComputedList" :key="index">
|
|
|
+ <div class="g-order-list__box" v-for="(item, index) in orderList" :key="index">
|
|
|
<div class="g-order-list__titlebar">
|
|
|
<div class="left">
|
|
|
<h4 :class="item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
|
|
|
@@ -77,7 +77,9 @@
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>浮动权益</span>
|
|
|
- <span :class="handlePriceColor(item.tHDetailEx.floatPL)">{{ item.tHDetailEx.floatPL }}</span>
|
|
|
+ <span :class="handlePriceColor(item.tHDetailEx.floatPL)">
|
|
|
+ {{ formatDecimal(item.tHDetailEx.floatPL) }}
|
|
|
+ </span>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>已补定金</span>
|
|
|
@@ -122,21 +124,20 @@ import { useOrder } from '@/business/trade'
|
|
|
import { shallowRef, onMounted, onUnmounted, computed, onActivated, defineAsyncComponent } from 'vue'
|
|
|
import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, showToast } from 'vant'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
-import { useFuturesStore, useUserStore } from '@/stores'
|
|
|
+import { useFuturesStore, useUserStore, useSBYJOrderStore } from '@/stores'
|
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
|
import { formatDecimal, parsePercent, handleNumberValue, handlePriceColor } from '@/filters'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { EPriceMode, EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
-import { useSBYJOrder } from '@/business/order'
|
|
|
import quoteSocket from '@/services/websocket/quote'
|
|
|
-import eventBus from '@/services/bus'
|
|
|
import { queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
import { getUserId } from '@/services/methods/user'
|
|
|
|
|
|
const { getQueryString } = useNavigation()
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
+const { getSBYJMyOrders, getOrderByGoodsId } = useSBYJOrderStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
const userStore = useUserStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
@@ -156,8 +157,9 @@ const componentMap = new Map<string, unknown>([
|
|
|
['closeholder', defineAsyncComponent(() => import('../../order/list/components/close-holder/index.vue'))], // 转让
|
|
|
])
|
|
|
|
|
|
-const { getSBYJMyOrders, orderComputedList } = useSBYJOrder()
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getOrderList())
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
|
|
|
+
|
|
|
+const orderList = computed(() => getOrderByGoodsId(quote.value?.goodsid))
|
|
|
|
|
|
// 合约乘数
|
|
|
const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
|
|
|
@@ -178,12 +180,6 @@ const qtyStepList = computed(() => {
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-const getOrderList = () => {
|
|
|
- getSBYJMyOrders({
|
|
|
- goodsId: quote.value?.goodsid
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
const commit = (buyOrSell: BuyOrSell) => {
|
|
|
/// 这里要去判断是否已经实名认证
|
|
|
if (userStore.hasAuth) {
|
|
|
@@ -221,7 +217,7 @@ const onSubmit = () => {
|
|
|
formSubmit().then(() => {
|
|
|
hideLoading('提交成功。', 'success')
|
|
|
// 刷新订单列表
|
|
|
- getOrderList()
|
|
|
+ getSBYJMyOrders()
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|
|
|
@@ -250,9 +246,6 @@ const showComponent = (componentName: string, row: Model.SBYJMyOrderRsp) => {
|
|
|
openComponent(componentName)
|
|
|
}
|
|
|
|
|
|
-// 接收委托单成交通知
|
|
|
-const orderDealedNtf = eventBus.$on('OrderDealedNtf', () => getOrderList())
|
|
|
-
|
|
|
onActivated(() => {
|
|
|
/// 查询是否已签署合同
|
|
|
queryMdUserSwapProtocol({
|
|
|
@@ -268,12 +261,11 @@ onMounted(() => {
|
|
|
subscribe.start(goodscode)
|
|
|
orderQty.value = agreeunit.value
|
|
|
qtyStep.value = qtyStepList.value[0]
|
|
|
- getOrderList()
|
|
|
+ getSBYJMyOrders()
|
|
|
})
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
subscribe.stop()
|
|
|
- orderDealedNtf.cancel()
|
|
|
})
|
|
|
</script>
|
|
|
|