Browse Source

修改可开和数量逻辑修改

master
liaoxinyu 1 year ago
parent
commit
6b4961502f
  1. 10
      src/views/contract/exchange-store.vue
  2. 85
      src/views/contract/index.vue

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

@ -246,7 +246,8 @@
<div v-if="tab == 1" class="kaicang">
<div class="d-flex justify-content-between mb-3">
<div class="color_7c">{{ $t("contract.e7") }} </div>
<div>{{ accountInfo.account_equity }}</div>
<!-- <div>{{ accountInfo.account_equity }}</div> -->
<div>{{ maxNum }} </div>
</div>
<div class="d-flex justify-content-between mb-3">
<div class="color_7c">{{ $t("contract.e1") }}</div>
@ -508,7 +509,7 @@ export default {
// console.info(this.form.lever_rate)
// console.info(this.margin)
if (!this.form.lever_rate || !this.marginBuy) return 0;
let p=this.marginBuy*this.form.lever_rate;
let p = Math.round(this.marginBuy*this.form.lever_rate);
this.buyform.amount=p;
return p
@ -517,7 +518,7 @@ export default {
// console.info(this.form.lever_rate)
// console.info(this.margin)
if (!this.form.lever_rate || !this.marginSell) return 0;
let p=this.marginSell*this.form.lever_rate;
let p = Math.round(this.marginSell*this.form.lever_rate);
this.sellform.amount=p;
return p
@ -537,7 +538,8 @@ export default {
// if (!this.form.lever_rate) {
// this.form.lever_rate = res.lever_rate;
// }
if (this.form.lever_rate && !boo) {
// this.form.lever_rate && !boo
if (this.form.lever_rate) {
this.openNum();
}
});

85
src/views/contract/index.vue

@ -78,33 +78,37 @@
<table class="table" :key="parent.coin_name + 1">
<thead>
<tr class="">
<th class="w-9/24">{{ $t("contract.h5") }}</th>
<!-- <th class="w-9/24">{{ $t("contract.h5") }}</th>
<th class="w-7/24 text-right">{{ $t("contract.g3") }}</th>
<th class="w-8/24 text-right">
{{ $t("contract.h6") }}
<th class="w-8/24 text-right">{{ $t("contract.h6") }}</th> -->
<th class="" style="display:block;width:100%">
<div class="width-32">{{ $t("contract.h5") }}</div>
<div class="text-right width-32">{{ $t("contract.g3") }}</div>
<div class="text-right width-32">{{ $t("contract.h6") }}</div>
</th>
</tr>
</thead>
<tbody>
<tbody class="trade-list">
<tr
v-for="item in parent.marketInfoList"
:key="item.symbol"
:class="{ active: item.symbol == activeSymbol }"
@click="ispopover1(item.symbol)"
v-show="isShow(item)"
style="display:block"
>
<td class="w-9/24 tr-text">
<td style="display:block;width:100%;border:none;">
<div class="width-32 tr-text">
{{ item.symbol }}/{{ parent.coin_name }}
<!-- {{ item.symbol }}/{{ parent.coin_name }} -->
</td>
<td class="w-7/24 text-right" >
</div>
<div class="width-32 text-right" >
<!-- :class="item.increase < 0 ? 'decreace' : 'increase'" -->
{{ item.price }}
</td>
<td
class="w-8/24 text-right"
:class="item.increase < 0 ? 'decreace' : 'increase'"
>
</div>
<div class="width-32 text-right":class="item.increase < 0 ? 'decreace' : 'increase'">
{{ item.increaseStr }}
</div>
</td>
</tr>
</tbody>
@ -270,22 +274,22 @@ export default {
activeSymbol() {
this.holdPosition();
},
filterCoin: {
handler(n,o){
if(!n){
this.contractListFilter = this.contractList;
}else{
this.contractListFilter = this.contractList.map((item1, index1)=>{
let arr = item1;
arr.marketInfoList = item1.marketInfoList.filter(item2=>{
return item2.symbol.indexOf(n.toUpperCase())!=-1
})
return arr;
})
}
},
immediate: true
}
// filterCoin: {
// handler(n,o){
// if(!n){
// this.contractListFilter = this.contractList;
// }else{
// this.contractListFilter = this.contractList.map((item1, index1)=>{
// let arr = item1;
// arr.marketInfoList = item1.marketInfoList.filter(item2=>{
// return item2.symbol.indexOf(n.toUpperCase())!=-1
// })
// return arr;
// })
// }
// },
// immediate: true
// }
},
destroyed() {
clearInterval(this._time);
@ -434,7 +438,21 @@ export default {
},
enterFilter(){
},
isShow(symbol) {
const reg = new RegExp(this.filterCoin, "gi");
if (!this.filterCoin) return true;
else {
// let name = symbol.coinName || symbol.pair;
// return name.search(reg) >= 0;
let name = symbol.pair_name || symbol.symbol;
return reg.test(name);
// return name.search(reg) >= 0;
}
// return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0;
},
}
};
</script>
@ -445,6 +463,12 @@ export default {
thead th, table td{
font-size: 14px;
}
.trade-list{
// width: 23vw;
height: 1110px;
overflow-y: auto;
display: block;
}
tbody tr{
cursor: pointer;
}
@ -504,4 +528,9 @@ export default {
.min-width-B{
min-width: 130px;
}
.width-32{
display: inline-block !important;
vertical-align: top !important;
width: 31% !important;
}
</style>

Loading…
Cancel
Save