From 1e07bf6d4b607f0834ef6f2554304d376e69ac8e Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sun, 6 Mar 2022 09:20:25 +0800 Subject: [PATCH] improve ux --- src/views/WalletAccounts.vue | 7 +++++-- src/views/components/charts/EchartScatter.vue | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/WalletAccounts.vue b/src/views/WalletAccounts.vue index 032d60ab..5926a8e7 100644 --- a/src/views/WalletAccounts.vue +++ b/src/views/WalletAccounts.vue @@ -558,7 +558,7 @@ export default { }, formatCurrency(amount, denom) { const qty = this.formatAmount(amount, denom, false) - return qty * this.getPrice(denom) + return parseFloat((qty * this.getPrice(denom)).toFixed(2)) }, priceColor(denom) { const d2 = this.formatDenom(denom) @@ -585,6 +585,9 @@ export default { }, formatChanges(denom) { const price = this.getChanges(denom) + if (price > 0) { + return `+${parseFloat(price.toFixed(2))}%` + } return price === 0 ? '' : `${parseFloat(price.toFixed(2))}%` }, formatPrice(denom) { @@ -622,7 +625,7 @@ export default { const ret = delegations.map(x => this.formatCurrency(x.amount, x.denom) * this.getChanges(x.denom) * 0.01).reduce((t, c) => t + c, 0) total += ret } - return parseFloat(total.toFixed(2)) + return total > 0 ? `+${parseFloat(total.toFixed(2))}` : parseFloat(total.toFixed(2)) }, formatBalanceChangesColor(v) { const total = this.formatBalanceChanges(v) diff --git a/src/views/components/charts/EchartScatter.vue b/src/views/components/charts/EchartScatter.vue index efa1acd4..1692d590 100644 --- a/src/views/components/charts/EchartScatter.vue +++ b/src/views/components/charts/EchartScatter.vue @@ -89,7 +89,7 @@ export default { series: [ { name: '', - data: this.items, + data: this.items.filter(x => x[1] > 0), type: 'scatter', symbolSize(data) { const r = Math.log(data[2])