Browse Source

修改可开和数量逻辑修改

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

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

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

101
src/views/contract/index.vue

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

Loading…
Cancel
Save