new UI and handle cashing

This commit is contained in:
2026-06-16 19:47:28 +03:30
parent e174ae28c5
commit 6e5ea0319f
41 changed files with 2936 additions and 641 deletions
@@ -19,7 +19,7 @@ const isBoursecuLayout = computed(() => ctx.isBoursecuHomeLayout.value)
const meta = computed(() => assetsSummary.value?.meta)
const metalTotals = computed(() => assetsSummary.value?.metal_totals ?? [])
const inventoryCards = computed(() => assetsSummary.value?.inventory_cards ?? [])
const totalRialValue = computed(() => assetsSummary.value?.total_rial_value ?? 0)
const cashWallet = computed(() => assetsSummary.value?.cash_wallet ?? 0)
const countBasedInventory = computed(() =>
(assetsSummary.value?.count_products ?? []).reduce((sum, item) => sum + Number(item.quantity ?? 0), 0),
)
@@ -90,7 +90,7 @@ const metrics = computed<MetricItem[]>(() => {
items.push({
id: 'rial',
label: 'دارایی ریالی',
value: `${usePriceWithoutType(totalRialValue.value)} ریال`,
value: `${usePriceWithoutType(cashWallet.value)} ریال`,
showInfo: true,
onInfo: 'rial',
})
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserStore } from '@/store/userStore'
import { loading } from '@/utils'
import { getToken } from '@/utils'
import { useHomePageContext } from '../../composables/useHomePage'
import HomeSkeleton from '../../components/HomeSkeleton.vue'
import DesktopHomeShell from '../components/DesktopHomeShell.vue'
@@ -18,10 +19,11 @@ defineEmits<{
}>()
const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore)
const ctx = useHomePageContext()
const showSkeleton = computed(() => loading.value || !userStore.userInfo)
const showContent = computed(() => !loading.value && Boolean(userStore.userInfo))
const showContent = computed(() => Boolean(userInfo.value))
const showSkeleton = computed(() => Boolean(getToken()) && !userInfo.value)
</script>
<template>
@@ -31,7 +33,7 @@ const showContent = computed(() => !loading.value && Boolean(userStore.userInfo)
<HomeSkeleton v-if="showSkeleton" />
<template v-else-if="showContent">
<template v-if="showContent">
<section class="dhome-hero-row">
<DesktopLivePrice />
<DesktopPriceRange />
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserStore } from '@/store/userStore'
import { loading } from '@/utils'
import { getToken } from '@/utils'
import { useHomePageContext } from '../../composables/useHomePage'
import HomeSkeleton from '../../components/HomeSkeleton.vue'
import DesktopHomeShell from '../components/DesktopHomeShell.vue'
@@ -21,10 +22,11 @@ defineEmits<{
}>()
const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore)
const ctx = useHomePageContext()
const showSkeleton = computed(() => loading.value || !userStore.userInfo)
const showContent = computed(() => !loading.value && Boolean(userStore.userInfo))
const showContent = computed(() => Boolean(userInfo.value))
const showSkeleton = computed(() => Boolean(getToken()) && !userInfo.value)
</script>
<template>
@@ -34,7 +36,7 @@ const showContent = computed(() => !loading.value && Boolean(userStore.userInfo)
<HomeSkeleton v-if="showSkeleton" />
<template v-else-if="showContent">
<template v-if="showContent">
<section class="dhome-hero-row">
<DesktopLivePrice />
<DesktopPriceRange />