|
|
|
@ -1,12 +1,12 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="banner-block col-xs-8"> |
|
|
|
<el-carousel :interval="6000" height="450px"> |
|
|
|
<el-carousel-item v-for="item in pcBannerList" :key="item.id"> |
|
|
|
<img :src="item.imgurl" width="100%" height="100%" /> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
</div> |
|
|
|
<!-- <div class="banner-block col-xs-8">--> |
|
|
|
<!-- <el-carousel :interval="6000" height="450px">--> |
|
|
|
<!-- <el-carousel-item v-for="item in pcBannerList" :key="item.id">--> |
|
|
|
<!-- <img :src="item.imgurl" width="100%" height="100%" />--> |
|
|
|
<!-- </el-carousel-item>--> |
|
|
|
<!-- </el-carousel>--> |
|
|
|
<!-- </div>--> |
|
|
|
<div class="container-fluid mtb15 no-fluid"> |
|
|
|
<div class="row sm-gutters"> |
|
|
|
|
|
|
|
@ -315,7 +315,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
getBalance() { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isLogin) { |
|
|
|
|
|
|
|
Exchange.getUserBalance(this.marketInfo.pair_name).then(data => { |
|
|
|
@ -420,9 +420,9 @@ export default { |
|
|
|
// 如果指定了id 订阅该行情的所有其他信息 |
|
|
|
if (this.symbol) this.addSub(); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.ws.on("message", (response) => { |
|
|
|
|
|
|
|
|
|
|
|
let { |
|
|
|
data, // 返回数据 |
|
|
|
sub, // 订阅标签 |
|
|
|
@ -430,36 +430,36 @@ export default { |
|
|
|
msg, // 提示信息 |
|
|
|
code, // 错误代号 |
|
|
|
} = response; |
|
|
|
|
|
|
|
|
|
|
|
// 答复心跳 保持连接 |
|
|
|
if (type == "ping") this.ws.send({ |
|
|
|
type: "pong" |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
switch (sub) { |
|
|
|
|
|
|
|
|
|
|
|
case "exchangeMarketList": |
|
|
|
|
|
|
|
|
|
|
|
this.marketList = data; |
|
|
|
|
|
|
|
|
|
|
|
if (!this.symbol) { // 默认symbol 重新请求数据 |
|
|
|
this.symbol = _.nth(data).marketInfoList[0].symbol; |
|
|
|
} else { // 找出该symbol对应的记录并更新页面 |
|
|
|
this.findMarketBySymbol(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case `buyList_${this.symbol}`: |
|
|
|
|
|
|
|
|
|
|
|
this.buyList = data; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case `sellList_${this.symbol}`: |
|
|
|
|
|
|
|
|
|
|
|
this.sellList = data; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case `tradeList_${this.symbol}`: |
|
|
|
if (type == "history") { // 历史记录 |
|
|
|
this.trade = this.trade.concat(data); |
|
|
|
@ -472,7 +472,7 @@ export default { |
|
|
|
break; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.ws.on("close", () => { |
|
|
|
// this.$message({ |
|
|
|
// type: "error", |
|
|
|
@ -483,7 +483,7 @@ export default { |
|
|
|
this.initWs() |
|
|
|
// if (this.symbol) this.getCurrencyExCny(); |
|
|
|
// this.indexList() |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|