feat: add required kyc blocking modal and fix copper asset units to kilogram

This commit is contained in:
2026-11-05 17:17:29 +03:30
parent ae01f6c8d6
commit 0f50ec315c
18 changed files with 495 additions and 50 deletions
+11 -5
View File
@@ -175,8 +175,10 @@ import {
formatPortfolioProfitPercent,
formatPortfolioProfitText,
resolveAssetsRialValue,
resolveBoursecuCopperUnit,
resolveMetalAssetsDisplayLabel,
} from '@/utils/productAssets'
import { formatWeightAmount } from '@/utils/usePrice'
import type { WalletMetalTotal } from '@/models/walletAssets'
import { useAssetsPortfolioChart } from './composables/useAssetsPortfolioChart'
import assetsCopperBanner from '@/assets/img/assets-copper-banner.webp'
@@ -265,10 +267,13 @@ const profitClass = computed(() => {
})
const summaryItems = computed(() => {
const items = metalTotals.value.map((metal) => ({
label: assetsMetalLabel(metal),
value: `${metal.total_weight} ${metal.unit}`,
}))
const items = metalTotals.value.map((metal) => {
const unit = metal.metal_id === 3 ? resolveBoursecuCopperUnit(metal.unit) : (metal.unit || 'کیلوگرم')
return {
label: assetsMetalLabel(metal),
value: `${formatWeightAmount(Number(metal.total_weight ?? 0))} ${unit}`,
}
})
items.push(
{ label: 'کیف پول ریالی', value: usePrice(cashWallet.value) },
{ label: 'ارزش ریالی مس', value: usePrice(metalRialValue.value) },
@@ -287,10 +292,11 @@ const assetRows = computed(() => {
const profit = portfolioInsight.value?.unrealized_profit_rial
const changeClass = profit == null || profit === 0 ? '' : profit > 0 ? 'is-profit' : 'is-loss'
const rows = metalTotals.value.flatMap((metal) => {
const unit = metal.metal_id === 3 ? resolveBoursecuCopperUnit(metal.unit) : (metal.unit || 'کیلوگرم')
const head = {
key: `metal-${metal.metal_id}`,
name: assetsMetalLabel(metal),
balance: `${metal.total_weight} ${metal.unit}`,
balance: `${formatWeightAmount(Number(metal.total_weight ?? 0))} ${unit}`,
rial: usePrice(metalRialValue.value),
change: pct || '—',
changeClass,
@@ -62,6 +62,7 @@ import {
formatPortfolioProfitPercent,
formatPortfolioProfitText,
resolveAssetsRialValue,
resolveBoursecuCopperUnit,
} from '@/utils/productAssets'
import { formatWeightAmount, usePriceWithoutType } from '@/utils/usePrice'
import { getTradeBuyPrice, lastPrice } from '@/utils/price'
@@ -76,7 +77,7 @@ const props = withDefaults(
const { assetsSummary } = useWalletAssets()
const portfolio = computed(() => assetsSummary.value?.portfolio)
const weightUnit = computed(() => assetsSummary.value?.meta?.weight_unit || 'گرم')
const weightUnit = computed(() => resolveBoursecuCopperUnit(assetsSummary.value?.meta?.weight_unit))
const totalRial = computed(() =>
Number(portfolio.value?.total_rial_value ?? assetsSummary.value?.total_rial_value ?? 0)
@@ -43,6 +43,7 @@ import {
formatPortfolioProfitLabel,
formatPortfolioProfitPercent,
formatPortfolioProfitText,
resolveBoursecuCopperUnit,
} from '@/utils/productAssets'
const props = withDefaults(
@@ -55,7 +56,7 @@ const props = withDefaults(
const { assetsSummary } = useWalletAssets()
const portfolio = computed(() => assetsSummary.value?.portfolio)
const weightUnit = computed(() => assetsSummary.value?.meta?.weight_unit || 'گرم')
const weightUnit = computed(() => resolveBoursecuCopperUnit(assetsSummary.value?.meta?.weight_unit))
const hasProfitInsight = computed(() => portfolio.value?.unrealized_profit_rial != null)
const profitTone = computed(() => formatPortfolioProfitLabel(portfolio.value?.unrealized_profit_rial))
+2 -11
View File
@@ -20,6 +20,7 @@ import { getBoursecuActionIconSrc } from '@/utils/config'
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
import { getReferralShareText, getReferralShareTitle, shareReferralText } from '@/utils/referralShare'
import { normalizeAuthFormFields } from '@/utils/persianDigits'
import { performUserLogout } from '@/utils/authSession'
import { useSettingsStore } from '@/store/settingsStore'
import { useTrackingSystemsFeature } from '@/composables/useTrackingSystemsFeature'
import { openGoldDayCalculator } from '@/composables/useGoldDayCalculator'
@@ -300,18 +301,8 @@ export function useUserPage() {
}
async function logout() {
userStore.userInfo = undefined
walletStore.walletInfo = undefined
clearWalletAssets()
resetHomePageData()
resetWalletPageData()
resetAddressPageData()
resetTransactionsPageData()
resetProductsPageData()
removeToken()
showLogoutConfirm.value = false
await router.push({ name: 'login' })
window.location.reload()
await performUserLogout()
}
onMounted(() => {
+2 -2
View File
@@ -68,11 +68,11 @@
<div class="text-black">مقدار {{ getMetalTypeTradeLabel() }} مبادله شده:</div>
<div :class="item.gold >= 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center">
<div class="text-base ml-1 number-ltr">{{ formatGoldAmount(item.gold) }}</div>
گرم
{{ getWeightUnit() }}
</div>
</div>
<div v-if="item.order" class="flex justify-between mb-3">
<div class="text-black">قیمت هر گرم {{ getTradePriceUnitLabel() }} حین معامله:</div>
<div class="text-black">قیمت هر {{ getWeightUnit() }} {{ getTradePriceUnitLabel() }} حین معامله:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.price?? 0) }}</div>
ریال
+1 -1
View File
@@ -77,7 +77,7 @@
/>
</a-form-item>
<a-form-item
v-if="settingsStore.isReferralFieldVisible"
v-if="settingsStore.isReferralFieldVisible || disableForm"
:rules="referralIdRules"
:class="variant === 'desktop' ? '' : 'home_appear_fade_in_down'"
label="کد معرف"
@@ -56,7 +56,9 @@
درباره مس
</button>
<span class="dauth-form-links__sep" aria-hidden="true">|</span>
<span class="dauth-form-links__text">پشتیبانی</span>
<button type="button" class="dauth-form-links__link" @click="onSupportClick">
پشتیبانی
</button>
</nav>
<div class="dauth-page-footer__status">
<span class="dauth-page-footer__status-icon" aria-hidden="true">
@@ -100,7 +100,7 @@ function handleSuccessDismiss() {
</a-form-item>
<a-form-item
v-if="settingsStore.isReferralFieldVisible"
v-if="settingsStore.isReferralFieldVisible || disableForm"
:rules="referralIdRules"
label="کد معرف"
name="referral_id"
@@ -1191,18 +1191,19 @@
/* ─── موبایل (<768): لوگو + کارت + پشتیبانی، وسط‌چین عمودی ─── */
@media (max-width: 767px) {
.dauth.dauth--boursecu {
/* 100vh آیفون پشت نوار سافاری است؛ اسکرول داخل 100dvh تا دکمهٔ ثبت‌نام برسد */
height: 100dvh;
max-height: 100dvh;
min-height: 0;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
/* 100vh آیفون پشت نوار سافاری است؛ اسکرول روان در ارتفاع واقعی بدون قفل شدن */
height: auto !important;
min-height: 100dvh !important;
max-height: none !important;
overflow-x: hidden !important;
overflow-y: auto !important;
-webkit-overflow-scrolling: touch !important;
touch-action: pan-y !important;
overscroll-behavior-y: auto !important;
display: flex;
flex-direction: column;
justify-content: flex-start;
justify-content: safe center;
padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
padding: 16px 0 calc(36px + env(safe-area-inset-bottom, 0px));
.dauth-page-logo {
position: relative;
@@ -1367,14 +1368,18 @@
font-size: 11px;
}
/* شناور پایین روی دکمهٔ ثبت‌نام می‌نشیند؛ زیر کارت بیاید */
/* دکمه شناور پشتیبانی در موبایل: زیر کارت و بالاتر از لینک‌های فوتر نمایش داده شود و شناور روی فرم نیفتد */
.dauth-form-support--fab {
position: static !important;
display: inline-flex !important;
top: auto !important;
left: auto !important;
right: auto !important;
bottom: auto !important;
width: auto !important;
align-self: center;
margin: 4px 0 0;
margin: 14px auto 0 !important;
z-index: 10 !important;
}
}
}
+17 -4
View File
@@ -60,6 +60,16 @@ onUnmounted(() => {
/* موبایل لاگین: تمام‌عرض — بدون فریم ۴۲۶ و حاشیه سفید دوطرف */
@media screen and (max-width: 767.98px) {
html.login-page-active {
html,
body {
overflow-x: hidden !important;
overflow-y: auto !important;
-webkit-overflow-scrolling: touch !important;
height: auto !important;
min-height: 100dvh !important;
overscroll-behavior-y: auto !important;
}
body {
display: block !important;
justify-content: unset !important;
@@ -71,6 +81,9 @@ onUnmounted(() => {
width: 100% !important;
max-width: none !important;
background: #0b192e !important;
height: auto !important;
min-height: 100dvh !important;
overflow: visible !important;
}
.desktopConfig,
@@ -90,12 +103,12 @@ onUnmounted(() => {
.app-main,
.login-page-root,
.dauth.dauth--boursecu {
min-height: 0 !important;
height: 100dvh !important;
max-height: 100dvh !important;
min-height: 100dvh !important;
height: auto !important;
max-height: none !important;
overflow-x: hidden !important;
overflow-y: auto !important;
-webkit-overflow-scrolling: touch;
-webkit-overflow-scrolling: touch !important;
background: #0b192e !important;
}