Browse Source

修改合约保证金为2位小数点、以及合约价格问题

master
liaoxinyu 9 months ago
parent
commit
d9eb95070f
  1. 13
      src/views/contract/exchange-store.vue
  2. 2
      src/views/contract/handicap.vue
  3. 18
      src/views/contract/index.vue

13
src/views/contract/exchange-store.vue

@ -101,6 +101,7 @@
class="form-control"
v-model="marginBuy"
:placeholder="tips"
@input="inputEnter(false)"
title=""
/>
<!-- <div class="input-group-append">
@ -229,6 +230,7 @@
class="form-control"
v-model="marginSell"
:placeholder="tips"
@input="inputEnter(true)"
title=""
/>
<!-- <div class="input-group-append">
@ -535,6 +537,17 @@ export default {
}
},
methods: {
inputEnter(boll) {
if(boll){
this.marginSell = this.marginSell
.replace(/[^\d.]/g, "") //
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); //
}else{
this.marginBuy = this.marginBuy
.replace(/[^\d.]/g, "") //
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); //
}
},
//
contractAccount(boo) {
if (!this.isLogin) return;

2
src/views/contract/handicap.vue

@ -198,6 +198,7 @@ export default {
bus.$on('collapse', msg => {
this.newPriceObj.price =this.symbol=='BTC'? (msg.close).toFixed(1):(msg.close).toFixed(3);
this.$emit("input", this.newPriceObj);
localStorage.setItem("price",this.newPriceObj.price)
});
},
//
@ -214,6 +215,7 @@ export default {
this.tradeList = res.swapTradeList;
this.newPriceObj = this.tradeList[0];
this.$emit("input", this.newPriceObj);
localStorage.setItem("price",this.newPriceObj.price)
});
},
//

18
src/views/contract/index.vue

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

Loading…
Cancel
Save