Selaa lähdekoodia

修改资金里 可用资金有误的bug

huangbin 3 vuotta sitten
vanhempi
commit
6017c985a1

+ 3 - 1
src/common/components/capitalInfo/index.vue

@@ -81,8 +81,10 @@ export default defineComponent({
             return show.value ? value : '******';
         }
         const loading = ref<boolean>(false)
-        const { canUseMoney, getHoldsList } = useHazardRates();
+        const { canUseMoney, getHoldsList, getSwapList } = useHazardRates();
         initData(() => {
+            // 交割商品
+            getSwapList()
             // 获取头寸
             getHoldsList(loading)
         })

+ 13 - 12
src/views/order/funding_information/components/funding_information_funding_summary/setup.ts

@@ -148,19 +148,19 @@ export const useHazardRates = () => {
             holdsList.value = res;
         })
     }
-        // 交割商品
+    // 交割商品
     const swapList = ref<QueryQuoteGoodsListRsp[]>([]);
     function getSwapList() {
-      const {  queryTable } = queryTableList<QueryQuoteGoodsListRsp>();
-      // 组装 参数
-      const marketids = getMarketIdsByTradeMode(TradeMode.DiaoQi)
-      const param: QueryQuoteGoodsListReq = {
-        usertype: getUserAccountType(),
-      }
-      if (marketids) {
-        param.marketids = marketids
-      }
-       queryTable(queryQuoteGoodsList, param).then(res => swapList.value = res)
+        const { queryTable } = queryTableList<QueryQuoteGoodsListRsp>();
+        // 组装 参数
+        const marketids = getMarketIdsByTradeMode(TradeMode.DiaoQi)
+        const param: QueryQuoteGoodsListReq = {
+            usertype: getUserAccountType(),
+        }
+        if (marketids) {
+            param.marketids = marketids
+        }
+        queryTable(queryQuoteGoodsList, param).then(res => swapList.value = res)
     }
     // 获取报价小数位
     function getDecimalplace() {
@@ -264,9 +264,10 @@ export const useHazardRates = () => {
             }
         }
         const decimalplace = getDecimalplace()
+        console.log('result.toFixed(decimalplace)', result.toFixed(decimalplace))
         return result.toFixed(decimalplace)
     }
 
-    return { handleProfitloss,getSwapList, hazardRates, netWorth, canUseMoney, getHoldsList, handleHoldPrice }
+    return { handleProfitloss, getSwapList, hazardRates, netWorth, canUseMoney, getHoldsList, handleHoldPrice }
 }