From bb0b02f730eb79a47f9d90f2379a1345909ad7dc Mon Sep 17 00:00:00 2001 From: bellezhuo <65014152@qq.com> Date: Mon, 20 Jul 2020 09:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/trend.js | 2 +- src/views/assets/coincoin_assets.vue | 4 +- src/views/coincoin/components/trade_depth.vue | 53 ++++++++++++------- .../coincoin/components/trade_order_list.vue | 39 +++++++++----- .../coincoin/components/trade_pair_list.vue | 1 - src/views/register/register.vue | 4 ++ .../release/components/release_depth.vue | 53 ++++++++++++------- .../release/components/release_order_list.vue | 38 +++++++------ .../release/components/release_pair_list.vue | 38 +++++++++---- 9 files changed, 151 insertions(+), 81 deletions(-) diff --git a/src/store/modules/trend.js b/src/store/modules/trend.js index b299d75..564df17 100644 --- a/src/store/modules/trend.js +++ b/src/store/modules/trend.js @@ -10,7 +10,7 @@ export default { allTrendList: [], //所有交易对+价格 myCollectList: [] ,//我的收藏 - currentPair: {}, //当前交易对 + currentPair: null, //当前交易对 }, mutations: { setCoin(state, data) { //币种 --资产模块 diff --git a/src/views/assets/coincoin_assets.vue b/src/views/assets/coincoin_assets.vue index 5b1a3ec..8fade3f 100644 --- a/src/views/assets/coincoin_assets.vue +++ b/src/views/assets/coincoin_assets.vue @@ -98,7 +98,9 @@
0.0000
-
0.0000
+
+ {{item.customAssetsTypes[0].assetsType == 'A_I_T_LOCK_UP' ? item.customAssetsTypes[0].amount : item.customAssetsTypes[1].assetsType == 'A_I_T_LOCK_UP' ? item.customAssetsTypes[1].amount : 0}} +
diff --git a/src/views/coincoin/components/trade_depth.vue b/src/views/coincoin/components/trade_depth.vue index fb3406b..3114e56 100644 --- a/src/views/coincoin/components/trade_depth.vue +++ b/src/views/coincoin/components/trade_depth.vue @@ -14,7 +14,8 @@
-
+
+
  • 9101.08
  • @@ -23,28 +24,20 @@
- -
-
    -
  • 9101.08
  • -
  • 0.0547
  • -
  • 1.44
  • -
- -

- 9062.14 - ≈64245.75 CNY + {{currentPair.price}} + ≈ {{currentPair.price * 7 | Decimal(2)}} CNY

- + {{$t('更多')}} - +
-
+
+
  • 9101.08
  • @@ -59,9 +52,12 @@
    -
    -
    -
    + +
    + +
    + +
    @@ -81,6 +77,8 @@ name: 'tradeDepth', data() { return { + timer:'', + depthListType: 1, //1全部 2买单 3卖单 depthValue: 1, depthOptions: [ @@ -95,9 +93,23 @@ ...mapState('trend', ['currentPair']), }, methods: { - chooseDepth(val) { + getDepth() { //获取深度盘口 + this.postAxios('/api/coin/price/getDepth', {symbolId: this.currentPair.symbolId}) + .then(data => { + console.log(JSON.stringify(data)) + }) + }, + + chooseDepth(val) { //切换深度 this.depthValue = val; + }, + changeList(val) { //切换列表类型 + this.depthListType = val; } + }, + mounted() { + this.getDepth(); + } } @@ -106,4 +118,7 @@ .deal-folder { height: 300px; } + .deal-folder-open { + height: 600px; + } diff --git a/src/views/coincoin/components/trade_order_list.vue b/src/views/coincoin/components/trade_order_list.vue index 58f44e2..2c01a3b 100644 --- a/src/views/coincoin/components/trade_order_list.vue +++ b/src/views/coincoin/components/trade_order_list.vue @@ -128,6 +128,8 @@ isContent: false, pageTotal: 0, //总页数 currentPage: 1, //默认当前页 + + timer: '', //定时器 } }, computed: { @@ -147,21 +149,30 @@ page: pages, } let url = this.titleIndex == 1 ? '/api/entrust/info/page' : '/api/entrust/info/page/history'; - this.orderList = []; - this.postAxios(url, params) - .then(data => { - this.pageTotal = data.data.pages; - - if (data.data.total == 0) { - this.isContent = true; - } else { - this.isContent = false; - } - - data.data.records.forEach(item => { - this.orderList.push(item); + + if(this.currentPair) { + this.postAxios(url, params) + .then(data => { + clearInterval(this.timers); + + this.pageTotal = data.data.pages; + this.orderList = []; + + if (data.data.total == 0) { + this.isContent = true; + } else { + this.isContent = false; + } + + data.data.records.forEach(item => { + this.orderList.push(item); + }) }) - }) + } else { + this.timer = setInterval(() => { + this.getOrderList(1); + }, 1000) + } }, tabOrder(val) { //切换标题 diff --git a/src/views/coincoin/components/trade_pair_list.vue b/src/views/coincoin/components/trade_pair_list.vue index fd85d63..e780320 100644 --- a/src/views/coincoin/components/trade_pair_list.vue +++ b/src/views/coincoin/components/trade_pair_list.vue @@ -7,7 +7,6 @@
    -
    diff --git a/src/views/register/register.vue b/src/views/register/register.vue index d0b9742..4831ff6 100644 --- a/src/views/register/register.vue +++ b/src/views/register/register.vue @@ -264,6 +264,10 @@ } }, created() { + if(this.$route.query.inviteCode) { + this.inviteCode = this.$route.query.inviteCode; + } + this.getImageCode(); }, } diff --git a/src/views/release/components/release_depth.vue b/src/views/release/components/release_depth.vue index fb3406b..3114e56 100644 --- a/src/views/release/components/release_depth.vue +++ b/src/views/release/components/release_depth.vue @@ -14,7 +14,8 @@
