li.shaoyi 1 năm trước cách đây
mục cha
commit
c3d40c986c

+ 11 - 1
src/packages/mobile/views/pricing/trade/components/detail/Index.vue

@@ -2,7 +2,7 @@
     <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
         <app-view class="pricing-detail g-form">
             <template #header>
-                <app-navbar :title="quote ? quote.goodscode + '/' + quote.goodsname : $t('quote.listinghall')" />
+                <app-navbar :title="quote ? quote.goodscode + '/' + quote.goodsname : $t('quote.listinghall')" @back="closed" />
             </template>
             <component :is="Price" v-bind="{ goodsCode }" />
             <component :is="Chart" v-bind="{ goodsCode }" />
@@ -31,6 +31,16 @@ const quote = futuresStore.getGoodsQuote(props.goodsCode)
 const Price = defineAsyncComponent(() => import('@mobile/components/modules/quote/price/index.vue'))
 const Chart = defineAsyncComponent(() => import('@mobile/components/modules/hqchart/index.vue'))
 
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
 </script>
 
 <style lang="less">

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

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

+ 1 - 1
src/packages/tss/views/order/delivery/components/offline/Index.vue

@@ -38,7 +38,7 @@
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.applydate') }}:</span>
-                                <span>{{ formatDate(item.reqtime, 'YYYY-MM-DD') }}</span>
+                                <span>{{ formatDate(item.reqtime) }}</span>
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.deliveryinfo') }}:</span>

+ 1 - 1
src/packages/tss/views/order/delivery/components/online/Index.vue

@@ -38,7 +38,7 @@
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.applydate') }}:</span>
-                                <span>{{ formatDate(item.reqtime, 'YYYY-MM-DD') }}</span>
+                                <span>{{ formatDate(item.reqtime) }}</span>
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.deliveryinfo1') }}:</span>

+ 1 - 1
src/packages/tss/views/order/delivery/components/spot/Index.vue

@@ -38,7 +38,7 @@
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.applydate') }}:</span>
-                                <span>{{ formatDate(item.reqtime, 'YYYY-MM-DD') }}</span>
+                                <span>{{ formatDate(item.reqtime) }}</span>
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.deliveryinfo2') }}:</span>

+ 1 - 1
src/packages/tss/views/order/list/fullpayment/Index.vue

@@ -38,7 +38,7 @@
                             </li>
                             <li>
                                 <span>{{ $t('delivery.offline.applydate') }}:</span>
-                                <span>{{ formatDate(item.reqtime, 'YYYY-MM-DD') }}</span>
+                                <span>{{ formatDate(item.reqtime) }}</span>
                             </li>
                             <!-- <li>
                                 <span>{{ $t('delivery.offline.deliveryinfo') }}:</span>

+ 1 - 1
src/packages/tss/views/order/list/prepayment/Index.vue

@@ -43,7 +43,7 @@
                             </li>
                             <li>
                                 <span>{{ $t('position.goods.holddetail.tradetime') }}:</span>
-                                <span>{{ formatDate(item.tradetime, "YYYY-MM-DD HH:mm:ss") }}</span>
+                                <span>{{ formatDate(item.tradetime) }}</span>
                             </li>
                         </ul>
                     </div>