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 {
|
||||
|
||||
Reference in New Issue
Block a user