handle huge things!

This commit is contained in:
2026-06-03 22:04:45 +03:30
parent 198f0a164b
commit f82a0c3873
29 changed files with 778 additions and 445 deletions
@@ -4,8 +4,8 @@
محصولات:
<div class="text-l mr-2 font-bold">{{ userStore?.userInfo?.wallet?.count_product ?? 0 }} عدد</div>
</div>
<div class="flex mt-2 justify-center text-tertiary w-full z-20">
دارایی طلایی:
<div v-if="!isBoursecuProject()" class="flex mt-2 justify-center text-tertiary w-full z-20">
{{ metalAssetLabel }}:
<div class="text-l mr-2 font-bold">{{ (userStore?.userInfo?.wallet?.count_gold ?? 0).toFixed(3) }} گرم</div>
<BasicIcon @click="$emit('openGoldModal')" icon="vuesax-linear:info-circle" size="18" color="tertiary" />
</div>
@@ -18,11 +18,15 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useUserStore } from '@/store/userStore'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import {usePriceWithoutType} from "../../../../utils/usePrice";
import { isBoursecuProject } from '@/utils/config'
import { getMetalAssetLabel } from '@/utils/productDealMethod'
const userStore = useUserStore()
const metalAssetLabel = computed(() => getMetalAssetLabel())
defineEmits<{
openGoldModal: []
@@ -4,7 +4,7 @@
<div>بالاترین قیمت امروز</div>
<div v-if="price" class="flex flex-col items-center mt-3">
<div class="text-green-600 flex gap-1 text-xs items-center">
<div class="text-base">{{ usePriceWithoutType(price?.buy ?? 0) }}</div>
<div class="text-base">{{ usePriceWithoutType(highPrice) }}</div>
ریال
</div>
</div>
@@ -15,7 +15,7 @@
<div class="flex w-full mt-3 justify-evenly">
<div v-if="price" class="flex flex-col items-center">
<div class="text-red-600 flex gap-1 text-xs items-center">
<div class="text-base">{{ usePriceWithoutType(price?.sell ?? 0) }}</div>
<div class="text-base">{{ usePriceWithoutType(lowPrice) }}</div>
ریال
</div>
</div>
@@ -25,10 +25,14 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { getTradeBuyPrice, getTradeSellPrice } from '@/utils/price'
import { usePriceWithoutType } from '../../../../utils/usePrice'
import {usePriceWithoutType} from "../../../../utils/usePrice";
defineProps<{
const props = defineProps<{
price: any
}>()
const highPrice = computed(() => getTradeBuyPrice(props.price))
const lowPrice = computed(() => getTradeSellPrice(props.price))
</script>
@@ -10,15 +10,24 @@
<BasicIcon v-else-if="['آبشده','طلا'].includes(props.ProductItem.group_type)" stroke-width="1" size="50" color="#0A1B37" class="rotate-310" icon="vuesax-linear:slider-vertical"/>
<BasicIcon v-else stroke-width="1" size="50" color="#0A1B37" class="rotate-310" icon="vuesax-linear:slider-vertical"/>
</div>
<div class="flex justify-between px-2 items-center ">
<div class="px-2">
<div class="flex justify-between items-center">
<BasicIcon v-if="props.ProductItem.group_type=='گوی'" stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:grammerly"/>
<BasicIcon v-else-if="props.ProductItem.group_type=='سکه'" stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:coin"/>
<BasicIcon v-else-if="props.ProductItem.group_type=='شمش'" stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:slider-vertical"/>
<BasicIcon v-else-if="props.ProductItem.group_type=='مکعب'" stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:keyboard"/>
<BasicIcon v-else stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:slider-vertical"/> <div class="flex justify-between gap-2 items-center">
<BasicIcon v-else stroke-width="1" size="26" color="#0A1B37" class="rotate-310" icon="vuesax-linear:slider-vertical"/>
<div class="flex justify-between gap-2 items-center">
<span v-if="['آبشده','طلا'].includes(props.ProductItem.group_type)" class="font-bold text-secondary">{{userWallet.walletInfo?.gold??0}}</span>
<span v-else class="font-bold text-secondary">{{props?.ProductItem.wallet?.gold??0}}</span>
<span class="text-gray-400">{{props?.ProductItem?.unit}}</span>
<span v-else class="font-bold text-secondary">{{ props?.ProductItem.wallet?.gold ?? 0 }}</span>
<span class="text-gray-400">{{ getProductQuantityUnit(props.ProductItem) }}</span>
</div>
</div>
<div
v-if="getProductUnitWeightLabel(props.ProductItem)"
class="mt-1 text-left text-xs text-gray-400"
>
هر عدد {{ getProductUnitWeightLabel(props.ProductItem) }}
</div>
</div>
</div>
@@ -30,6 +39,7 @@
import BasicIcon from "@/components/BasicPacks/BasicIcon.vue";
import type {PInventory} from "@/models/products";
import {useWalletStore} from "../../../../store/walletStore";
import { getProductQuantityUnit, getProductUnitWeightLabel } from '@/utils/productDealMethod'
interface Prop {
ProductItem: PInventory
}