Browse Source

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

master
liaoxinyu 11 months ago
parent
commit
8576cde6db
  1. 13
      src/views/contract/exchange-store.vue
  2. 2
      src/views/contract/handicap.vue
  3. 15
      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

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

15
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 @@
<div style="margin-left: 10px;">{{ item.symbol }}/{{ parent.coin_name }}</div>
</div>
</div>
<div class="text-right width-32">{{ item.close }}</div>
<div class="text-right width-32">{{item.symbol == activeSymbol ? price1 : item.price}}</div>
<div class="text-right width-32" :class="item.increase < 0 ? 'decreace' : 'increase'">{{ item.increaseStr }}</div>
</td>
<!-- <td class="w-7/24 text-right" >{{ item.close }}</td>
@ -241,7 +242,9 @@ export default {
currentIcon: '',
filterCoin: "",
contractListFilter: [],
Liste:[]
Liste:[],
price1:0,
intervalId:''
};
},
computed: {
@ -319,6 +322,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