-
+
+
  • 9101.08
  • @@ -23,28 +24,20 @@
- -
-
    -
  • 9101.08
  • -
  • 0.0547
  • -
  • 1.44
  • -
- -

- 9062.14 - ≈64245.75 CNY + {{currentPair.price}} + ≈ {{currentPair.price * 7 | Decimal(2)}} CNY

- + {{$t('更多')}} - +
-
+
+
  • 9101.08
  • @@ -59,9 +52,12 @@
    -
    -
    -
    + +
    + +
    + +
    @@ -81,6 +77,8 @@ name: 'tradeDepth', data() { return { + timer:'', + depthListType: 1, //1全部 2买单 3卖单 depthValue: 1, depthOptions: [ @@ -95,9 +93,23 @@ ...mapState('trend', ['currentPair']), }, methods: { - chooseDepth(val) { + getDepth() { //获取深度盘口 + this.postAxios('/api/coin/price/getDepth', {symbolId: this.currentPair.symbolId}) + .then(data => { + console.log(JSON.stringify(data)) + }) + }, + + chooseDepth(val) { //切换深度 this.depthValue = val; + }, + changeList(val) { //切换列表类型 + this.depthListType = val; } + }, + mounted() { + this.getDepth(); + } } @@ -106,4 +118,7 @@ .deal-folder { height: 300px; } + .deal-folder-open { + height: 600px; + } diff --git a/src/views/release/components/release_order_list.vue b/src/views/release/components/release_order_list.vue index 61beb5b..9ba8794 100644 --- a/src/views/release/components/release_order_list.vue +++ b/src/views/release/components/release_order_list.vue @@ -111,6 +111,8 @@ isContent: false, pageTotal: 0, //总页数 currentPage: 1, //默认当前页 + + timer: '', //定时器 } }, computed: { @@ -131,21 +133,27 @@ } let url = this.titleIndex == 1 ? '/api/entrust/info/page' : '/api/entrust/info/page/history'; - this.postAxios(url, params) - .then(data => { - this.pageTotal = data.data.pages; - this.orderList = []; - - if (data.data.total == 0) { - this.isContent = true; - } else { - this.isContent = false; - } - - data.data.records.forEach(item => { - this.orderList.push(item); - }) - }) + if(this.currentPair) { + this.postAxios(url, params) + .then(data => { + this.pageTotal = data.data.pages; + this.orderList = []; + + if (data.data.total == 0) { + this.isContent = true; + } else { + this.isContent = false; + } + + data.data.records.forEach(item => { + this.orderList.push(item); + }) + }) + } else { + this.timer = setInterval(() => { + this.getOrderList(1); + }, 1000) + } }, tabOrder(val) { //切换标题 diff --git a/src/views/release/components/release_pair_list.vue b/src/views/release/components/release_pair_list.vue index 635dc70..248ec13 100644 --- a/src/views/release/components/release_pair_list.vue +++ b/src/views/release/components/release_pair_list.vue @@ -5,7 +5,7 @@
    {{$t('市场')}}
    - +
    @@ -60,12 +60,12 @@ {{item.dealCoin}}/{{item.convertType}}
    - +
    {{item.price}}
    - +
    +{{item.changes * 100 | Decimal(2)}}% @@ -93,6 +93,7 @@ data() { return { caseIndex: 3, //选择主板 + searchKeywords: '', //搜索关键字 toPrice: 0, //按价格排序 toRange: 0, //按涨跌幅度排序 } @@ -115,15 +116,30 @@ // }, tradePairList() { //所有交易对 let list = []; - this.allPairList.forEach(item => { - if(item.caseCode == 3) { - item.childen.forEach(item2 => { - item2.prices.forEach(item3 => { - list.push(item3); + + if(this.searchKeywords) { //搜索 + this.allPairList.forEach(item => { + if(item.caseCode == 3) { + item.childen.forEach(item2 => { + item2.prices.forEach(item3 => { + if (item3.dealCoin.toUpperCase().indexOf(this.searchKeywords.toUpperCase()) > -1) { + list.push(item3); + } + }) }) - }) - } - }); + } + }); + } else { + this.allPairList.forEach(item => { + if(item.caseCode == 3) { + item.childen.forEach(item2 => { + item2.prices.forEach(item3 => { + list.push(item3); + }) + }) + } + }); + } //是否收藏 list.forEach(item => {