Browse Source

修改k线和右边的价格一样

master
liaoxinyu 2 years ago
parent
commit
1ddf8a87f8
  1. 21
      src/views/contract/handicap.vue
  2. 2
      src/views/contract/index.vue

21
src/views/contract/handicap.vue

@ -199,10 +199,17 @@ export default {
this.linkSocket(); this.linkSocket();
} }
bus.$on('collapse', msg => { 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; if (msg.close.endsWith('.')) {
// this.$emit("input", this.newPriceObj); // '0'
msg.close += '0';
}
this.newPriceObj.price = msg.close;
this.$emit("input", this.newPriceObj);
// console.log(this.newPriceObj.price, 'this.newPriceObj.price-----') // console.log(this.newPriceObj.price, 'this.newPriceObj.price-----')
// const closeStr = msg.close.toString();
// this.newPriceObj.price = this.symbol === 'BTC' ? closeStr.slice(0, closeStr.indexOf('.') + 2) : closeStr.slice(0, closeStr.indexOf('.') + 4);
// this.$emit("input", this.newPriceObj);
}); });
}, },
// //
@ -217,9 +224,9 @@ export default {
this.sellList = res.swapSellList; this.sellList = res.swapSellList;
this.buyList = res.swapBuyList; this.buyList = res.swapBuyList;
this.tradeList = res.swapTradeList; this.tradeList = res.swapTradeList;
if(this.tradeList.length>0){ // if(this.tradeList.length>0){
this.newPriceObj = this.tradeList[0]; this.newPriceObj = this.tradeList[0];
} // }
this.$emit("input", this.newPriceObj); this.$emit("input", this.newPriceObj);
}); });
}, },
@ -272,8 +279,8 @@ export default {
// console.log('if (sub == this.msg.trade)', this.msg.trade) // console.log('if (sub == this.msg.trade)', this.msg.trade)
this.tradeList.unshift(data); this.tradeList.unshift(data);
this.tradeList.pop(); this.tradeList.pop();
this.newPriceObj = data; // this.newPriceObj = data;
this.$emit("input", this.newPriceObj); // this.$emit("input", this.newPriceObj);
} else if (type == "ping" ||cmd == "ping") { } else if (type == "ping" ||cmd == "ping") {
this.ws.send({ this.ws.send({
cmd: "pong" cmd: "pong"

2
src/views/contract/index.vue

@ -264,7 +264,7 @@ export default {
this._time = setInterval(() => { this._time = setInterval(() => {
if (this.contractOpen) { if (this.contractOpen) {
// mounted holdPosition // mounted holdPosition
// this.holdPosition(); this.holdPosition();
} }
}, 3000); }, 3000);
this.ws.on("open", () => { this.ws.on("open", () => {

Loading…
Cancel
Save