fixed price
This commit is contained in:
@@ -2,17 +2,21 @@
|
||||
<div
|
||||
class="dhome-surface dhome-hero-price"
|
||||
:class="{
|
||||
'dhome-hero-price--boursecu-open': isBoursecu && !showStoreClosed,
|
||||
'dhome-hero-price--boursecu-closed': isBoursecu && showStoreClosed,
|
||||
'dhome-hero-price--boursecu-open': isBoursecu && displayState === 'open',
|
||||
'dhome-hero-price--boursecu-closed': isBoursecu && displayState !== 'open',
|
||||
}"
|
||||
>
|
||||
<template v-if="isBoursecu && showStoreClosed">
|
||||
<div class="dhome-hero-price__closed">
|
||||
<template v-if="displayState !== 'open'">
|
||||
<div class="dhome-hero-price__closed" :class="{ 'dhome-hero-price__closed--default': !isBoursecu }">
|
||||
<div class="dhome-hero-price__closed-icon">
|
||||
<BasicIcon icon="vuesax-linear:lock" size="22" color="#ffffff" />
|
||||
<BasicIcon
|
||||
:icon="displayState === 'closed' ? 'vuesax-linear:lock' : 'vuesax-linear:info-circle'"
|
||||
size="22"
|
||||
:color="isBoursecu ? '#ffffff' : '#64748b'"
|
||||
/>
|
||||
</div>
|
||||
<p class="dhome-hero-price__closed-title">فروشگاه بسته است</p>
|
||||
<p class="dhome-hero-price__closed-hint">{{ storeClosedHint }}</p>
|
||||
<p class="dhome-hero-price__closed-title">{{ statusTitle }}</p>
|
||||
<p class="dhome-hero-price__closed-hint">{{ statusHint }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -54,30 +58,36 @@ import { useConfigStore } from '@/store/configStore'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
import { isBoursecuProject } from '@/utils/config'
|
||||
import { getTradeBuyPrice, lastPrice, percentPriceChanged } from '@/utils/price'
|
||||
import { getStoreClosedMessage, isStoreClosed } from '@/utils/storeHours'
|
||||
import {
|
||||
NO_QUOTE_MESSAGE,
|
||||
getPriceDisplayState,
|
||||
getStoreClosedMessage,
|
||||
} from '@/utils/storeHours'
|
||||
import { formatSignedPercentChange } from '@/utils/usePrice'
|
||||
|
||||
const config = useConfigStore()
|
||||
const userStore = useUserStore()
|
||||
const isBoursecu = isBoursecuProject()
|
||||
|
||||
const showStoreClosed = computed(() => {
|
||||
if (isBoursecu) {
|
||||
return isStoreClosed()
|
||||
}
|
||||
return lastPrice?.value?.goldir === 0 && getTradeBuyPrice(lastPrice.value) === 0
|
||||
})
|
||||
const displayState = computed(() => getPriceDisplayState())
|
||||
|
||||
const storeClosedHint = computed(() => {
|
||||
const custom = userStore.getValueByKey('closed_message')
|
||||
if (typeof custom === 'string' && custom.trim()) {
|
||||
return custom.replace(/<[^>]*>/g, '').trim()
|
||||
const statusTitle = computed(() =>
|
||||
displayState.value === 'closed' ? 'فروشگاه بسته است' : NO_QUOTE_MESSAGE
|
||||
)
|
||||
|
||||
const statusHint = computed(() => {
|
||||
if (displayState.value === 'closed') {
|
||||
const custom = userStore.getValueByKey('closed_message')
|
||||
if (typeof custom === 'string' && custom.trim()) {
|
||||
return custom.replace(/<[^>]*>/g, '').trim()
|
||||
}
|
||||
return getStoreClosedMessage()
|
||||
}
|
||||
return getStoreClosedMessage()
|
||||
return 'در حال حاضر مظنهای برای نمایش وجود ندارد.'
|
||||
})
|
||||
|
||||
const displayGoldVal = computed(() => {
|
||||
if (showStoreClosed.value) return 0
|
||||
if (displayState.value !== 'open') return 0
|
||||
return getTradeBuyPrice(lastPrice.value)
|
||||
})
|
||||
|
||||
@@ -143,4 +153,18 @@ const percentChange = computed(() => {
|
||||
line-height: 1.7;
|
||||
color: rgba(255, 255, 255, 0.78);
|
||||
}
|
||||
|
||||
.dhome-hero-price__closed--default {
|
||||
.dhome-hero-price__closed-icon {
|
||||
background: #f1f5f9;
|
||||
}
|
||||
|
||||
.dhome-hero-price__closed-title {
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.dhome-hero-price__closed-hint {
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user