change some bug
This commit is contained in:
@@ -22,7 +22,11 @@
|
||||
دارایی مس:
|
||||
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_copper ?? 0}}گرم</div>
|
||||
</div>
|
||||
<div v-if="!isBoursecuProject" class="flex justify-center mt-2 w-full z-20">
|
||||
<div v-if="isBoursecuProject()" class="flex justify-center mt-2 w-full z-20">
|
||||
مجموع موجودی:
|
||||
<div class="text-l mr-4 font-bold">{{ inventory }} عدد</div>
|
||||
</div>
|
||||
<div v-if="!isBoursecuProject()" class="flex justify-center mt-2 w-full z-20">
|
||||
{{ metalAssetLabel }}:
|
||||
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_gold ?? 0 }}{{ getWeightUnit() }}</div>
|
||||
</div>
|
||||
@@ -71,7 +75,7 @@ import BasicModal from "@/components/BasicPacks/BasicModal.vue";
|
||||
import img from '@/assets/img/user_ly1.svg'
|
||||
import empty from '@/assets/img/cash_empty.svg'
|
||||
import Item from './components/Item.vue'
|
||||
import {onMounted, ref, computed} from "vue";
|
||||
import { onMounted, ref, computed } from "vue";
|
||||
import {loading} from "@/utils";
|
||||
import type {TableOutput} from "@/models/table";
|
||||
import type {Fund} from "@/models/fund";
|
||||
@@ -88,12 +92,18 @@ const metalAssetLabel = computed(() => getMetalAssetLabel())
|
||||
|
||||
const items = ref<Fund[]>([])
|
||||
const tableOutput = ref<TableOutput<Fund> | null>(null)
|
||||
const inventory = ref<number>(0)
|
||||
const fundStore = useFundUserStore()
|
||||
const walletStore = useWalletStore()
|
||||
const userInfo = ref<User>()
|
||||
const weight = ref<number>(0)
|
||||
const total = ref<number>(0)
|
||||
|
||||
const inventory = computed(() =>
|
||||
items.value
|
||||
.filter(x => x.title !== 'آبشده نقدی')
|
||||
.reduce((sum, x) => sum + (x?.wallet?.gold ?? 0), 0)
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
initTable()
|
||||
})
|
||||
@@ -106,15 +116,10 @@ async function initTable() {
|
||||
console.log(tableOutput.value)
|
||||
items.value.push(...tableOutput.value?.rows ?? [])
|
||||
items.value.forEach(x => {
|
||||
console.log(x.wallet)
|
||||
if (x.title !== 'آبشده نقدی')
|
||||
inventory.value += x?.wallet?.gold ?? 0
|
||||
total.value += ((x?.wallet?.gold) ?? 0) * ((x?.price) ?? 0)
|
||||
if (x.title !== 'آبشده نقدی' && x.title !== 'سکه')
|
||||
weight.value += ((x?.wallet?.gold) ?? 0) * ((x?.amount) ?? 0)
|
||||
// console.log(inventory.value)
|
||||
weight.value += ((x?.wallet?.gold) ?? 0) * ((x?.amount) ?? 0)
|
||||
})
|
||||
// console.log(tableOutput.value)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<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>
|
||||
<div class="text-l mr-2 font-bold">{{ (userStore?.userInfo?.wallet?.count_gold ?? 0).toFixed(3) }} {{ weightUnit }}</div>
|
||||
<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">
|
||||
@@ -23,10 +23,11 @@ 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'
|
||||
import { getMetalAssetLabel, getWeightUnit } from '@/utils/productDealMethod'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const metalAssetLabel = computed(() => getMetalAssetLabel())
|
||||
const weightUnit = computed(() => getWeightUnit())
|
||||
|
||||
defineEmits<{
|
||||
openGoldModal: []
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<div class="mt-5">
|
||||
<BasicInfoItem
|
||||
class="flex justify-between"
|
||||
title="مجموعه کل دارایی طلایی"
|
||||
:title="`مجموعه کل دارایی ${settingsStore.metalTypeLabel}`"
|
||||
is-line
|
||||
:info="`در این قسمت مجموع کل وزن طلای آبشده (${(walletInfo?.gold ?? 0)?.toFixed(3)}) + ارزش دارایی ها (${(walletInfo?.treasure_sum ?? 0)?.toFixed(3)} ) را مشاهده میفرمایید.`"
|
||||
infoHead="مجموع کل دارایی طلایی"
|
||||
:value="parseFloat((walletInfo?.gold_sum ?? 0).toFixed(2)) + ' گرم'"
|
||||
:info="`در این قسمت مجموع کل وزن ${settingsStore.metalTypeLabel} آبشده (${(walletInfo?.gold ?? 0)?.toFixed(3)}) + ارزش دارایی ها (${(walletInfo?.treasure_sum ?? 0)?.toFixed(3)} ) را مشاهده میفرمایید.`"
|
||||
:infoHead="`مجموع کل دارایی ${settingsStore.metalTypeLabel}`"
|
||||
:value="parseFloat((walletInfo?.gold_sum ?? 0).toFixed(2)) + ' ' + weightUnit"
|
||||
/>
|
||||
<a-divider class="!my-1" />
|
||||
<BasicInfoItem
|
||||
@@ -23,9 +23,9 @@
|
||||
<a-divider class="!my-1" />
|
||||
<BasicInfoItem
|
||||
class="flex justify-between"
|
||||
title="دارایی کیف پول طلایی"
|
||||
:title="`دارایی کیف پول ${settingsStore.metalTypeLabel}`"
|
||||
is-line
|
||||
:value="(walletInfo?.count_gold_wallet ?? 0) + ' گرم'"
|
||||
:value="(walletInfo?.count_gold_wallet ?? 0) + ' ' + weightUnit"
|
||||
/>
|
||||
<a-divider v-if="nameProject === 'goldsun'" class="!my-1" />
|
||||
<BasicInfoItem
|
||||
@@ -62,6 +62,8 @@ import { computed } from 'vue'
|
||||
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
|
||||
import BasicInfoItem from '@/components/BasicPacks/BasicInfoItem.vue'
|
||||
import { useConfigStore } from '@/store/configStore'
|
||||
import { useSettingsStore } from '@/store/settingsStore'
|
||||
import { getWeightUnit } from '@/utils/productDealMethod'
|
||||
import {usePrice} from "@/utils/usePrice";
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -76,6 +78,8 @@ const emit = defineEmits<{
|
||||
|
||||
const config = useConfigStore()
|
||||
const nameProject = config.config.name
|
||||
const settingsStore = useSettingsStore()
|
||||
const weightUnit = computed(() => getWeightUnit())
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.show,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="w-full relative mt-2 border-gray-200 border-1 rounded-lg py-3 flex flex-col justify-center home_appear_fade_in">
|
||||
<div class="text-gray-600 text-[12px] ml-2 w-full text-center">قیمت خرید از {{ config.config.name_fa }}</div>
|
||||
<div class="w-full items-center flex justify-center">
|
||||
<div class="text-gray-600 text-[12px] ml-2">قیمت خرید از {{ config.config.name_fa }}</div>
|
||||
<div v-if="price" class="flex gap-1 text-xs items-center">
|
||||
<div
|
||||
v-if="percentPriceChanged() !== 0"
|
||||
|
||||
@@ -33,6 +33,6 @@ const props = defineProps<{
|
||||
price: any
|
||||
}>()
|
||||
|
||||
const highPrice = computed(() => getTradeBuyPrice(props.price))
|
||||
const lowPrice = computed(() => getTradeSellPrice(props.price))
|
||||
const highPrice = computed(() => props.price?.up?.buy ?? getTradeBuyPrice(props.price))
|
||||
const lowPrice = computed(() => props.price?.up?.sell ?? getTradeSellPrice(props.price))
|
||||
</script>
|
||||
Reference in New Issue
Block a user