37 lines
1.2 KiB
Vue
37 lines
1.2 KiB
Vue
<script setup lang="ts">
|
||||
|
|
import { computed, inject } from 'vue'
|
|||
|
|
import { useUserStore } from '@/store/userStore'
|
|||
|
|
import { usePriceWithoutType } from '@/utils/usePrice'
|
|||
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
|||
|
|
import { HOME_PAGE_CONTEXT_KEY } from '../../composables/useHomePage'
|
|||
|
|
|
|||
|
|
const ctx = inject(HOME_PAGE_CONTEXT_KEY)!
|
|||
|
|
const userStore = useUserStore()
|
|||
|
|
|
|||
|
|
const showLimitedPrice = computed(
|
|||
|
|
() =>
|
|||
|
|
ctx.limitedPrice.value !== undefined &&
|
|||
|
|
userStore.userInfo?.trade_active !== 1,
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
const limitedPriceText = computed(() =>
|
|||
|
|
usePriceWithoutType(Number(ctx.limitedPrice.value?.value ?? 0)),
|
|||
|
|
)
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<template>
|
|||
|
|
<div v-if="showLimitedPrice || ctx.showClosedMessage.value" class="dhome-alerts">
|
|||
|
|
<div v-if="showLimitedPrice" class="dhome-alert dhome-alert--warning">
|
|||
|
|
<BasicIcon icon="vuesax-linear:info-circle" size="14" />
|
|||
|
|
<span>
|
|||
|
|
حداقل مبلغ اولیه برای ثبت سفارش {{ limitedPriceText }} ریال میباشد.
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<div
|
|||
|
|
v-if="ctx.showClosedMessage.value"
|
|||
|
|
class="dhome-alert dhome-alert--info"
|
|||
|
|
v-html="ctx.closedMessage.value"
|
|||
|
|
/>
|
|||
|
|
</div>
|
|||
|
|
</template>
|