|
|
@@ -82,7 +82,7 @@
|
|
|
@click-right-icon="showContact = true" />
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
- <Tabs class="van-tabs--list" v-model:active="active">
|
|
|
+ <Tabs v-model:active="active">
|
|
|
<template v-for="(item, index) in components.filter(e => e.show === true)" :key="index">
|
|
|
<Tab :title="item.title" :name="item.name">
|
|
|
<component :is="item.component" v-bind="{ goodsCode, goodsid, fromTrade, pictureurl }"
|
|
|
@@ -114,10 +114,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { useFuturesStore, useUserStore, i18n } from '@/stores'
|
|
|
-import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
|
|
|
+import { onBeforeRouteLeave } from 'vue-router'
|
|
|
import { Form, Field, Button, FieldRule, FormInstance, Radio, RadioGroup, CellGroup, Icon, Tab, Tabs } from 'vant'
|
|
|
+import { useFuturesStore, useUserStore, i18n } from '@/stores'
|
|
|
+import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
import { BuyOrSell, BuildType, PriceMode } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
@@ -163,7 +164,7 @@ const system_1012 = getSystemParamValue('1012') ?? '1'
|
|
|
const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
|
|
|
|
|
|
const pictureurl = computed(() => {
|
|
|
- return futuresStore.getGoods(goodsCode.value)?.pictureurl ?? {}
|
|
|
+ return futuresStore.getGoods(goodsCode.value)?.pictureurl ?? ''
|
|
|
})
|
|
|
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
@@ -355,6 +356,17 @@ onMounted(() => {
|
|
|
onUnmounted(() => {
|
|
|
subscribe.stop()
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+// 阻止页面离开
|
|
|
+onBeforeRouteLeave((to, from, next) => {
|
|
|
+ if (showContact.value) {
|
|
|
+ showContact.value = false
|
|
|
+ next(false)
|
|
|
+ } else {
|
|
|
+ next(true)
|
|
|
+ }
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|