changes of boursecu

This commit is contained in:
2026-06-03 19:54:23 +03:30
parent eab6b0df52
commit 198f0a164b
12 changed files with 165 additions and 31 deletions
+3 -2
View File
@@ -62,13 +62,13 @@
<!-- {{walletStore?.walletInfo?.gold}}-->
<Transition mode="out-in" name="fade">
<div v-if="!isBuy" class="font-bold text-xs">
<div> {{ `موجودی کیف طلا: ${walletStore?.walletInfo?.gold ?? 0} گرم` }}</div>
<div>{{ formatGoldWalletBalanceText(walletStore?.walletInfo?.gold ?? 0, props?.ProductItem?.group_type) }}</div>
<!-- <div v-if="walletStore?.walletInfo?.gold_block !== 0">
{{ `موجودی قابل برداشت طلا: ${walletStore?.walletInfo?.gold_block ?? 0} گرم` }}
</div>-->
</div>
<div v-else class="font-bold text-xs">
{{ `موجودی کیف پول: ${usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)} ریال` }}
{{ formatCashWalletBalanceText(usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0), props?.ProductItem?.group_type) }}
</div>
</Transition>
<Transition mode="out-in" name="fade">
@@ -237,6 +237,7 @@ import type { Product } from '@/models/products'
import { useFundUserStore } from '@/store/fundStore'
import {useConfigStore} from "@/store/configStore";
import { calcFeeInGrams } from '@/utils/serviceFee'
import { formatCashWalletBalanceText, formatGoldWalletBalanceText } from '@/utils/productDealMethod'
const infoVisible = ref(false)
const walletStore = useWalletStore()
+35
View File
@@ -10,6 +10,33 @@
<img :src="img" alt="" class="w-full absolute bottom-0 left-0 opacity-5 pointer-events-none z-0" />
<div class="pt-15 flex flex-col relative z-10">
<div class="text-tertiary font-bold mr-5 z-20">موجودی دارایی ها</div>
<template v-if="isBoursecuProject()">
<div class="flex justify-center mt-2 w-full z-20">
{{ BOURSECU_ASSET_LABEL_KATOD }}:
<div class="text-l mr-4 font-bold">
{{ formatBoursecuAssetAmount(walletStore.walletInfo?.count_katod_mes) }}
</div>
</div>
<div class="flex justify-center mt-2 w-full z-20">
{{ BOURSECU_ASSET_LABEL_MAFTOL }}:
<div class="text-l mr-4 font-bold">
{{ formatBoursecuAssetAmount(walletStore.walletInfo?.count_maftol_mes) }}
</div>
</div>
<div class="flex justify-center mt-2 w-full z-20">
{{ BOURSECU_ASSET_LABEL_GOLD }}:
<div class="text-l mr-4 font-bold">
{{ formatBoursecuAssetAmount(walletStore.walletInfo?.count_gold) }}
</div>
</div>
<div class="flex justify-center mt-2 w-full z-20">
دارایی ریالی:
<div class="text-l mr-4 font-bold">
{{ usePriceWithoutType(walletStore.walletInfo?.count_cash ?? 0) }}ریال
</div>
</div>
</template>
<template v-else>
<div class="flex mt-4 justify-center mt-2 w-full z-20">
محصولات:
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_product ?? 0}}عدد</div>
@@ -34,6 +61,7 @@
معادل ریالی مجموع دارایی ها:
<div class="text-l mr-4 font-bold">{{ usePriceWithoutType(walletStore.walletInfo?.count_cash_total ?? 0) }}ریال</div>
</div>
</template>
</div>
</div>
<div class="pt-[20rem] ">
@@ -81,6 +109,13 @@ import type { User } from '@/models/login'
import {usePriceWithoutType} from "../../../utils/usePrice";
import {useWalletStore} from "@/store/walletStore";
import {useConfigStore} from "@/store/configStore";
import { isBoursecuProject } from '@/utils/config'
import {
BOURSECU_ASSET_LABEL_GOLD,
BOURSECU_ASSET_LABEL_KATOD,
BOURSECU_ASSET_LABEL_MAFTOL,
formatBoursecuAssetAmount,
} from '@/utils/productDealMethod'
const nameProject = useConfigStore().config.name
const items = ref<Fund[]>([])
+2 -1
View File
@@ -58,7 +58,7 @@
type="text" inputmode="decimal"
size="large" />
<div v-if="isDeposit" class="mt-2 text-xs font-bold leading-5">
<div>موجودی کیف طلا: {{ walletStore?.walletInfo?.gold }} گرم</div>
<div>{{ formatGoldWalletBalanceText(walletStore?.walletInfo?.gold ?? 0) }}</div>
<div v-if="info?.wallet?.gold !== 0">
{{ `موجودی قابل برداشت گنج: ${info?.wallet?.gold ?? 0} گرم` }}
</div>
@@ -144,6 +144,7 @@ import { required } from '@/utils/inputRules'
import type { FormInstance } from 'ant-design-vue'
import { message } from 'ant-design-vue'
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
import { formatGoldWalletBalanceText } from '@/utils/productDealMethod'
import BasicInput from '@/components/BasicPacks/BasicInput.vue'
import { useWalletStore } from '@/store/walletStore'
import ListAnim from '@/components/ListAnim.vue'
+3 -2
View File
@@ -61,13 +61,13 @@
<!-- {{walletStore?.walletInfo?.gold}}-->
<Transition mode="out-in" name="fade">
<div v-if="!isBuy" class="font-bold text-xs">
<div> {{ `موجودی کیف طلا: ${walletStore?.walletInfo?.gold ?? 0} گرم` }}</div>
<div>{{ formatGoldWalletBalanceText(walletStore?.walletInfo?.gold ?? 0, props?.ProductItem?.group_type) }}</div>
<!-- <div v-if="walletStore?.walletInfo?.gold_block !== 0">
{{ `موجودی قابل برداشت طلا: ${walletStore?.walletInfo?.gold_block ?? 0} گرم` }}
</div>-->
</div>
<div v-else class="font-bold text-xs">
{{ `موجودی کیف پول: ${usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)} ریال` }}
{{ formatCashWalletBalanceText(usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0), props?.ProductItem?.group_type) }}
</div>
</Transition>
<Transition mode="out-in" name="fade">
@@ -232,6 +232,7 @@ import type { Product } from '@/models/products'
import { useFundUserStore } from '@/store/fundStore'
import {useConfigStore} from "@/store/configStore";
import { calcFeeInGrams, loadServiceFeeFromSettings } from '@/utils/serviceFee'
import { formatCashWalletBalanceText, formatGoldWalletBalanceText } from '@/utils/productDealMethod'
const infoVisible = ref(false)
const walletStore = useWalletStore()
@@ -60,7 +60,7 @@
</a-form-item>
<a-form-item v-if="isBuy" name="goldValue"
:rules="[justNumber2(props?.ProductItem?.price , form.method , props?.ProductItem?.amount, true)]">
:rules="[justNumber2(props?.ProductItem?.price , form.method , props?.ProductItem?.amount, true, props?.ProductItem?.group_type)]">
<BasicInput v-model:value="form.goldValue" addon-before="تعداد" addon-bg-color="#000000FF"
addon-text-color="white"
place-holder="تعداد"
@@ -81,16 +81,16 @@
<div v-if="props?.ProductItem?.group_type !== 'سکه'" class="flex justify-between">
<div> وزن کل</div>
<div>{{ form.goldVazn ?? 0 }} گرم</div>
<div>{{ form.goldVazn ?? 0 }} {{ getWeightUnit() }}</div>
</div>
<!-- {{walletStore?.walletInfo?.gold}}-->
<Transition mode="out-in" name="fade" class="mt-2">
<div v-if="isBuy && form.method === 'gold'" class="font-bold text-xs">
<div> {{ `موجودی کیف طلا: ${walletStore?.walletInfo?.gold ?? 0} گرم` }}</div>
<div>{{ goldWalletBalanceText }}</div>
</div>
<div v-else-if="isBuy" class="font-bold text-xs">
{{ `موجودی کیف پول: ${usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)} ریال` }}
{{ cashWalletBalanceText }}
</div>
<div class="font-bold text-xs" v-else>{{ `موجودی محصول: ${getInventoryById(props?.ProductItem?.id)}` }}
</div>
@@ -259,9 +259,25 @@ import {
getDefaultProductDealMethod,
getProductDealMethodOptions,
isCashLikeDealMethod,
formatCashWalletBalanceText,
formatGoldWalletBalanceText,
getWeightUnit,
} from '@/utils/productDealMethod'
const typeDeal = computed(() => getProductDealMethodOptions(props?.ProductItem?.group_type))
const productGroupType = computed(() => props?.ProductItem?.group_type)
const goldWalletBalanceText = computed(() =>
formatGoldWalletBalanceText(walletStore?.walletInfo?.gold ?? 0, productGroupType.value)
)
const cashWalletBalanceText = computed(() =>
formatCashWalletBalanceText(
usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0),
productGroupType.value
)
)
const infoVisible = ref(false)
const walletStore = useWalletStore()
const userStore = useUserStore()
@@ -68,7 +68,7 @@
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-primary">موجودی کیف پول:</div>
<div class="text-primary">{{ getCashWalletLabel(item.wallet?.product?.group_type) }}:</div>
<div :class="item.cash > 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center number-ltr">
<div class="text-base">{{ usePriceWithoutType(item.balance_cash ?? 0) }}</div>
ریال
@@ -82,10 +82,10 @@
</div>
</div>
<div class="flex justify-between mb-3" v-else>
<div class="text-primary">موجودی کیف آبشده:</div>
<div class="text-primary">{{ getGoldWalletLabel(item.wallet?.product?.group_type) }}:</div>
<div class="flex text-xs text-yellow-700 items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
گرم
{{ getWeightUnit() }}
</div>
</div>
<!-- <div class="flex justify-between mb-3">
@@ -138,6 +138,7 @@ import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
import { computed, ref } from 'vue'
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
import type { Transaction } from '@/models/transaction'
import { getCashWalletLabel, getGoldWalletLabel, getWeightUnit } from '@/utils/productDealMethod'
import { toJalaliNotime, toJalaliOutOfUTC, toTime } from '../../../../utils/useDateTime'
const infoVisible = ref<boolean>(false)
+4 -3
View File
@@ -79,17 +79,17 @@
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-black">موجودی کیف پول:</div>
<div class="text-black">{{ getCashWalletLabel() }}:</div>
<div :class="item.cash > 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center">
<div class="text-base number-ltr">{{ usePriceWithoutType(item.balance_cash ?? 0) }}</div>
ریال
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-black">موجودی کیف طلا:</div>
<div class="text-black">{{ getGoldWalletLabel() }}:</div>
<div class="flex text-xs text-yellow-700 items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
گرم
{{ getWeightUnit() }}
</div>
</div>
<!-- <div class="flex justify-between mb-3">
@@ -143,6 +143,7 @@ import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
import {computed, ref} from "vue";
import BasicButton from "@/components/BasicPacks/BasicButton.vue";
import type {Transaction} from "@/models/transaction";
import {getCashWalletLabel, getGoldWalletLabel, getWeightUnit} from '@/utils/productDealMethod'
import {toJalaliNotime, toJalaliOutOfUTC, toTime} from "../../../../utils/useDateTime";
const infoVisible = ref<boolean>(false)
+2 -5
View File
@@ -48,11 +48,7 @@
<div v-if="!isDeposit">
<div class="text-red text-xs font-bold mb-2">حداقل مبلغ برداشتی 100 هزار تومان می باشد.</div>
<div class="font-bold text-xs">
{{
`موجودی کیف پول: ${usePriceWithoutType(
walletStore?.walletInfo?.cash ?? 0
)} ریال`
}}
{{ formatCashWalletBalanceText(usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)) }}
</div>
<a-form-item v-if="walletStore?.walletInfo" class="!mt-3">
<a-slider
@@ -359,6 +355,7 @@
<script lang="ts" setup>
import { computed, onMounted, ref } from 'vue'
import { formatCashWalletBalanceText } from '@/utils/productDealMethod'
import { usePriceWithoutType } from '@/utils/usePrice'
import { loading, loadingMore } from '@/utils'
import BasicButton from '@/components/BasicPacks/BasicButton.vue'