Handy_Cao 1 년 전
부모
커밋
ab0051ec79

+ 4 - 2
src/packages/mobile/views/pricing/trade/Index.vue

@@ -159,8 +159,9 @@ import { useOrder } from '@/business/trade'
 import { BuyOrSell, getBuyOrSellList, BuildType, getPricemode2List, PriceMode } from '@/constants/order'
 import { useComponent } from '@/hooks/component'
 import { fullloading, dialog } from '@/utils/vant'
-import Stepper from '@mobile/components/base/stepper/index.vue'
 import { formatDecimal, handleNumberValue, handleRequestBigNumber } from '@/filters'
+import Stepper from '@mobile/components/base/stepper/index.vue'
+import eventBus from '@/services/bus'
 
 const { getQueryString, getQueryStringToNumber } = useNavigation()
 const { global: { t } } = i18n
@@ -358,7 +359,8 @@ const onSubmit = () => {
         formSubmit().then(() => {
             hideLoading()
             dialog(t('common.submitsuccess')).then(() => {
-                // router.back()
+                // 成交通知
+                eventBus.$emit('OrderDealedNtf')
             })
         }).catch((err) => {
             hideLoading(err, 'fail')

+ 12 - 4
src/packages/mobile/views/pricing/trade/components/cancel/Index.vue

@@ -46,7 +46,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, onUnmounted } from 'vue'
 import { Button } from 'vant'
 import { useRequest } from '@/hooks/request'
 import { queryTradeOrderDetail } from '@/services/api/order'
@@ -56,6 +56,7 @@ import { useCancelOrder } from '@/business/trade'
 import { dialog } from '@/utils/vant'
 import { fullloading } from '@/utils/vant'
 import { i18n } from '@/stores'
+import eventBus from '@/services/bus'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const props = defineProps({
@@ -78,9 +79,7 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTradeOrderDetail,
         orderStatus: '3,7'
     },
     onSuccess: (res) => {
-        if (pageIndex.value === 1) {
-            dataList.value = []
-        }
+        dataList.value = []
         dataList.value.push(...res.data.filter(e => e.goodsid === props.goodsid))
     },
     onError: () => {
@@ -108,4 +107,13 @@ const onCancelSumit = (item: Model.TradeOrderDetailRsp) => {
     })
 }
 
+// 接收成交通知
+const posChangedNtf = eventBus.$on('OrderDealedNtf', () => {
+    run()
+})
+
+onUnmounted(() => {
+    posChangedNtf.cancel()
+})
+
 </script>

+ 3 - 0
src/packages/sbyj/views/order/detail/index.vue

@@ -69,6 +69,7 @@ import { useGlobalStore, useFuturesStore } from '@/stores'
 import { useModifyOrder } from '@/business/trade'
 import { fullloading, dialog } from '@/utils/vant'
 import AppModal from '@/components/base/modal/index.vue'
+import eventBus from '@/services/bus'
 
 const props = defineProps({
     selectedRow: {
@@ -124,6 +125,8 @@ const onSubmit = () => {
         fullloading((hideLoading) => {
             formSubmit().then(() => {
                 hideLoading('修改提交成功。', 'success')
+                // 成交通知
+                eventBus.$emit('OrderDealedNtf')
                 // 刷新订单列表
                 closed()
             }).catch((err) => {