fix some bug

This commit is contained in:
2026-06-06 15:48:27 +03:30
parent f82a0c3873
commit 4c707849ef
5 changed files with 29 additions and 27 deletions
@@ -31,7 +31,7 @@
<script setup lang="ts">
import Icon from '@/components/BasicPacks/BasicIcon.vue'
import { useConfigStore } from '@/store/configStore'
import {lastPrice, percentPriceChanged, price} from '@/utils/price'
import { getTradeBuyPrice, lastPrice, percentPriceChanged, price } from '@/utils/price'
import Vue3Odometer from 'vue3-odometer'
import 'odometer/themes/odometer-theme-default.css'
import {useTowDecimal} from "../../../../utils/usePrice";
@@ -42,19 +42,19 @@ const config = useConfigStore()
// محاسبه درصد تغییرات به صورت reactive
const percentChange = computed(() => {
if (! lastPrice?.value?.price_last) return 0
if (!getTradeBuyPrice(lastPrice.value)) return 0
return percentPriceChanged()
})
// بررسی بسته بودن بازار
const isMarketClosed = computed(() => {
return lastPrice?.value?.goldir === 0 && lastPrice?.value?.price_last === 0
return lastPrice?.value?.goldir === 0 && getTradeBuyPrice(lastPrice.value) === 0
})
// مقدار نمایشی برای ادومتر (با مدیریت خطا)
const displayGoldVal = computed(() => {
if (isMarketClosed.value) return 0
return lastPrice?.value?.price_last|| 0
return getTradeBuyPrice(lastPrice.value)
})
// انیمیشن fade-in