26/8/1404
This commit is contained in:
+4
-2
@@ -1,5 +1,5 @@
|
|||||||
import useAxios from '@/utils/useAxios'
|
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<any> => {
|
export const cardVerification = async (obj: Verification): Promise<any> => {
|
||||||
return await useAxios.post(`/customer/vc_validate`, obj)
|
return await useAxios.post(`/customer/vc_validate`, obj)
|
||||||
@@ -9,4 +9,6 @@ export const transferRegister = async (obj: Transfer): Promise<any> => {
|
|||||||
return await useAxios.post(`/customer/havale`, obj)
|
return await useAxios.post(`/customer/havale`, obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getTransfers = async () => await useAxios.get<Transfer[]>(`/customer/price_triggers`)
|
export async function getTransfers(payload: TransferList) {
|
||||||
|
return await useAxios.post(`customer/havale_list` , payload)
|
||||||
|
}
|
||||||
@@ -40,3 +40,8 @@ export interface Transfer {
|
|||||||
destination: string
|
destination: string
|
||||||
amount: string
|
amount: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TransferList {
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -55,6 +55,7 @@ export async function getUpPrice() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getLastPrices() {
|
export async function getLastPrices() {
|
||||||
try {
|
try {
|
||||||
// loading.value = true
|
// loading.value = true
|
||||||
@@ -74,7 +75,7 @@ export async function getLastPrices() {
|
|||||||
|
|
||||||
export function stopPriceInterval() {
|
export function stopPriceInterval() {
|
||||||
// console.log('stop')
|
// console.log('stop')
|
||||||
clearInterval(interval);
|
clearInterval(interval)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function percentPriceChanged() {
|
export function percentPriceChanged() {
|
||||||
@@ -82,6 +83,5 @@ export function percentPriceChanged() {
|
|||||||
// console.log(lastPrice.value?.price_last)
|
// console.log(lastPrice.value?.price_last)
|
||||||
if (!olderPrice.value)
|
if (!olderPrice.value)
|
||||||
return 0
|
return 0
|
||||||
return ((lastPrice.value?.price_last-olderPrice.value) *100)/olderPrice.value
|
return ((lastPrice.value?.price_last-olderPrice.value) *100)/olderPrice.value
|
||||||
|
}
|
||||||
}
|
|
||||||
@@ -144,6 +144,7 @@ import ListAnim from '@/components/ListAnim.vue'
|
|||||||
import TransactionSkeleton from '@/components/TransactionSkeleton.vue'
|
import TransactionSkeleton from '@/components/TransactionSkeleton.vue'
|
||||||
import DialogVant from '@/components/DialogVant.vue'
|
import DialogVant from '@/components/DialogVant.vue'
|
||||||
import { useFundUserStore } from '@/store/fundStore'
|
import { useFundUserStore } from '@/store/fundStore'
|
||||||
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||||
|
|
||||||
const info = ref<Fund>()
|
const info = ref<Fund>()
|
||||||
const items = ref<Transaction[]>([])
|
const items = ref<Transaction[]>([])
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
<img :src="img1" alt="" class="h-[88px] absolute">
|
<img :src="img1" alt="" class="h-[88px] absolute">
|
||||||
<div class="w-full items-center flex flex-col">
|
<div class="w-full items-center flex flex-col">
|
||||||
<div class="text-gray-700 font-bold">{{ !isBuy ? 'قیمت فروش' : 'قیمت خرید' }}</div>
|
<div class="text-gray-700 font-bold">{{ !isBuy ? 'قیمت فروش' : 'قیمت خرید' }}</div>
|
||||||
<div v-if="price" class="flex gap-1 mt-3 text-xs items-center">
|
<div class="flex gap-1 mt-3 text-xs items-center">
|
||||||
<div :class="!isBuy? 'text-red-700' : 'text-green-700'" class="font-bold text-2xl color-transition">
|
<div :class="!isBuy? 'text-red-700' : 'text-green-700'" class="font-bold text-2xl color-transition">
|
||||||
{{ 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)) ) }}
|
||||||
</div>
|
</div>
|
||||||
ریال
|
ریال
|
||||||
</div>
|
</div>
|
||||||
@@ -224,11 +224,9 @@ import type { Transaction } from '@/models/transaction'
|
|||||||
import type { TableEngineInput, TableOutput } from '@/models/table'
|
import type { TableEngineInput, TableOutput } from '@/models/table'
|
||||||
import { useInfiniteScroll } from '@vueuse/core'
|
import { useInfiniteScroll } from '@vueuse/core'
|
||||||
import { getTransactionTable } from '@/api/transaction'
|
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 type { Product } from '@/models/products'
|
||||||
import { useFundUserStore } from '@/store/fundStore'
|
import { useFundUserStore } from '@/store/fundStore'
|
||||||
// import Bg_main from "@/components/bg_main.vue";
|
|
||||||
|
|
||||||
const infoVisible = ref(false)
|
const infoVisible = ref(false)
|
||||||
const walletStore = useWalletStore()
|
const walletStore = useWalletStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -580,6 +578,7 @@ async function ok() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const livePrice = computed(() => lastPrice.value?.price_last ?? 0)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
|
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<div>
|
<div>
|
||||||
<div class="font-bold text-base mb-2">{{usePrice(item.target_price) }}</div>
|
<div class="content-center text-s mb-2">{{usePrice(item.note) }}</div>
|
||||||
|
<div class="content-center text-s mb-2">{{toJalali(item.created_at) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2 ">
|
<div class="flex gap-2 ">
|
||||||
<BasicIcon color="red" icon="vuesax-linear:trash" @click.stop="deleteConfirmVisible = true" class="p-1"/>
|
<BasicIcon color="red" icon="vuesax-linear:trash" @click.stop="deleteConfirmVisible = true" class="p-1"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-divider class="!my-3" />
|
<!-- <a-divider class="!my-3" />-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
|||||||
import type { Transfer } from '@/models/physicalreceive'
|
import type { Transfer } from '@/models/physicalreceive'
|
||||||
import DialogVant from '@/components/DialogVant.vue'
|
import DialogVant from '@/components/DialogVant.vue'
|
||||||
import { usePrice } from '../../../../utils/usePrice'
|
import { usePrice } from '../../../../utils/usePrice'
|
||||||
|
import { toJalali } from '../../../../utils/useDateTime'
|
||||||
|
|
||||||
const infoVisible = ref<boolean>(false)
|
const infoVisible = ref<boolean>(false)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div ref="el" :class="loading? 'h-screen': ''" class="px-3 pt-16 pb-2 overflow-y-scroll"
|
<div ref="el" :class="loading? 'h-screen': ''" class="px-3 pt-16 pb-2 overflow-y-scroll"
|
||||||
style="max-height: calc(100vh - 50px)">
|
style="max-height: calc(100vh - 50px)">
|
||||||
<list-anim v-if="!loading" class="pb-12vh">
|
<list-anim v-if="!loading" class="pb-12vh">
|
||||||
<!-- <Item v-for="item in items" :key="item.id" :item="item" @refresh="initItems" />-->
|
<Item v-for="item in items" :item="item" @refresh="initItems" />
|
||||||
<!-- <TransactionSkeleton v-if="loadingMore" class="mt-1 mb-8" />-->
|
<!-- <TransactionSkeleton v-if="loadingMore" class="mt-1 mb-8" />-->
|
||||||
</list-anim>
|
</list-anim>
|
||||||
<div v-if="loading">
|
<div v-if="loading">
|
||||||
@@ -139,6 +139,7 @@ import { type FormInstance, message } from 'ant-design-vue'
|
|||||||
import type { CardVerification, Transfer } from '@/models/physicalreceive'
|
import type { CardVerification, Transfer } from '@/models/physicalreceive'
|
||||||
import Item from './components/Item.vue'
|
import Item from './components/Item.vue'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
import { useUserStore } from '@/store/userStore'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { cardVerification, getTransfers, transferRegister } from '@/api/transfer'
|
import { cardVerification, getTransfers, transferRegister } from '@/api/transfer'
|
||||||
import defaultResult from 'ant-design-vue/es/_util/isMobile'
|
import defaultResult from 'ant-design-vue/es/_util/isMobile'
|
||||||
@@ -149,7 +150,7 @@ const verificationCardVisible = ref<boolean>(false)
|
|||||||
const finalRegisterSheet = ref<boolean>(false)
|
const finalRegisterSheet = ref<boolean>(false)
|
||||||
const editId = ref<number | undefined>(undefined)
|
const editId = ref<number | undefined>(undefined)
|
||||||
const el = ref()
|
const el = ref()
|
||||||
|
const userStore = useUserStore()
|
||||||
const form = ref<CardVerification>({
|
const form = ref<CardVerification>({
|
||||||
cardNumber: ''
|
cardNumber: ''
|
||||||
})
|
})
|
||||||
@@ -179,8 +180,13 @@ function openAdd() {
|
|||||||
|
|
||||||
async function initItems() {
|
async function initItems() {
|
||||||
try {
|
try {
|
||||||
|
const payload = {
|
||||||
|
id: userStore?.userInfo?.id
|
||||||
|
}
|
||||||
items.value = []
|
items.value = []
|
||||||
items.value = await getTransfers()
|
items.value = await getTransfers(payload)
|
||||||
|
|
||||||
|
console.log('id', items.value)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user