2026-06-14 10:08:46 +03:30
|
|
|
|
<template>
|
2026-06-23 16:02:41 +03:30
|
|
|
|
<div
|
|
|
|
|
|
class="dhome-surface dhome-hero-price"
|
|
|
|
|
|
:class="{
|
2026-07-06 12:35:42 +02:00
|
|
|
|
'dhome-hero-price--boursecu-open': displayState === 'open',
|
|
|
|
|
|
'dhome-hero-price--boursecu-closed': displayState !== 'open',
|
2026-06-23 16:02:41 +03:30
|
|
|
|
}"
|
|
|
|
|
|
>
|
2026-06-28 21:48:48 +03:30
|
|
|
|
<template v-if="displayState !== 'open'">
|
2026-07-06 12:35:42 +02:00
|
|
|
|
<div class="dhome-hero-price__closed">
|
2026-06-23 16:02:41 +03:30
|
|
|
|
<div class="dhome-hero-price__closed-icon">
|
2026-06-28 21:48:48 +03:30
|
|
|
|
<BasicIcon
|
|
|
|
|
|
: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-06-23 16:02:41 +03:30
|
|
|
|
</div>
|
2026-06-28 21:48:48 +03:30
|
|
|
|
<p class="dhome-hero-price__closed-title">{{ statusTitle }}</p>
|
2026-07-11 12:42:56 +02:00
|
|
|
|
<p v-if="statusHint" class="dhome-hero-price__closed-hint">{{ statusHint }}</p>
|
2026-06-23 16:02:41 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-else>
|
2026-07-06 12:35:42 +02:00
|
|
|
|
<span class="dhome-label dhome-label--boursecu">
|
|
|
|
|
|
قیمت لحظهای کاتد مس
|
2026-06-14 10:08:46 +03:30
|
|
|
|
</span>
|
2026-06-23 16:02:41 +03:30
|
|
|
|
<div class="dhome-hero-price__value-row">
|
|
|
|
|
|
<span
|
|
|
|
|
|
v-if="percentChange !== 0"
|
|
|
|
|
|
class="dhome-hero-price__delta"
|
|
|
|
|
|
:class="percentChange > 0 ? 'dhome-hero-price__delta--up' : 'dhome-hero-price__delta--down'"
|
|
|
|
|
|
>
|
|
|
|
|
|
<BasicIcon
|
|
|
|
|
|
:icon="percentChange > 0 ? 'vuesax-linear:arrow-up-2' : 'vuesax-linear:arrow-down-2'"
|
|
|
|
|
|
size="14"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<span class="dhome-hero-price__delta-value">{{ formatSignedPercentChange(percentChange) }}</span>
|
|
|
|
|
|
</span>
|
2026-07-20 16:57:03 +03:30
|
|
|
|
<span
|
2026-07-06 12:35:42 +02:00
|
|
|
|
class="dhome-hero-price__odometer o-text dhome-hero-price__odometer--boursecu"
|
2026-07-20 16:57:03 +03:30
|
|
|
|
style="direction: ltr"
|
|
|
|
|
|
>{{ usePriceWithoutType(displayGoldVal) }}</span>
|
2026-07-06 12:35:42 +02:00
|
|
|
|
<span class="dhome-hero-price__unit dhome-hero-price__unit--boursecu">ریال</span>
|
2026-06-23 16:02:41 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2026-06-14 10:08:46 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { computed } from 'vue'
|
2026-06-16 19:47:59 +03:30
|
|
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
2026-06-23 16:02:41 +03:30
|
|
|
|
import { useUserStore } from '@/store/userStore'
|
2026-06-14 10:08:46 +03:30
|
|
|
|
import { getTradeBuyPrice, lastPrice, percentPriceChanged } from '@/utils/price'
|
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-06-28 21:48:48 +03:30
|
|
|
|
} from '@/utils/storeHours'
|
2026-07-20 16:57:03 +03:30
|
|
|
|
import { formatSignedPercentChange, usePriceWithoutType } from '@/utils/usePrice'
|
2026-06-14 10:08:46 +03:30
|
|
|
|
|
2026-06-23 16:02:41 +03:30
|
|
|
|
const userStore = useUserStore()
|
2026-06-14 10:08:46 +03:30
|
|
|
|
|
2026-06-28 21:48:48 +03:30
|
|
|
|
const displayState = computed(() => getPriceDisplayState())
|
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-06-28 21:48:48 +03:30
|
|
|
|
return 'در حال حاضر مظنهای برای نمایش وجود ندارد.'
|
2026-06-23 16:02:41 +03:30
|
|
|
|
})
|
2026-06-14 10:08:46 +03:30
|
|
|
|
|
|
|
|
|
|
const displayGoldVal = computed(() => {
|
2026-06-28 21:48:48 +03:30
|
|
|
|
if (displayState.value !== 'open') return 0
|
2026-06-14 10:08:46 +03:30
|
|
|
|
return getTradeBuyPrice(lastPrice.value)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const percentChange = computed(() => {
|
|
|
|
|
|
if (!getTradeBuyPrice(lastPrice.value)) return 0
|
|
|
|
|
|
return percentPriceChanged()
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
2026-06-23 16:02:41 +03:30
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
|
.dhome-hero-price--boursecu-open {
|
|
|
|
|
|
background: linear-gradient(135deg, #c98a4a 0%, #a86528 100%);
|
|
|
|
|
|
border-color: transparent;
|
|
|
|
|
|
box-shadow: 0 4px 14px rgba(168, 101, 40, 0.28);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price--boursecu-closed {
|
|
|
|
|
|
background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
|
|
|
|
|
|
border-color: transparent;
|
|
|
|
|
|
box-shadow: 0 4px 14px rgba(45, 55, 72, 0.22);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-label--boursecu {
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.92);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__odometer--boursecu {
|
|
|
|
|
|
color: #ffffff !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__unit--boursecu {
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.85);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__closed {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__closed-icon {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
width: 44px;
|
|
|
|
|
|
height: 44px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
background: rgba(255, 255, 255, 0.12);
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__closed-title {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dhome-hero-price__closed-hint {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
line-height: 1.7;
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.78);
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|