changes of boursemes
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
|
||||
<!-- {{walletStore?.walletInfo?.gold}}-->
|
||||
<Transition mode="out-in" name="fade" class="mt-2">
|
||||
<div v-if="isBuy&&form.method=='gold'" class="font-bold text-xs">
|
||||
<div v-if="isBuy && form.method === 'gold'" class="font-bold text-xs">
|
||||
<div> {{ `موجودی کیف طلا: ${walletStore?.walletInfo?.gold ?? 0} گرم` }}</div>
|
||||
</div>
|
||||
<div v-else-if="isBuy" class="font-bold text-xs">
|
||||
@@ -253,20 +253,15 @@ import { getTransactionTable } from '@/api/transaction'
|
||||
import { getLastPrices, lastPrice} from '@/utils/price'
|
||||
import { Product } from '@/models/products'
|
||||
import BasicSelect from '@/components/BasicPacks/BasicSelect.vue'
|
||||
import { SelectItem } from '@/models/SelectItem'
|
||||
import Bg_main from '@/components/bg_main.vue'
|
||||
import { useFundUserStore } from '@/store/fundStore'
|
||||
const typeDeal: SelectItem[] = [
|
||||
{
|
||||
value: 'نقدی',
|
||||
key: 'cash'
|
||||
},
|
||||
{
|
||||
value: ' طلایی',
|
||||
key: 'gold'
|
||||
}
|
||||
import {
|
||||
getDefaultProductDealMethod,
|
||||
getProductDealMethodOptions,
|
||||
isCashLikeDealMethod,
|
||||
} from '@/utils/productDealMethod'
|
||||
|
||||
]
|
||||
const typeDeal = computed(() => getProductDealMethodOptions(props?.ProductItem?.group_type))
|
||||
const infoVisible = ref(false)
|
||||
const walletStore = useWalletStore()
|
||||
const userStore = useUserStore()
|
||||
@@ -454,6 +449,18 @@ const form = ref<Gold>({
|
||||
goldVazn:undefined
|
||||
})
|
||||
|
||||
function resetDealMethod() {
|
||||
form.value.method = getDefaultProductDealMethod(props?.ProductItem?.group_type)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [props?.ProductItem?.id, props?.ProductItem?.group_type],
|
||||
() => {
|
||||
resetDealMethod()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
// تابع تبدیل اعداد فارسی به انگلیسی
|
||||
const persianToEnglish = (str: string | number | undefined): string => {
|
||||
if (!str) return ''
|
||||
@@ -622,6 +629,7 @@ function setIsBuy(val: boolean) {
|
||||
form.value.goldCash = undefined
|
||||
form.value.percentWallet = 0
|
||||
priceErrorVisible.value = false
|
||||
resetDealMethod()
|
||||
|
||||
// console.log(bganim.value.classList)
|
||||
// bganim?.value?.classList.add(val?'right':'left')
|
||||
@@ -685,7 +693,7 @@ async function ok() {
|
||||
goldValue: undefined,
|
||||
goldCash: undefined,
|
||||
percentWallet: undefined,
|
||||
method: 'cash'
|
||||
method: getDefaultProductDealMethod(props?.ProductItem?.group_type)
|
||||
}
|
||||
// refreshTable()
|
||||
await fundStore.getMyFund()
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
|
||||
<BasicActionSheet placement="bottom" v-model:show="showFilter">
|
||||
<div class="">
|
||||
<indexGold v-if="['آبشده'].includes(selectedProduct?.group_type)"
|
||||
<indexGold v-if="['آبشده'].includes(selectedProduct?.group_type) && !isBoursecuProject()"
|
||||
:ProductItem="selectedProduct"
|
||||
>
|
||||
</indexGold>
|
||||
<CopperSilver v-else-if="['مس','نقره'].includes(selectedProduct?.group_type)"
|
||||
<CopperSilver v-else-if="['مس','نقره'].includes(selectedProduct?.group_type) && !isBoursecuDealProductGroup(selectedProduct?.group_type)"
|
||||
:ProductItem="selectedProduct"
|
||||
>
|
||||
</CopperSilver>
|
||||
@@ -105,6 +105,8 @@ import { cloneDeep } from 'lodash'
|
||||
import img from "@/assets/img/user_ly1.svg";
|
||||
import BasicModal from "@/components/BasicPacks/BasicModal.vue";
|
||||
import { isProductPriceInactive } from '@/utils/productPrice'
|
||||
import { isBoursecuProject } from '@/utils/config'
|
||||
import { isBoursecuDealProductGroup } from '@/utils/productDealMethod'
|
||||
|
||||
const activekey = ref('طلا' ||'آبشده')
|
||||
const showFilter = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user