From 05ca8ab4d617ab166f3be37acc2ee4aa3f36276c Mon Sep 17 00:00:00 2001 From: vee <897831508@qq.com> Date: Tue, 30 Aug 2022 20:09:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/positionList/positionList.vue | 26 +- components/transaction/transaction.vue | 8 +- pages/markets/index.vue | 10 +- pages/markets/kLine.vue | 568 ++++++++++++++++++----- pages/markets/trade.vue | 358 +++++++------- utils/axios.js | 6 +- utils/language/en_US.js | 2 +- utils/websocket.js | 25 +- 8 files changed, 696 insertions(+), 307 deletions(-) diff --git a/components/positionList/positionList.vue b/components/positionList/positionList.vue index 12d0d8a..8f6edac 100644 --- a/components/positionList/positionList.vue +++ b/components/positionList/positionList.vue @@ -6,9 +6,9 @@ - {{ item.price }} - {{ item.total }} - + {{ parseFloat(item.price).toFixed(item.baseCoinScale) }} + {{ item.size }} + @@ -18,9 +18,9 @@ - {{ item.price }} - {{ item.total }} - + {{ parseFloat(item.price).toFixed(item.baseCoinScale) }} + {{ item.size }} + @@ -33,7 +33,15 @@ export default { item: Object, marketDetail: { type: Object, - default: () => {} + default: () => { + + } + }, + sum: { + type: Object, + default: () => { + + } }, bboList:{ type: Object, @@ -43,9 +51,7 @@ export default { data() { return { popoverVisible: false, - depthValue: 1, - sellList: 9, - buyList: 10, + } }, computed: { diff --git a/components/transaction/transaction.vue b/components/transaction/transaction.vue index fcd668c..0e28f38 100644 --- a/components/transaction/transaction.vue +++ b/components/transaction/transaction.vue @@ -86,6 +86,12 @@ export default { return 'USDT' } }, + type: { // 货币名称 + type: String, + default() { + return 'buy' + } + }, coinPrice: { // 数字货币价格 type: Number, default() { @@ -107,7 +113,7 @@ export default { }, data() { return { - type: 'buy', + priceSelectListShow: false, priceTypeValue: 0, priceTypeList: [ diff --git a/pages/markets/index.vue b/pages/markets/index.vue index 1225c06..e0981ab 100644 --- a/pages/markets/index.vue +++ b/pages/markets/index.vue @@ -43,11 +43,11 @@ onShow() { }, - onHide() { - this.unsubWebSocket(); - }, - onUnload() { - this.unsubWebSocket(); + onHide() { + this.websock.closeSocket(); + }, + onUnload() { + this.websock.closeSocket(); }, computed: { i18n() { diff --git a/pages/markets/kLine.vue b/pages/markets/kLine.vue index af6e4c2..26aefe0 100644 --- a/pages/markets/kLine.vue +++ b/pages/markets/kLine.vue @@ -1,41 +1,48 @@