瀏覽代碼

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi 4 年之前
父節點
當前提交
80dfa07bb5

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

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

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

@@ -9,7 +9,6 @@ import { getMarketByTradeMode } from './market';
 
 // 获取全部商品信息
 export function getGoodsList(): Goods[] {
-    console.log('APP.get', APP.get('Goods'))
     return APP.get('Goods')
 }
 

+ 4 - 12
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -187,7 +187,7 @@ export default defineComponent({
         queryTable(queryTradePosition);
 
         // 获取保证金比例
-        const { getReckonMarginValueByTradeMode, getReckonMarginTypeAndValueByTradeMode } = useTodayMargin();
+        const { getReckonMarginTypeAndValueByTradeMode } = useTodayMargin();
         // 控制弹窗
         const { visible, cancel } = _closeModal(context);
         // 表单
@@ -204,17 +204,7 @@ export default defineComponent({
             isFloat,
             canUseMoney,
         };
-        // 挂牌金额
-        // function getMoney() {
-
-        // }
-        // 估算价
-        function getAppraise() {}
-        // 合约单位
-        const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
-        console.log();
-        console.log('合约单位', agreeunit);
-        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param, agreeunit);
+        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param);
         // 保证金
         const getMargin = () => {
             let result = '--';
@@ -245,6 +235,8 @@ 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/setup.ts

@@ -42,6 +42,7 @@ export const useSwapList = () => {
                     const result: RefGoodsList = {
                         ...quote,
                         goodsname: el.goodsname,
+                        goodscode: el.goodscode,
                         refgoodsname: el.refgoodsname,
                         refgoodscode: el.refgoodscode
                     }