Hide Zaarbox key on Montzar and tighten product pricing UI.
Hide zaarbox_price_key when price_provider is montzar, add +/- for fixed melted and manual prices, drop formula on fixed, and remove the show-in-assets switch. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -253,6 +253,11 @@ export function isSettingVisible(key: string | undefined | null): boolean {
|
|||||||
const provider = (priceProviderSetting.value || '').trim().toLowerCase()
|
const provider = (priceProviderSetting.value || '').trim().toLowerCase()
|
||||||
if (provider && provider !== 'montzar') return false
|
if (provider && provider !== 'montzar') return false
|
||||||
}
|
}
|
||||||
|
// شناسه ردیف تابلو فقط برای منبع zaarbox معنی دارد
|
||||||
|
if (k === 'zaarbox_price_key') {
|
||||||
|
const provider = (priceProviderSetting.value || '').trim().toLowerCase()
|
||||||
|
if (provider === 'montzar') return false
|
||||||
|
}
|
||||||
// تنظیمات قابلویرایش کانال فقط وقتی دسترسی دیپلوی روشن است
|
// تنظیمات قابلویرایش کانال فقط وقتی دسترسی دیپلوی روشن است
|
||||||
if (PRICE_CHANNEL_PANEL_KEYS.has(k) && !priceChannelAccessSetting.value) return false
|
if (PRICE_CHANNEL_PANEL_KEYS.has(k) && !priceChannelAccessSetting.value) return false
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<div
|
<div
|
||||||
v-if="usesMeltedPricing"
|
v-if="usesMeltedPricing"
|
||||||
class="product-editor-panel flex flex-col gap-3"
|
class="product-editor-panel flex flex-col gap-3 p-3"
|
||||||
>
|
>
|
||||||
<div class="product-spec-switch-row">
|
<div class="product-spec-switch-row">
|
||||||
<div class="product-spec-label">
|
<div class="product-spec-label">
|
||||||
@@ -34,21 +34,41 @@
|
|||||||
<a-radio-button value="reference">مرجع متفاوت</a-radio-button>
|
<a-radio-button value="reference">مرجع متفاوت</a-radio-button>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="meltedPriceOption === 'fixed'" class="grid items-start gap-4 md:grid-cols-3">
|
<div v-if="meltedPriceOption === 'fixed'" class="flex flex-col gap-2">
|
||||||
<a-form-item name="price" class="!mb-0">
|
<a-form-item name="price" class="!mb-0">
|
||||||
<template #label>
|
<template #label>
|
||||||
<DashboardLabelWithHelp label="قیمت ثابت" :help="fixedPriceHelp" size="sm" />
|
<DashboardLabelWithHelp label="قیمت ثابت" :help="fixedPriceHelp" size="sm" />
|
||||||
</template>
|
</template>
|
||||||
<BasicInput addon-before="ریال" type="price" v-model:value="form.price" />
|
<div class="flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:items-center">
|
||||||
|
<BasicInput
|
||||||
|
class="min-w-0 w-full flex-1"
|
||||||
|
addon-before="ریال"
|
||||||
|
type="price"
|
||||||
|
v-model:value="form.price"
|
||||||
|
/>
|
||||||
|
<div class="grid w-full grid-cols-2 gap-1.5 sm:w-auto sm:shrink-0">
|
||||||
|
<AButton
|
||||||
|
class="border-green text-green !flex items-center justify-center gap-1"
|
||||||
|
size="middle"
|
||||||
|
@click="$emit('addPrice')"
|
||||||
|
>
|
||||||
|
<Icon icon="vuesax-linear:add" size="18" />
|
||||||
|
<span>۱۰ هزار</span>
|
||||||
|
</AButton>
|
||||||
|
<AButton
|
||||||
|
class="border-red text-red !flex items-center justify-center gap-1"
|
||||||
|
size="middle"
|
||||||
|
@click="$emit('minusPrice')"
|
||||||
|
>
|
||||||
|
<Icon icon="vuesax-linear:minus" size="18" />
|
||||||
|
<span>۱۰ هزار</span>
|
||||||
|
</AButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<FormulaPriceSection
|
<p class="m-0 text-xs leading-5" style="color: var(--admin-text-secondary)">
|
||||||
class="md:col-span-2"
|
با دکمههای مثبت و منفی هر بار ۱۰٬۰۰۰ ریال کم یا زیاد میشود؛ برای اعمال نهایی «ثبت» را بزنید.
|
||||||
:model-value="form"
|
</p>
|
||||||
:reference-middle-price="formulaReferenceMiddlePrice"
|
|
||||||
:product-amount="Number(form.amount) || 0"
|
|
||||||
@update:model-value="onFormulaFormPatch"
|
|
||||||
@enabled-change="onFormulaEnabledChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="meltedPriceOption === 'reference'" class="grid items-start gap-4 md:grid-cols-4">
|
<div v-if="meltedPriceOption === 'reference'" class="grid items-start gap-4 md:grid-cols-4">
|
||||||
<a-form-item name="reading_method" class="!mb-0 md:col-span-2">
|
<a-form-item name="reading_method" class="!mb-0 md:col-span-2">
|
||||||
@@ -158,21 +178,41 @@
|
|||||||
<a-radio-button value="3">قیمت صفحه اصلی اپلیکیشن</a-radio-button>
|
<a-radio-button value="3">قیمت صفحه اصلی اپلیکیشن</a-radio-button>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="methodOption === '1'" class="grid items-start gap-4 md:grid-cols-4">
|
<div v-if="methodOption === '1'" class="flex flex-col gap-2">
|
||||||
<a-form-item name="price" class="!mb-0 md:col-span-2">
|
<a-form-item name="price" class="!mb-0">
|
||||||
<template #label>
|
<template #label>
|
||||||
<DashboardLabelWithHelp label="قیمت وسط" :help="manualPriceHelp" size="sm" />
|
<DashboardLabelWithHelp label="قیمت وسط" :help="manualPriceHelp" size="sm" />
|
||||||
</template>
|
</template>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:items-center">
|
||||||
<BasicInput class="flex-1" addon-before="ریال" type="price" v-model:value="form.price" />
|
<BasicInput
|
||||||
<AButton class="border-green text-green shrink-0 rounded-full aspect-square" size="small" shape="circle" @click="$emit('addPrice')">
|
class="min-w-0 w-full flex-1"
|
||||||
<template #icon><Icon icon="vuesax-linear:add" size="20" /></template>
|
addon-before="ریال"
|
||||||
</AButton>
|
type="price"
|
||||||
<AButton class="border-red text-red shrink-0 rounded-full" size="small" shape="circle" @click="$emit('minusPrice')">
|
v-model:value="form.price"
|
||||||
<template #icon><Icon icon="vuesax-linear:minus" size="20" /></template>
|
/>
|
||||||
</AButton>
|
<div class="grid w-full grid-cols-2 gap-1.5 sm:w-auto sm:shrink-0">
|
||||||
|
<AButton
|
||||||
|
class="border-green text-green !flex items-center justify-center gap-1"
|
||||||
|
size="middle"
|
||||||
|
@click="$emit('addPrice')"
|
||||||
|
>
|
||||||
|
<Icon icon="vuesax-linear:add" size="18" />
|
||||||
|
<span>۱۰ هزار</span>
|
||||||
|
</AButton>
|
||||||
|
<AButton
|
||||||
|
class="border-red text-red !flex items-center justify-center gap-1"
|
||||||
|
size="middle"
|
||||||
|
@click="$emit('minusPrice')"
|
||||||
|
>
|
||||||
|
<Icon icon="vuesax-linear:minus" size="18" />
|
||||||
|
<span>۱۰ هزار</span>
|
||||||
|
</AButton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<p class="m-0 text-xs leading-5" style="color: var(--admin-text-secondary)">
|
||||||
|
با دکمههای مثبت و منفی هر بار ۱۰٬۰۰۰ ریال کم یا زیاد میشود؛ برای اعمال نهایی «ثبت» را بزنید.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="methodOption === '2'" class="grid gap-4 md:grid-cols-4">
|
<div v-if="methodOption === '2'" class="grid gap-4 md:grid-cols-4">
|
||||||
<a-form-item name="reading_method" class="!mb-0 md:col-span-2">
|
<a-form-item name="reading_method" class="!mb-0 md:col-span-2">
|
||||||
@@ -459,10 +499,6 @@
|
|||||||
<span class="text-sm">نمایش در لیست محصولات</span>
|
<span class="text-sm">نمایش در لیست محصولات</span>
|
||||||
<a-switch v-model:checked="form.show_in_list" />
|
<a-switch v-model:checked="form.show_in_list" />
|
||||||
</div>
|
</div>
|
||||||
<div class="product-visibility-row">
|
|
||||||
<span class="text-sm">نمایش در داراییها</span>
|
|
||||||
<a-switch v-model:checked="form.show_in_assets" />
|
|
||||||
</div>
|
|
||||||
<div class="product-visibility-row">
|
<div class="product-visibility-row">
|
||||||
<span class="text-sm">نمایش در تابلو TV</span>
|
<span class="text-sm">نمایش در تابلو TV</span>
|
||||||
<a-switch v-model:checked="form.show_on_tv" />
|
<a-switch v-model:checked="form.show_on_tv" />
|
||||||
@@ -674,7 +710,7 @@ const manualPriceHelp: DashboardHelp = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fixedPriceHelp: DashboardHelp = {
|
const fixedPriceHelp: DashboardHelp = {
|
||||||
description: 'مبلغ ثابت خرید/فروش این محصول آبشدهای.',
|
description: 'مبلغ ثابت خرید/فروش این محصول آبشدهای. دکمههای +/− هر بار ۱۰٬۰۰۰ ریال تنظیم میکنند.',
|
||||||
}
|
}
|
||||||
|
|
||||||
const priceReferenceHelp: DashboardHelp = {
|
const priceReferenceHelp: DashboardHelp = {
|
||||||
@@ -733,10 +769,6 @@ const cashFeeSellHelp: DashboardHelp = {
|
|||||||
formula: 'نقدی: −۲۰۰٬۰۰۰ ریال | درصدی: ۰.۵٪ یا ۱۰٪ از قیمت پایه',
|
formula: 'نقدی: −۲۰۰٬۰۰۰ ریال | درصدی: ۰.۵٪ یا ۱۰٪ از قیمت پایه',
|
||||||
}
|
}
|
||||||
|
|
||||||
const showInAssetsHelp: DashboardHelp = {
|
|
||||||
description: 'روشن: این محصول در صفحه داراییهای مشتری نمایش داده میشود.',
|
|
||||||
}
|
|
||||||
|
|
||||||
const showOnTvHelp: DashboardHelp = {
|
const showOnTvHelp: DashboardHelp = {
|
||||||
description: 'روشن: این محصول در صفحه تابلو قیمت مشتری (/tv) نمایش داده میشود.',
|
description: 'روشن: این محصول در صفحه تابلو قیمت مشتری (/tv) نمایش داده میشود.',
|
||||||
}
|
}
|
||||||
@@ -937,6 +969,7 @@ watch(
|
|||||||
if (option === 'fixed') {
|
if (option === 'fixed') {
|
||||||
props.form.direct_price = 1
|
props.form.direct_price = 1
|
||||||
props.form.price_offset_percent = 0
|
props.form.price_offset_percent = 0
|
||||||
|
props.form.price_formula_enabled = false
|
||||||
}
|
}
|
||||||
if (option === 'reference') {
|
if (option === 'reference') {
|
||||||
props.form.direct_price = 0
|
props.form.direct_price = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user