diff --git a/src/store/fundStore.ts b/src/store/fundStore.ts index ea8f009..388cdb1 100644 --- a/src/store/fundStore.ts +++ b/src/store/fundStore.ts @@ -11,7 +11,7 @@ export const useFundUserStore = defineStore('fund', () => { async function getMyFund() { try { console.log('fff') - myFunds.value = await getProductInventory() + myFunds.value = await getFundTable() return myFunds.value } catch (e) { console.log(e) diff --git a/src/views/base/fund/components/Item.vue b/src/views/base/fund/components/Item.vue index fa7a8b7..e68a0eb 100644 --- a/src/views/base/fund/components/Item.vue +++ b/src/views/base/fund/components/Item.vue @@ -1,14 +1,8 @@ @@ -20,19 +14,14 @@ import circulationImg from '@/assets/img/cash_circulation.svg' import loveImg from '@/assets/img/cash_love.svg' import repairsImg from '@/assets/img/cash_repairs.svg' import savingImg from '@/assets/img/cash_saving.svg' -import {computed} from "vue" -import type {Fund} from "@/models/fund" -import defaultImg from "@/assets/img/defaultAbshodeh.svg" -import goyImg from "@/assets/img/goyImg.svg" -import mokaabImg from "@/assets/img/mokaabImg.svg" -import sekkeImg from "@/assets/img/sekkeImg.svg" -import venusImg from "@/assets/img/venousImg.svg" -import type { Product } from '@/models/products' +import {computed} from "vue"; +import type {Fund} from "@/models/fund"; +import logo from '@/assets/img/logo_full.svg' /*function itemImg() { }*/ interface Prop { - item: Product + item: Fund } const props = defineProps() diff --git a/src/views/base/fund/index.vue b/src/views/base/fund/index.vue index 08b2b94..c848119 100644 --- a/src/views/base/fund/index.vue +++ b/src/views/base/fund/index.vue @@ -1,34 +1,18 @@ @@ -63,7 +46,6 @@ import router from "@/router"; import BasicIcon from "@/components/BasicPacks/BasicIcon.vue"; -import BasicModal from "@/components/BasicPacks/BasicModal.vue"; import img from '@/assets/img/cash_img.svg' import empty from '@/assets/img/cash_empty.svg' import Item from './components/Item.vue' @@ -72,39 +54,25 @@ import {loading} from "@/utils"; import type {TableOutput} from "@/models/table"; import type {Fund} from "@/models/fund"; import {useFundUserStore} from "@/store/fundStore"; -import { getMe } from '@/api/me' -import type { User } from '@/models/login' -import {usePriceWithoutType} from "../../../utils/usePrice"; -import {useWalletStore} from "@/store/walletStore"; -const openModal = ref(false) - const items = ref([]) const tableOutput = ref | null>(null) const inventory = ref(0) const fundStore = useFundUserStore() -const walletStore = useWalletStore() -const userInfo = ref() -const weight = ref(0) -const total = ref(0) + onMounted(() => { initTable() }) async function initTable() { try { - userInfo.value = await getMe() loading.value = true tableOutput.value = fundStore.myFunds ?? await fundStore.getMyFund() ?? null - console.log(tableOutput.value) + // 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(x.wallet[0]?.gold) + inventory.value += x?.wallet[0]?.gold ?? 0 // console.log(inventory.value) }) // console.log(tableOutput.value) diff --git a/src/views/base/fund/info/components/Item.vue b/src/views/base/fund/info/components/Item.vue index 72015e2..b922120 100644 --- a/src/views/base/fund/info/components/Item.vue +++ b/src/views/base/fund/info/components/Item.vue @@ -9,17 +9,17 @@
-
{{ item.title }}
+
{{ item.type_str }}
{{ toJalaliNotime(item.expire_at) }}
-
+
{{ item.gold }}
- {{item.unit}} + گرم
@@ -34,32 +34,32 @@ -
{{ props.item.title }}
+
{{ props.item.type_str }}
-
مقدار {{props.title}} مبادله شده:
+
مقدار طلا مبادله شده:
{{ item.gold }}
- {{item.unit}} + گرم
-
موجودی {{ props.title }}:
+
موجودی کیف طلا:
{{ item.balance_gold }}
- {{item.unit}} + گرم
-
وضعیت:
+
وضعیت:
{{ item.active ? 'موفق' : 'نا موفق' @@ -68,11 +68,11 @@
-
تاریخ:
+
تاریخ:
{{ toJalaliNotime(item.expire_at) }}
-
زمان:
+
زمان:
{{ toTime(item.expire_at) }}
بازگشت @@ -94,12 +94,11 @@ const infoVisible = ref(false) interface Prop { item: Transaction - title?: string } const props = withDefaults(defineProps(), {}) const isUp = computed(() => props.item.type === 3 || props.item.type === 1) -// const isGold = computed(() => props.item.type === 1 || props.item.type === 2 || props.item.type === 10) +const isGold = computed(() => props.item.type === 1 || props.item.type === 2) /*const title = computed(() => { if (isUp.value) { if (isGold.value) { diff --git a/src/views/base/fund/info/index.vue b/src/views/base/fund/info/index.vue index 6061410..6c56f1f 100644 --- a/src/views/base/fund/info/index.vue +++ b/src/views/base/fund/info/index.vue @@ -1,46 +1,41 @@