179 lines
7.4 KiB
Vue
179 lines
7.4 KiB
Vue
<template>
|
|
<div >
|
|
<div class="flex">
|
|
<div :class="isUp? 'bg-green-50':'bg-red-50'" class="rounded-lg p-4 h-fit w-fit flex justify-center items-center">
|
|
<Icon :class="isUp? 'text-green-600':'text-red-600'"
|
|
:icon="`vuesax-linear:${isUp? 'tick-circle':'close-circle'}`"/>
|
|
</div>
|
|
<div class=" w-full mr-2 ">
|
|
<div class="flex w-full text-xs ">{{item.note ?? '-'}}</div>
|
|
<div class="flex mt-1 text-xs">
|
|
<div>وضعیت:</div>
|
|
<div :class="'text-green-600'" class="mr-1" v-if="item.transaction[0]">موفق</div>
|
|
<div :class="'text-red-600'" class="mr-1" v-else>ناموفق</div>
|
|
</div>
|
|
<div class="flex mt-1 text-xs ">
|
|
<div class="w-4rem">کد پیگیری: </div>
|
|
<div class=" mr-1">{{item.tracked_number ?? '-'}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-full mr-3">
|
|
<div class="flex justify-between w-full">
|
|
<div>{{ item.type_str }}</div>
|
|
<div>{{ toJalaliNotime(item.created_at) }}</div>
|
|
</div>
|
|
<div class="flex justify-between mt-2">
|
|
<div :class="item.gold >= 0? 'text-green-600':'text-red-600'" class="text-gray-500 text-xs number-ltr">
|
|
<!-- {{ item.gold }}
|
|
<div>گرم</div>-->
|
|
</div>
|
|
<div class="text-gray-500 flex gap-1 text-xs items-center">
|
|
<div :class="item.cash > 0 ? 'text-green-600':'text-red-600'" class="text-base number-ltr">
|
|
{{ usePriceWithoutType(item.cash ?? 0) }}
|
|
</div>
|
|
ریال
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-if="isGold" class="flex w-full justify-between mt-2">
|
|
<div class="text-gray-500">قیمت معامله:</div>
|
|
<div class="text-gray-500 flex gap-1 text-xs items-center">
|
|
<div class="text-base">{{ usePriceWithoutType((Math.abs(item.cash) / Math.abs(item.gold)).toFixed(0)) }}</div>
|
|
ریال
|
|
</div>
|
|
</div>
|
|
<!-- <div class="flex w-full justify-between mt-2">
|
|
<div class="text-gray-500">وضعیت :</div>
|
|
<div class="text-gray-500 flex gap-1 text-xs items-center">
|
|
<ATag class="!py-1 !px-6 !ml-0" color="blue">
|
|
{{ item.order?.sts_str ?? '' }}
|
|
</ATag>
|
|
</div>
|
|
</div>-->
|
|
<!-- <div v-else class="h-8"></div>-->
|
|
<a-divider class="!my-3"/>
|
|
<BasicActionSheet v-model:show="infoVisible">
|
|
<div class="font-bold text-lg">{{ props.item.type_str }}</div>
|
|
<div class="pb-20 mt-5">
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">مبلغ:</div>
|
|
<div :class="item.cash > 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center">
|
|
<div class="text-base ml-1 number-ltr">{{ usePriceWithoutType(item.cash) }}</div>
|
|
ریال
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">مقدار طلا مبادله شده:</div>
|
|
<div :class="item.gold >= 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center">
|
|
<div class="text-base ml-1 number-ltr">{{ item.gold }}</div>
|
|
گرم
|
|
</div>
|
|
</div>
|
|
<div v-if="item.order" class="flex justify-between mb-3">
|
|
<div class="text-black">قیمت هر گرم طلا حین معامله:</div>
|
|
<div class="flex text-xs items-center number-ltr">
|
|
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.price?? 0) }}</div>
|
|
ریال
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">موجودی کیف پول:</div>
|
|
<div :class="item.cash > 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center">
|
|
<div class="text-base number-ltr">{{ usePriceWithoutType(item.balance_cash ?? 0) }}</div>
|
|
ریال
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">موجودی کیف طلا:</div>
|
|
<div class="flex text-xs text-yellow-700 items-center">
|
|
<div class="text-base ml-1">{{ item.balance_gold }}</div>
|
|
گرم
|
|
</div>
|
|
</div>
|
|
<!-- <div class="flex justify-between mb-3">
|
|
<div class="text-black">موجودی کیف پول:</div>
|
|
<div class="flex text-xs items-center" :class="isUp? 'text-green-600' : 'text-red-600'"><div class="text-base">{{usePriceWithoutType(12000000)}}</div>ریال</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">موجودی کیف طلا:</div>
|
|
<div class="flex items-center" :class="isUp? 'text-red-600' : 'text-green-600'">60 گرم</div>
|
|
</div>-->
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">وضعیت:</div>
|
|
<div class="flex text-xs items-center">
|
|
<ATag :color="item.active? 'blue': 'red'" class="!py-1 !px-6 !ml-0">{{
|
|
item.order?.sts_str
|
|
}}
|
|
</ATag>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">تاریخ:</div>
|
|
<div>{{ toJalaliNotime(item.expire_at) }}</div>
|
|
</div>
|
|
<div class="flex justify-between mb-3">
|
|
<div class="text-black">زمان:</div>
|
|
<div>{{ toTime(item.expire_at) }}</div>
|
|
</div>
|
|
<!-- <div class="flex justify-between mb-3">
|
|
<div class="text-black">وضعیت معامله:</div>
|
|
<div class="flex text-xs items-center">
|
|
<ATag class="!py-1 !px-6 !ml-0" color="orange">
|
|
معاملات باز
|
|
</ATag>
|
|
</div>
|
|
</div>-->
|
|
<div v-if="item.eaj" class="flex justify-between mb-3">
|
|
<div class="text-black">مهلت ارسال فیش:</div>
|
|
<div>{{ item.eaj }}</div>
|
|
</div>
|
|
<BasicButton class="w-full mt-5" @click="infoVisible = false">بازگشت</BasicButton>
|
|
</div>
|
|
</BasicActionSheet>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import Icon from "@/components/BasicPacks/BasicIcon.vue";
|
|
import {usePriceWithoutType} from "../../../../utils/usePrice";
|
|
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
|
|
import {computed, ref} from "vue";
|
|
import BasicButton from "@/components/BasicPacks/BasicButton.vue";
|
|
import type {Transaction} from "@/models/transaction";
|
|
import {toJalaliNotime, toJalaliOutOfUTC, toTime} from "../../../../utils/useDateTime";
|
|
|
|
const infoVisible = ref<boolean>(false)
|
|
|
|
interface Prop {
|
|
item: Transaction
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Prop>(), {})
|
|
// const isUp = computed(() => props.item.type === 3 || props.item.type === 1)
|
|
const isUp = computed(() => props.item.transaction[0])
|
|
const isGold = computed(() => props.item.type === 1 || props.item.type === 2 || props.item.type === 10)
|
|
/*const title = computed(() => {
|
|
if (isUp.value) {
|
|
if (isGold.value) {
|
|
return 'واریز ریالی'
|
|
} else {
|
|
return 'خرید طلا'
|
|
}
|
|
} else {
|
|
if (isGold.value) {
|
|
return 'برداشت ریالی'
|
|
} else {
|
|
return 'فروش طلا'
|
|
}
|
|
}
|
|
})*/
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|
|
|