li.shaoyi 2 jaren geleden
bovenliggende
commit
d2d142e475

+ 17 - 0
src/constants/order.ts

@@ -296,4 +296,21 @@ export function getPayStatusList() {
 export function getPayStatusName(value: number) {
     const enums = getPayStatusList()
     return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取摘牌类型列表
+ * @returns 
+ */
+export function getDelistingTypeList() {
+    return getEnumTypeList('delistingtype')
+}
+
+/**
+ * 获取摘牌类型名称
+ * @returns 
+ */
+export function getDelistingTypeName(value: number) {
+    const enums = getDelistingTypeList()
+    return getEnumTypeName(enums, value)
 }

+ 11 - 13
src/packages/mobile/views/goods/detail/Index.vue

@@ -1,14 +1,12 @@
 <template>
     <app-view class="goods-detail">
         <template #header>
-            <app-navbar :title="item.goodscode + '/' + item.goodsname">
+            <app-navbar :title="quote ? quote.goodscode + '/' + quote.goodsname : '挂牌大厅'">
                 <template #right>
-                    <div class="button-more" @click="onListing">
-                        <span>挂牌</span>
-                    </div>
+                    <Icon name="add" size=".4rem" @click="onListing" />
                 </template>
-                <template #footer>
-                    <app-quote :goodscode="item.goodscode" style="margin-bottom: .2rem;" />
+                <template #footer v-if="quote">
+                    <app-quote :goodscode="quote.goodscode" style="margin-bottom: .2rem;" />
                 </template>
             </app-navbar>
         </template>
@@ -31,14 +29,14 @@
                 </app-list>
             </div>
         </app-pull-refresh>
-        <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, tabIndex, item, quote }"
+        <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, goodsid }"
             @closed="closeComponent" v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
-import { Tab, Tabs, Button, showToast } from 'vant'
+import { Tab, Tabs, Button, showToast, Icon } from 'vant'
 import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@/hooks/navigation'
 import { useComponent } from '@/hooks/component'
@@ -49,28 +47,28 @@ import AppQuote from '@mobile/components/modules/quote/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const futuresStore = useFuturesStore()
 const componentMap = new Map<string, unknown>([
     ['delisting', defineAsyncComponent(() => import('./components/delisting/Index.vue'))],
     ['listing', defineAsyncComponent(() => import('./components/listing/Index.vue'))],
 ])
 
+const { getQueryStringToNumber } = useNavigation()
 const loginStore = useLoginStore()
+const futuresStore = useFuturesStore()
+const goodsid = getQueryStringToNumber('goodsid')
+const quote = futuresStore.getQuoteInfo(goodsid)
 
-const { getParamString } = useNavigation()
-const item: Model.QuoteGoodsListRsp = JSON.parse(getParamString('item')?.toString() || '{}')
 const tabIndex = shallowRef(BuyOrSell.Buy)
 const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()
 const error = shallowRef(false)
 const dataList = shallowRef<Model.WrTradeOrderDetailRsp[]>([])
