huangbin %!s(int64=4) %!d(string=hai) anos
pai
achega
8710ce32d9

+ 3 - 2
src/common/setup/trade/index.ts

@@ -92,8 +92,9 @@ export function useFloatPriceMoney<T extends CommomTradeForm>(formState: T, good
 }
 
 // 获取 挂牌 的 最大可挂数量,金额,保证金
-export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formState, goodscode, isFloat, canUseMoney }: ListingTradeNumAndPrice<T>) {
-    const agreeunit = getGoodsAgreeunitByGoodsCode(goodscode)
+export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formState, goodscode, isFloat, canUseMoney }: ListingTradeNumAndPrice<T>, agreeunitParam?: number) {
+    const agreeunit = agreeunitParam || getGoodsAgreeunitByGoodsCode(goodscode)
+    console.log('agreeunit', agreeunit)
     function getMaxNum(value: number, isBuy: boolean) {
         // 可用资金
         const money = canUseMoney() > 0 ? canUseMoney() : 0

+ 2 - 1
src/services/bus/goods.ts

@@ -9,13 +9,14 @@ import { getMarketByTradeMode } from './market';
 
 // 获取全部商品信息
 export function getGoodsList(): Goods[] {
+    console.log('APP.get', APP.get('Goods'))
     return APP.get('Goods')
 }
 
 // 获取全部上市 商品信息
 export function getIPOGoodsList(): Goods[] {
     //商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-    return getGoodsList().filter(e => e.goodsstatus === 1)
+    return getGoodsList().filter(e => e.goodsstatus === 3)
 }
 
 // 通过trademode 获取商品

+ 11 - 3
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -204,7 +204,17 @@ export default defineComponent({
             isFloat,
             canUseMoney,
         };
-        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param);
+        // 挂牌金额
+        // function getMoney() {
+
+        // }
+        // 估算价
+        function getAppraise() {}
+        // 合约单位
+        const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
+        console.log();
+        console.log('合约单位', agreeunit);
+        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param, agreeunit);
         // 保证金
         const getMargin = () => {
             let result = '--';
@@ -235,8 +245,6 @@ export default defineComponent({
             if (marginType && money && formState.FixedPrice) {
                 // 保证金方式 1:比率 2:固定
                 if (marginType === 1) {
-                    // 合约单位
-                    const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
                     // 最大可挂牌数量=可用/(价格*合约单位*保证金比例
                     result = money / (((formState.FixedPrice * marginValue) / 100) * agreeunit);
                 } else {

+ 1 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/interface.ts

@@ -3,5 +3,6 @@ import { QueryQuoteDayRsp } from "@/services/go/quote/interface";
 export interface RefGoodsList extends QueryQuoteDayRsp {
     refgoodsname: string
     goodsname: string
+    refgoodscode: string
     orderid: number
 }

+ 4 - 2
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts

@@ -41,13 +41,15 @@ export const useSwapList = () => {
                 if (quote) {
                     const result: RefGoodsList = {
                         ...quote,
-                        goodsname: el.goodsname, refgoodsname: el.refgoodsname
+                        goodsname: el.goodsname,
+                        refgoodsname: el.refgoodsname,
+                        refgoodscode: el.refgoodscode
                     }
                     goodsList.value.push(result)
                     allGoodsList.value.push(result)
                 }
             })
-            console.log(goodsList.value)
+            console.log('商品掉期', res)
         })
     })
     // 获取标记商品列表