2026-05-14 13:44:43 +03:30
|
|
|
<template>
|
2026-06-23 16:02:41 +03:30
|
|
|
<div
|
|
|
|
|
class="w-full relative mt-2 rounded-lg py-3 flex flex-col justify-center home_appear_fade_in transition-colors duration-300"
|
|
|
|
|
:class="containerClass"
|
|
|
|
|
>
|
2026-09-02 08:26:52 -04:00
|
|
|
<div
|
|
|
|
|
v-if="quotePending"
|
|
|
|
|
class="flex flex-col items-center gap-2 px-4 py-2"
|
|
|
|
|
aria-busy="true"
|
|
|
|
|
aria-label="در حال بارگذاری قیمت"
|
|
|
|
|
>
|
|
|
|
|
<div class="h-3 w-32 rounded boursecu-price-skeleton animate-pulse" />
|
|
|
|
|
<div class="h-6 w-48 rounded boursecu-price-skeleton animate-pulse" />
|
|
|
|
|
<div class="h-8 w-24 rounded-lg boursecu-price-skeleton animate-pulse" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="displayState !== 'open'">
|
2026-07-06 12:35:42 +02:00
|
|
|
<div class="status-box status-box--boursecu">
|
2026-06-28 21:48:48 +03:30
|
|
|
<div class="status-box__icon-wrap">
|
|
|
|
|
<Icon
|
|
|
|
|
:icon="displayState === 'closed' ? 'vuesax-linear:lock' : 'vuesax-linear:info-circle'"
|
|
|
|
|
size="22"
|
2026-07-06 12:35:42 +02:00
|
|
|
color="#ffffff"
|
2026-06-28 21:48:48 +03:30
|
|
|
/>
|
2026-05-14 13:44:43 +03:30
|
|
|
</div>
|
2026-06-28 21:48:48 +03:30
|
|
|
<div class="status-box__title">{{ statusTitle }}</div>
|
2026-07-11 12:42:56 +02:00
|
|
|
<div v-if="statusHint" class="status-box__hint">{{ statusHint }}</div>
|
2026-05-14 13:44:43 +03:30
|
|
|
</div>
|
2026-06-23 16:02:41 +03:30
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else>
|
2026-11-03 19:57:39 +03:30
|
|
|
<ul class="hero-quotes">
|
|
|
|
|
<li v-for="row in quoteRows" :key="row.label" class="hero-quotes__row">
|
|
|
|
|
<span class="hero-quotes__label">{{ row.label }}</span>
|
|
|
|
|
<span class="hero-quotes__value" dir="ltr">
|
|
|
|
|
<bdi>{{ row.value }}</bdi>
|
|
|
|
|
<small v-if="row.unit">{{ row.unit }}</small>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2026-06-23 16:02:41 +03:30
|
|
|
</template>
|
2026-05-14 13:44:43 +03:30
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-06-16 19:47:59 +03:30
|
|
|
import { computed } from 'vue'
|
2026-05-14 13:44:43 +03:30
|
|
|
import Icon from '@/components/BasicPacks/BasicIcon.vue'
|
2026-06-23 16:02:41 +03:30
|
|
|
import { useUserStore } from '@/store/userStore'
|
2026-11-03 19:57:39 +03:30
|
|
|
import { useHomeQuoteRows } from '@/views/base/home/composables/useHomeQuoteRows'
|
2026-06-28 21:48:48 +03:30
|
|
|
import {
|
|
|
|
|
NO_QUOTE_MESSAGE,
|
2026-07-11 12:42:56 +02:00
|
|
|
STORE_CLOSED_TITLE,
|
2026-06-28 21:48:48 +03:30
|
|
|
getPriceDisplayState,
|
2026-07-11 12:42:56 +02:00
|
|
|
getStoreClosedHint,
|
2026-09-02 08:26:52 -04:00
|
|
|
isHomeQuotePending,
|
2026-06-28 21:48:48 +03:30
|
|
|
} from '@/utils/storeHours'
|
2026-05-14 13:44:43 +03:30
|
|
|
|
2026-06-23 16:02:41 +03:30
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
const displayState = computed(() => getPriceDisplayState())
|
2026-09-02 08:26:52 -04:00
|
|
|
const quotePending = computed(() => isHomeQuotePending())
|
2026-06-23 16:02:41 +03:30
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
const statusTitle = computed(() =>
|
2026-07-11 12:42:56 +02:00
|
|
|
displayState.value === 'closed' ? STORE_CLOSED_TITLE : NO_QUOTE_MESSAGE
|
2026-06-28 21:48:48 +03:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const statusHint = computed(() => {
|
|
|
|
|
if (displayState.value === 'closed') {
|
2026-07-11 12:42:56 +02:00
|
|
|
return getStoreClosedHint(userStore.getValueByKey('closed_message'))
|
2026-06-23 16:02:41 +03:30
|
|
|
}
|
2026-10-21 03:39:00 -04:00
|
|
|
return 'در حال حاضر قیمتی برای نمایش وجود ندارد.'
|
2026-06-23 16:02:41 +03:30
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const containerClass = computed(() => {
|
2026-09-02 08:26:52 -04:00
|
|
|
if (quotePending.value) {
|
|
|
|
|
return 'boursecu-price-box boursecu-price-box--open'
|
|
|
|
|
}
|
2026-06-28 21:48:48 +03:30
|
|
|
if (displayState.value !== 'open') {
|
2026-06-23 16:02:41 +03:30
|
|
|
return 'boursecu-price-box boursecu-price-box--closed'
|
|
|
|
|
}
|
|
|
|
|
return 'boursecu-price-box boursecu-price-box--open'
|
|
|
|
|
})
|
2026-05-14 13:44:43 +03:30
|
|
|
|
2026-11-03 19:57:39 +03:30
|
|
|
const { quoteRows } = useHomeQuoteRows()
|
2026-06-16 19:47:59 +03:30
|
|
|
</script>
|
2026-05-14 13:44:43 +03:30
|
|
|
|
2026-06-16 19:47:59 +03:30
|
|
|
<style scoped>
|
2026-06-23 16:02:41 +03:30
|
|
|
.boursecu-price-box {
|
|
|
|
|
border: none;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.boursecu-price-box--open {
|
|
|
|
|
background: linear-gradient(135deg, #c98a4a 0%, #a86528 100%);
|
|
|
|
|
box-shadow: 0 4px 14px rgba(168, 101, 40, 0.28);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.boursecu-price-box--closed {
|
|
|
|
|
background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
|
|
|
|
|
box-shadow: 0 4px 14px rgba(45, 55, 72, 0.22);
|
|
|
|
|
min-height: 88px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-03 19:57:39 +03:30
|
|
|
.hero-quotes {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0 12px;
|
|
|
|
|
list-style: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-quotes__row {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: baseline;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hero-quotes__label {
|
2026-06-23 16:02:41 +03:30
|
|
|
color: rgba(255, 255, 255, 0.92);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 600;
|
2026-11-03 19:57:39 +03:30
|
|
|
min-width: 0;
|
2026-06-23 16:02:41 +03:30
|
|
|
}
|
|
|
|
|
|
2026-11-03 19:57:39 +03:30
|
|
|
.hero-quotes__value {
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-variant-numeric: tabular-nums;
|
|
|
|
|
white-space: nowrap;
|
2026-06-23 16:02:41 +03:30
|
|
|
}
|
|
|
|
|
|
2026-11-03 19:57:39 +03:30
|
|
|
.hero-quotes__value small {
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
color: rgba(255, 255, 255, 0.8);
|
|
|
|
|
font-size: 11px;
|
2026-06-23 16:02:41 +03:30
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-02 08:26:52 -04:00
|
|
|
.boursecu-price-skeleton {
|
|
|
|
|
background: rgba(255, 255, 255, 0.25);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
.status-box {
|
2026-06-23 16:02:41 +03:30
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
.status-box__icon-wrap {
|
2026-06-23 16:02:41 +03:30
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-bottom: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
.status-box__title {
|
2026-06-23 16:02:41 +03:30
|
|
|
font-size: 15px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
.status-box__hint {
|
2026-06-23 16:02:41 +03:30
|
|
|
font-size: 11px;
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
max-width: 280px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
.status-box--boursecu .status-box__icon-wrap {
|
|
|
|
|
background: rgba(255, 255, 255, 0.12);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-box--boursecu .status-box__title {
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-box--boursecu .status-box__hint {
|
|
|
|
|
color: rgba(255, 255, 255, 0.78);
|
|
|
|
|
}
|
2026-06-16 19:47:59 +03:30
|
|
|
</style>
|