This commit is contained in:
Kseninia Mikhaylova 2024-06-18 16:41:36 +03:00
parent 745444dafc
commit c472787c8f
1 changed files with 14 additions and 14 deletions

View File

@ -91,23 +91,23 @@ const roubleSign = new Intl.NumberFormat('ru-RU', {
style: 'currency', style: 'currency',
currency: 'RUB', currency: 'RUB',
}); });
const total = computed(() => { const { mortgage, pillar, lamella, rivets, bar, guide } = calculatorData.value
const { mortgage, pillar, lamella, rivets, bar, guide } = calculatorData.value const pillar_count = (section_count.value + 1)
const pillar_count = (section_count.value + 1) const pil = (parseFloat(mortgage) + parseFloat(pillar)) * pillar_count
const pil = (parseFloat(mortgage) + parseFloat(pillar)) * pillar_count
const length = fence_section.value const length = fence_section.value
const lam_count = lamelles_count.value * section_count.value const lam_count = lamelles_count.value * section_count.value
const lam = (lam_count * length * parseFloat(lamella)) + parseFloat(rivets) const lam = (lam_count * length * parseFloat(lamella)) + parseFloat(rivets)
const top_count = section_count.value const top_count = section_count.value
const top = top_count * lamella const top = top_count * lamella
const guides_count = section_count.value * 2 const guides_count = section_count.value * 2
const guides = guides_count * parseFloat(guide) * lam_count * 0.115 const guides = guides_count * parseFloat(guide) * lam_count * 0.115
const total = (!remove_pillar.value ? pil : 0) + lam + guides + top const total = (!remove_pillar.value ? pil : 0) + lam + guides + top
const total_txt = computed(() => {
return [ return [
!remove_pillar.value && `Столб, ${pillar_count}: (${parseFloat(mortgage)} + ${parseFloat(pillar)}) x ${pillar_count} = ${roubleSign.format(pil)}`, !remove_pillar.value && `Столб, ${pillar_count}: (${parseFloat(mortgage)} + ${parseFloat(pillar)}) x ${pillar_count} = ${roubleSign.format(pil)}`,
`Ламели, ${lam_count}: (${lam_count} x ${length} x ${lamella}) + ${rivets} = ${roubleSign.format(lam)}`, `Ламели, ${lam_count}: (${lam_count} x ${length} x ${lamella}) + ${rivets} = ${roubleSign.format(lam)}`,
@ -127,7 +127,7 @@ const total = computed(() => {
<input type="text" placeholder="Ваше имя" v-model="modal_data.name" @keyup="validate" /> <input type="text" placeholder="Ваше имя" v-model="modal_data.name" @keyup="validate" />
<input type="phone" placeholder="Номер телефона или e-mail" v-model="modal_data.phone" <input type="phone" placeholder="Номер телефона или e-mail" v-model="modal_data.phone"
@keypress="validateInput" @keyup="validate" /> @keypress="validateInput" @keyup="validate" />
Итого: {{roubleSign.format(total)}} Итого: {{ roubleSign.format(total) }}
<div class="flex gap-4"> <div class="flex gap-4">
<button class="not-prose" :disabled="modal_form.disabled" type="submit">Отправить</button> <button class="not-prose" :disabled="modal_form.disabled" type="submit">Отправить</button>
<button class="not-prose" type="reset" @click="toggleModal">Отмена</button> <button class="not-prose" type="reset" @click="toggleModal">Отмена</button>
@ -144,7 +144,7 @@ const total = computed(() => {
Цвет столба: {{ getColorNameFromRal(pillar_color) }}<br /> Цвет столба: {{ getColorNameFromRal(pillar_color) }}<br />
Цвет ламелей: {{ getColorNameFromRal(lamelle_color) }}</p> Цвет ламелей: {{ getColorNameFromRal(lamelle_color) }}</p>
<p> <p>
<template v-for="i in total">{{ i }}<br /></template> <template v-for="i in total_txt">{{ i }}<br /></template>
</p> </p>
</div> </div>
<div class="flex gap-4"> <div class="flex gap-4">