Browse Source

优化WS

master
ltlzx 4 years ago
parent
commit
80190076e3
  1. 11
      src/views/contract/handicap.vue
  2. 10
      src/views/contract/index.vue

11
src/views/contract/handicap.vue

@ -162,11 +162,11 @@ export default {
},
computed: {
msg() {
return {
buy: `swapBuyList_${this.symbol}`,
sell: `swapSellList_${this.symbol}`,
trade: `swapTradeList_${this.symbol}`
};
return {
buy: `swapBuyList_${this.symbol}`,
sell: `swapSellList_${this.symbol}`,
trade: `swapTradeList_${this.symbol}`
};
},
sellListShow() {
let list = this.sellList.splice(0, 12);
@ -267,6 +267,7 @@ export default {
});
}
});
},
//
unLink(symbol) {

10
src/views/contract/index.vue

@ -130,6 +130,7 @@
:wsUrl="wsUrl"
:ws="ws"
class="mr-2"
ref="handicap"
/>
<!-- 交易 -->
<exchange-store
@ -263,6 +264,7 @@ export default {
this.ws.on("open", () => {
this.swapMarketList();
});
console.info(this.$refs)
},
//
mounted: function () {
@ -296,9 +298,15 @@ export default {
this.ws.on('close',()=>{
this.ws= new Socket(this.Globals.Server.Path.WS1),
console.log('链接关闭');
this.swapMarketList();
this.wsOpen();
})
},
wsOpen(){
this.ws.on("open", () => {
this.swapMarketList();
this.$refs.handicap.linkSocket()
});
},
//
getMarketList() {
Contract.getMarketList().then(res => {

Loading…
Cancel
Save