Browse Source

修改k线时间

master
liaoxinyu 1 year ago
parent
commit
986d075dbb
  1. 2
      src/views/contract/handicap.vue
  2. 19
      src/views/contract/index.vue

2
src/views/contract/handicap.vue

@ -198,6 +198,7 @@ export default {
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.$emit("input", this.newPriceObj); this.$emit("input", this.newPriceObj);
localStorage.setItem("price",this.newPriceObj.price)
}); });
}, },
// //
@ -214,6 +215,7 @@ export default {
this.tradeList = res.swapTradeList; this.tradeList = res.swapTradeList;
this.newPriceObj = this.tradeList[0]; this.newPriceObj = this.tradeList[0];
this.$emit("input", this.newPriceObj); this.$emit("input", this.newPriceObj);
localStorage.setItem("price",this.newPriceObj.price)
}); });
}, },
// //

19
src/views/contract/index.vue

@ -20,7 +20,8 @@
decreace2: activeContract.increase < 0, decreace2: activeContract.increase < 0,
increase: activeContract.increase >= 0 increase: activeContract.increase >= 0
}"> }">
{{ activeContract.price }} <!-- {{ activeContract.price }} -->
{{price1}}
</div> </div>
<!-- <div class="title mb-1 text-secondary"> <!-- <div class="title mb-1 text-secondary">
{{ $t("contract.h6") }} {{ $t("contract.h6") }}
@ -104,7 +105,8 @@
</div> </div>
<div class="width-32 text-right" > <div class="width-32 text-right" >
<!-- :class="item.increase < 0 ? 'decreace' : 'increase'" --> <!-- :class="item.increase < 0 ? 'decreace' : 'increase'" -->
{{ item.price }} <!-- {{ item.price }} -->
{{item.symbol == activeSymbol ? price1 : item.price}}
</div> </div>
<div class="width-32 text-right":class="item.increase < 0 ? 'decreace' : 'increase'"> <div class="width-32 text-right":class="item.increase < 0 ? 'decreace' : 'increase'">
{{ item.increaseStr }} {{ item.increaseStr }}
@ -244,7 +246,9 @@ export default {
symbolDetail:{}, symbolDetail:{},
currentIcon: '', currentIcon: '',
filterCoin: "", filterCoin: "",
contractListFilter: [] contractListFilter: [],
price1:0,
intervalId:''
}; };
}, },
computed: { computed: {
@ -314,8 +318,7 @@ export default {
if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price
}) })
}); });
this.startWatchingPrice();
}, },
// //
mounted: function () { mounted: function () {
@ -324,6 +327,12 @@ export default {
}, 2000) }, 2000)
}, },
methods: { methods: {
startWatchingPrice(){
this.intervalId = setInterval(() => {
let newPrice = localStorage.getItem('price');
this.price1 = newPrice;
}, 10); //
},
ispopover1(item){ ispopover1(item){
this.activeSymbol=item; this.activeSymbol=item;
// this.$refs.popover.showPopper = false; // this.$refs.popover.showPopper = false;

Loading…
Cancel
Save