li.shaoyi 2 lat temu
rodzic
commit
0eb52ec97a
26 zmienionych plików z 506 dodań i 373 usunięć
  1. 3 2
      src/business/bank/index.ts
  2. 2 9
      src/business/user/account.ts
  3. 17 0
      src/constants/account.ts
  4. 113 56
      src/packages/gstj/components/modules/quote/forex/index.vue
  5. 3 3
      src/packages/gstj/views/bank/wallet/components/deposit/Index.vue
  6. 4 52
      src/packages/gstj/views/goods/detail/components/listing/Index.vue
  7. 2 2
      src/packages/gstj/views/mine/Index.vue
  8. 113 56
      src/packages/mobile/components/modules/quote/forex/index.vue
  9. 12 6
      src/packages/mobile/views/account/certification/Index.vue
  10. 3 3
      src/packages/mobile/views/bank/wallet/components/deposit/Index.vue
  11. 4 52
      src/packages/mobile/views/goods/detail/components/listing/Index.vue
  12. 2 2
      src/packages/mobile/views/mine/Index.vue
  13. 4 0
      src/packages/pc/components/base/table/index.less
  14. 1 1
      src/packages/pc/views/auth/components/layout/index.vue
  15. 1 3
      src/packages/pc/views/footer/goods/position/index.vue
  16. 6 4
      src/packages/pc/views/market/trade/goods/detail/components/order/index.vue
  17. 113 56
      src/packages/qxst/components/modules/quote/forex/index.vue
  18. 3 3
      src/packages/qxst/views/bank/wallet/components/deposit/Index.vue
  19. 4 52
      src/packages/qxst/views/goods/detail/components/listing/Index.vue
  20. 2 2
      src/packages/qxst/views/mine/Index.vue
  21. 5 5
      src/packages/sbyj/views/bank/wallet/components/deposit/Index.vue
  22. 2 2
      src/packages/sbyj/views/mine/index.vue
  23. 1 0
      src/services/websocket/trade.ts
  24. 1 1
      src/stores/modules/enum.ts
  25. 82 0
      src/stores/modules/position.ts
  26. 3 1
      src/types/model/bank.d.ts

+ 3 - 2
src/business/bank/index.ts

@@ -1,11 +1,12 @@
 import { reactive, shallowRef, computed } from 'vue'
-import { useAccountStore, useUserStore } from '@/stores'
+import { useAccountStore, useUserStore, useLoginStore } from '@/stores'
 import { t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign, accountFundInfoReq } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/services/websocket/package/crypto'
 import moment from "moment"
 
 const accountStore = useAccountStore()
