115 lines
3.8 KiB
Vue
115 lines
3.8 KiB
Vue
<template>
|
|||
|
|
<div>
|
||
|
|
<div class="bg-white w-full py-3 px-3 text-black font-bold drop-shadow fixed md:absolute top-0 flex h-12 z-20">
|
||
|
|
<div @click="goBack()">
|
||
|
|
<BasicIcon icon="vuesax-linear:arrow-right-1" />
|
||
|
|
</div>
|
||
|
|
<div class="mr-2">دارایی ها</div>
|
||
|
|
</div>
|
||
|
|
<div class="bg-[#EFCED9] w-screen md:w-full h-[70vh] fixed md:absolute overflow-hidden">
|
||
|
|
<img
|
||
|
|
:src="fundHeaderBackground"
|
||
|
|
alt=""
|
||
|
|
class="mt-[-4rem] mr-10 max-w-[22rem] self-end pointer-events-none absolute bottom-0 left-0 opacity-20"
|
||
|
|
/>
|
||
|
|
<div class="pt-15 flex flex-col relative z-10">
|
||
|
|
<div class="text-gray-700 font-bold mr-5 z-20">موجودی دارایی ها</div>
|
||
|
|
|
||
|
|
<div
|
||
|
|
v-if="meta?.has_count_based_products"
|
||
|
|
class="flex justify-center mt-4 w-full z-20"
|
||
|
|
>
|
||
|
|
محصولات:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ countBasedInventory }} عدد</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<template v-if="meta?.single_metal && primaryMetalTotal">
|
||
|
|
<div class="flex justify-center mt-2 w-full z-20">
|
||
|
|
{{ primaryMetalTotal.label }}:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ formatMetalTotal(primaryMetalTotal) }}</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
<template v-else>
|
||
|
|
<div
|
||
|
|
v-for="metal in metalTotals"
|
||
|
|
:key="`metal-${metal.metal_id}`"
|
||
|
|
class="flex justify-center mt-2 w-full z-20"
|
||
|
|
>
|
||
|
|
{{ metal.label }}:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ formatMetalTotal(metal) }}</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<div
|
||
|
|
v-if="meta?.has_count_based_products"
|
||
|
|
class="flex justify-center mt-2 w-full z-20"
|
||
|
|
>
|
||
|
|
مجموع موجودی:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ countBasedInventory }} عدد</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="flex justify-center mt-2 w-full z-20">
|
||
|
|
دارایی ریالی:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ usePriceWithoutType(cashWallet) }} ریال</div>
|
||
|
|
</div>
|
||
|
|
<div class="flex justify-center mt-2 w-full z-20">
|
||
|
|
معادل ریالی مجموع دارایی ها:
|
||
|
|
<div class="text-l mr-4 font-bold">{{ usePriceWithoutType(totalRialValue) }} ریال</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="pt-[20rem]">
|
||
|
|
<div
|
||
|
|
class="bg-gray-100 w-screen md:w-full z-20 relative rounded-t-3xl h-[calc(100vh-20rem-70px)] overflow-y-auto pb-15"
|
||
|
|
style="box-shadow: 0px -2px 4px -2px #0000001a"
|
||
|
|
>
|
||
|
|
<div
|
||
|
|
v-if="inventoryCards.length === 0 && !loading"
|
||
|
|
class="w-full h-full flex justify-center items-center"
|
||
|
|
>
|
||
|
|
<div>
|
||
|
|
<img :src="fundEmptyImage" alt="" class="w-70" />
|
||
|
|
<div class="text-center text-lg">{{ fundEmptyText }}</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<a-spin :spinning="loading">
|
||
|
|
<div :class="loading ? 'h-[40vh]' : ''" class="grid grid-cols-2 gap-3 p-5">
|
||
|
|
<Item
|
||
|
|
v-for="item in inventoryCards"
|
||
|
|
:key="item.product_id"
|
||
|
|
:item="item"
|
||
|
|
@click="openFundInfo(item.product_id)"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
</a-spin>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script lang="ts" setup>
|
||
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||
|
|
import { loading } from '@/utils'
|
||
|
|
import { usePriceWithoutType } from '@/utils/usePrice'
|
||
|
|
import Item from '../components/Item.vue'
|
||
|
|
import { useFundPageContext } from '../composables/useFundPage'
|
||
|
|
|
||
|
|
const {
|
||
|
|
meta,
|
||
|
|
inventoryCards,
|
||
|
|
metalTotals,
|
||
|
|
primaryMetalTotal,
|
||
|
|
cashWallet,
|
||
|
|
totalRialValue,
|
||
|
|
countBasedInventory,
|
||
|
|
fundHeaderBackground,
|
||
|
|
fundEmptyImage,
|
||
|
|
fundEmptyText,
|
||
|
|
formatMetalTotal,
|
||
|
|
openFundInfo,
|
||
|
|
goBack,
|
||
|
|
} = useFundPageContext()
|
||
|
|
</script>
|