-const quote = futuresStore.getQuoteInfo(item.goodscode)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => onTabChange())
 
 const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetail, {
     params: {
         pagesize: 20,
-        goodsid: item.goodsid,
+        goodsid,
         buyorsell: tabIndex.value
     },
     onSuccess: (res) => {

+ 21 - 26
src/packages/mobile/views/goods/detail/components/delisting/Index.vue

@@ -6,9 +6,9 @@
                     <span>{{ accountStore.accountId }}</span>
                 </template>
             </Field>
-            <Field label="订单商品">
+            <Field label="订单商品" v-if="quote">
                 <template #input>
-                    <span>{{ item.goodscode }}/{{ item.goodsname }}</span>
+                    <span>{{ quote.goodscode }}/{{ quote.goodsname }}</span>
                 </template>
             </Field>
             <Field label="挂牌方">
@@ -41,48 +41,44 @@
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="摘牌数量">
                 <template #input>
-                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22" :min="0" :step="1" :max="selectedRow.orderqty" :auto-fixed="false" integer/>
+                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22" :min="0" :step="1"
+                        :max="selectedRow.orderqty" :auto-fixed="false" integer />
                 </template>
             </Field>
         </Form>
         <template #footer>
-            <Button type="primary" block round @click="formRef?.submit">{{ tabIndex === 0 ? '卖出' : '买入' }}</Button>
+            <Button type="primary" block round @click="formRef?.submit">
+                {{ selectedRow.buyorsell === BuyOrSell.Buy ? '卖出' : '买入' }}
+            </Button>
         </template>
     </app-popup>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
-import { Form, FormInstance, Button, Field, RadioGroup, Radio, FieldRule, Stepper} from 'vant'
+import { Form, FormInstance, Button, Field, RadioGroup, Radio, FieldRule, Stepper } from 'vant'
+import { BuyOrSell } from '@/constants/order'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
 import { fullloading, dialog } from '@/utils/vant'
-
 import AppPopup from '@mobile/components/base/popup/index.vue'
 import { getBuyOrSellName } from '@/constants/order'
 
-const accountStore = useAccountStore()
-const { formData, formSubmit} = useOrder()
-
-/// 挂牌类型
-const buildType = shallowRef(EBuildType.BUILDTYPE_OPEN)
-
 const props = defineProps({
     selectedRow: {
         type: Object as PropType<Model.WrTradeOrderDetailRsp>,
         required: true
     },
-    item: {
-        type: Object as PropType<Model.QuoteGoodsListRsp>,
-        required: true
-    },
-    tabIndex: {
-        type: Number,
-        required: true
-    }
 })
 
+const accountStore = useAccountStore()
+const futuresStore = useFuturesStore()
+const { formData, formSubmit } = useOrder()
+
+/// 挂牌类型
+const buildType = shallowRef(EBuildType.BUILDTYPE_OPEN)
+const quote = futuresStore.getQuoteInfo(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
@@ -99,22 +95,21 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
 
 // 提交摘牌
 const onSubmit = () => {
-    const { goodsid, orderid, orderprice, buyorsell} = props.selectedRow
+    const { goodsid, orderid, orderprice, buyorsell } = props.selectedRow
+    const { marketid = 0 } = quote.value ?? {}
+
     /// 获取对应的市场ID
-    formData.MarketID = useFuturesStore().getGoods(goodsid).value?.marketid ?? 0
+    formData.MarketID = marketid
     formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
     formData.RelatedID = orderid
     formData.OrderPrice = orderprice
-    formData.BuyOrSell = buyorsell === 0 ? 1 : 0,
+    formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
     formData.GoodsID = goodsid
     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 = ""
     formData.BuildType = buildType.value
 
     fullloading((hideLoading) => {

+ 35 - 34
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -1,18 +1,18 @@
 <template>
     <app-popup class="goods-listing" :title="'挂牌'" v-model:show="showModal" :refresh="refresh">
         <Form class="goods-listing__form" ref="formRef" @submit="onSubmit">
-            <Tabs class="van-tabs--list" v-model:active="buyOrSell" :swipe-threshold="2">
-                <Tab title="挂牌买入" />
-                <Tab title="挂牌卖出" />
+            <Tabs class="van-tabs--list" v-model:active="formData.BuyOrSell" :swipe-threshold="2">
+                <Tab title="挂牌买入" :name="BuyOrSell.Buy" />
+                <Tab title="挂牌卖出" :name="BuyOrSell.Sell" />
             </Tabs>
             <Field label="交易账户">
                 <template #input>
                     <span>{{ accountStore.accountId }}</span>
                 </template>
             </Field>
-            <Field label="订单商品">
+            <Field label="订单商品" v-if="quote">
                 <template #input>
-                    <span>{{ item.goodscode }}/{{ item.goodsname }}</span>
+                    <span>{{ quote.goodscode }}/{{ quote.goodsname }}</span>
                 </template>
             </Field>
             <Field label="挂牌类型">
@@ -25,8 +25,8 @@
             </Field>
             <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格">
                 <template #input>
-                    <Stepper v-model="formData.OrderPrice" input-width="100" :default-value="$props.tabIndex === 0 ? $props.quote.ask : $props.quote.bid" theme="round" button-size="22"
-                        :auto-fixed="false" :decimal-length="item.decimalplace" />
+                    <Stepper v-model="formData.OrderPrice" input-width="100" :default-value="defaultPrice" theme="round"
+                        button-size="22" :auto-fixed="false" :decimal-length="quote?.decimalplace" />
                 </template>
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
@@ -43,16 +43,25 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType } from 'vue'
+import { shallowRef, computed, onMounted } from 'vue'
 import { Form, FormInstance, Button, FieldRule, Field, Tab, Tabs, Stepper, Radio, RadioGroup } from 'vant'
+import { BuyOrSell } from '@/constants/order'
 import { useOrder } from '@/business/trade'
 import { fullloading, dialog } from '@/utils/vant'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
-
 import AppPopup from '@mobile/components/base/popup/index.vue'
 
+const props = defineProps({
+    goodsid: {
+        type: Number,
+        required: true
+    },
+})
+
 const accountStore = useAccountStore()
+const futuresStore = useFuturesStore()
+const quote = futuresStore.getQuoteInfo(props.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据
@@ -60,43 +69,31 @@ const refresh = shallowRef(true) // 是否刷新父组件数据
 const buildType = shallowRef(EBuildType.BUILDTYPE_OPEN)
 const { formData, formSubmit } = useOrder()
 
-
-const props = defineProps({
-    item: {
-        type: Object as PropType<Model.QuoteGoodsListRsp>,
-        required: true
-    },
-    tabIndex: {
-        type: Number,
-        required: true
-    },
-    quote: {
-        type: Object as PropType<Model.Futures>,
-        required: true
+// 默认价格
+const defaultPrice = computed(() => {
+    const { ask = 0, bid = 0, preclose = 0 } = quote.value ?? {}
+    switch (formData.BuyOrSell) {
+        case BuyOrSell.Buy:
+            return ask
+        case BuyOrSell.Sell:
+            return bid
+        default:
+            return preclose
     }
 })
 
-/// 买卖方向
-const buyOrSell = shallowRef(props.tabIndex)
-
 // 提交挂牌
 const onSubmit = () => {
-    /// 买卖方向
-    const { goodsid } = props.item ?? {}
+    const { marketid = 0 } = quote.value ?? {}
     /// 获取对应的市场ID
-    formData.MarketID = useFuturesStore().getGoods(goodsid).value?.marketid ?? 0
-    formData.BuyOrSell = buyOrSell.value,
+    formData.MarketID = marketid
     formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
-    formData.MarketMaxSub = 0.0
-    formData.GoodsID = goodsid
+    formData.GoodsID = props.goodsid
     formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
     formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
     formData.BuildType = EBuildType.BUILDTYPE_OPEN
     formData.ValidType = EValidType.VALIDTYPE_DR
     formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-    formData.TriggerType = 0
-    formData.ServiceTime = ""
-    formData.ValidTime = ""
     formData.BuildType = buildType.value
 
     fullloading((hideLoading) => {
@@ -131,6 +128,10 @@ const closed = (isRefresh = true) => {
     showModal.value = false
 }
 
+onMounted(() => {
+    formData.BuyOrSell = BuyOrSell.Buy
+})
+
 // 暴露组件属性给父组件调用
 defineExpose({
     closed,

+ 42 - 5
src/packages/mobile/views/goods/list/Index.vue

@@ -4,6 +4,22 @@
             <app-navbar title="订单挂牌" />
         </template>
         <app-list :columns="columns" :data-list="tableList" @row-click="rowClick">
+            <!-- 买价 -->
+            <template #bid="{ row }">
+                <span :class="row.bidColor">{{ row.bid }}</span>
+            </template>
+            <!-- 买量 -->
+            <template #bidvolume="{ row }">
+                <span :class="row.bidvolumeColor">{{ row.bidvolume }}</span>
+            </template>
+            <!-- 卖价 -->
+            <template #ask="{ row }">
+                <span :class="row.askColor">{{ row.ask }}</span>
+            </template>
+            <!-- 卖量 -->
+            <template #askvolume="{ row }">
+                <span :class="row.askvolumeColor">{{ row.askvolume }}</span>
+            </template>
             <!-- 当前价 -->
             <template #last="{ row }">
                 <span :class="row.lastColor">{{ row.last }}</span>
@@ -28,12 +44,19 @@
             <template #highest="{ row }">
                 <span :class="row.highestColor">{{ row.highest }}</span>
             </template>
+            <!-- 涨停 -->
+            <template #limitup="{ value }">
+                <span class="g-up-color">{{ value }}</span>
+            </template>
+            <!-- 跌停 -->
+            <template #limitdown="{ value }">
+                <span class="g-down-color">{{ value }}</span>
+            </template>
         </app-list>
     </app-view>
 </template>
 
 <script lang="ts" setup>
-
 import { computed } from 'vue'
 import { v4 } from 'uuid'
 import { parsePercent, handleNumberValue } from '@/filters'
@@ -55,7 +78,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
         marketids: '50101'
     },
     onSuccess: (res) => {
-        const goodsCodes = res.data.map((e) => e.refgoodscode)
+        const goodsCodes = res.data.map((e) => e.goodscode)
         const subscribe = quoteSocket.addSubscribe(goodsCodes, subscribeId)
         subscribe.start()
     }
@@ -64,7 +87,7 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
 const tableList = computed(() => {
     return dataList.value.map((item) => {
         const quote = futuresStore.getQuoteInfo(item.goodscode)
-        const { goodsname, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
+        const { goodsname, bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
         return {
             ...item,
             goodsname,
@@ -72,6 +95,12 @@ const tableList = computed(() => {
             openedColor,
             lowestColor,
             highestColor,
+            askColor,
+            bidColor,
+            bid: handleNumberValue(bid),
+            bidvolume: handleNumberValue(bidvolume),
+            ask: handleNumberValue(ask),
+            askvolume: handleNumberValue(askvolume),
             last: handleNumberValue(last),
             rise: handleNumberValue(rise?.toFixed(item.decimalplace)),
             change: parsePercent(change),
@@ -80,12 +109,18 @@ const tableList = computed(() => {
             lowest: handleNumberValue(lowest),
             highest: handleNumberValue(highest),
             amplitude: parsePercent(amplitude),
+            limitdown: handleNumberValue(limitdown),
+            limitup: handleNumberValue(limitup),
         }
     })
 })
 
 const columns: Model.TableColumn[] = [
     { prop: 'goodsname', label: '商品/标的' },
+    { prop: 'bid', label: '买价' },
+    { prop: 'bidvolume', label: '买量' },
+    { prop: 'ask', label: '卖价' },
+    { prop: 'askvolume', label: '卖量' },
     { prop: 'last', label: '当前价' },
     { prop: 'rise', label: '涨跌' },
     { prop: 'change', label: '幅度' },
@@ -94,13 +129,15 @@ const columns: Model.TableColumn[] = [
     { prop: 'lowest', label: '最低' },
     { prop: 'highest', label: '最高' },
     { prop: 'amplitude', label: '振幅' },
+    { prop: 'limitup', label: '涨停' },
+    { prop: 'limitdown', label: '跌停' },
 ]
 
 const rowClick = (row: Model.QuoteGoodsListRsp) => {
     router.push({
         name: 'goods-detail',
-        params: {
-            item: JSON.stringify(row)
+        query: {
+            goodsid: row.goodsid
         }
     })
 }

+ 3 - 1
src/packages/mobile/views/order/list/components/goodsorder/detail/Index.vue

@@ -9,6 +9,8 @@
                 <CellGroup title="订单委托信息">
                     <Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
                     <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
+                    <Cell title="类型" :value="getBuildTypeName(selectedRow.buildtype)" />
+                    <Cell title="摘牌类型" :value="getDelistingTypeName(selectedRow.delistingtype)" />
                     <Cell title="委托数量" :value="formatDecimal(selectedRow.orderqty)" />
                     <Cell title="委托价格" :value="formatDecimal(selectedRow.orderprice)" />
                     <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
@@ -28,7 +30,7 @@
 import { shallowRef, PropType } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
 import { CellGroup, Cell, Button } from 'vant'
-import { getBuyOrSellName, getWRTradeOrderStatusName } from '@/constants/order'
+import { getBuyOrSellName, getWRTradeOrderStatusName, getBuildTypeName, getDelistingTypeName } from '@/constants/order'
 import { formatDate, formatDecimal } from '@/filters'
 import { useCancelOrder } from '@/business/trade'
 import { dialog, fullloading } from '@/utils/vant'

+ 2 - 2
src/packages/mobile/views/order/list/components/goodsorder/list/Index.vue

@@ -42,8 +42,8 @@
                 </div>
                 <div class="g-order-list__btnbar">
                     <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
-                    <Button size="small" v-if="(item.orderstatus === 3 || item.orderstatus === 7)"
-                        @click="onCancelSumit(item)" round>撤销</Button>
+                    <Button size="small" v-if="[3, 7, 12].includes(item.orderstatus)" @click="onCancelSumit(item)"
+                        round>撤销</Button>
                 </div>
             </div>
         </div>

+ 34 - 10
src/packages/mobile/views/order/position/components/goods/close/Index.vue

@@ -14,15 +14,16 @@
                     <Cell title="冻结数量" :value="formatDecimal(selectedRow.frozenqty)" />
                     <Cell title="可用数量" :value="formatDecimal(selectedRow.enableqty)" />
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
-                    <Cell title="参考损益" :value="'--'" />
+                    <Cell title="参考损益" :value="formatDecimal(closepl)" />
                 </CellGroup>
                 <CellGroup title="平仓信息">
-                    <Cell title="当前价" :value="'--'" />
+                    <Cell title="当前价" :value="handleNumberValue(quote?.last)" />
                     <Form class="goods-close__form" ref="formRef" @submit="onCloseSumit" v-if="props">
                         <Field name="OrderPrice" :rules="formRules.OrderPrice" label="平仓价格">
                             <template #input>
                                 <Stepper v-model="formData.OrderPrice" input-width="100" theme="round" button-size="22"
-                                    :min="0" :decimal-length="selectedRow.decimalplace" :auto-fixed="false" />
+                                    :min="0" :default-value="defaultPrice" :decimal-length="selectedRow.decimalplace"
+                                    :auto-fixed="false" />
                             </template>
                         </Field>
                         <Field name="OrderQty" :rules="formRules.OrderQty" label="平仓数量">
@@ -42,24 +43,47 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType } from 'vue'
+import { shallowRef, PropType, computed } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
 import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper } from 'vant'
-import { getBuyOrSellName } from '@/constants/order'
-import { formatDecimal } from '@/filters'
+import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
+import { formatDecimal, handleNumberValue } from '@/filters'
 import { useOrder } from '@/business/trade'
 import { dialog, fullloading } from '@/utils/vant'
+import { useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradePositionRsp>,
+        required: true,
+    }
+})
+
+const futuresStore = useFuturesStore()
+const quote = futuresStore.getQuoteInfo(props.selectedRow.goodscode)
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)
 const { formSubmit, formData } = useOrder()
 
-const props = defineProps({
-    selectedRow: {
-        type: Object as PropType<Model.TradePositionRsp>,
-        required: true,
+// 损益
+const closepl = computed(() => {
+    const { last = 0 } = quote.value ?? {}
+    const { curpositionqty, holderamount, agreeunit, buyorsell } = props.selectedRow
+    return (last * curpositionqty * agreeunit - holderamount) * (buyorsell === BuyOrSell.Buy ? 1 : -1)
+})
+
+// 默认平仓价格
+const defaultPrice = computed(() => {
+    const { bid, ask, preclose = 0 } = quote.value ?? {}
+    switch (props.selectedRow.buyorsell) {
+        case BuyOrSell.Buy:
+            return bid || preclose
+        case BuyOrSell.Sell:
+            return ask || preclose
+        default:
+            return preclose
     }
 })
 

+ 9 - 6
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -36,12 +36,14 @@
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="挂牌数量">
                 <template #input>
-                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22" :min="0" :step="0.01" :max="selectedRow.orderqty" :auto-fixed="false" />
+                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22" :min="0"
+                        :step="0.01" :max="selectedRow.orderqty" :auto-fixed="false" />
                 </template>
             </Field>
             <Field name="OrderPrice" v-if="priceMove === 2" :rules="formRules.OrderPrice" label="摘牌价格">
                 <template #input>
-                    <Stepper v-model="formData.OrderPrice" input-width="100" theme="round" button-size="22" :min="0"  :auto-fixed="false" />
+                    <Stepper v-model="formData.OrderPrice" input-width="100" theme="round" button-size="22" :min="0"
+                        :auto-fixed="false" />
                 </template>
             </Field>
             <Field label="估算金额" v-if="priceMove === 3">
@@ -68,7 +70,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
-import { Form, FormInstance, Button, Field, RadioGroup, Radio, FieldRule, Stepper} from 'vant'
+import { Form, FormInstance, Button, Field, RadioGroup, Radio, FieldRule, Stepper } from 'vant'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderDirection, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
@@ -77,7 +79,8 @@ import { fullloading, dialog } from '@/utils/vant'
 import AppPopup from '@mobile/components/base/popup/index.vue'
 
 const accountStore = useAccountStore()
-const { formData, formSubmit} = useOrder()
+const futuresStore = useFuturesStore()
+const { formData, formSubmit } = useOrder()
 
 /// 挂牌金额
 const amount = shallowRef(0.0)
@@ -143,10 +146,10 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
 const onSubmit = () => {
     const { goodsid, orderid } = props.selectedRow
     /// 获取对应的市场ID
-    formData.MarketID = useFuturesStore().getGoods(goodsid).value?.marketid ?? 0
+    formData.MarketID = futuresStore.getGoodsMarket(goodsid)
     formData.PriceMode = priceMove.value
     formData.RelatedID = orderid
-    formData.BuyOrSell = props.tabIndex === EOrderDirection.BUY ? EOrderDirection.SELL : EOrderDirection.BUY,
+    formData.BuyOrSell = props.tabIndex === EOrderDirection.BUY ? EOrderDirection.SELL : EOrderDirection.BUY
     formData.GoodsID = goodsid
     formData.PriceMode = priceMove.value
     formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTING

+ 9 - 5
src/packages/mobile/views/swap/detail/components/listing/Index.vue

@@ -20,12 +20,14 @@
             </Field>
             <Field name="OrderPrice" :rules="formRules.OrderPrice" label="挂牌价格" v-if="priceMove === 2">
                 <template #input>
-                    <Stepper v-model="formData.OrderPrice" input-width="100" theme="round" button-size="22" :auto-fixed="false" :step="0.01" />
+                    <Stepper v-model="formData.OrderPrice" input-width="100" theme="round" button-size="22"
+                        :auto-fixed="false" :step="0.01" />
                 </template>
             </Field>
             <Field name="MarketMaxSub" :rules="formRules.MarketMaxSub" label="点差" v-if="priceMove === 3">
                 <template #input>
-                    <Stepper v-model="formData.MarketMaxSub" input-width="100" theme="round" button-size="22" :auto-fixed="false" :step="0.01" />
+                    <Stepper v-model="formData.MarketMaxSub" input-width="100" theme="round" button-size="22"
+                        :auto-fixed="false" :step="0.01" />
                 </template>
             </Field>
             <Field label="估算价格" v-if="priceMove === 3">
@@ -40,7 +42,8 @@
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="挂牌数量">
                 <template #input>
-                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22" :auto-fixed="false" integer />
+                    <Stepper v-model="formData.OrderQty" input-width="100" theme="round" button-size="22"
+                        :auto-fixed="false" integer />
                 </template>
             </Field>
             <Field label="挂牌金额" v-if="priceMove === 2">
@@ -81,6 +84,7 @@ import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType,
 import AppPopup from '@mobile/components/base/popup/index.vue'
 
 const accountStore = useAccountStore()
+const futuresStore = useFuturesStore()
 const userStore = useUserStore()
 
 const formRef = shallowRef<FormInstance>()
@@ -113,8 +117,8 @@ const onSubmit = () => {
     /// 买卖方向
     const { goodsid } = props.item ?? {}
     /// 获取对应的市场ID
-    formData.MarketID = useFuturesStore().getGoods(goodsid).value?.marketid ?? 0
-    formData.BuyOrSell = buyOrSell.value,
+    formData.MarketID = futuresStore.getGoodsMarket(goodsid)
+    formData.BuyOrSell = buyOrSell.value
     formData.OrderPrice = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? formData.OrderPrice : 0.0
     formData.PriceMode = priceMove.value
     formData.MarketMaxSub = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? 0.0 : formData.MarketMaxSub

+ 1 - 1
src/stores/modules/enum.ts

@@ -12,7 +12,7 @@ export interface EnumType {
     disabled?: boolean;
 }
 
-const enumKeys = ['clientType', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2'] as const
+const enumKeys = ['clientType', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'delistingtype'] as const
 
 const enumMap = new Map<typeof enumKeys[number], ShallowRef<Model.EnumRsp[]>>()
 

+ 7 - 8
src/stores/modules/futures.ts

@@ -18,11 +18,6 @@ export const useFuturesStore = defineStore(() => {
         quoteDayList: <Model.QuoteDayRsp[]>[], // 盘面列表
     })
 
-    /// 根据商品id获取对应的商品信息
-    const getGoods = (goodsid: number) => {
-        return computed(() => state.goodsList.find((e) => e.goodsid === goodsid))
-    }
-
     // 行情列表
     const quoteList = computed(() => {
         return state.goodsList.reduce((res, cur) => {
@@ -99,8 +94,6 @@ export const useFuturesStore = defineStore(() => {
                 bidColor: handleColor(bid),
                 askColor: handleColor(ask),
                 lastColor: handleColor(last),
-                bidvolumeColor: handleColor(bidvolume),
-                askvolumeColor: handleColor(askvolume),
                 openedColor: handleColor(opened),
                 highestColor: handleColor(highest),
                 lowestColor: handleColor(lowest),
@@ -154,6 +147,12 @@ export const useFuturesStore = defineStore(() => {
         })
     }
 
+    // 获取商品市场ID
+    const getGoodsMarket = (code?: string | number) => {
+        const quote = state.goodsList.find((e) => e.goodscode === code || e.goodsid === code)
+        return quote?.marketid ?? 0
+    }
+
     // 处理行情数据
     const handleQuote = timerInterceptor.setThrottle(() => {
         state.quotes.forEach((item) => {
@@ -345,7 +344,7 @@ export const useFuturesStore = defineStore(() => {
         getGoodsList,
         getQuoteInfo,
         getQuotePrice,
-        getGoods,
+        getGoodsMarket,
         quotePushNotify,
     }
 })

+ 0 - 2
src/types/model/market.d.ts

@@ -95,8 +95,6 @@ declare namespace Model {
         bidColor: string;// 买价颜色
         askColor: string;// 卖价颜色
         lastColor: string;// 最新价颜色
-        bidvolumeColor: string;// 买量颜色
-        askvolumeColor: string;// 卖量颜色
         openedColor: string;// 开盘颜色
         highestColor: string;// 最高颜色
         lowestColor: string;// 最低颜色