|
|
@@ -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>
|