fix(product): simplify TV formula help text and show regular formula for melted products
- Move FormulaPriceSection outside usesMeltedPricing guard so it appears for all product types - Shorten TV formula tooltip to a single sentence Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -219,15 +219,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormulaPriceSection
|
|
||||||
:model-value="form"
|
|
||||||
:reference-middle-price="formulaReferenceMiddlePrice"
|
|
||||||
:product-amount="Number(form.amount) || 0"
|
|
||||||
@update:model-value="onFormulaFormPatch"
|
|
||||||
@enabled-change="onFormulaEnabledChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<FormulaPriceSection
|
||||||
|
:model-value="form"
|
||||||
|
:reference-middle-price="formulaReferenceMiddlePrice"
|
||||||
|
:product-amount="Number(form.amount) || 0"
|
||||||
|
@update:model-value="onFormulaFormPatch"
|
||||||
|
@enabled-change="onFormulaEnabledChange"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="live-price-preview rounded-lg border border-solid px-3 py-2">
|
<div class="live-price-preview rounded-lg border border-solid px-3 py-2">
|
||||||
<div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-3">
|
<div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-3">
|
||||||
<div class="flex flex-wrap items-center gap-x-3 gap-y-1 md:min-w-0 md:flex-1">
|
<div class="flex flex-wrap items-center gap-x-3 gap-y-1 md:min-w-0 md:flex-1">
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import {
|
import {
|
||||||
DEFAULT_PRICE_FORMULA,
|
DEFAULT_PRICE_FORMULA,
|
||||||
getFormulaVariableHelp,
|
|
||||||
resolveFormulaWeight,
|
resolveFormulaWeight,
|
||||||
computeFormulaProductPrice
|
computeFormulaProductPrice
|
||||||
} from '@/utils/formulaPrice'
|
} from '@/utils/formulaPrice'
|
||||||
@@ -83,16 +82,9 @@ watch(
|
|||||||
|
|
||||||
const formulaWeight = computed(() => resolveFormulaWeight(props.productAmount))
|
const formulaWeight = computed(() => resolveFormulaWeight(props.productAmount))
|
||||||
|
|
||||||
const formulaHelp = computed((): DashboardHelp => {
|
const formulaHelp = computed((): DashboardHelp => ({
|
||||||
const lines = getFormulaVariableHelp(formulaWeight.value)
|
description: 'فرمول مخصوص تابلو TV — کاری با قیمت عادی ندارد.',
|
||||||
.map((item) => `${item.symbol} = ${item.label}`)
|
}))
|
||||||
.join(' | ')
|
|
||||||
return {
|
|
||||||
description:
|
|
||||||
'فرمول جداگانه برای قیمت نمایشی روی تابلو TV. این فرمول فقط روی صفحه TV تأثیر دارد و قیمت عادی محصول را تغییر نمیدهد.',
|
|
||||||
formula: `${lines}. مثال: ROUND(((P)/MG)*W+100000, -3)`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const computedProductPrice = computed(() =>
|
const computedProductPrice = computed(() =>
|
||||||
computeFormulaProductPrice(
|
computeFormulaProductPrice(
|
||||||
|
|||||||
Reference in New Issue
Block a user