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 <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,9 @@
|
|||||||
<div class="ml-1 text-base text-black">{{ info?.wallet[0]?.gold }}</div>
|
<div class="ml-1 text-base text-black">{{ info?.wallet[0]?.gold }}</div>
|
||||||
گرم
|
گرم
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="rialEquivalent !== null" class="mt-1 text-xs text-gray-400">
|
||||||
|
{{ usePriceWithoutType(rialEquivalent) }} ریال
|
||||||
|
</div>
|
||||||
<div class="text-gray-400">موجودی قلک {{ info?.title }}</div>
|
<div class="text-gray-400">موجودی قلک {{ info?.title }}</div>
|
||||||
<div class="w-full p-5">
|
<div class="w-full p-5">
|
||||||
<div class="w-full flex gap-3">
|
<div class="w-full flex gap-3">
|
||||||
@@ -145,6 +148,8 @@ import TransactionSkeleton from '@/components/TransactionSkeleton.vue'
|
|||||||
import DialogVant from '@/components/DialogVant.vue'
|
import DialogVant from '@/components/DialogVant.vue'
|
||||||
import { useFundUserStore } from '@/store/fundStore'
|
import { useFundUserStore } from '@/store/fundStore'
|
||||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||||
|
import { getLastPrices, lastPrice } from '@/utils/price'
|
||||||
|
import { usePriceWithoutType } from '@/utils/usePrice'
|
||||||
|
|
||||||
const info = ref<Fund>()
|
const info = ref<Fund>()
|
||||||
const items = ref<Transaction[]>([])
|
const items = ref<Transaction[]>([])
|
||||||
@@ -159,8 +164,16 @@ let fundStore = useFundUserStore()
|
|||||||
let walletStore = useWalletStore()
|
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(() => {
|
onMounted(() => {
|
||||||
initInfo()
|
initInfo()
|
||||||
|
if (!lastPrice.value) getLastPrices()
|
||||||
// initTable()
|
// initTable()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user