calculator and other cleaning
This commit is contained in:
@ -73,22 +73,11 @@
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex justify-between">
|
||||
<p>{{ $t("monthly_savings") }}</p>
|
||||
<p
|
||||
class="text-accent-green-light dark:text-accent-green-dark font-bold"
|
||||
>
|
||||
{{ store.monthlySavings }}
|
||||
{{ menuStore.selectedCurrency?.sign }}
|
||||
<p class="text-accent-green-light dark:text-accent-green-dark font-bold">
|
||||
{{ formater.price(store.monthlySavings) }}
|
||||
</p>
|
||||
</div>
|
||||
<input
|
||||
v-model="store.monthlySavings"
|
||||
type="range"
|
||||
max="600"
|
||||
:min="store.minValue"
|
||||
class="w-full accent-button cursor-pointer"
|
||||
@mouseup="store.getCalculator()"
|
||||
@touchend="store.getCalculator()"
|
||||
>
|
||||
<input v-model="store.monthlySavings" type="range" :max="store.getMaxAmount" :min="store.getMinAmount" class="w-full accent-button cursor-pointer" @change="store.getCalculator()">
|
||||
</div>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex justify-between">
|
||||
@ -99,14 +88,7 @@
|
||||
{{ store.storagePeriod }}
|
||||
</p>
|
||||
</div>
|
||||
<input
|
||||
v-model="store.storagePeriod"
|
||||
type="range"
|
||||
max="20"
|
||||
class="w-full accent-button cursor-pointer"
|
||||
@mouseup="store.getCalculator()"
|
||||
@touchend="store.getCalculator()"
|
||||
>
|
||||
<input v-model="store.storagePeriod" type="range" max="20" class="w-full accent-button cursor-pointer" @change="store.getCalculator()">
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -117,17 +99,14 @@
|
||||
<h2
|
||||
class="h2-bold-bounded text-accent-green-light dark:text-accent-green-dark"
|
||||
>
|
||||
{{ menuStore.selectedCurrency?.sign }} {{ store.totalInvestment }}
|
||||
{{ formater.price(store.totalInvestment) }}
|
||||
</h2>
|
||||
</div>
|
||||
<UiButtonArrow :arrow="true"
|
||||
type="fill"
|
||||
class="mx-auto sm:m-0"
|
||||
>
|
||||
{{
|
||||
component.front_section_lang[0].data.button
|
||||
}}
|
||||
</UiButtonArrow>
|
||||
<nuxt-link :to="{ name: `id-slug___${$i18n.locale}`, params: { id: menuStore.getInvestmentCalculatorMenu()?.id, slug: menuStore.getInvestmentCalculatorMenu()?.front_menu_lang.at(0)?.link_rewrite } }">
|
||||
<UiButtonArrow :arrow="true" type="fill" class="mx-auto sm:m-0">
|
||||
{{ component.front_section_lang[0].data.button }}
|
||||
</UiButtonArrow>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -168,9 +147,11 @@ defineProps<{
|
||||
|
||||
const store = useStore()
|
||||
const menuStore = useMenuStore()
|
||||
const { $session } = useNuxtApp()
|
||||
|
||||
const itemCount = ref(4)
|
||||
const productStore = useProductStore()
|
||||
const formater = useFormater(useNuxtApp())
|
||||
|
||||
async function updateItemCount() {
|
||||
const width = window.innerWidth
|
||||
@ -185,6 +166,10 @@ watch(itemCount, async () => {
|
||||
await productStore.getList(itemCount.value)
|
||||
})
|
||||
|
||||
watch($session.cookieData, async () => {
|
||||
await productStore.getList(itemCount.value)
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await updateItemCount()
|
||||
window.addEventListener('resize', updateItemCount)
|
||||
|
Reference in New Issue
Block a user