From c566ddb99171b5d9461994e7dec19bc162aff59a Mon Sep 17 00:00:00 2001 From: Immanuel Onyeka Date: Sun, 16 Jul 2023 20:40:25 -0400 Subject: [PATCH] Correctly represent fee types in estimates vue --- components/estimates.vue | 40 +++++++++++++++++++++++++------------- components/fee-dialog.vue | 18 ++++++++++------- components/new/summary.vue | 4 ++-- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/components/estimates.vue b/components/estimates.vue index ba6b927..94e443d 100644 --- a/components/estimates.vue +++ b/components/estimates.vue @@ -10,7 +10,7 @@ :key="fee.name + indx" class="fee" > - diff --git a/components/fee-dialog.vue b/components/fee-dialog.vue index 1d08972..94fb87f 100644 --- a/components/fee-dialog.vue +++ b/components/fee-dialog.vue @@ -11,21 +11,20 @@ +:value="fee.amount / 100 || ''" +@input="(e) => {fee.perc = 0; fee.amount = Math.round(strip(e) * 100)}"> +@input="changePerc"> @@ -53,10 +52,15 @@ function validFee() { return true } +function changePerc(e){ + this.fee.perc = stripPerc(e) + this.fee.amount = stripPerc(e)/100*this.price +} + export default { components: { Dialog }, methods: { - stripLetters, strip, stripInt, stripPerc + stripLetters, strip, stripInt, stripPerc, changePerc }, computed: { validFee, diff --git a/components/new/summary.vue b/components/new/summary.vue index e6fa032..d9670e7 100644 --- a/components/new/summary.vue +++ b/components/new/summary.vue @@ -25,7 +25,7 @@
- +
@@ -35,7 +35,7 @@