remove toPersianDigits

This commit is contained in:
2026-06-17 13:51:29 +03:30
parent b42b123957
commit 61e10dd45a
13 changed files with 65 additions and 55 deletions
@@ -11,7 +11,7 @@
<div class="flex items-center justify-between">
<div class="flex items-center">
<div>مبلغ پاداش :</div>
<div class="mr-4">{{item.gold}}</div>
<div class="mr-4">{{ formatGoldAmount(item.gold) }}</div>
</div>
<!-- <div class="mt-2 rounded-[8px] p-2 text-xs" :class="item.is_legal === 0? 'bg-red-100 text-red-600':'bg-green-100 test-green-600'">{{item.is_legal === 0? 'احراز هویت نشده':'احراز هویت شده'}}</div>-->
<div class="flex text-[#9CA3AF]">
@@ -26,6 +26,7 @@
<script setup lang="ts">
import { formatGoldAmount } from '@/utils/usePrice'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import { toJalali, toJalaliNotime } from '../../../../utils/useDateTime'
import type { Gifts } from '@/models/gifts'
+4 -3
View File
@@ -17,7 +17,7 @@
</div>
<div class="text-gray-500 flex gap-1 text-xs items-center">
<div :class="item.gold > 0 ? 'text-green-600':'text-red-600'" class="text-base number-ltr">
{{ item.gold }}
{{ formatGoldAmount(item.gold) }}
</div>
{{item.unit}}
</div>
@@ -39,14 +39,14 @@
<div class="flex justify-between mb-3">
<div class="text-primary">مقدار {{props.title}} مبادله شده:</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 class="text-base ml-1 number-ltr">{{ formatGoldAmount(item.gold) }}</div>
{{item.unit}}
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-primary">موجودی {{ props.title }}:</div>
<div class="flex text-xs text-yellow-700 items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
{{item.unit}}
</div>
</div>
@@ -88,6 +88,7 @@ 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 {formatGoldAmount, usePriceWithoutType} from "../../../../../utils/usePrice";
import {toJalaliNotime, toTime} from "../../../../../utils/useDateTime";
const infoVisible = ref<boolean>(false)
@@ -19,7 +19,7 @@
<Vue3Odometer
:value="displayGoldVal"
class="o-text !text-xl font-bold"
style="font-family: iran-sans; direction: ltr"
style="direction: ltr"
/>
ریال
</div>
@@ -113,10 +113,6 @@ onMounted(async () => {
chartMounted.value = true
})
const toPersianNumber = (num: number) => {
return num.toString().replace(/\d/g, (d) => '۰۱۲۳۴۵۶۷۸۹'[d])
}
const chartOptions = computed(() => {
const fontFamily = getProjectFontFamily()
@@ -144,7 +140,7 @@ const chartOptions = computed(() => {
tickAmount: 8,
show: false,
labels: {
formatter: (val: number) => toPersianNumber(usePrice(val, true, 'ه.ریال')),
formatter: (val: number) => usePrice(val, true, 'ه.ریال'),
style: { fontSize: '13px', fontFamily },
},
},
@@ -165,7 +161,7 @@ const chartOptions = computed(() => {
})}`
},
},
formatter: (val: number) => toPersianNumber(usePrice(val, true, 'ه.ریال')),
formatter: (val: number) => usePrice(val, true, 'ه.ریال'),
style: { fontFamily },
},
colors: [config.config.color],
@@ -17,7 +17,6 @@
<Vue3Odometer
:value="displayGoldVal"
class="dhome-hero-price__odometer o-text"
style="font-family: iran-sans"
/>
<span class="dhome-hero-price__unit">ریال</span>
</div>
@@ -34,7 +34,7 @@
]"
>
<div class="flex items-center">
<div class="text-base ml-1">{{ item.gold }}</div>
<div class="text-base ml-1">{{ formatGoldAmount(item.gold) }}</div>
{{ item.unit }}
</div>
<div
@@ -66,7 +66,7 @@
</div>
<div class="flex flex-col items-end text-xs text-yellow-700">
<div class="flex items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
{{ getProductQuantityUnit(item.wallet.product) }}
</div>
<div v-if="getProductUnitWeightLabel(item.wallet.product)" class="text-gray-500">
@@ -79,7 +79,7 @@
{{ getGoldWalletLabel(item.wallet?.product?.group_type) }}:
</div>
<div class="flex text-xs text-yellow-700 items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
{{ getWeightUnit() }}
</div>
</div>
@@ -107,7 +107,7 @@
</template>
<script lang="ts" setup>
import { usePriceWithoutType } from '@/utils/usePrice'
import { formatGoldAmount, usePriceWithoutType } from '@/utils/usePrice'
import type { Transaction } from '@/models/transaction'
import {
getCashWalletLabel,
+3 -3
View File
@@ -67,7 +67,7 @@
<div class="flex justify-between mb-3">
<div class="text-black">مقدار {{ getMetalTypeTradeLabel() }} مبادله شده:</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 class="text-base ml-1 number-ltr">{{ formatGoldAmount(item.gold) }}</div>
گرم
</div>
</div>
@@ -88,7 +88,7 @@
<div class="flex justify-between mb-3">
<div class="text-black">{{ getGoldWalletLabel() }}:</div>
<div class="flex text-xs text-yellow-700 items-center">
<div class="text-base ml-1">{{ item.balance_gold }}</div>
<div class="text-base ml-1">{{ formatGoldAmount(item.balance_gold) }}</div>
{{ getWeightUnit() }}
</div>
</div>
@@ -138,7 +138,7 @@
<script lang="ts" setup>
import Icon from "@/components/BasicPacks/BasicIcon.vue";
import {getTransactionTradePrice, usePriceWithoutType} from "../../../../utils/usePrice";
import {formatGoldAmount, getTransactionTradePrice, usePriceWithoutType} from "../../../../utils/usePrice";
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
import {computed, ref} from "vue";
import BasicButton from "@/components/BasicPacks/BasicButton.vue";