changes of boursemes
This commit is contained in:
@@ -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('موجودی کیف طلا ناکافی است')
|
||||
|
||||
Reference in New Issue
Block a user