huangbin 4 years ago
parent
commit
c7b4fd2fbf

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
 {
-    "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
 }
 }

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/buy/index.vue

@@ -127,7 +127,7 @@ export default defineComponent({
                 // 先置空 要不然数据变更了,视图不更新
                 // 先置空 要不然数据变更了,视图不更新
                 const fn = () => {
                 const fn = () => {
                     tableList.value = [];
                     tableList.value = [];
-                    tableList.value = sortPirce(res, props.parantSelectedRow);
+                    tableList.value = sortPirce(res, props.parantSelectedRow, false);
                 };
                 };
                 if (hasFloat(res)) {
                 if (hasFloat(res)) {
                     // 有浮动价, 则每三秒更新一次数据
                     // 有浮动价, 则每三秒更新一次数据

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

@@ -69,8 +69,11 @@ export function getBuyOrSellMarketPrice(record: QueryTjmdTradeOrderDetailRsp, se
 }
 }
 
 
 // 价格排序
 // 价格排序
-export function sortPirce(arr: QueryTjmdTradeOrderDetailRsp[], selectedRow: RefGoodsList) {
-    return arr.sort((a, b) => getBuyOrSellMarketPrice(b, selectedRow) - getBuyOrSellMarketPrice(a, selectedRow))
+// true: 升序,false: 倒序
+export function sortPirce(arr: QueryTjmdTradeOrderDetailRsp[], selectedRow: RefGoodsList, isUp = true) {
+    return arr.sort((a, b) => {
+        return isUp ? getBuyOrSellMarketPrice(a, selectedRow) - getBuyOrSellMarketPrice(b, selectedRow) : getBuyOrSellMarketPrice(b, selectedRow) - getBuyOrSellMarketPrice(a, selectedRow)
+    })
 }
 }
 
 
 // 是否有浮动价
 // 是否有浮动价