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. 17
      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{ .el-button:focus{
border: none; border: none;
outline: none;
} }
} }

8
src/i18n/tw.json

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

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

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

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

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

3
src/views/exchange/index.vue

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

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

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

Loading…
Cancel
Save