changes of boursemes

This commit is contained in:
2026-06-01 17:19:45 +03:30
parent b0dfe51239
commit f4b98576f5
9 changed files with 272 additions and 135 deletions
+3 -2
View File
@@ -31,6 +31,7 @@ export function inputLenRules(len: number, title?: string) {
import {computed, ref} from 'vue'
import type {Rule} from 'ant-design-vue/es/form'
import {useWalletStore} from "@/store/walletStore";
import { isCashLikeDealMethod } from '@/utils/productDealMethod'
export const mobileValidation = (title?: string) => {
return {len: 11, message: `شماره همراه باید 11 رقم باشد`}
@@ -145,13 +146,13 @@ const checkNumber = async (_rule: Rule, value: number) => {
return Promise.reject('استفاده از اعداد اعشاری مجاز نمی باشد')
}
if (isBuyP){
if (!walletCash?.walletInfo?.cash && methodP == 'cash'){
if (!walletCash?.walletInfo?.cash && isCashLikeDealMethod(methodP)){
return Promise.reject('موجودی کیف پول ناکافی است')
}
if (!walletCash?.walletInfo?.gold && methodP == 'gold'){
return Promise.reject('موجودی کیف طلا ناکافی است')
}
if (priceP * value > walletCash?.walletInfo?.cash && methodP == 'cash')
if (priceP * value > walletCash?.walletInfo?.cash && isCashLikeDealMethod(methodP))
return Promise.reject('موجودی کیف پول ناکافی است')
if (amountP * value > walletCash?.walletInfo?.gold && methodP == 'gold')
return Promise.reject('موجودی کیف طلا ناکافی است')