+const loginStore = useLoginStore()
 
 // 提现请求
 export function useDoWithdraw() {
@@ -76,7 +77,7 @@ export function useDoDeposit(userid?: number) {
 
     const request = queryBankAccountSign({
         data: {
-            userid
+            userid: userid ?? loginStore.userId
         }
     }).then((res) => {
         if (res.data.length) {

+ 2 - 9
src/business/user/account.ts

@@ -10,7 +10,7 @@ const accountStore = useAccountStore()
 export function addAuthReq() {
     const loading = shallowRef(false)
 
-    const formData = reactive<Partial<Model.AddAuthReq>>({
+    const formData = reactive<Model.AddAuthReq>({
         userid: loginStore.userId,
         cardtype: 0
     })
@@ -19,14 +19,7 @@ export function addAuthReq() {
         try {
             loading.value = true
             await requestAddAuth({
-                data: {
-                    ...formData,
-                    username: formData.username,
-                    cardtype: formData.cardtype,
-                    cardbackphotourl: formData.cardbackphotourl,
-                    cardfrontphotourl: formData.cardfrontphotourl,
-                    cardnum: formData.cardnum
-                }
+                data: formData
             })
         } finally {
             loading.value = false

+ 17 - 0
src/constants/account.ts

@@ -61,6 +61,23 @@ export function getCertificateTypeCodeValue(label: string) {
 }
 
 /**
+ * 获取个人证件类型列表
+ * @returns 
+ */
+export function getCerTypePersonList() {
+    return getEnumTypeList('certypeperson')
+}
+
+/**
+ * 获取个人证件类型名称
+ * @returns 
+ */
+export function getCerTypePersonName(value: number) {
+    const enums = getCerTypePersonList()
+    return getEnumTypeName(enums, value)
+}
+
+/**
  * 获取铁合金收益角色列表
  * @returns 
  */

+ 113 - 56
src/packages/gstj/components/modules/quote/forex/index.vue

@@ -1,75 +1,40 @@
 <template>
     <div class="app-quote-forex">
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onSellClick(1)">
-                <span>卖一</span>
-                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume) }}</span>
-            </dd>
-            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
-                <span>卖二</span>
-                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
-            </dd>
-            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
-                <span>卖三</span>
-                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
-            </dd>
-            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
-                <span>卖四</span>
-                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
-            </dd>
-            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
-                <span>卖五</span>
-                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in sellList" :key="index">
+                <dd :class="active === 'sell_' + index ? 'is-active' : ''" @click="onSellClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onBuyClick(1)">
-                <span>买一</span>
-                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
-            </dd>
-            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
-                <span>买二</span>
-                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
-            </dd>
-            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
-                <span>买三</span>
-                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
-            </dd>
-            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
-                <span>买四</span>
-                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
-            </dd>
-            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
-                <span>买五</span>
-                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in buyList" :key="index">
+                <dd :class="active === 'buy_' + index ? 'is-active' : ''" @click="onBuyClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
     </div>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef, computed, useAttrs } from 'vue'
 import { Icon } from 'vant'
 import { handleNumberValue } from '@/filters'
 import { useNavigation } from '../../../../router/navigation'
@@ -87,17 +52,109 @@ const props = defineProps({
     }
 })
 
-const emit = defineEmits(['sellclick', 'buyclick'])
+const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
+const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteInfo(props.goodsCode)
+const quote = computed(() => futuresStore.getQuoteInfo(props.goodsCode).value)
+const active = shallowRef('')
+
+const buyList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '买一',
+                price: item.bid,
+                qty: item.bidvolume,
+                color: item.bidColor,
+            },
+            {
+                label: '买二',
+                price: item.bid2,
+                qty: item.bidvolume2,
+                color: item.bid2Color,
+            },
+            {
+                label: '买三',
+                price: item.bid3,
+                qty: item.bidvolume3,
+                color: item.bid3Color,
+            },
+            {
+                label: '买四',
+                price: item.bid4,
+                qty: item.bidvolume4,
+                color: item.bid4Color,
+            },
+            {
+                label: '买五',
+                price: item.bid5,
+                qty: item.bidvolume5,
+                color: item.bid5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
+
+const sellList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '卖一',
+                price: item.ask,
+                qty: item.askvolume,
+                color: item.askColor,
+            },
+            {
+                label: '卖二',
+                price: item.ask2,
+                qty: item.askvolume2,
+                color: item.ask2Color,
+            },
+            {
+                label: '卖三',
+                price: item.ask3,
+                qty: item.askvolume3,
+                color: item.ask3Color,
+            },
+            {
+                label: '卖四',
+                price: item.ask4,
+                qty: item.askvolume4,
+                color: item.ask4Color,
+            },
+            {
+                label: '卖五',
+                price: item.ask5,
+                qty: item.askvolume5,
+                color: item.ask5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
 
 const onBuyClick = (index: number) => {
-    emit('buyclick', index)
+    if (attrs.onBuyClick) {
+        const { bid, presettle } = quote.value ?? {}
+        const item = buyList.value[index]
+        active.value = 'buy_' + index
+        emit('buyClick', item.price || bid || presettle)
+    }
 }
 
 const onSellClick = (index: number) => {
-    emit('sellclick', index)
+    if (attrs.onSellClick) {
+        const { ask, presettle } = quote.value ?? {}
+        const item = sellList.value[index]
+        active.value = 'sell_' + index
+        emit('sellClick', item.price || ask || presettle)
+    }
 }
 
 const navigateTo = (buyorsell: BuyOrSell) => {

+ 3 - 3
src/packages/gstj/views/bank/wallet/components/deposit/Index.vue

@@ -14,7 +14,7 @@
         <div class="g-form__time">
             <label>充值提现时间:{{ start }}-{{ end }}</label>
         </div>
-        <div class="g-form__bank">
+        <div class="g-form__bank" v-if="false">
             <table cellspacing="10" cellpadding="0">
                 <tr>
                     <td>
@@ -54,8 +54,8 @@
             </table>
         </div>
         <template #footer>
-            <div class="g-form__footer">
-                <Button round block type="primary" @click="formRef?.submit()">确定</Button>
+            <div class="g-form__footer inset">
+                <Button round block type="danger" @click="formRef?.submit()">确定</Button>
             </div>
         </template>
     </app-view>

+ 4 - 52
src/packages/gstj/views/goods/detail/components/listing/Index.vue

@@ -5,8 +5,8 @@
                 <app-navbar :title="quote ? `${quote.goodscode}/${quote.goodsname}` : '挂牌'" @back="closed" />
             </template>
             <component :is="Price" v-bind="{ goodsCode }" />
-            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buyclick="onBuyClick"
-                @sellclick="onSellClick" />
+            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buy-click="onPriceClick"
+                @sell-click="onPriceClick" />
             <Form ref="formRef" class="g-form__container" @submit="onSubmit">
                 <CellGroup inset>
                     <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格">
@@ -137,56 +137,8 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     }],
 }
 
-const onBuyClick = (index: number) => {
-    const { bid = 0, bid2 = 0, bid3 = 0, bid4 = 0, bid5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = bid
-            break
-        }
-        case 2: {
-            formData.OrderPrice = bid2 || bid
-            break
-        }
-        case 3: {
-            formData.OrderPrice = bid3 || bid
-            break
-        }
-        case 4: {
-            formData.OrderPrice = bid4 || bid
-            break
-        }
-        case 5: {
-            formData.OrderPrice = bid5 || bid
-            break
-        }
-    }
-}
-
-const onSellClick = (index: number) => {
-    const { ask = 0, ask2 = 0, ask3 = 0, ask4 = 0, ask5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = ask
-            break
-        }
-        case 2: {
-            formData.OrderPrice = ask2 || ask
-            break
-        }
-        case 3: {
-            formData.OrderPrice = ask3 || ask
-            break
-        }
-        case 4: {
-            formData.OrderPrice = ask4 || ask
-            break
-        }
-        case 5: {
-            formData.OrderPrice = ask5 || ask
-            break
-        }
-    }
+const onPriceClick = (price: number) => {
+    formData.OrderPrice = price
 }
 
 const onRadioChange = (value: number) => {

+ 2 - 2
src/packages/gstj/views/mine/Index.vue

@@ -46,8 +46,8 @@
                     </div>
                 </div>
                 <div class="button">
-                    <Button size="small" round @click="doInOutMoney('1')">提现</Button>
-                    <Button type="danger" size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button type="danger" size="small" round @click="doInOutMoney('1')">提现</Button>
                 </div>
             </div>
         </div>

+ 113 - 56
src/packages/mobile/components/modules/quote/forex/index.vue

@@ -1,75 +1,40 @@
 <template>
     <div class="app-quote-forex">
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onSellClick(1)">
-                <span>卖一</span>
-                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume) }}</span>
-            </dd>
-            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
-                <span>卖二</span>
-                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
-            </dd>
-            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
-                <span>卖三</span>
-                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
-            </dd>
-            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
-                <span>卖四</span>
-                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
-            </dd>
-            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
-                <span>卖五</span>
-                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in sellList" :key="index">
+                <dd :class="active === 'sell_' + index ? 'is-active' : ''" @click="onSellClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onBuyClick(1)">
-                <span>买一</span>
-                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
-            </dd>
-            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
-                <span>买二</span>
-                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
-            </dd>
-            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
-                <span>买三</span>
-                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
-            </dd>
-            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
-                <span>买四</span>
-                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
-            </dd>
-            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
-                <span>买五</span>
-                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in buyList" :key="index">
+                <dd :class="active === 'buy_' + index ? 'is-active' : ''" @click="onBuyClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
     </div>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef, computed, useAttrs } from 'vue'
 import { Icon } from 'vant'
 import { handleNumberValue } from '@/filters'
 import { useNavigation } from '../../../../router/navigation'
