Browse Source

优化

master
ltlzx 4 years ago
parent
commit
fc4ede4a68
  1. 46
      pages/exchange/open-position.vue

46
pages/exchange/open-position.vue

@ -115,14 +115,19 @@
></v-input>
</view>
<view>
<v-input
:placeholder="$t('contract.d2')"
v-model="form.amount"
<!-- :placeholder="$t('contract.d2')"
v-model="form.amount" -->
<v-input
:placeholder="$t('common.c4')"
v-model="margin"
@input="sliderActive=-1"
class="h-30 p-x-sm p-y-xxs rounded bg-form-panel-3"
>
<template #right>
<span class="color-light fn-bold"> {{ $t("contract.d8") }} </span>
<span class="color-light fn-bold">
<!-- {{ $t("contract.d8") }} -->
USDT
</span>
</template>
</v-input>
</view>
@ -245,15 +250,18 @@
{{ $t("common.c3") }}
</view>
<view class="">
{{ maxNum }}{{ $t("contract.d8") }}
{{ maxNum }}
<!-- {{ $t("contract.d8") }} -->
</view>
</view>
<view class="fn-sm m-t-xs d-flex justify-between">
<view class="">
{{ $t("common.c4") }}
<!-- {{ $t("common.c4") }} -->
{{ $t('contract.d2') }}
</view>
<view class="">
{{ margin }} USDT
<!-- {{ margin }} USDT -->
{{amount}}
</view>
</view>
</view>
@ -729,6 +737,7 @@ export default {
},
data() {
return {
margin:'',
sellList: [],
buyList: [],
tradeList: [],
@ -812,12 +821,21 @@ export default {
// return this.commissionTypes.find((item) => this.form.type == item.value);
// },
//
margin() {
return math.omitTo(
(this.form.amount * this.unit_amount) / this.form.lever_rate,
0
);
},
// margin() {
// return math.omitTo(
// (this.form.amount * this.unit_amount) / this.form.lever_rate,
// 0
// );
// },
amount(){
console.info(this.form.lever_rate)
console.info(this.margin)
if (!this.form.lever_rate || !this.margin) return 0;
let p=this.margin*this.form.lever_rate;
this.form.amount=p;
return p
},
//
activeStep() {
return (this.form.amount / this.maxNum) * 100;
@ -1317,6 +1335,8 @@ export default {
sliderChange(n,i) {
this.form.amount = Math.round((this.maxNum * n) / 100);
this.sliderActive=i
this.margin=this.form.amount/this.form.lever_rate
},
pingChange(n,i) {
console.log(n)

Loading…
Cancel
Save