|
|
|
@ -50,20 +50,14 @@ |
|
|
|
:class="{ |
|
|
|
' color-plain': form.direction == 'buy', |
|
|
|
}" |
|
|
|
@click=" |
|
|
|
form.direction = 'buy'; |
|
|
|
getDefaultPrice(); |
|
|
|
" |
|
|
|
@click="changeDirection('buy')" |
|
|
|
>{{ $t("exchange.c3") }}</view> |
|
|
|
<view |
|
|
|
class="color-gray w-6/12 h-34 d-flex justify-center align-center" |
|
|
|
:class="{ |
|
|
|
' color-plain': form.direction == 'sell', |
|
|
|
}" |
|
|
|
@click=" |
|
|
|
form.direction = 'sell'; |
|
|
|
getDefaultPrice(); |
|
|
|
" |
|
|
|
@click="changeDirection('sell')" |
|
|
|
>{{ $t("exchange.c4") }}</view> |
|
|
|
</view> |
|
|
|
<!-- <v-picker :list="typeList" v-model="form.type" class="p-y-md fn-14"> |
|
|
|
@ -605,6 +599,7 @@ export default { |
|
|
|
}, |
|
|
|
// 计算滑动出来的金额 |
|
|
|
sliderChange(n,i) { |
|
|
|
// console.log(n, i, this.form.direction); |
|
|
|
let num = n/100; |
|
|
|
this.sliderActive=i |
|
|
|
if (this.form.direction == "buy") { |
|
|
|
@ -674,9 +669,18 @@ export default { |
|
|
|
this.form.amount = ""; |
|
|
|
this.form.total = ""; |
|
|
|
if(res.code===200){ |
|
|
|
let timer=null,ti = 0; |
|
|
|
this.$toast.success(this.$t("exchange.e1")); |
|
|
|
timer = setInterval(()=>{ |
|
|
|
// 一遍拿不到最新数值 |
|
|
|
ti++; |
|
|
|
this.getUserBalance(); |
|
|
|
if(ti===3){ |
|
|
|
clearInterval(timer); |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
this.getUserBalance(); |
|
|
|
|
|
|
|
this.dtime = setInterval(() => { |
|
|
|
this.getCurrentEntrust(true) |
|
|
|
}, 1000); |
|
|
|
@ -711,6 +715,13 @@ export default { |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 切换方向 |
|
|
|
changeDirection(type){ |
|
|
|
this.form.direction = type; |
|
|
|
this.getDefaultPrice(); |
|
|
|
let n = this.progress[this.sliderActive]; |
|
|
|
this.sliderChange(n, this.sliderActive); |
|
|
|
}, |
|
|
|
// 计算深度 |
|
|
|
getValue(amount) { |
|
|
|
const arr = this.buyList.concat(this.sellList).map((item) => item.amount); |
|
|
|
|