@@ -87,17 +52,109 @@ const props = defineProps({
     }
 })
 
-const emit = defineEmits(['sellclick', 'buyclick'])
+const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
+const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteInfo(props.goodsCode)
+const quote = computed(() => futuresStore.getQuoteInfo(props.goodsCode).value)
+const active = shallowRef('')
+
+const buyList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '买一',
+                price: item.bid,
+                qty: item.bidvolume,
+                color: item.bidColor,
+            },
+            {
+                label: '买二',
+                price: item.bid2,
+                qty: item.bidvolume2,
+                color: item.bid2Color,
+            },
+            {
+                label: '买三',
+                price: item.bid3,
+                qty: item.bidvolume3,
+                color: item.bid3Color,
+            },
+            {
+                label: '买四',
+                price: item.bid4,
+                qty: item.bidvolume4,
+                color: item.bid4Color,
+            },
+            {
+                label: '买五',
+                price: item.bid5,
+                qty: item.bidvolume5,
+                color: item.bid5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
+
+const sellList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '卖一',
+                price: item.ask,
+                qty: item.askvolume,
+                color: item.askColor,
+            },
+            {
+                label: '卖二',
+                price: item.ask2,
+                qty: item.askvolume2,
+                color: item.ask2Color,
+            },
+            {
+                label: '卖三',
+                price: item.ask3,
+                qty: item.askvolume3,
+                color: item.ask3Color,
+            },
+            {
+                label: '卖四',
+                price: item.ask4,
+                qty: item.askvolume4,
+                color: item.ask4Color,
+            },
+            {
+                label: '卖五',
+                price: item.ask5,
+                qty: item.askvolume5,
+                color: item.ask5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
 
 const onBuyClick = (index: number) => {
-    emit('buyclick', index)
+    if (attrs.onBuyClick) {
+        const { bid, presettle } = quote.value ?? {}
+        const item = buyList.value[index]
+        active.value = 'buy_' + index
+        emit('buyClick', item.price || bid || presettle)
+    }
 }
 
 const onSellClick = (index: number) => {
-    emit('sellclick', index)
+    if (attrs.onSellClick) {
+        const { ask, presettle } = quote.value ?? {}
+        const item = sellList.value[index]
+        active.value = 'sell_' + index
+        emit('sellClick', item.price || ask || presettle)
+    }
 }
 
 const navigateTo = (buyorsell: BuyOrSell) => {

+ 12 - 6
src/packages/mobile/views/account/certification/Index.vue

@@ -9,7 +9,7 @@
                     :rules="formRules.username" />
                 <Field name="cardtype" label="证件类型" :rules="formRules.cardtype" is-link>
                     <template #input>
-                        <app-select v-model="formData.cardtype" placeholder="请选择证件类型" :options="enums" />
+                        <app-select v-model="formData.cardtype" placeholder="请选择证件类型" :options="getCerTypePersonList()" />
                     </template>
                 </Field>
                 <Field v-model="formData.cardnum" name="cardnum" label="证件号码" placeholder="请输入证件号码"
@@ -24,6 +24,11 @@
                         <app-uploader @success="f_afterRead" />
                     </template>
                 </Field>
+                <Field name="halfbodyphotourl" label="手持证件照" :rules="formRules.halfbodyphotourl">
+                    <template #input>
+                        <app-uploader @success="h_afterRead" />
+                    </template>
+                </Field>
             </CellGroup>
         </Form>
         <img src="../../../assets/images/certification.png" />
@@ -36,11 +41,11 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, computed } from 'vue'
+import { shallowRef } from 'vue'
 import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule } from 'vant'
 import { addAuthReq } from '@/business/user'
 import { fullloading, dialog } from '@/utils/vant';
