Procházet zdrojové kódy

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL

li.shaoyi před 2 roky
rodič
revize
0c21a13db2

+ 16 - 7
src/packages/mobile/views/swap/detail/Index.vue

@@ -9,7 +9,7 @@
                 </template>
             </app-navbar>
         </template>
-        <Tabs v-model:active="tabIndex" @change="tabChange">
+        <Tabs v-model:active="tabIndex">
             <Tab title="卖大厅">
             </Tab>
             <Tab title="买大厅">
@@ -18,19 +18,19 @@
         <div class="trade">
                 <div class="trade-section sell" v-if="dataList.length">
                     <app-list :columns="columns" :data-list="dataList">
-                        <template>
-                            <Button size="small" round>摘牌</Button>
+                        <template #operate="{ row }">
+                            <Button size="small" round @click="onDelisting(row, tabIndex)">摘牌</Button>
                         </template>
                     </app-list>
                 </div>
             </div>
-        <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow }" @closed="closeComponent"
+        <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, tabIndex }" @closed="closeComponent"
             v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent } from 'vue'
+import { shallowRef, defineAsyncComponent, PropType } from 'vue'
 import { Tab, Tabs, Button } from 'vant'
 import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@/hooks/navigation'
@@ -51,6 +51,13 @@ const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
 const error = shallowRef(false)
 const dataList = shallowRef<Model.TjmdTradeOrderDetailRsp[]>([])
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TjmdTradeOrderDetailRsp>,
+        required: true,
+    }
+})
+
 const { pageIndex } = useRequest(queryTjmdTradeOrderDetail, {
     params: {
         goodsid: goodsId,
@@ -73,8 +80,10 @@ const columns: Model.TableColumn[] = [
     { prop: 'username', label: '挂牌方' },
 ]
 
-const tabChange = (index: number) => {
-    console.log('切换列表', index)
+const onDelisting = (row: Model.TjmdTradeOrderDetailRsp, value: number) => {
+    tabIndex.value = value
+    selectedRow.value = row
+    showComponent('delisting')
 }
 
 const onListing = () => {

+ 12 - 1
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -70,7 +70,7 @@
 import { shallowRef } from 'vue'
 import { Form, FormInstance, Button, Field, RadioGroup, Radio, FieldRule, Stepper} from 'vant'
 import { useAccountStore } from '@/stores'
-import { EPriceMode } from '@/constants/client'
+import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
 import { fullloading, dialog } from '@/utils/vant'
 
@@ -141,6 +141,17 @@ const onSubmit = () => {
                     // PriceMode: priceMode,
                     // OrderPrice: priceMode === EPriceMode.PRICEMODE_LIMIT ? orderPrice : maxSub,
                     // OrderQty: orderQty,  
+
+    formData.PriceMode = priceMove.value
+    formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTING
+    formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
+    formData.BuildType = EBuildType.BUILDTYPE_OPEN
+    formData.ValidType = EValidType.VALIDTYPE_DR
+    formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+    formData.TriggerType = 0
+    formData.ServiceTime = ""
+    formData.ValidTime = ""
+
     fullloading((hideLoading) => {
         formSubmit().then(() => {
             hideLoading()

+ 10 - 1
src/packages/mobile/views/swap/detail/components/listing/Index.vue

@@ -76,7 +76,7 @@ import { Form, FormInstance, Button, FieldRule, Field, Tab, Tabs, Stepper, Radio
 import { useOrder } from '@/business/trade'
 import { fullloading, dialog } from '@/utils/vant'
 import { useAccountStore } from '@/stores'
-import { EOrderDirection, EPriceMode } from '@/constants/client'
+import { EOrderDirection, EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
 
 import AppPopup from '@mobile/components/base/popup/index.vue'
 
@@ -112,6 +112,15 @@ const onSubmit = () => {
     formData.PriceMode = priceMove.value
     formData.MarketMaxSub = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? 0.0 : formData.MarketMaxSub
     formData.GoodsID = goodsid
+    formData.PriceMode = priceMove.value
+    formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_LISTING
+    formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
+    formData.BuildType = EBuildType.BUILDTYPE_OPEN
+    formData.ValidType = EValidType.VALIDTYPE_DR
+    formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+    formData.TriggerType = 0
+    formData.ServiceTime = ""
+    formData.ValidTime = ""
 
     fullloading((hideLoading) => {
         formSubmit().then(() => {

+ 1 - 2
src/services/api/swap/index.ts

@@ -1,9 +1,8 @@
-import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
+import { useLoginStore, useUserStore } from '@/stores'
 import http from '@/services/http'
 import { RequestConfig } from '@/services/http/types'
 
 const loginStore = useLoginStore()
-const accountStore = useAccountStore()
 const userStore = useUserStore()
 
 /**