| | |
| | | <input :placeholder="$t('数量')" class=" w-full h-70 border-none textColor font-28" v-model="form.volume" |
| | | @input="onInput" /> |
| | | <span class="textColor font-28">{{ symbol.toLocaleUpperCase() }}</span> |
| | | <span @click="fillAllBalance" class="cursor-pointer text-blue-500 " style="padding: 0 10px;">{{ $t('全部') }}</span> |
| | | <span @click="fillAllBalance" class="cursor-pointer text-blue-500" |
| | | style="padding: 0 10px;width: 80px;text-align: right;">{{ |
| | | $t('全部') |
| | | }}</span> |
| | | </div> |
| | | <div v-if="isTotal" class="h-70 lh-70 inputBackground mb-36 flex justify-center px-16"> |
| | | <input :placeholder="$t('总额')" class=" w-full h-70 border-none textColor font-28" v-model="form.total" |
| | |
| | | this.form.volume = Math.floor(sum * 100000) / 100000; |
| | | this.onInput(); |
| | | } else { |
| | | let sum = parseFloat(this.initClose.volume) |
| | | this.form.volume = (Math.floor(sum * (val / 100) * 100000)) / 100000 |
| | | let sum = parseFloat(this.initClose.volume) || 0; |
| | | console.log('sum1: ', sum, this.initClose.volume) |
| | | this.form.volume = (Math.floor(sum * (val / 100) * 100000)) / 100000; |
| | | this.onInput(); |
| | | |
| | | } |
| | | } else { |
| | | if (this.currentType == 'open') { |
| | | this.form.total = this.initOpen.volume * (val / 100) |
| | | } else { |
| | | console.log('volume1: ', this.initClose.volume) |
| | | this.form.total = Math.floor((this.initClose.volume * (val / 100) * parseFloat(this.form.price)) * 1000) / 1000 |
| | | } |
| | | } |
| | |
| | | } else { |
| | | vol = this.initClose.volume / 1 |
| | | } |
| | | this.options.max = Number(vol.toFixed(3)) |
| | | this.options.max = vol ? Number(vol.toFixed(3)) : 0 |
| | | if (this.options.max > 0) { |
| | | this.options.disabled = false |
| | | } else { |
| | |
| | | this.form.volume = maxSum |
| | | } |
| | | } else { |
| | | if (this.form.volume * 1 / 1 > this.options.max / 1) { |
| | | if (!isNaN(this.options.max) && this.form.volume * 1 > this.options.max) { |
| | | this.form.volume = this.options.max / 1 |
| | | } |
| | | } |