-import { getCertificateTypeList } from "@/constants/account";
+import { getCerTypePersonList } from "@/constants/account";
 import AppSelect from '../../../components/base/select/index.vue'
 import { useNavigation } from '../../../router/navigation'
 import AppUploader from '../../../components/base/uploader/index.vue'
@@ -49,9 +54,6 @@ const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = addAuthReq()
 const { router } = useNavigation()
 
-/// 获取对应的证件枚举类型
-const enums = computed(() => { return getCertificateTypeList().map(obj => { return { label: obj.label, value: obj.value } }) })
-
 const b_afterRead = (filePath: string) => {
     formData.cardfrontphotourl = filePath
 }
@@ -60,6 +62,10 @@ const f_afterRead = (filePath: string) => {
     formData.cardbackphotourl = filePath
 }
 
+const h_afterRead = (filePath: string) => {
+    formData.halfbodyphotourl = filePath
+}
+
 // 表单验证规则
 const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
     username: [{

+ 3 - 3
src/packages/mobile/views/bank/wallet/components/deposit/Index.vue

@@ -14,7 +14,7 @@
         <div class="g-form__time">
             <label>充值提现时间:{{ start }}-{{ end }}</label>
         </div>
-        <div class="g-form__bank">
+        <div class="g-form__bank" v-if="false">
             <table cellspacing="10" cellpadding="0">
                 <tr>
                     <td>
@@ -54,8 +54,8 @@
             </table>
         </div>
         <template #footer>
-            <div class="g-form__footer">
-                <Button round block type="primary" @click="formRef?.submit()">确定</Button>
+            <div class="g-form__footer inset">
+                <Button round block type="danger" @click="formRef?.submit()">确定</Button>
             </div>
         </template>
     </app-view>

+ 4 - 52
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -5,8 +5,8 @@
                 <app-navbar :title="quote ? `${quote.goodscode}/${quote.goodsname}` : '挂牌'" @back="closed" />
             </template>
             <component :is="Price" v-bind="{ goodsCode }" />
-            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buyclick="onBuyClick"
-                @sellclick="onSellClick" />
+            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buy-click="onPriceClick"
+                @sell-click="onPriceClick" />
             <Form ref="formRef" class="g-form__container" @submit="onSubmit">
                 <CellGroup inset>
                     <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格">
@@ -137,56 +137,8 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     }],
 }
 
