Browse Source

币币交易获取最新余额

master
luyisha 2 years ago
parent
commit
c94f4729b8
  1. 29
      pages/exchange/exchange-transaction.vue

29
pages/exchange/exchange-transaction.vue

@ -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);

Loading…
Cancel
Save