Files
boursecu_user/src/views/base/home/components/PriceStats.vue
T

38 lines
1.4 KiB
Vue
Raw Normal View History

2026-05-14 13:44:43 +03:30
<template>
<div class="w-full flex justify-evenly rounded-lg py-2 home_appear_fade_in mt-6 pb-45">
<div class="text-center w-full">
<div>بالاترین قیمت امروز</div>
<div v-if="price" class="flex flex-col items-center mt-3">
<div class="text-green-600 flex gap-1 text-xs items-center">
2026-06-03 22:04:45 +03:30
<div class="text-base">{{ usePriceWithoutType(highPrice) }}</div>
2026-05-14 13:44:43 +03:30
ریال
</div>
</div>
</div>
<a-divider class="bg-gray-200 !h-auto !my-2" type="vertical" />
<div class="text-center w-full">
<div>پایین ترین قیمت امروز</div>
<div class="flex w-full mt-3 justify-evenly">
<div v-if="price" class="flex flex-col items-center">
<div class="text-red-600 flex gap-1 text-xs items-center">
2026-06-03 22:04:45 +03:30
<div class="text-base">{{ usePriceWithoutType(lowPrice) }}</div>
2026-05-14 13:44:43 +03:30
ریال
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
2026-06-03 22:04:45 +03:30
import { computed } from 'vue'
import { getTradeBuyPrice, getTradeSellPrice } from '@/utils/price'
import { usePriceWithoutType } from '../../../../utils/usePrice'
2026-05-14 13:44:43 +03:30
2026-06-03 22:04:45 +03:30
const props = defineProps<{
2026-05-14 13:44:43 +03:30
price: any
}>()
2026-06-03 22:04:45 +03:30
2026-06-08 12:34:10 +03:30
const highPrice = computed(() => props.price?.up?.buy ?? getTradeBuyPrice(props.price))
const lowPrice = computed(() => props.price?.up?.sell ?? getTradeSellPrice(props.price))
2026-05-14 13:44:43 +03:30
</script>