-const onBuyClick = (index: number) => {
-    const { bid = 0, bid2 = 0, bid3 = 0, bid4 = 0, bid5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = bid
-            break
-        }
-        case 2: {
-            formData.OrderPrice = bid2 || bid
-            break
-        }
-        case 3: {
-            formData.OrderPrice = bid3 || bid
-            break
-        }
-        case 4: {
-            formData.OrderPrice = bid4 || bid
-            break
-        }
-        case 5: {
-            formData.OrderPrice = bid5 || bid
-            break
-        }
-    }
-}
-
-const onSellClick = (index: number) => {
-    const { ask = 0, ask2 = 0, ask3 = 0, ask4 = 0, ask5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = ask
-            break
-        }
-        case 2: {
-            formData.OrderPrice = ask2 || ask
-            break
-        }
-        case 3: {
-            formData.OrderPrice = ask3 || ask
-            break
-        }
-        case 4: {
-            formData.OrderPrice = ask4 || ask
-            break
-        }
-        case 5: {
-            formData.OrderPrice = ask5 || ask
-            break
-        }
-    }
+const onPriceClick = (price: number) => {
+    formData.OrderPrice = price
 }
 
 const onRadioChange = (value: number) => {

+ 2 - 2
src/packages/mobile/views/mine/Index.vue

@@ -46,8 +46,8 @@
                     </div>
                 </div>
                 <div class="button">
-                    <Button size="small" round @click="doInOutMoney('1')">提现</Button>
-                    <Button type="danger" size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button type="danger" size="small" round @click="doInOutMoney('1')">提现</Button>
                 </div>
             </div>
         </div>

+ 4 - 0
src/packages/pc/components/base/table/index.less

@@ -73,6 +73,10 @@
         &__expanded-cell {
             padding: 4px !important;
 
+            &:empty {
+                display: none;
+            }
+
             .buttonbar,
             .app-auth {
                 position: sticky;

+ 1 - 1
src/packages/pc/views/auth/components/layout/index.vue

@@ -29,7 +29,7 @@ defineProps({
   },
 })
 
-const year = new Date().getFullYear()
+//const year = new Date().getFullYear()
 </script>
 
 <style lang="less">

+ 1 - 3
src/packages/pc/views/footer/goods/position/index.vue

@@ -72,9 +72,7 @@ defineProps({
 })
 
 const { loading, dataList, run } = useRequest(queryTradePosition, {
-    params: {
-        tradeMode: '50'
-    },
+
 })
 
 const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TradePositionRsp>({ rowKey: 'pkid' })

+ 6 - 4
src/packages/pc/views/market/trade/goods/detail/components/order/index.vue

@@ -4,8 +4,8 @@
         <app-table class="sell" :data="sellList" v-model:columns="sellColumns" :row-key="rowKey"
             :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
             <!-- 展开行 -->
-            <template #expand="{ row }">
-                <div class="buttonbar">
+            <template #expand="{ row, index }">
+                <div class="buttonbar" v-if="index === 0">
                     <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
                         @click="showComponent('delisting', row)">摘牌</el-button>
                 </div>
@@ -14,8 +14,8 @@
         <app-table class="buy" :data="buyList" v-model:columns="buyColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
             @row-click="rowClick" showIndex>
             <!-- 展开行 -->
-            <template #expand="{ row }">
-                <div class="buttonbar">
+            <template #expand="{ row, index }">
+                <div class="buttonbar" v-if="index === 0">
                     <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
                         @click="showComponent('delisting', row)">摘牌</el-button>
                 </div>
@@ -56,6 +56,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 
 const { dataList: buyList, run: getBuyList } = useRequest(queryWrTradeOrderDetail, {
     params: {
+        pagesize: 10,
         goodsid: props.goodsId,
         buyorsell: BuyOrSell.Buy
     },
@@ -63,6 +64,7 @@ const { dataList: buyList, run: getBuyList } = useRequest(queryWrTradeOrderDetai
 
 const { dataList: sellList, run: getSellList } = useRequest(queryWrTradeOrderDetail, {
     params: {
+        pagesize: 10,
         goodsid: props.goodsId,
         buyorsell: BuyOrSell.Sell
     },

+ 113 - 56
src/packages/qxst/components/modules/quote/forex/index.vue

@@ -1,75 +1,40 @@
 <template>
     <div class="app-quote-forex">
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>卖挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Sell)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onSellClick(1)">
-                <span>卖一</span>
-                <span :class="quote.askColor">{{ handleNumberValue(quote.ask) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume) }}</span>
-            </dd>
-            <dd @click="onSellClick(2)" v-if="quote.quotegear > 1">
-                <span>卖二</span>
-                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
-            </dd>
-            <dd @click="onSellClick(3)" v-if="quote.quotegear > 2">
-                <span>卖三</span>
-                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
-            </dd>
-            <dd @click="onSellClick(4)" v-if="quote.quotegear > 3">
-                <span>卖四</span>
-                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
-            </dd>
-            <dd @click="onSellClick(5)" v-if="quote.quotegear > 4">
-                <span>卖五</span>
-                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5) }}</span>
-                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in sellList" :key="index">
+                <dd :class="active === 'sell_' + index ? 'is-active' : ''" @click="onSellClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
-        <dl v-if="quote">
+        <dl>
             <dt>
                 <span>买挂牌</span>
                 <span @click="navigateTo(BuyOrSell.Buy)" v-if="showMore">更多
                     <Icon name="arrow" />
                 </span>
             </dt>
-            <dd @click="onBuyClick(1)">
-                <span>买一</span>
-                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
-            </dd>
-            <dd @click="onBuyClick(2)" v-if="quote.quotegear > 1">
-                <span>买二</span>
-                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
-            </dd>
-            <dd @click="onBuyClick(3)" v-if="quote.quotegear > 2">
-                <span>买三</span>
-                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
-            </dd>
-            <dd @click="onBuyClick(4)" v-if="quote.quotegear > 3">
-                <span>买四</span>
-                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
-            </dd>
-            <dd @click="onBuyClick(5)" v-if="quote.quotegear > 4">
-                <span>买五</span>
-                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5) }}</span>
-                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
-            </dd>
+            <template v-for="(item, index) in buyList" :key="index">
+                <dd :class="active === 'buy_' + index ? 'is-active' : ''" @click="onBuyClick(index)">
+                    <span>{{ item.label }}</span>
+                    <span :class="item.color">{{ handleNumberValue(item.price.toFixed(quote?.decimalplace)) }}</span>
+                    <span>{{ handleNumberValue(item.qty) }}</span>
+                </dd>
+            </template>
         </dl>
     </div>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef, computed, useAttrs } from 'vue'
 import { Icon } from 'vant'
 import { handleNumberValue } from '@/filters'
 import { useNavigation } from '../../../../router/navigation'
