From 9f7a98e06483a07bad7e183ebbd23c6f2ca3c1e0 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Thu, 15 Oct 2026 18:42:54 +0330 Subject: [PATCH] feat(fund): show rial value of piggy-bank gold The gram balance alone does not show what the holding is worth. Co-authored-by: Cursor --- src/views/base/fund/info/index.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/views/base/fund/info/index.vue b/src/views/base/fund/info/index.vue index fb9eff8..1373819 100644 --- a/src/views/base/fund/info/index.vue +++ b/src/views/base/fund/info/index.vue @@ -21,6 +21,9 @@
{{ info?.wallet[0]?.gold }}
گرم +
+ {{ usePriceWithoutType(rialEquivalent) }} ریال +
موجودی قلک {{ info?.title }}
@@ -145,6 +148,8 @@ import TransactionSkeleton from '@/components/TransactionSkeleton.vue' import DialogVant from '@/components/DialogVant.vue' import { useFundUserStore } from '@/store/fundStore' import BasicIcon from '@/components/BasicPacks/BasicIcon.vue' +import { getLastPrices, lastPrice } from '@/utils/price' +import { usePriceWithoutType } from '@/utils/usePrice' const info = ref() const items = ref([]) @@ -159,8 +164,16 @@ let fundStore = useFundUserStore() let walletStore = useWalletStore() +const rialEquivalent = computed(() => { + const unit = Number(lastPrice.value?.price_last ?? 0) + if (!unit) return null + const gold = Number(info.value?.wallet?.[0]?.gold ?? 0) + return Math.round(gold * unit) +}) + onMounted(() => { initInfo() + if (!lastPrice.value) getLastPrices() // initTable() })