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";
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
v-else-if="variant !== 'desktop'"
|
||||
:src="getProjectLoginLogo(config.config?.avatar)"
|
||||
alt=""
|
||||
class="z-100 rounded-full aspect-square self-center w-36"
|
||||
:class="[
|
||||
'z-100 self-center w-36',
|
||||
config.config?.name === 'garoosi'
|
||||
? 'h-auto object-contain'
|
||||
: 'rounded-full aspect-square',
|
||||
]"
|
||||
style="margin-bottom: 60px"
|
||||
>
|
||||
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
v-else-if="variant !== 'desktop'"
|
||||
:src="getProjectLoginLogo(config.config?.avatar)"
|
||||
alt=""
|
||||
class="z-100 rounded-full aspect-square self-center w-36"
|
||||
:class="[
|
||||
'z-100 self-center w-36',
|
||||
config.config?.name === 'garoosi'
|
||||
? 'h-auto object-contain mb-[60px]'
|
||||
: 'rounded-full aspect-square',
|
||||
]"
|
||||
>
|
||||
<div v-if="variant !== 'desktop'" class="font-bold text-center text-xl">ثبت نام</div>
|
||||
<a-form
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</DesktopAuthShell>
|
||||
|
||||
<!-- Mobile: original layout -->
|
||||
<div v-show="!isDesktop" class="login-page flex items-center justify-center">
|
||||
<div v-show="!isDesktop" class="login-page flex flex-col items-center">
|
||||
<template v-if="!isBoursecu">
|
||||
<div class="fixed top-0 right-0 left-0 h-1/3 w-screen flex">
|
||||
<img :src="img_topGradiant" alt="" class="absolute z-10 w-screen h-full object-cover" />
|
||||
@@ -31,18 +31,36 @@
|
||||
<img :src="img_pattern" alt="" class="absolute w-screen h-full object-none" />
|
||||
</div>
|
||||
</template>
|
||||
<div class="z-1000 w-full p-5">
|
||||
<div class="login-page__content z-1000 w-full p-5">
|
||||
<Login v-if="!loginPage.enterType" @register="loginPage.setEnterType" />
|
||||
<Register v-else @register="loginPage.setEnterType" />
|
||||
</div>
|
||||
|
||||
<div v-if="isGaroosi" class="login-page__enamad z-1000">
|
||||
<a
|
||||
referrerpolicy="origin"
|
||||
target="_blank"
|
||||
href="https://trustseal.enamad.ir/?id=710578&Code=DdltBYWJgvc7LJs9eM46SEliXRRU0kSW"
|
||||
>
|
||||
<img
|
||||
referrerpolicy="origin"
|
||||
src="https://trustseal.enamad.ir/logo.aspx?id=710578&Code=DdltBYWJgvc7LJs9eM46SEliXRRU0kSW"
|
||||
alt="enamad"
|
||||
style="cursor: pointer"
|
||||
code="DdltBYWJgvc7LJs9eM46SEliXRRU0kSW"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import { useLoginPage } from './composables/useLoginPage'
|
||||
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
|
||||
import { isBoursecuProject } from '@/utils/config'
|
||||
import { useConfigStore } from '@/store/configStore'
|
||||
import Login from './components/Login.vue'
|
||||
import Register from './components/Register.vue'
|
||||
import DesktopAuthShell from './desktop/components/DesktopAuthShell.vue'
|
||||
@@ -53,6 +71,8 @@ import img_pattern from './assets/img/pattern.svg'
|
||||
const isDesktop = useDesktopBreakpoint()
|
||||
const isBoursecu = isBoursecuProject()
|
||||
const loginPage = useLoginPage()
|
||||
const config = useConfigStore()
|
||||
const isGaroosi = computed(() => config.config?.name === 'garoosi')
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -64,4 +84,23 @@ const loginPage = useLoginPage()
|
||||
.login-page {
|
||||
min-height: calc(100vh - var(--app-credit-footer-offset, 28px));
|
||||
}
|
||||
|
||||
.login-page__content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.login-page__enamad {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0 20px 16px;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.login-page__enamad img {
|
||||
max-width: 96px;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user