Browse Source

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

master
liaoxinyu 9 months ago
parent
commit
07d0c40bac
  1. 7
      src/views/contract/exchange-store.vue
  2. 2
      src/views/contract/handicap.vue
  3. 14
      src/views/contract/index.vue

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

@ -97,6 +97,8 @@
class="form-control"
v-model="margin"
:placeholder="tips"
@input="inputEnter"
title=""
/>
<!-- <div class="input-group-append">
<span class="input-group-text">{{ $t("contract.e2") }}</span>
@ -344,6 +346,11 @@ export default {
}
},
methods: {
inputEnter(boll) {
this.margin = this.margin
.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)
});
},
//

14
src/views/contract/index.vue

@ -59,7 +59,7 @@
class="w-7/24 "
:class="item.increase < 0 ? 'decreace' : 'increase'"
>
{{ item.price }}
{{item.symbol == activeSymbol ? price1 : item.price}}
</td>
<td
class="w-7/24"
@ -81,7 +81,8 @@
increace: activeContract.increase >= 0
}"
>
<span class="current">{{ activeContract.price }}$</span>
<!-- <span class="current">{{ activeContract.price }}$</span> -->
<span class="current">{{price1}}$</span>
&nbsp;
<span class="zf">{{ activeContract.increaseStr }}</span>
</div>
@ -231,6 +232,8 @@ export default {
contractOpen: false,
contractAgreement: {},
symbolDetail:{},
price1:0,
intervalId:''
};
},
computed: {
@ -276,6 +279,7 @@ export default {
if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price
})
});
this.startWatchingPrice();
},
//
mounted: function () {
@ -284,6 +288,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