Merge origin/modular into feature/responsive-layout-refactor.
Keep responsive layout refactor while taking modular store-hours, transaction price, and garoosi login fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -239,6 +239,7 @@ import {useConfigStore} from "@/store/configStore";
|
||||
import { calcFeeInGrams } from '@/utils/serviceFee'
|
||||
import { formatCashWalletBalanceText, formatGoldWalletBalanceText } from '@/utils/productDealMethod'
|
||||
import { getCashWalletBalance } from '@/utils/productAssets'
|
||||
import { isStoreClosed, getStoreClosedMessage } from '@/utils/storeHours'
|
||||
|
||||
const infoVisible = ref(false)
|
||||
const walletStore = useWalletStore()
|
||||
@@ -325,6 +326,7 @@ const equivalentPrice = computed(() => usePriceWithoutType(feeInRial.value.toFix
|
||||
|
||||
const disableTransaction = computed(() =>
|
||||
loading.value ||
|
||||
isStoreClosed() ||
|
||||
form.value?.goldValue === undefined ||
|
||||
form.value?.goldValue === '' ||
|
||||
form.value?.goldCash === '' ||
|
||||
@@ -640,10 +642,18 @@ async function initPrice() {
|
||||
}
|
||||
|
||||
function okConfirm() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
confirmAction.value = true
|
||||
}
|
||||
|
||||
async function ok() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
infoVisible.value = true
|
||||
|
||||
@@ -296,6 +296,7 @@ import type { Product } from '@/models/products'
|
||||
import { useFundUserStore } from '@/store/fundStore'
|
||||
import {useConfigStore} from "@/store/configStore";
|
||||
import { calcFeeInGrams, loadServiceFeeFromSettings } from '@/utils/serviceFee'
|
||||
import { isStoreClosed, getStoreClosedMessage } from '@/utils/storeHours'
|
||||
import { formatCashWalletBalanceText, getWeightUnit } from '@/utils/productDealMethod'
|
||||
import { formatProductWalletBalanceText, getCashWalletBalance, getProductInventoryQuantity } from '@/utils/productAssets'
|
||||
import { useWalletAssets } from '@/composables/useWalletAssets'
|
||||
@@ -406,6 +407,7 @@ const priceUnavailable = computed(() => {
|
||||
|
||||
const disableTransaction = computed(() =>
|
||||
loading.value ||
|
||||
isStoreClosed() ||
|
||||
form.value?.goldValue === undefined ||
|
||||
form.value?.goldValue === '' ||
|
||||
form.value?.goldCash === '' ||
|
||||
@@ -695,6 +697,10 @@ async function initPrice() {
|
||||
}
|
||||
|
||||
function okConfirm() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
if (cashValidationMessage.value) {
|
||||
message.warning(cashValidationMessage.value)
|
||||
return
|
||||
@@ -703,6 +709,10 @@ function okConfirm() {
|
||||
}
|
||||
|
||||
async function ok() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
infoVisible.value = true
|
||||
|
||||
@@ -297,6 +297,7 @@ import {
|
||||
} from '@/utils/productOrderLimit'
|
||||
import { useWalletAssets } from '@/composables/useWalletAssets'
|
||||
import { formatProductWalletBalanceText, getCashWalletBalance, getProductInventoryQuantity } from '@/utils/productAssets'
|
||||
import { isStoreClosed, getStoreClosedMessage } from '@/utils/storeHours'
|
||||
|
||||
const typeDeal = computed(() => getProductDealMethodOptions(props?.ProductItem?.group_type, isBuy.value))
|
||||
|
||||
@@ -438,6 +439,7 @@ const cashValidationMessage = computed(() =>
|
||||
|
||||
const disableTransaction = computed(() =>
|
||||
loading.value ||
|
||||
isStoreClosed() ||
|
||||
form.value?.goldValue === undefined ||
|
||||
form.value?.goldValue === '' ||
|
||||
form.value?.goldCash === '' ||
|
||||
@@ -795,11 +797,19 @@ async function initPrice() {
|
||||
// })
|
||||
|
||||
function okConfirm() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
confirmAction.value = true
|
||||
refInput.value?.validateFields()
|
||||
}
|
||||
|
||||
async function ok() {
|
||||
if (isStoreClosed()) {
|
||||
message.warning(getStoreClosedMessage())
|
||||
return
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
infoVisible.value = true
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<p class="dtxn-row__title">{{ props.item.title }}</p>
|
||||
<div class="dtxn-row__meta">
|
||||
<span>{{ toJalaliOutOfUTC(props.item.expire_at) }}</span>
|
||||
<span :class="props.item.gold >= 0 ? 'text-green-600' : 'text-red-600'">
|
||||
{{ props.item.gold }} {{ props.item.unit }}
|
||||
<span :class="goldAmount >= 0 ? 'text-green-600' : 'text-red-600'">
|
||||
{{ formatGoldAmount(goldAmount) }} {{ props.item.unit }}
|
||||
</span>
|
||||
<span v-if="isGold">
|
||||
قیمت معامله:
|
||||
{{ usePriceWithoutType(parseInt((Math.abs(props.item.cash) / Math.abs(props.item.gold)).toFixed(0))) }}
|
||||
{{ usePriceWithoutType(tradePrice) }}
|
||||
ریال
|
||||
</span>
|
||||
</div>
|
||||
@@ -56,10 +56,10 @@
|
||||
</div>
|
||||
<div class="flex justify-between mt-2">
|
||||
<div
|
||||
:class="props.item.gold >= 0 ? 'text-green-600' : 'text-red-600'"
|
||||
:class="goldAmount >= 0 ? 'text-green-600' : 'text-red-600'"
|
||||
class="text-gray-500 text-xs number-ltr"
|
||||
>
|
||||
{{ props.item.gold }}
|
||||
{{ formatGoldAmount(goldAmount) }}
|
||||
<div>{{ props.item.unit }}</div>
|
||||
</div>
|
||||
<div class="text-gray-500 flex gap-1 text-xs items-center number-ltr">
|
||||
@@ -75,7 +75,7 @@
|
||||
<div class="text-gray-500">قیمت معامله:</div>
|
||||
<div class="text-gray-500 flex gap-1 text-xs items-center">
|
||||
<div class="text-base">
|
||||
{{ usePriceWithoutType(parseInt((Math.abs(props.item.cash) / Math.abs(props.item.gold)).toFixed(0))) }}
|
||||
{{ usePriceWithoutType(tradePrice) }}
|
||||
</div>
|
||||
ریال
|
||||
</div>
|
||||
@@ -114,7 +114,12 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Icon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
import { usePriceWithoutType } from '@/utils/usePrice'
|
||||
import {
|
||||
formatGoldAmount,
|
||||
getTransactionGoldAmount,
|
||||
getTransactionTradePrice,
|
||||
usePriceWithoutType,
|
||||
} from '@/utils/usePrice'
|
||||
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
|
||||
import BasicModal from '@/components/BasicPacks/BasicModal.vue'
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -133,6 +138,9 @@ const props = withDefaults(
|
||||
{ variant: 'mobile' },
|
||||
)
|
||||
|
||||
const goldAmount = computed(() => getTransactionGoldAmount(props.item))
|
||||
const tradePrice = computed(() => getTransactionTradePrice(props.item))
|
||||
|
||||
const isUp = computed(
|
||||
() =>
|
||||
props.item.type === 3
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div v-if="isGold" class="flex w-full justify-between mt-2">
|
||||
<div class="text-gray-500">قیمت معامله:</div>
|
||||
<div class="text-gray-500 flex gap-1 text-xs items-center">
|
||||
<div class="text-base">{{ usePriceWithoutType((Math.abs(item.cash) / Math.abs(item.gold)).toFixed(0)) }}</div>
|
||||
<div class="text-base">{{ usePriceWithoutType(getTransactionTradePrice(item)) }}</div>
|
||||
ریال
|
||||
</div>
|
||||
</div>
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Icon from "@/components/BasicPacks/BasicIcon.vue";
|
||||
import {usePriceWithoutType} from "../../../../utils/usePrice";
|
||||
import {getTransactionTradePrice, usePriceWithoutType} from "../../../../utils/usePrice";
|
||||
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
|
||||
import {computed, ref} from "vue";
|
||||
import BasicButton from "@/components/BasicPacks/BasicButton.vue";
|
||||
|
||||
Reference in New Issue
Block a user