Browse Source

持有仓位定时器打开

master
luyisha 2 years ago
parent
commit
1915a4794b
  1. 2
      src/views/contract/hold-position.vue
  2. 26
      src/views/contract/index.vue

2
src/views/contract/hold-position.vue

@ -461,7 +461,7 @@ export default {
},
newPrice: {
default: 0,
type: Number,
type: Number|String,
required: false,
},
holdPositionAll: {

26
src/views/contract/index.vue

@ -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)
}
}
};

Loading…
Cancel
Save