li.shaoyi 2 éve
szülő
commit
1af11b8112

+ 4 - 4
src/packages/mobile/components/base/list/index.vue

@@ -13,7 +13,7 @@
             </thead>
             <tbody class="app-list__body">
                 <template v-for="(row, i) in dataList" :key="i">
-                    <tr class="app-list__row" @click="onClick(row, i)">
+                    <tr class="app-list__row" @click="rowClick(row, i)">
                         <td class="app-list__column" :class="column.className" v-for="(column, n) in columns"
                             :key="i + n.toString()">
                             <div class="app-list__cell">
@@ -46,11 +46,11 @@ defineProps({
     }
 })
 
-const emit = defineEmits(['click'])
+const emit = defineEmits(['rowClick'])
 //const colWidth = computed(() => (100 / props.columns.length) + '%')
 
-const onClick = (row: unknown, index: number) => {
-    emit('click', row, index)
+const rowClick = (row: unknown, index: number) => {
+    emit('rowClick', row, index)
 }
 </script>
 

+ 3 - 3
src/packages/mobile/router/index.ts

@@ -71,7 +71,7 @@ const routes: Array<RouteRecordRaw> = [
     children: [
       {
         path: 'login',
-        name: "user-login",
+        name: 'user-login',
         component: () => import('../views/user/login/Index.vue'),
         meta: {
           ignoreAuth: true,
@@ -79,7 +79,7 @@ const routes: Array<RouteRecordRaw> = [
       },
       {
         path: 'register',
-        name: "user-register",
+        name: 'user-register',
         component: () => import('../views/user/register/Index.vue'),
         meta: {
           ignoreAuth: true,
@@ -87,7 +87,7 @@ const routes: Array<RouteRecordRaw> = [
       },
       {
         path: 'forget',
-        name: "user-forget",
+        name: 'user-forget',
         component: () => import('../views/user/forget/Index.vue'),
         meta: {
           ignoreAuth: true,

+ 10 - 0
src/packages/mobile/views/goods/list/Index.vue

@@ -0,0 +1,10 @@
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="订单挂牌" />
+        </template>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+</script>

+ 2 - 1
src/packages/mobile/views/home/Index.vue

@@ -100,7 +100,8 @@ const versionToNumber = (value: number | string) => {
 }
 
 onMounted(() => {
-  currentTab.value = tabList.findIndex((e) => e.name === route.name)
+  const { tabIndex } = getGlobalUrlParams()
+  currentTab.value = tabIndex > -1 ? tabIndex : tabList.findIndex((e) => e.name === route.name)
 
   const os = plus.getSystemInfo('os')
   const currentVersion = plus.getSystemInfo('version')

+ 1 - 1
src/packages/mobile/views/home/main/Index.vue

@@ -29,7 +29,7 @@
           </li>
         </ul>
         <ul>
-          <li>
+          <li @click="routerTo('goods-list')">
             <img src="@mobile/assets/icons/wdrw.svg" />
             <span>订单挂牌</span>
           </li>

+ 9 - 5
src/packages/mobile/views/market/list/Index.vue

@@ -3,11 +3,7 @@
         <template #header>
             <app-navbar title="参考行情" />
         </template>
-        <app-list :columns="columns" :data-list="dataList">
-            <!-- 合约 -->
-            <template #goodscode="{ value }">
-                <span @click="$router.push({ name: 'market-detail' })">{{ value }}</span>
-            </template>
+        <app-list :columns="columns" :data-list="dataList" @row-click="rowClick">
             <!-- 卖价 -->
             <template #ask="{ row }">
                 <span :class="row.askColor">{{ row.ask }}</span>
@@ -47,10 +43,12 @@
 <script lang="ts" setup>
 import { onMounted, onUnmounted, computed } from 'vue'
 import { parsePercent, handleNumberValue } from '@/filters'
+import { useNavigation } from '@/hooks/navigation'
 import { useFuturesStore } from '@/stores'
 import quoteSocket from '@/services/websocket/quote'
 import AppList from '@mobile/components/base/list/index.vue'
 
+const { router } = useNavigation()
 const futuresStore = useFuturesStore()
 
 const dataList = computed(() => {
@@ -93,6 +91,12 @@ const columns: Model.TableColumn[] = [
     { prop: 'amplitude', label: '振幅' },
 ]
 
+const rowClick = () => {
+    router.push({
+        name: 'market-detail',
+    })
+}
+
 onMounted(() => subscribe.start())
 onUnmounted(() => subscribe.stop())
 </script>

+ 52 - 0
src/packages/mobile/views/order/list/components/transfer/detail/Index.vue

@@ -0,0 +1,52 @@
+<!-- 我的持仓-转让持仓-详情 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="转让持仓详情" @back="closed" />
+            </template>
+            <div class="g-form__container">
+                <CellGroup title="预售认购信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodsname" />
+                    <Cell title="持仓金额" :value="selectedRow.buycurholderamount" />
+                    <Cell title="持仓数量" :value="selectedRow.buycurpositionqty" />
+                    <Cell title="冻结数量" :value="selectedRow.buyfrozenqty" />
+                    <Cell title="可用数量" :value="selectedRow.buycurpositionqty - selectedRow.buyfrozenqty" />
+                    <Cell title="发售方" :value="selectedRow.sellname" />
+                    <Cell title="订货价" :value="selectedRow.presaleprice" />
+                    <Cell title="总货款" :value="selectedRow.buycurpositionqty * selectedRow.presaleprice" />
+                    <Cell title="转让订金比例" :value="selectedRow.transferdepositratio" />
+                    <Cell title="转让订金" :value="selectedRow.transferdeposit" />
+                    <Cell title="未付订金" :value="selectedRow.depositremain" />
+                    <Cell title="支付状态" :value="selectedRow.paystatus" />
+                    <Cell title="最后交易日" :value="selectedRow.lasttradedate" />
+                </CellGroup>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import AppModal from '@/components/base/modal/index.vue'
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.MineTradePositionExsRsp>,
+        required: true,
+    }
+})
+
+const showModal = shallowRef(true)
+
+// 关闭弹窗
+const closed = () => {
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 104 - 0
src/packages/mobile/views/order/list/components/transfer/list/Index.vue

@@ -0,0 +1,104 @@
+<!-- 我的持仓-转让委托 -->
+<template>
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+        :page-count="pageCount" @refresh="run">
+        <div class="g-order-list">
+            <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
+                <div class="g-order-list__titlebar">
+                    <div class="left">
+                        <h4>{{ item.goodsname }}</h4>
+                    </div>
+                    <div class="right">
+                        <span>{{ item.paystatus }}</span>
+                    </div>
+                </div>
+                <div class="g-order-list__content">
+                    <ul>
+                        <li>
+                            <span>持仓数量</span>
+                            <span>{{ item.buycurpositionqty }}</span>
+                        </li>
+                        <li>
+                            <span>订货价</span>
+                            <span>{{ item.presaleprice }}</span>
+                        </li>
+                        <li>
+                            <span>持仓金额</span>
+                            <span>{{ item.buycurholderamount }}</span>
+                        </li>
+                        <li>
+                            <span>转让定金比例</span>
+                            <span>{{ item.transferdepositratio }}</span>
+                        </li>
+                        <li>
+                            <span>转让定金</span>
+                            <span>{{ item.transferdeposit }}</span>
+                        </li>
+                        <li>
+                            <span>未付定金</span>
+                            <span>{{ item.depositremain }}</span>
+                        </li>
+                        <li>
+                            <span>最后交易日</span>
+                            <span>{{ item.lasttradedate }}</span>
+                        </li>
+                        <li>
+                            <span>可用数量</span>
+                            <span>{{ item.buycurpositionqty - item.buyfrozenqty }}</span>
+                        </li>
+                    </ul>
+                </div>
+                <div class="g-order-list__btnbar">
+                    <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>追加定金</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>转让</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>交收</Button>
+                </div>
+            </div>
+        </div>
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
+    </app-pull-refresh>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { Button } from 'vant'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { queryMineTradePositionExs } from '@/services/api/transfer'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../detail/Index.vue'))],
+])
+
+const dataList = shallowRef<Model.MineTradePositionExsRsp[]>([])
+const selectedRow = shallowRef<Model.MineTradePositionExsRsp>()
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    pullRefreshRef.value?.refresh()
+})
+
+const { loading, pageIndex, pageCount, run } = useRequest(queryMineTradePositionExs, {
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+const showComponent = (componentName: string, row: Model.MineTradePositionExsRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+</script>

+ 3 - 1
src/packages/mobile/views/order/position/Index.vue

@@ -8,9 +8,10 @@
                 <Presale />
             </Tab>
             <Tab title="转让持仓">
+                <Transfer />
             </Tab>
             <Tab title="掉期持仓">
-               <Swap />
+                <Swap />
             </Tab>
             <Tab title="订单持仓">
             </Tab>
@@ -25,6 +26,7 @@
 import { shallowRef } from 'vue'
 import { Tab, Tabs } from 'vant'
 import Presale from './components/presale/list/Index.vue'
+import Transfer from './components/transfer/list/Index.vue'
 import Spot from './components/spot/list/Index.vue'
 import Swap from './components/swap/list/Index.vue'
 

+ 52 - 0
src/packages/mobile/views/order/position/components/transfer/detail/Index.vue

@@ -0,0 +1,52 @@
+<!-- 我的持仓-转让持仓-详情 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="转让持仓详情" @back="closed" />
+            </template>
+            <div class="g-form__container">
+                <CellGroup title="预售认购信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodsname" />
+                    <Cell title="持仓金额" :value="selectedRow.buycurholderamount" />
+                    <Cell title="持仓数量" :value="selectedRow.buycurpositionqty" />
+                    <Cell title="冻结数量" :value="selectedRow.buyfrozenqty" />
+                    <Cell title="可用数量" :value="selectedRow.buycurpositionqty - selectedRow.buyfrozenqty" />
+                    <Cell title="发售方" :value="selectedRow.sellname" />
+                    <Cell title="订货价" :value="selectedRow.presaleprice" />
+                    <Cell title="总货款" :value="selectedRow.buycurpositionqty * selectedRow.presaleprice" />
+                    <Cell title="转让订金比例" :value="selectedRow.transferdepositratio" />
+                    <Cell title="转让订金" :value="selectedRow.transferdeposit" />
+                    <Cell title="未付订金" :value="selectedRow.depositremain" />
+                    <Cell title="支付状态" :value="selectedRow.paystatus" />
+                    <Cell title="最后交易日" :value="selectedRow.lasttradedate" />
+                </CellGroup>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import AppModal from '@/components/base/modal/index.vue'
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.MineTradePositionExsRsp>,
+        required: true,
+    }
+})
+
+const showModal = shallowRef(true)
+
+// 关闭弹窗
+const closed = () => {
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 104 - 0
src/packages/mobile/views/order/position/components/transfer/list/Index.vue

@@ -0,0 +1,104 @@
+<!-- 我的持仓-转让持仓 -->
+<template>
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+        :page-count="pageCount" @refresh="run">
+        <div class="g-order-list">
+            <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
+                <div class="g-order-list__titlebar">
+                    <div class="left">
+                        <h4>{{ item.goodsname }}</h4>
+                    </div>
+                    <div class="right">
+                        <span>{{ item.paystatus }}</span>
+                    </div>
+                </div>
+                <div class="g-order-list__content">
+                    <ul>
+                        <li>
+                            <span>持仓数量</span>
+                            <span>{{ item.buycurpositionqty }}</span>
+                        </li>
+                        <li>
+                            <span>订货价</span>
+                            <span>{{ item.presaleprice }}</span>
+                        </li>
+                        <li>
+                            <span>持仓金额</span>
+                            <span>{{ item.buycurholderamount }}</span>
+                        </li>
+                        <li>
+                            <span>转让定金比例</span>
+                            <span>{{ item.transferdepositratio }}</span>
+                        </li>
+                        <li>
+                            <span>转让定金</span>
+                            <span>{{ item.transferdeposit }}</span>
+                        </li>
+                        <li>
+                            <span>未付定金</span>
+                            <span>{{ item.depositremain }}</span>
+                        </li>
+                        <li>
+                            <span>最后交易日</span>
+                            <span>{{ item.lasttradedate }}</span>
+                        </li>
+                        <li>
+                            <span>可用数量</span>
+                            <span>{{ item.buycurpositionqty - item.buyfrozenqty }}</span>
+                        </li>
+                    </ul>
+                </div>
+                <div class="g-order-list__btnbar">
+                    <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>追加定金</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>转让</Button>
+                    <Button size="small" @click="showComponent('detail', item)" round>交收</Button>
+                </div>
+            </div>
+        </div>
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
+    </app-pull-refresh>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { Button } from 'vant'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { queryMineTradePositionExs } from '@/services/api/transfer'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../detail/Index.vue'))],
+])
+
+const dataList = shallowRef<Model.MineTradePositionExsRsp[]>([])
+const selectedRow = shallowRef<Model.MineTradePositionExsRsp>()
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    pullRefreshRef.value?.refresh()
+})
+
+const { loading, pageIndex, pageCount, run } = useRequest(queryMineTradePositionExs, {
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+const showComponent = (componentName: string, row: Model.MineTradePositionExsRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+</script>

+ 20 - 51
src/packages/mobile/views/transfer/detail/Index.vue

@@ -8,51 +8,21 @@
                 <img :src="url" />
             </SwipeItem>
         </Swipe>
-        <div class="g-detail__info">
+        <div class="g-detail__info" v-if="detail">
             <div class="pricebar">
                 <div class="pricebar-left">
-                    <span class="tag">起拍价</span>
+                    <span class="tag">订货价</span>
                     <span class="unit">¥</span>
-                    <span class="price">{{ detail.startprice?.toFixed(2) }}</span>
+                    <span class="price">{{ detail.presaleprice.toFixed(2) }}</span>
                 </div>
                 <div class="pricebar-right">
-                    <span>总量:{{ detail.presaleqty }}</span>
+                    <span>最新价:{{ detail.goodsid }}</span>
                 </div>
             </div>
-            <div class="tag">
-                <Tag type="danger" round>大宗竞拍</Tag>
-            </div>
             <div class="titlebar">
                 <span>{{ detail.sellname }}</span>
                 <span>{{ detail.goodsname }}</span>
             </div>
-            <div class="timebar">
-
-            </div>
-        </div>
-        <div class="g-detail__cell">
-            <ul>
-                <li>
-                    <span>预售定金</span>
-                    <span>{{ earnest }}</span>
-                </li>
-                <li>
-                    <span>转让比例</span>
-                    <span>{{ parsePercent(detail.transferdepositratio) }}</span>
-                </li>
-            </ul>
-        </div>
-        <div class="g-detail__cell">
-            <ul>
-                <li>
-                    <span>开始时间</span>
-                    <span>{{ detail.starttime }}</span>
-                </li>
-                <li>
-                    <span>结束时间</span>
-                    <span>{{ detail.endtime }}</span>
-                </li>
-            </ul>
         </div>
         <div class="g-detail__desc">
             <template v-for="(url, index) in detailImages" :key="index">
@@ -73,39 +43,38 @@
 import { computed, defineAsyncComponent } from 'vue'
 import { Swipe, SwipeItem, Button, Tag } from 'vant'
 import { getFileUrl, parsePercent } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryPresaleDefault } from '@/services/api/transfer'
 import { useComponent } from '@/hooks/component'
 import { useNavigation } from '@/hooks/navigation'
+import { useFuturesStore } from '@/stores'
 
 const componentMap = new Map<string, unknown>([
     ['delisting', defineAsyncComponent(() => import('./components/delisting/index.vue'))], // 摘牌
 ])
 
-const { getParamString } = useNavigation()
+const { getQueryStringToNumber } = useNavigation()
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
-const qs = getParamString('item')
-const detail: Model.PresaleAuctionsRsp = JSON.parse(qs.toString() || '{}')
+const futuresStore = useFuturesStore()
+
+const { data: detail } = useRequest(queryPresaleDefault, {
+    params: {
+        goodsid: getQueryStringToNumber('goodsid'),
+    },
+    onSuccess: (res) => {
+        futuresStore.getQuotePrice(res.data.goodscode)
+    }
+})
 
 // 商品banner
 const detailBanners = computed(() => {
-    const bannerpicurl = detail.bannerpicurl ?? ''
+    const bannerpicurl = detail.value?.bannerpicurl ?? ''
     return bannerpicurl?.split(',').map((path) => getFileUrl(path))
 })
 
-// 预售定金
-const earnest = computed(() => {
-    switch (detail.presaledepositalgorithm) {
-        case 1:
-            return (detail.presaledepositvalue * 100).toFixed(2)
-        case 2:
-            return detail.presaledepositvalue.toFixed(2)
-        default:
-            return '0.0'
-    }
-})
-
 // 商品图片列表
 const detailImages = computed(() => {
-    const pictureurls = detail.pictureurls ?? ''
+    const pictureurls = detail.value?.pictureurls ?? ''
     return pictureurls.split(',').map((path) => getFileUrl(path))
 })
 </script>

+ 11 - 5
src/packages/mobile/views/transfer/list/Index.vue

@@ -3,27 +3,26 @@
         <template #header>
             <app-navbar title="订单转让" :show-back-button="false" />
         </template>
-        <app-list :columns="columns" :data-list="dataList">
-            <template #goodscode="{ value }">
-                <span @click="$router.push({ name: 'transfer-detail' })">{{ value }}</span>
-            </template>
-        </app-list>
+        <app-list :columns="columns" :data-list="dataList" @row-click="rowClick" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { onMounted, computed } from 'vue'
 import { handleNumberValue } from '@/filters'
+import { useNavigation } from '@/hooks/navigation'
 import { useFuturesStore } from '@/stores'
 import quoteSocket from '@/services/websocket/quote'
 import AppList from '@mobile/components/base/list/index.vue'
 
+const { router } = useNavigation()
 const futuresStore = useFuturesStore()
 
 const dataList = computed(() => {
     const list = futuresStore.quoteList.filter((e) => e.marketid === 49201)
     return list.map((e) => ({
         goodscode: e.goodscode,
+        goodsid: e.goodsid,
         ask: handleNumberValue(e.ask),
         last: handleNumberValue(e.last),
         askvolume: handleNumberValue(e.askvolume),
@@ -40,5 +39,12 @@ const columns: Model.TableColumn[] = [
     { prop: 'askvolume', label: '卖量' },
 ]
 
+const rowClick = ({ goodsid }: Model.Futures) => {
+    router.push({
+        name: 'transfer-detail',
+        query: { goodsid }
+    })
+}
+
 onMounted(() => subscribe.start())
 </script>

+ 54 - 0
src/services/api/transfer/index.ts

@@ -0,0 +1,54 @@
+import { useLoginStore } from '@/stores'
+import http from '@/services/http'
+import { RequestConfig } from '@/services/http/types'
+
+const loginStore = useLoginStore()
+
+/**
+ * 查询转让详情
+ */
+export function queryPresaleDefault(config: RequestConfig<Model.PresaleDefaultReq> = {}) {
+    return http.commonRequest<Model.PresaleDefaultRsp>({
+        url: '/Presale/QueryPresaleDefault',
+        params: config.data,
+    })
+}
+
+/**
+ * 我的持仓-转让持仓
+ */
+export function queryMineTradePositionExs(config: RequestConfig<Model.MineTradePositionExsReq> = {}) {
+    return http.commonRequest<Model.MineTradePositionExsRsp[]>({
+        url: '/Mine/QueryMineTradePositionExs',
+        params: {
+            userid: loginStore.userId,
+            ...config.data
+        },
+    })
+}
+
+/**
+ * 我的订单-转让委托
+ */
+export function queryMineTradeOrders(config: RequestConfig<Model.MineTradeOrdersReq> = {}) {
+    return http.commonRequest<Model.MineTradeOrdersRsp[]>({
+        url: '/Mine/QueryMineTradeOrders',
+        params: {
+            userid: loginStore.userId,
+            ...config.data
+        },
+    })
+}
+
+/**
+ * 我的订单-转让成交
+ */
+export function queryMineTradeTradeDetails(config: RequestConfig<Model.MineTradeTradeDetailsReq> = {}) {
+    return http.commonRequest<Model.MineTradeTradeDetailsRsp[]>({
+        url: '/Mine/QueryMineTradeTradeDetails',
+        params: {
+            userid: loginStore.userId,
+            ...config.data
+        },
+    })
+}

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

@@ -47,7 +47,7 @@ export const useFuturesStore = defineStore(() => {
 
             // 处理行情价格颜色
             const handleColor = (value: number) => {
-                if (value === presettle) {
+                if (value === 0 || value === presettle) {
                     return ''
                 } else if (value > presettle) {
                     return 'g-up-color'

+ 189 - 0
src/types/model/transfer.d.ts

@@ -0,0 +1,189 @@
+declare namespace Model {
+    /** 查询转让详情 请求 */
+    interface PresaleDefaultReq {
+        goodsid: number; // 商品ID
+    }
+
+    /** 查询转让详情 响应 */
+    interface PresaleDefaultRsp {
+        sellname: string; // 客户名称(企业名称)
+        bannerpicurl: string; // Banner图(逗号分隔)(2:1)
+        goodscode: string; // 期货合约代码(内部)
+        goodsid: number; // 期货合约ID(自增ID SEQ_GOODS)
+        goodsname: string; // 期货合约名称
+        pictureurls: string; // 详情图片(逗号分隔)(宽:1125)
+        presaleprice: number; // 发售价\订货价(49)
+        transferdepositratio: number; // 转让定金比例(49)
+    }
+
+    /** 我的持仓-转让持仓 请求 */
+    interface MineTradePositionExsReq {
+        userid?: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+    }
+
+    /** 我的持仓-转让持仓 响应 */
+    interface MineTradePositionExsRsp {
+        accountid: number; // 账号Id
+        buycurholderamount: number; // 买当前持仓总金额[商品币种]
+        buycurpositionqty: number; // 买当前持仓总数量
+        buyfrozenqty: number; // 买持仓冻结数量
+        depositremain: number; // 未付定金
+        goodscode: string; // 期货合约代码(内部)
+        goodsid: number; // 商品Id
+        goodsname: string; // 期货合约名称
+        goodsnamedisplay: string; // 商品名称
+        lasttradedate: string; // 最后交易日期
+        paystatus: number; // 支付状态 -1:待支付 2:已支付
+        presaleprice: number; // 发售价(49)
+        relatedgoodsid: number; // 关联交易合约ID
+        sellname: string; // 客户名称(企业名称)
+        transferdeposit: number; // 转让定金(49)
+        transferdepositratio: number; // 转让定金比例(49)
+    }
+
+    /** 我的订单-转让委托 请求 */
+    interface MineTradeOrdersReq {
+        userid?: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        ishis?: boolean; // 是否历史查询
+        begindate?: string; // 开始交易日(yyyymmdd)
+        enddate?: string; // 结束交易日(yyyymmdd)
+    }
+
+    /** 我的订单-转让委托 响应 */
+    interface MineTradeOrdersRsp {
+        accountid: number; // 账户ID[报价币种]
+        amountflag: number; // 资金标识 - 1:余额 2;待付
+        buildtype: number; // 委托单据类型 - 1:建仓 2:平仓 3:先平后建
+        buyorsell: number; // 买卖 - 0:买 1:卖
+        cancelorderid: number; // 撤单单号(撤单时填写)
+        cancelqty: number; // 撤单数量
+        clientordertime: string; // 客户端委托时间
+        clientticket: string; // 客户端流水号
+        clienttype: number; // 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端安卓 4:网页客户端 5:微信客户端 6:手机客户端苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+        closeexchagechargevalue: number; // 平仓交易所手续费设置值
+        closefeealgorithm: number; // 平仓手续费收取方式 1:比率 2:固定
+        closefreezecharge: number; // 平仓冻结手续费(先建后平操作,需要记录)
+        closememberchargevalue: number; // 平仓会员手续费设置值
+        closeqty: number; // 平仓数量(先建后平操作 需要记录)
+        closetradeqty: number; // 平仓成交数量(先建后平操作,需要记录)
+        closeunfreezecharge: number; // 平仓解冻手续费(先建后平操作,需要记录)
+        delistingtype: number; // 摘牌类型 - 1:价格最优 2:点选成交
+        freezecharge: number; // 冻结手续费
+        freezemargin: number; // 冻结保证金(冻结交易金额)
+        freezeqty: number; // 冻结数量
+        gcaccountid: number; // 账户ID[合约币种]
+        goodscode: string; // 期货合约代码(内部)
+        goodsid: number; // 商品ID
+        goodsname: string; // 期货合约名称
+        goodsnamedisplay: string; // 商品名称
+        isconfirmexercise: number; // 是否确认行权- 0:否 1:是
+        ispreexercise: number; // 是否预申报- 0:否 1:是
+        listingselecttype: number; // 挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+        marginalgorithm: number; // 保证金收取方式 1:比率 2:固定
+        marginvalue: number; // 即市保证金设置值
+        marketid: number; // 市场ID
+        marketmaxsub: number; // 市价最大偏移范围 [浮动价 - 点差]
+        memberuserid: number; // 所属会员UserID
+        openexchagechargevalue: number; // 建仓交易所手续费设置值
+        openfeealgorithm: number; // 建仓手续费收取方式 1:比率 2:固定
+        openfreezecharge: number; // 开仓冻结手续费(先建后平操作,需要记录)
+        openmemberchargevalue: number; // 建仓会员手续费设置值
+        openqty: number; // 开仓数量(先建后平操作,需要记录)
+        opentradeqty: number; // 开仓成交数量(先建后平操作,需要记录)
+        openunfreezecharge: number; // 开仓解冻手续费(先建后平操作,需要记录)
+        operatetype: number; // 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让 … 23:融资买入
+        operatorid: number; // 登录账号(LoginID)
+        optiontype: number; // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
+        orderflag: number; // 委托标识 - 1:按量 2:按金额
+        orderid: string; // 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        orderprice: number; // 委托价格
+        orderqty: number; // 委托数量
+        ordersrc: number; // 委托来源 - 1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+        orderstatus: number; // 委托状态 - 参考枚举’orderstatus’ - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:部成 8:已成 9:部成部撤 10:成交失败 11:委托拒绝 12:经过摘牌(先摘后挂专用) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用) 17:冻结PD成功 18:冻结PD失败 19:冻结能量成功 20:冻结能量失败 21:预约已报价 22:过期未付 23:优惠券处理中 24:仓单生成失败 25:首付扣款失败 26:履约失败 27:撤单解冻贷款失败
+        ordertime: string; // 委托时间
+        preexerciseprice: number; // 预申报价格
+        premium: number; // 权利金
+        preorderid: number; // 关联预埋单号(止盈止损单时填写)
+        presaleprice: number; // 发售价(49)
+        pricemode: number; // 取价方式 - 1:市价 2: 限价 3:浮动价
+        quoteid: number; // 报价单ID
+        relatedid: number; // 关联单号(交割单)
+        retcode: number; // 错误代码
+        sessionid: number; // 会话ID
+        tradedate: string; // 交易日(yyyyMMdd)
+        tradeproperty: number; // 交易属性
+        tradeqty: number; // 成交数量
+        unfreezecharge: number; // 解冻手续费
+        unfreezemargin: number; // 解冻保证金
+        updatetime: string; // 更新时间
+        uuid: string; // 发起端唯一id
+        validtime: string; // 有效期限
+        validtype: number; // 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
+        volumetype: number; // 当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量 1:最小量(暂时不支持) 2:全部量
+    }
+
+    /** 我的订单-转让成交 请求 */
+    interface MineTradeTradeDetailsReq {
+        userid?: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        ishis?: boolean; // 是否历史查询
+        begindate?: string; // 开始交易日(yyyymmdd)
+        enddate?: string; // 结束交易日(yyyymmdd)
+    }
+
+    /** 我的订单-转让成交 响应 */
+    interface MineTradeTradeDetailsRsp {
+        accountid: number; // 账户ID[报价币种]
+        accountname: string; // 账户名称(机构名称)
+        buildtype: number; // 委托单据类型 1:建仓 2:平仓 3:先平后建
+        buyorsell: number; // 方向 - 0:买 1:卖
+        closecharge: number; // 平仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+        closeexchagechargevalue: number; // 平仓交易所手续费设置值
+        closefeealgorithm: number; // 平仓手续费收取方式 1:比率 2:固定
+        closememberchargevalue: number; // 平仓会员手续费设置值
+        closepl: number; // 平仓盈亏
+        closepl2: number; // 平仓盈亏[逐笔]
+        closeqty: number; // 平仓数量(先建后平操作 需要记录)
+        creditamount: number; // 授信金额
+        gcaccountid: number; // 账户ID[合约币种]
+        goodscode: string; // 期货合约代码(内部)
+        goodsid: number; // 商品ID
+        goodsname: string; // 期货合约名称
+        goodsnamedisplay: string; // 商品名称
+        intclosepl: number; // 整型盈亏(用于交易结算试算平衡-收益权)
+        isconfirmexercise: number; // 是否确认行权- 0:否 1:是
+        ismain: number; // 是否主单 - 0:不是 1:是
+        ispreexercise: number; // 是否预申报- 0:否 1:是
+        isreckoned: number; // 是否结算 - 0:未结算 1:已结算
+        marketid: number; // 市场ID
+        matchaccountid: number; // 对手账号id
+        memberuserid: number; // 会员id 个人投资者 需要填写
+        opencharge: number; // 建仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+        openexchagechargevalue: number; // 建仓交易所手续费设置值
+        openfeealgorithm: number; // 建仓手续费收取方式 1:比率 2:固定
+        openmemberchargevalue: number; // 建仓会员手续费设置值
+        openqty: number; // 开仓数量(先建后平操作 需要记录)
+        optiontype: number; // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
+        orderid: number; // 委托单号
+        performanceplanid: number; // 履约计划ID[期权]
+        performancestatus: number; // 履约状态[期权] - 0:无履约 1:未履约 2:履约中 3:履约完成
+        preexerciseprice: number; // 预申报价格
+        premium: number; // 权利金 - [持仓单的权利金]
+        presaleprice: number; // 发售价(49)
+        relatedouttradeid: number; // 关联外部成交单ID
+        status: number; // 处理状态 - 1:待处理 2:已处理 3:处理失败
+        tradeamount: number; // 成交金额[账户币种,用于所有权]
+        tradedate: string; // 交易日(yyyyMMdd)
+        tradeid: string; // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        tradeprice: number; // 成交价格
+        tradeproperty: number; // 交易属性
+        tradeqty: number; // 成交数量
+        tradetime: string; // 成交时间
+        tradetype: number; // 成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+    }
+}