diff --git a/pages/exchange/open-position.vue b/pages/exchange/open-position.vue index 19f8bdb..1c9ca56 100755 --- a/pages/exchange/open-position.vue +++ b/pages/exchange/open-position.vue @@ -115,14 +115,19 @@ > - + @@ -245,15 +250,18 @@ {{ $t("common.c3") }} - {{ maxNum }}{{ $t("contract.d8") }} + {{ maxNum }} + - {{ $t("common.c4") }} + + {{ $t('contract.d2') }} - {{ margin }} USDT + + {{amount}} @@ -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)