luyisha 3 years ago
parent
commit
2da608403d
  1. 1
      src/assets/scss/base/_common.scss
  2. 8
      src/i18n/tw.json
  3. 18
      src/views/contract/exchange-store.vue
  4. 15
      src/views/exchange/book-trades.vue
  5. 3
      src/views/exchange/index.vue
  6. 4
      src/views/exchange/make-deal.vue

1
src/assets/scss/base/_common.scss

@ -529,6 +529,7 @@ $basew: 24;
}
.el-button:focus{
border: none;
outline: none;
}
}

8
src/i18n/tw.json

@ -220,7 +220,7 @@
"learn":"學習"
},
"exchange": {
"search": "索",
"search": "索",
"pair": "交易對",
"last-price": "最新價",
"change": "漲跌幅",
@ -379,7 +379,7 @@
"addressManagement1": "地址管理",
"addAddress": "添加地址",
"filter": "篩選器",
"search": "索",
"search": "索",
"selectActiveArea": "請選擇活動區域",
"areaOne": "區域一",
"areaTwo": "區域二",
@ -412,7 +412,7 @@
"spotAccount": "現貨帳戶",
"hide": "隱藏",
"balanceAssets": "餘額資產",
"searchCurrency": "索幣種",
"searchCurrency": "索幣種",
"addressManagement": "提幣地址管理",
"totalAssets": "總資產",
"availableBalance": "可用餘額",
@ -632,7 +632,7 @@
"toMatch": "未撮合",
"operation": "操作",
"reset": "重置",
"search": "索",
"search": "索",
"to": "至",
"startTime": "開始日期",
"endTime": "結束日期",

18
src/views/contract/exchange-store.vue

@ -1,7 +1,7 @@
<template>
<div class="markets-pair-list exchange-store bg-plain">
<div class="nav nav-pills">
<div class="nav-item">
<div class="nav-item" :class="{ active: tab == 1 }">
<a class="nav-link" :class="{ active: tab == 1 }" @click="tab = 1">{{
$t("contract.d5")
}}</a>
@ -55,13 +55,13 @@
</div>
<div class="d-flex align-items-center" style="margin: 0.5rem 0;color: #666;">
<div class="nav nav-pills">
<div class="nav-item">
<a style="display:block;padding:5px 0px;margin:0 15px 0 0;" :class="{ active: form.type == 1 }" @click="form.type = 1">
<div class="nav-item" :class="{ active: form.type == 1 }" @click="form.type = 1">
<a style="display:block;padding:5px 0px;margin:0 15px 0 0;">
{{ $t("contract.e0") }}
</a>
</div>
<div class="nav-item">
<a style="display:block;padding:5px 0px;margin:0 15px 0 0;" :class="{ active: form.type == 2 }" @click="form.type = 2">
<div class="nav-item" :class="{ active: form.type == 2 }" @click="form.type = 2">
<a style="display:block;padding:5px 0px;margin:0 15px 0 0;">
{{ $t("contract.d9") }}
</a>
</div>
@ -470,6 +470,7 @@ export default {
symbol: this.symbol,
...this.form
};
console.log(this.form, 111111)
Contract.openPosition(data).then(() => {
this.contractAccount();
this.form.amount = 0;
@ -507,10 +508,7 @@ export default {
/* /deep/ .el-slider__stop{
background-color: ;
} */
.markets-pair-list .nav-link.active{
color: #F7D558;
}
.nav-item .active{
color: #F7D558;
.markets-pair-list .nav-item.active a{
color: #F7D558 !important;
}
</style>

15
src/views/exchange/book-trades.vue

@ -28,6 +28,7 @@
</tbody>
<tbody class="ob-heading">
<!-- 最新价 -->
<tr style="display:block;" v-if="newTrade">
<td class="w-33">
<span>{{ $t("exchange.last-price") }}</span>
@ -102,7 +103,6 @@
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tradeList" :key="index">
<td style="display:block;width:100%">
<div class="w-33" :style="{color : item.color}">{{ item.price }}</div>
@ -146,6 +146,8 @@ export default {
},
reversed() {
//
// console.log(this.buyList,'this.$parent', 'reversed-----------------')
// console.log(this.tradeList)
if (this.buyList && this.buyList.length) return this.buyList;
else return [];
@ -171,11 +173,12 @@ export default {
tradeList() {
let count = 0;
let tradeArr = [];
// 1~(n-1)绿
if (this.trade && this.trade.length) {
return this.trade.sort((m, n) => {
tradeArr = this.trade.sort((m, n) => {
let dm = Number(m.price),
dn = Number(n.price);
@ -200,8 +203,12 @@ export default {
m.amount = Math.omitTo(m.amount, this.qtyDecimals);
m.time = Date.parseTime(m.ts, false, "{h}:{i}:{s}");
}
});
// console.log(tradeArr, 34344343434)
return tradeArr;
} else {
// console.log(this.trade, 121211212121);
return this.trade;
}
}
@ -241,7 +248,6 @@ export default {
this.sellList = response.sellList.sort((a, b) => b.price - a.price);
this.buyList = response.buyList;
this.trade = response.tradeList;
}).catch(err => {
});
@ -252,7 +258,10 @@ export default {
mounted() {
// mounted[]created []ajax
// setInterval(() => {
console.log('最新成交记录')
this.bookTrades();
// }, 1000);
},
}

3
src/views/exchange/index.vue

@ -259,6 +259,9 @@ export default {
}, {
cmd: 'unsub',
msg: `buyList_${symbol}`
}, {
cmd: 'req',
msg: `tradeList_${symbol}`//
}, {
cmd: 'unsub',
msg: `tradeList_${symbol}`

4
src/views/exchange/make-deal.vue

@ -569,7 +569,9 @@ export default {
this.$confirm(this.$t('nav.login'), {
confirmButtonText:this.$t('common.confirmBtn'),
cancelButtonText: this.$t('common.cancelBtn'),
type: 'warning'
type: 'warning',
confirmButtonClass:'bg-yellow2',//
cancelButtonClass:'bg-gray-ccc'
}).then(() => {
this.$router.push(`/sign-in`);
}).catch();

Loading…
Cancel
Save