From d8110f024f7e05369915b6caaff34fbdd755b513 Mon Sep 17 00:00:00 2001 From: MojtabaSoumi Date: Sat, 9 May 2026 16:52:43 +0330 Subject: [PATCH] 1405/02/19-change style for garoosi --- components.d.ts | 2 +- src/views/base/gold/index.vue | 87 ++---- src/views/base/home/index.vue | 566 ++++++++++++++++++++++++---------- 3 files changed, 441 insertions(+), 214 deletions(-) diff --git a/components.d.ts b/components.d.ts index d3428fd..e9be9b0 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,7 +8,6 @@ export {} declare module 'vue' { export interface GlobalComponents { AButton: typeof import('ant-design-vue/es')['Button'] - AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] ADivider: typeof import('ant-design-vue/es')['Divider'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] @@ -24,6 +23,7 @@ declare module 'vue' { ASpin: typeof import('ant-design-vue/es')['Spin'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATag: typeof import('ant-design-vue/es')['Tag'] + ATextarea: typeof import('ant-design-vue/es')['Textarea'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default'] Basic: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/basic.vue')['default'] diff --git a/src/views/base/gold/index.vue b/src/views/base/gold/index.vue index 168612c..db8ab27 100644 --- a/src/views/base/gold/index.vue +++ b/src/views/base/gold/index.vue @@ -4,11 +4,11 @@
-
خرید طلا {{ props?.ProductItem?.title }}
-
فروش طلا {{ props?.ProductItem?.title }}
@@ -46,17 +46,17 @@
- + type="price" @onchange="calculateGold" /> - - + + size="large" type="text" inputmode="decimal" @onchange="calculateCash" /> @@ -182,7 +182,6 @@
ریال
- ثبت نهایی @@ -208,27 +207,35 @@ import img1 from '@/assets/img/home_ly2.svg' import { usePrice, usePriceWithoutType } from '@/utils/usePrice' import BasicInput from '@/components/BasicPacks/BasicInput.vue' import type { Gold } from '@/models/gold' -import { loading, loadingMore, toFixedDownThreeChar } from '@/utils' +import { isIphone, loading, loadingMore, toFixedDownThreeChar } from '@/utils' import BasicButton from '@/components/BasicPacks/BasicButton.vue' import router from '@/router' import { useWalletStore } from '@/store/walletStore' import { createOrder } from '@/api/order' import { message } from 'ant-design-vue' import type { Price } from '@/models/home' +import { getLastPrice } from '@/api/home' import Icon from '@/components/BasicPacks/BasicIcon.vue' import { useUserStore } from '@/store/userStore' import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue' import { justNumber } from '@/utils/inputRules' import GoldSkeleton from '@/views/base/gold/components/GoldSkeleton.vue' import GoldLoading from '@/components/GoldLoading.vue' +import { update } from 'lodash' import BasicIcon from '@/components/BasicPacks/BasicIcon.vue' +import TransactionSkeleton from '@/components/TransactionSkeleton.vue' +import ListAnim from '@/components/ListAnim.vue' +import Item from '@/views/base/wallet/components/Item.vue' 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, getUpPrice, lastPrice, setIntervalGetAllPrice, stopPriceInterval } from '@/utils/price' import type { Product } from '@/models/products' import { useFundUserStore } from '@/store/fundStore' -import {debounce} from "lodash"; +import {useConfigStore} from "@/store/configStore"; +// import Bg_main from "@/components/bg_main.vue"; + const infoVisible = ref(false) const walletStore = useWalletStore() const userStore = useUserStore() @@ -247,7 +254,6 @@ interface Prop { } const props = withDefaults(defineProps(), {}) - const isBuy = ref(true) const buyPagination = ref({ @@ -397,53 +403,24 @@ const form = ref({ goldValue: undefined, percentWallet: undefined }) - -const persianToEnglish = (str: string | number | undefined): string => { - if (!str) return ''; - return str.toString() - .replace(/[۰-۹]/g, (d) => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d).toString()) - .replace(/٫/g, '.'); -}; - -function handleGoldCashChange(val: string | number | undefined) { - if (val === undefined || val === null || val === '') { - form.value.goldCash = undefined - return - } - const valStr = val.toString() - const convertedValue = persianToEnglish(valStr) - const numericValue = parseFloat(convertedValue.replace(/,/g, '')) - form.value.goldCash = isNaN(numericValue) ? undefined : numericValue - if (form.value.goldCash !== undefined) { - calculateGold(form.value.goldCash) - } -} - -const handleGoldValueChange = debounce( (val: string | number | undefined) => { - if (val === undefined || val === null || val === '') { - form.value.goldValue = undefined - return - } - const valStr = val.toString() - const convertedValue = persianToEnglish(valStr) - const numericValue = parseFloat(convertedValue) - form.value.goldValue = isNaN(numericValue) ? undefined : numericValue - if (form.value.goldValue !== undefined) { - calculateCash(form.value.goldValue) - } -},1500) - const allowedAsciiCodeFloat = [46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57] const allowedAsciiCodeInt = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57] -watch(() => form.value.goldValue, (newVal) => { - if (newVal !== undefined && newVal !== null && newVal !== '') { - calculateCash(newVal) +watch(form.value, () => { + if (form.value.goldValue) { + const lastCharGoldStr: string = form.value.goldValue.toString() + if (!allowedAsciiCodeFloat.includes(lastCharGoldStr.slice(-1).charCodeAt(0))) { + form.value.goldValue = isNaN(parseFloat(lastCharGoldStr.slice(0, -1))) ? null : parseFloat(lastCharGoldStr.slice(0, -1)) + calculateCash(form.value.goldValue) + } } -}) -watch(() => form.value.goldCash, (newVal) => { - if (newVal !== undefined && newVal !== null && newVal !== '') { - calculateGold(newVal) + if (form.value.goldCash) { + const lastCharCashStr: string = form.value.goldCash.toString() + if (!allowedAsciiCodeInt.includes(lastCharCashStr.slice(-1).charCodeAt(0))) { + form.value.goldCash = isNaN(parseFloat(lastCharCashStr.slice(0, -1))) ? null : parseFloat(lastCharCashStr.slice(0, -1)) + calculateGold(form.value.goldCash) + } } + }) onMounted(() => { @@ -638,7 +615,7 @@ async function ok() { background: blue; }*/ .completeButtonStyle .van-dialog__confirm .van-button__content { - background: #000000FF; + background: @App-primary-color; color: white; } diff --git a/src/views/base/home/index.vue b/src/views/base/home/index.vue index 3f3c583..f4d8f9e 100644 --- a/src/views/base/home/index.vue +++ b/src/views/base/home/index.vue @@ -1,19 +1,19 @@