|
|
|
@ -199,9 +199,9 @@ export default { |
|
|
|
this.linkSocket(); |
|
|
|
} |
|
|
|
bus.$on('collapse', msg => { |
|
|
|
this.newPriceObj.price =this.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3); |
|
|
|
// this.newPriceObj.price =this.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3); |
|
|
|
// this.newPriceObj.price = msg.close; |
|
|
|
this.$emit("input", this.newPriceObj); |
|
|
|
// this.$emit("input", this.newPriceObj); |
|
|
|
// console.log(this.newPriceObj.price, 'this.newPriceObj.price-----') |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -265,18 +265,19 @@ export default { |
|
|
|
this.ws.on("message", res => { |
|
|
|
let { data, msg, code, sub, type, status, cmd } = res; |
|
|
|
if (sub == this.msg.buy) { |
|
|
|
this.buyList = data; |
|
|
|
this.buyList = data; |
|
|
|
} else if (sub == this.msg.sell) { |
|
|
|
this.sellList = data; |
|
|
|
this.sellList = data; |
|
|
|
} else if (sub == this.msg.trade) { |
|
|
|
this.tradeList.unshift(data); |
|
|
|
this.tradeList.pop(); |
|
|
|
// this.newPriceObj = data; |
|
|
|
// this.$emit("input", this.newPriceObj); |
|
|
|
// console.log('if (sub == this.msg.trade)', this.msg.trade) |
|
|
|
this.tradeList.unshift(data); |
|
|
|
this.tradeList.pop(); |
|
|
|
this.newPriceObj = data; |
|
|
|
this.$emit("input", this.newPriceObj); |
|
|
|
} else if (type == "ping" ||cmd == "ping") { |
|
|
|
this.ws.send({ |
|
|
|
cmd: "pong" |
|
|
|
}); |
|
|
|
this.ws.send({ |
|
|
|
cmd: "pong" |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|