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

36 lines
1.6 KiB
Vue
Raw Normal View History

2026-05-14 13:44:43 +03:30
<template>
<div class="bg-primary rounded-lg p-2 py-3 mt-2">
<div class="flex justify-center text-tertiary w-full z-20">
محصولات:
<div class="text-l mr-2 font-bold">{{ userStore?.userInfo?.wallet?.count_product ?? 0 }} عدد</div>
</div>
2026-06-03 22:04:45 +03:30
<div v-if="!isBoursecuProject()" class="flex mt-2 justify-center text-tertiary w-full z-20">
{{ metalAssetLabel }}:
2026-06-08 12:34:10 +03:30
<div class="text-l mr-2 font-bold">{{ (userStore?.userInfo?.wallet?.count_gold ?? 0).toFixed(3) }} {{ weightUnit }}</div>
2026-05-14 13:44:43 +03:30
<BasicIcon @click="$emit('openGoldModal')" icon="vuesax-linear:info-circle" size="18" color="tertiary" />
</div>
<div class="flex mt-2 justify-center text-tertiary w-full z-20">
دارایی ریالی:
<div class="text-l mr-2 font-bold">{{ usePriceWithoutType(userStore?.userInfo?.wallet?.count_cash ?? 0) }} ریال</div>
<BasicIcon @click="$emit('openRialModal')" icon="vuesax-linear:info-circle" size="18" color="tertiary" />
</div>
</div>
</template>
<script setup lang="ts">
2026-06-03 22:04:45 +03:30
import { computed } from 'vue'
2026-05-14 13:44:43 +03:30
import { useUserStore } from '@/store/userStore'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import {usePriceWithoutType} from "../../../../utils/usePrice";
2026-06-03 22:04:45 +03:30
import { isBoursecuProject } from '@/utils/config'
2026-06-08 12:34:10 +03:30
import { getMetalAssetLabel, getWeightUnit } from '@/utils/productDealMethod'
2026-05-14 13:44:43 +03:30
const userStore = useUserStore()
2026-06-03 22:04:45 +03:30
const metalAssetLabel = computed(() => getMetalAssetLabel())
2026-06-08 12:34:10 +03:30
const weightUnit = computed(() => getWeightUnit())
2026-05-14 13:44:43 +03:30
defineEmits<{
openGoldModal: []
openRialModal: []
}>()
</script>