From 9c4391be428041d1a64c53a4d57a63cb580eeeb3 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Mon, 17 Nov 2025 09:34:35 +0330 Subject: [PATCH] 26/8/1404 --- src/api/transfer.ts | 6 ++++-- src/models/physicalreceive.ts | 7 ++++++- src/utils/price.ts | 8 ++++---- src/views/base/fund/info/index.vue | 1 + src/views/base/gold/index.vue | 9 ++++----- src/views/base/transfer/components/Item.vue | 6 ++++-- src/views/base/transfer/index.vue | 12 +++++++++--- 7 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/api/transfer.ts b/src/api/transfer.ts index 5baf918..1dfc979 100644 --- a/src/api/transfer.ts +++ b/src/api/transfer.ts @@ -1,5 +1,5 @@ import useAxios from '@/utils/useAxios' -import type { Transfer, Verification } from '@/models/physicalreceive' +import type { Transfer, TransferList, Verification } from '@/models/physicalreceive' export const cardVerification = async (obj: Verification): Promise => { return await useAxios.post(`/customer/vc_validate`, obj) @@ -9,4 +9,6 @@ export const transferRegister = async (obj: Transfer): Promise => { return await useAxios.post(`/customer/havale`, obj) } -export const getTransfers = async () => await useAxios.get(`/customer/price_triggers`) +export async function getTransfers(payload: TransferList) { + return await useAxios.post(`customer/havale_list` , payload) +} \ No newline at end of file diff --git a/src/models/physicalreceive.ts b/src/models/physicalreceive.ts index 94b2c33..d443911 100644 --- a/src/models/physicalreceive.ts +++ b/src/models/physicalreceive.ts @@ -39,4 +39,9 @@ export interface CardVerification { export interface Transfer { destination: string amount: string -} \ No newline at end of file +} + +export interface TransferList { + id: number +} + diff --git a/src/utils/price.ts b/src/utils/price.ts index 1b9b0ca..abab927 100644 --- a/src/utils/price.ts +++ b/src/utils/price.ts @@ -55,6 +55,7 @@ export async function getUpPrice() { } } + export async function getLastPrices() { try { // loading.value = true @@ -74,7 +75,7 @@ export async function getLastPrices() { export function stopPriceInterval() { // console.log('stop') - clearInterval(interval); + clearInterval(interval) } export function percentPriceChanged() { @@ -82,6 +83,5 @@ export function percentPriceChanged() { // console.log(lastPrice.value?.price_last) if (!olderPrice.value) return 0 -return ((lastPrice.value?.price_last-olderPrice.value) *100)/olderPrice.value - - } \ No newline at end of file + return ((lastPrice.value?.price_last-olderPrice.value) *100)/olderPrice.value +} \ No newline at end of file diff --git a/src/views/base/fund/info/index.vue b/src/views/base/fund/info/index.vue index 6c56f1f..fb9eff8 100644 --- a/src/views/base/fund/info/index.vue +++ b/src/views/base/fund/info/index.vue @@ -144,6 +144,7 @@ import ListAnim from '@/components/ListAnim.vue' import TransactionSkeleton from '@/components/TransactionSkeleton.vue' import DialogVant from '@/components/DialogVant.vue' import { useFundUserStore } from '@/store/fundStore' +import BasicIcon from '@/components/BasicPacks/BasicIcon.vue' const info = ref() const items = ref([]) diff --git a/src/views/base/gold/index.vue b/src/views/base/gold/index.vue index 1e0d364..9142c81 100644 --- a/src/views/base/gold/index.vue +++ b/src/views/base/gold/index.vue @@ -24,9 +24,9 @@
{{ !isBuy ? 'قیمت فروش' : 'قیمت خرید' }}
-
+
- {{ usePriceWithoutType(isBuy ? ((props?.ProductItem?.price ?? 0) + (props?.ProductItem?.cash_fee_buy ?? 0)) ?? 0 : ((props?.ProductItem?.price ?? 0) - (props?.ProductItem?.cash_fee_sell ?? 0))) }} + {{ usePriceWithoutType(isBuy ? ((props?.ProductItem?.price ?? 0) + (props?.ProductItem?.cash_fee_buy ?? 0)) : ((props?.ProductItem?.price ?? 0) - (props?.ProductItem?.cash_fee_sell ?? 0)) ) }}
ریال
@@ -224,11 +224,9 @@ import type { Transaction } from '@/models/transaction' import type { TableEngineInput, TableOutput } from '@/models/table' import { useInfiniteScroll } from '@vueuse/core' import { getTransactionTable } from '@/api/transaction' -import { getLastPrices, lastPrice, setIntervalGetAllPrice, stopPriceInterval } from '@/utils/price' +import { getLastPrices, lastPrice } from '@/utils/price' import type { Product } from '@/models/products' import { useFundUserStore } from '@/store/fundStore' -// import Bg_main from "@/components/bg_main.vue"; - const infoVisible = ref(false) const walletStore = useWalletStore() const userStore = useUserStore() @@ -580,6 +578,7 @@ async function ok() { } } +const livePrice = computed(() => lastPrice.value?.price_last ?? 0)