Unify store-closed messaging when the market is closed or has no quote.
Treat missing quotes as closed across home and products, show only the admin closed_message as hint, and block trading with consistent notices. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
/>
|
||||
</div>
|
||||
<p class="dhome-hero-price__closed-title">{{ statusTitle }}</p>
|
||||
<p class="dhome-hero-price__closed-hint">{{ statusHint }}</p>
|
||||
<p v-if="statusHint" class="dhome-hero-price__closed-hint">{{ statusHint }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -55,8 +55,9 @@ import { useUserStore } from '@/store/userStore'
|
||||
import { getTradeBuyPrice, lastPrice, percentPriceChanged } from '@/utils/price'
|
||||
import {
|
||||
NO_QUOTE_MESSAGE,
|
||||
STORE_CLOSED_TITLE,
|
||||
getPriceDisplayState,
|
||||
getStoreClosedMessage,
|
||||
getStoreClosedHint,
|
||||
} from '@/utils/storeHours'
|
||||
import { formatSignedPercentChange } from '@/utils/usePrice'
|
||||
|
||||
@@ -65,16 +66,12 @@ const userStore = useUserStore()
|
||||
const displayState = computed(() => getPriceDisplayState())
|
||||
|
||||
const statusTitle = computed(() =>
|
||||
displayState.value === 'closed' ? 'فروشگاه بسته است' : NO_QUOTE_MESSAGE
|
||||
displayState.value === 'closed' ? STORE_CLOSED_TITLE : 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 getStoreClosedHint(userStore.getValueByKey('closed_message'))
|
||||
}
|
||||
return 'در حال حاضر مظنهای برای نمایش وجود ندارد.'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user