|
|
|
@ -142,12 +142,12 @@ |
|
|
|
:newPriceObj="newPriceObj" |
|
|
|
:contractOpen="contractOpen" |
|
|
|
@accountInfo="accountInfo = $event" |
|
|
|
@position="holdPosition" |
|
|
|
@position="getLastHoldPosition" |
|
|
|
@getSymbolDetail="symbolDetail=$event" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<page-bottom |
|
|
|
@position="holdPosition" |
|
|
|
@position="getLastHoldPosition" |
|
|
|
@isall=" |
|
|
|
holdPositionAll = $event; |
|
|
|
holdPosition(); |
|
|
|
@ -263,7 +263,8 @@ export default { |
|
|
|
this.indexList(); |
|
|
|
this._time = setInterval(() => { |
|
|
|
if (this.contractOpen) { |
|
|
|
this.holdPosition();//临时注释 |
|
|
|
// mounted 中有定时器跑holdPosition了 |
|
|
|
// this.holdPosition(); |
|
|
|
} |
|
|
|
}, 3000); |
|
|
|
this.ws.on("open", () => { |
|
|
|
@ -279,10 +280,10 @@ export default { |
|
|
|
}, |
|
|
|
//三秒更新一次数据 |
|
|
|
mounted: function () { |
|
|
|
// created 中有定时器跑holdPosition了 |
|
|
|
// setInterval(() => { |
|
|
|
// this.holdPosition(); |
|
|
|
// }, 2000) |
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
this.holdPosition(); |
|
|
|
}, 2000) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
ispopover1(item){ |
|
|
|
@ -376,6 +377,17 @@ export default { |
|
|
|
//获取某一个持仓订单的数据 |
|
|
|
setactiveItem(index=0){ |
|
|
|
this.accountInfo=this.holdPositionList[index] |
|
|
|
}, |
|
|
|
// 线上最新数据有延迟,多请求两次以保拿到 |
|
|
|
getLastHoldPosition(){ |
|
|
|
let ti = 0,timer=null; |
|
|
|
timer = setInterval(()=>{ |
|
|
|
this.holdPosition(); |
|
|
|
ti++; |
|
|
|
if(ti==3){ |
|
|
|
clearInterval(timer); |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|