From b541bdead72bb5cbf7831e7da77c6540bdb94747 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 18 Jun 2024 16:00:59 +0300 Subject: [PATCH] modal data --- components/modal.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/modal.vue b/components/modal.vue index f4d784c..890f9e7 100644 --- a/components/modal.vue +++ b/components/modal.vue @@ -91,19 +91,25 @@ const roubleSign = new Intl.NumberFormat('ru-RU', { currency: 'RUB', }); const total = computed(() => { - const { mortgage, pillar, lamella } = calculatorData.value + const { mortgage, pillar, lamella, rivets, bar, guide } = calculatorData.value const pillar_count = (section_count.value + 1) const pil = (parseFloat(mortgage) + parseFloat(pillar)) * pillar_count + const length = fence_section.value + const lam_count = lamelles_count.value * section_count.value - const lam = lam_count * lamella + const lam = (lam_count * length * parseFloat(lamella)) + parseFloat(rivets) const top_count = section_count.value const top = top_count * lamella + + const guides_count = section_count.value + const guides = guides_count * parseFloat(guide) * lam_count * 115 return [ - `Столб, ${pillar_count}: ${roubleSign.format(pil)}`, - `Ламели, ${lam_count}: ${roubleSign.format(lam)}`, - `Верхняя планка, ${top_count}: ${roubleSign.format(top)}`, + `Столб, ${pillar_count}: (${parseFloat(mortgage)} + ${parseFloat(pillar)}) x ${pillar_count} = ${roubleSign.format(pil)}`, + `Ламели, ${lam_count}: (${lam_count} x ${length} x ${lamella}) + ${rivets} = ${roubleSign.format(lam)}`, + `Направляющая, ${guides_count}: ${guides_count} x ${guide} x ${lam_count} x 115 = ${roubleSign.format(guides)}`, + `Верхняя планка, ${top_count}: ${top_count} x ${length} x ${bar} = ${roubleSign.format(top)}`, ] })