@@ -87,17 +52,109 @@ const props = defineProps({
     }
 })
 
-const emit = defineEmits(['sellclick', 'buyclick'])
+const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 const { router } = useNavigation()
+const attrs = useAttrs()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getQuoteInfo(props.goodsCode)
+const quote = computed(() => futuresStore.getQuoteInfo(props.goodsCode).value)
+const active = shallowRef('')
+
+const buyList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '买一',
+                price: item.bid,
+                qty: item.bidvolume,
+                color: item.bidColor,
+            },
+            {
+                label: '买二',
+                price: item.bid2,
+                qty: item.bidvolume2,
+                color: item.bid2Color,
+            },
+            {
+                label: '买三',
+                price: item.bid3,
+                qty: item.bidvolume3,
+                color: item.bid3Color,
+            },
+            {
+                label: '买四',
+                price: item.bid4,
+                qty: item.bidvolume4,
+                color: item.bid4Color,
+            },
+            {
+                label: '买五',
+                price: item.bid5,
+                qty: item.bidvolume5,
+                color: item.bid5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
+
+const sellList = computed(() => {
+    const item = quote.value
+    if (item) {
+        const result = [
+            {
+                label: '卖一',
+                price: item.ask,
+                qty: item.askvolume,
+                color: item.askColor,
+            },
+            {
+                label: '卖二',
+                price: item.ask2,
+                qty: item.askvolume2,
+                color: item.ask2Color,
+            },
+            {
+                label: '卖三',
+                price: item.ask3,
+                qty: item.askvolume3,
+                color: item.ask3Color,
+            },
+            {
+                label: '卖四',
+                price: item.ask4,
+                qty: item.askvolume4,
+                color: item.ask4Color,
+            },
+            {
+                label: '卖五',
+                price: item.ask5,
+                qty: item.askvolume5,
+                color: item.ask5Color,
+            }
+        ]
+        return result.slice(0, item.quotegear || 1)
+    }
+    return []
+})
 
 const onBuyClick = (index: number) => {
-    emit('buyclick', index)
+    if (attrs.onBuyClick) {
+        const { bid, presettle } = quote.value ?? {}
+        const item = buyList.value[index]
+        active.value = 'buy_' + index
+        emit('buyClick', item.price || bid || presettle)
+    }
 }
 
 const onSellClick = (index: number) => {
-    emit('sellclick', index)
+    if (attrs.onSellClick) {
+        const { ask, presettle } = quote.value ?? {}
+        const item = sellList.value[index]
+        active.value = 'sell_' + index
+        emit('sellClick', item.price || ask || presettle)
+    }
 }
 
 const navigateTo = (buyorsell: BuyOrSell) => {

+ 3 - 3
src/packages/qxst/views/bank/wallet/components/deposit/Index.vue

@@ -14,7 +14,7 @@
         <div class="g-form__time">
             <label>充值提现时间:{{ start }}-{{ end }}</label>
         </div>
-        <div class="g-form__bank">
+        <div class="g-form__bank" v-if="false">
             <table cellspacing="10" cellpadding="0">
                 <tr>
                     <td>
@@ -54,8 +54,8 @@
             </table>
         </div>
         <template #footer>
-            <div class="g-form__footer">
-                <Button round block type="primary" @click="formRef?.submit()">确定</Button>
+            <div class="g-form__footer inset">
+                <Button round block type="danger" @click="formRef?.submit()">确定</Button>
             </div>
         </template>
     </app-view>

+ 4 - 52
src/packages/qxst/views/goods/detail/components/listing/Index.vue

@@ -5,8 +5,8 @@
                 <app-navbar :title="quote ? `${quote.goodscode}/${quote.goodsname}` : '挂牌'" @back="closed" />
             </template>
             <component :is="Price" v-bind="{ goodsCode }" />
-            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buyclick="onBuyClick"
-                @sellclick="onSellClick" />
+            <component :is="Forex" v-bind="{ goodsCode, showMore: false }" @buy-click="onPriceClick"
+                @sell-click="onPriceClick" />
             <Form ref="formRef" class="g-form__container" @submit="onSubmit">
                 <CellGroup inset>
                     <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格">
@@ -137,56 +137,8 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     }],
 }
 
