diff --git a/src/api/exchange.js b/src/api/exchange.js index 8f2c530..e06ab01 100644 --- a/src/api/exchange.js +++ b/src/api/exchange.js @@ -11,6 +11,16 @@ class Exchange { static storeEntrust(data) { return server.post(`/exchange/storeEntrust`, data); } + + // 获取账户余额 + static getstockUserBalance(symbol) { + return server.get(`/stock/getUserCoinBalance?symbol=${encodeURIComponent(symbol)}`); + } + + // 提交订单 + static stockstoreEntrust(data) { + return server.post(`/stock/storeEntrust`, data); + } // 获取币种基本信息 static getSymbolInfo(data) { @@ -26,6 +36,11 @@ class Exchange { static getCurrencyExCny(data){ return server.get('/market/getCurrencyExCny',{params:data}) } + + // 获取持仓 + static stockholdPosition(data, config) { + return server.get('/stock/holdPosition', {params:data,config} ) + } } export default Exchange; \ No newline at end of file diff --git a/src/api/market.js b/src/api/market.js index f00fe76..785c28c 100644 --- a/src/api/market.js +++ b/src/api/market.js @@ -50,7 +50,19 @@ class Market { static getCoinInfo(params) { return server.get(`/exchange/getCoinInfo`,{ params }); } - + + // 初始化查询市场行情 + static getstockMarketList() { + return server.get(`/stock/getMarketList`); + } + // 初始化买卖盘数据 + static getstockMarketInfo(symbol) { + return server.get(`/stock/getMarketInfo?symbol=${symbol}`); + } + // 币种信息 + static getstockCoinInfo(params) { + return server.get(`/stock/getCoinInfo`,{ params }); + } } export default Market; \ No newline at end of file diff --git a/src/api/option.js b/src/api/option.js index 1da950d..d2b74c5 100644 --- a/src/api/option.js +++ b/src/api/option.js @@ -33,6 +33,13 @@ class Option { params: data }) } + static getStockKline(data) { + // let url = `https://api.hadax.com/market/history/kline`; + let url = `/option/getStockKline`; + return server.get(url, { + params: data + }) + } /** * 获取可用于期权交易的币种列表 */ diff --git a/src/api/order.js b/src/api/order.js index 31801aa..fb871c1 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -26,6 +26,12 @@ class Order { params:data }); } + + static getstockHistoryEntrust(data) { + return server.get(`/stock/getHistoryEntrust`,{ + params:data + }); + } /** * 获取当前委托 * @param {object} data @@ -39,6 +45,12 @@ class Order { params:data }); } + + static getstockCurrentEntrust(data) { + return server.get(`/stock/getCurrentEntrust`,{ + params:data + }); + } // 获取止盈止损单 static getConditionEntrust(data) { @@ -60,6 +72,11 @@ class Order { params:data }); } + static getstockEntrustTradeRecord(data) { + return server.get(`/stock/getEntrustTradeRecord`,{ + params:data + }); + } /** * 撤单 @@ -72,6 +89,11 @@ class Order { static cancelEntrust(data) { return server.post(`/exchange/cancelEntrust`,data); } + + static stockcancelEntrust(data) { + return server.post(`/stock/cancelEntrust`,data); + } + /** * 批量撤单 * @param {object} data diff --git a/src/components/CommonHeader.vue b/src/components/CommonHeader.vue index cdeedfc..2d2210e 100644 --- a/src/components/CommonHeader.vue +++ b/src/components/CommonHeader.vue @@ -42,6 +42,9 @@
+ {{$t('exchange.order-total')}}: + {{buyTotal}} {{pair.from}} +
+{{$t('otc.j3')}}:
+ {{toBalance}} {{pair.to}}
+ {{fromBalance}} {{pair.from}}
+
+ {{$t('exchange.order-total')}}: + + {{sellTotal}} {{pair.from}} +
+{{$t('otc.j3')}}:
+ {{toBalance}} {{pair.to}}
+ {{fromBalance}} {{pair.from}}
+
| {{ $t("contract.h5") }} | +{{ $t("contract.g3") }} | ++ {{ $t("contract.h6") }} + | +
|---|---|---|
| + {{ item.symbol }}/{{ parent.coin_name }} + | ++ {{item.price}} + + | ++ {{ item.increaseStr }} + | +
+ {{$t('exchange.order-total')}} + {{buyTotal}} {{pair.from}} +
+
+ {{ $t('exchange.amount') }}
+ {{toBalance}} {{pair.to}}
+ {{ $t('exchange.balance') }}
+ {{fromBalance}} {{pair.from}}
+
+ {{ $t('exchange.order-total') }} + + {{sellTotal}} {{pair.from}} +
+
+ {{$t('exchange.amount')}}
+ {{toBalance}} {{pair.to}}
+ {{ $t('exchange.balance') }}
+ {{fromBalance}} {{pair.from}}
+
| {{ $t("common.created") }} | +{{ $t("common.pair") }} | +{{ $t("common.direction") }} | +{{ $t("common.order-type") }} | +{{ $t("common.order-price") }} | +{{ $t("common.order-amount") }} | +{{ $t("common.executed-amount") }} | +{{ $t("common.executed-total") }} | +{{ $t("common.outstanding") }} | +{{ $t("common.order-total") }} | + +{{ $t("common.action") }} | +|
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{item.created_at}} | +{{item.symbol}} | + + +{{$t("common.buy-in")}} | + + +{{$t("common.sell-out")}} | + + ++ {{ $t("common.limit-type") }} + {{ $t("common.market-type") }} + | + +{{item.entrust_price|omitTo(priceDecimals)}} | + +{{item.amount|omitTo(qtyDecimals)}} | + +{{item.traded_amount|omitTo(priceDecimals)}} | +{{item.traded_money|omitTo(priceDecimals)}} | + +{{item.surplus_amount||omitTo(qtyDecimals)}} | + +{{item.money ? Math.omitTo(item.money, priceDecimals) : '-'}} | + ++ + | +
| {{$t("exchange.a3")}} | +{{$t("exchange.a4")}} | +{{$t("exchange.a5")}} | +{{$t("exchange.a6")}} | +{{$t("exchange.a7")}} | +{{$t("exchange.a8")}} | +{{$t("exchange.a9")}} | +{{$t("exchange.a10")}} | +
|---|---|---|---|---|---|---|---|
| {{item.pair_name}} | +{{item.market}} | +{{item.usable_balance}} | +{{item.realtimePrice}} | +{{item.cost_price}} | +{{item.dayProfit}} | +{{item.unRealProfit}} | +{{item.profitRate}} | +
| {{ $t("common.created") }} | +{{ $t("common.pair") }} | +{{ $t("common.direction") }} | +{{ $t("common.order-type") }} | +{{ $t("common.order-price") }} | +{{ $t("common.order-amount") }} | +{{ $t("common.executed-amount") }} | +{{ $t("common.avg-price") }} | + +{{ $t("common.order-total") }} | +{{ $t("common.status") }} | +{{ $t("common.details") }} | +|||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{item.created_at}} | +{{item.symbol}} | + +{{$t("common.buy-in")}} | + + +{{$t("common.sell-out")}} | + ++ {{ $t("common.limit-type") }} + {{ $t("common.market-type") }} + | +{{item.entrust_price ? Math.omitTo(item.entrust_price, priceDecimals) : '-'}} + | +{{item.amount|omitTo(qtyDecimals)}} | + +{{ item.traded_amount|omitTo(qtyDecimals) }} | + ++ {{Math.division(item.traded_money,item.traded_amount,priceDecimals)}} + | +- | +{{item.traded_money|omitTo(priceDecimals)}} | + ++ {{ $t("common.completed") }} + | + + +{{ $t("common.canceled") }} | + ++ + + | +
|
+
+
+
+
+ {{ $t("common.id") }}
+ :{{ rec.order_id}}
+
+
+ {{ $t("common.created") }}:{{ rec.created_at}}
+
+
+ {{ $t("common.filled-price") }}:{{ rec.unit_price|omitTo(priceDecimals)}}
+
+
+ {{ $t("common.filled-amount") }}:{{ rec.trade_amount|omitTo(qtyDecimals)}}
+
+
+ {{ $t("common.filled-total") }}:{{ rec.trade_money|omitTo(priceDecimals)}}
+
+
+ {{ $t("common.fee") }}:{{ rec.trade_fee|omitTo(priceDecimals)}}
+
+
+ {{ $t("common.d23") }}:{{rec.total_profit}}
+
+
+
+
+ Loading...
+
+ |
+ |||||||||||||
| {{ $t("exchange.pair") }} | +{{ $t("exchange.last-price") }} | +{{ $t("exchange.change") }} | +
|---|---|---|
| + + {{ coin.coin_name == 'fav' ? item.pair_name : item.coin_name + '/' + coin.coin_name}} + | ++ {{ coin.coin_name == 'fav' ? item.close : item.price}} + | + ++ {{ item.increaseStr }} + | +