-const onBuyClick = (index: number) => {
-    const { bid = 0, bid2 = 0, bid3 = 0, bid4 = 0, bid5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = bid
-            break
-        }
-        case 2: {
-            formData.OrderPrice = bid2 || bid
-            break
-        }
-        case 3: {
-            formData.OrderPrice = bid3 || bid
-            break
-        }
-        case 4: {
-            formData.OrderPrice = bid4 || bid
-            break
-        }
-        case 5: {
-            formData.OrderPrice = bid5 || bid
-            break
-        }
-    }
-}
-
-const onSellClick = (index: number) => {
-    const { ask = 0, ask2 = 0, ask3 = 0, ask4 = 0, ask5 = 0 } = quote.value ?? {}
-    switch (index) {
-        case 1: {
-            formData.OrderPrice = ask
-            break
-        }
-        case 2: {
-            formData.OrderPrice = ask2 || ask
-            break
-        }
-        case 3: {
-            formData.OrderPrice = ask3 || ask
-            break
-        }
-        case 4: {
-            formData.OrderPrice = ask4 || ask
-            break
-        }
-        case 5: {
-            formData.OrderPrice = ask5 || ask
-            break
-        }
-    }
+const onPriceClick = (price: number) => {
+    formData.OrderPrice = price
 }
 
 const onRadioChange = (value: number) => {

+ 2 - 2
src/packages/qxst/views/mine/Index.vue

@@ -46,8 +46,8 @@
                     </div>
                 </div>
                 <div class="button">
-                    <Button size="small" round @click="doInOutMoney('1')">提现</Button>
-                    <Button type="danger" size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button type="danger" size="small" round @click="doInOutMoney('1')">提现</Button>
                 </div>
             </div>
         </div>

+ 5 - 5
src/packages/sbyj/views/bank/wallet/components/deposit/Index.vue

@@ -14,7 +14,7 @@
         <div class="g-form__time">
             <label>充值提现时间:{{ start }}-{{ end }}</label>
         </div>
-        <div class="g-form__bank">
+        <div class="g-form__bank" v-if="false">
             <table cellspacing="10" cellpadding="0">
                 <tr>
                     <td>
@@ -54,8 +54,8 @@
             </table>
         </div>
         <template #footer>
-            <div class="g-form__footer">
-                <Button round block type="primary" @click="formRef?.submit()">确定</Button>
+            <div class="g-form__footer inset">
+                <Button round block type="danger" @click="formRef?.submit()">确定</Button>
             </div>
         </template>
     </app-view>
@@ -66,9 +66,9 @@ import { shallowRef } from 'vue'
 import { Form, Field, CellGroup, Button, FieldRule, FormInstance, showFailToast, showSuccessToast } from 'vant'
 import { useDoDeposit } from '@/business/bank'
 import { fullloading, dialog } from '@/utils/vant'
-import { useNavigation } from '@/packages/sbyj/router/navigation'
+import { useNavigation } from '../../../../../router/navigation'
 import { useUserStore } from '@/stores'
-import AppUploader from '@/packages/sbyj/components/base/uploader/index.vue'
+import AppUploader from '../../../../../components/base/uploader/index.vue'
 
 const formRef = shallowRef<FormInstance>()
 const { formData, onSubmit, extendInfo } = useDoDeposit()

+ 2 - 2
src/packages/sbyj/views/mine/index.vue

@@ -46,8 +46,8 @@
                     </div>
                 </div>
                 <div class="button">
-                    <Button size="small" round @click="doInOutMoney('1')">提现</Button>
-                    <Button type="primary" size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button size="small" round @click="doInOutMoney('0')">充值</Button>
+                    <Button type="danger" size="small" round @click="doInOutMoney('1')">提现</Button>
                 </div>
             </div>
         </div>

+ 1 - 0
src/services/websocket/trade.ts

@@ -19,6 +19,7 @@ export default new (class {
 
             switch (funCode) {
                 case FunCode.LogoutRsp: {
+                    console.log('接收到用户登出通知', funCode)
                     // 用户登出通知
                     eventBus.$emit('LogoutNotify', '网络错误')
                     break;

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

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

+ 82 - 0
src/stores/modules/position.ts

@@ -0,0 +1,82 @@
+import { reactive, computed, toRefs } from 'vue'
+import { BuyOrSell } from '@/constants/order'
+import { queryTradePosition } from '@/services/api/order'
+import { useFuturesStore } from './futures'
+import { defineStore } from '../store'
+import eventBus from '@/services/bus'
+
+/**
+ * 持仓存储对象
+ */
+const useStore = defineStore(() => {
+    const futuresStore = useFuturesStore()
+    const state = reactive({
+        loading: false,
+        tradeMode: 0,
+        orderPositionList: <Model.TradePositionRsp[]>[], // 持仓汇总列表
+    })
+
+    // 获取持仓汇总列表
+    const getTradePosition = async () => {
+        try {
+            state.loading = true
+            const res = await queryTradePosition()
+            state.orderPositionList = res.data
+        } finally {
+            state.loading = false
+        }
+    }
+
+    // 持仓汇总计算列表
+    const orderPositionComputedList = computed(() => {
+        const result: (Model.TradePositionRsp & {
+            closepl: number; // 参考损益
+        })[] = []
+
+        state.orderPositionList.forEach((item) => {
+            const lastPrice = futuresStore.getQuotePrice(item.goodscode)
+
+            // 计算参考损益
+            const closepl = (lastPrice.value * item.curpositionqty * item.agreeunit - item.curholderamount) * (item.buyorsell === BuyOrSell.Buy ? 1 : -1)
+
+            result.push({
+                ...item,
+                closepl,
+            })
+        })
+
+        return result
+    })
+
+    const orderPositionList = computed(() => {
+        if (state.tradeMode) {
+            return orderPositionComputedList.value.filter((e) => e.trademode === state.tradeMode)
+        }
+        return orderPositionComputedList.value
+    })
+
+    // 获取持仓数量
+    const getOrderQty = (buyOrSell: BuyOrSell, goodsCode: string) => {
+        return computed(() => {
+            const item = state.orderPositionList.find((e) => e.goodscode === goodsCode && e.buyorsell === buyOrSell)
+            return item?.enableqty ?? 0
+        })
+    }
+
+    // 接收持仓变化通知
+    const posChangedNtf = eventBus.$on('PosChangedNtf', () => getTradePosition())
+
+    return {
+        ...toRefs(state),
+        getTradePosition,
+        getOrderQty,
+        orderPositionList,
+        posChangedNtf,
+    }
+})
+
+export const usePositionStore = (tradeMode = 0) => {
+    const store = useStore()
+    store.tradeMode = tradeMode
+    return store
+}

+ 3 - 1
src/types/model/bank.d.ts

@@ -214,7 +214,9 @@ declare namespace Model {
         /// 证件反面照
         cardbackphotourl?: string,
         // 用户id
-        userid?: number
+        userid?: number;
+        halfbodyphotourl?: string; // 手持证件照
+        userinfotype?: number; // 用户类型
     }
 
     /** 资金流水查询(当前) 请求 */