fix bug
This commit is contained in:
@@ -66,6 +66,12 @@
|
|||||||
<div class="text-xs text-gray-500">
|
<div class="text-xs text-gray-500">
|
||||||
قیمت خرید/فروش از قیمت صفحه اصلی اپ محاسبه میشود. مثبت = گرانتر، منفی = ارزانتر.
|
قیمت خرید/فروش از قیمت صفحه اصلی اپ محاسبه میشود. مثبت = گرانتر، منفی = ارزانتر.
|
||||||
</div>
|
</div>
|
||||||
|
<a-form-item label="قیمت صفر از provider" name="use_last_price_if_zero" class="!mb-0">
|
||||||
|
<a-switch v-model:checked="form.use_last_price_if_zero" />
|
||||||
|
<span class="mr-2 text-xs text-gray-500">
|
||||||
|
اگر provider قیمت نداد (صفر)، با آخرین قیمت ذخیرهشده معامله شود
|
||||||
|
</span>
|
||||||
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -93,14 +93,20 @@ export function computeProductEditorPricePreview(input: {
|
|||||||
|
|
||||||
if (input.meltedPriceOption === 'app') {
|
if (input.meltedPriceOption === 'app') {
|
||||||
const base = resolveAppBasePrice(input.appLastPrice)
|
const base = resolveAppBasePrice(input.appLastPrice)
|
||||||
if (base <= 0) {
|
if (base > 0) {
|
||||||
return { status: 'empty', message: '' }
|
return {
|
||||||
}
|
status: 'ready',
|
||||||
return {
|
amount: adjustedProductPrice(base, 0, offsetPercent),
|
||||||
status: 'ready',
|
source: 'قیمت صفحه اصلی اپ'
|
||||||
amount: adjustedProductPrice(base, 0, offsetPercent),
|
}
|
||||||
source: 'قیمت صفحه اصلی اپ'
|
|
||||||
}
|
}
|
||||||
|
const fallback = resolveStoredFallbackPrice(
|
||||||
|
input.form.price,
|
||||||
|
input.form.use_last_price_if_zero ?? false
|
||||||
|
)
|
||||||
|
return fallback > 0
|
||||||
|
? { status: 'ready', amount: fallback, source: 'آخرین قیمت ذخیرهشده' }
|
||||||
|
: { status: 'empty', message: 'قیمت provider صفر است' }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!input.form.reading_method) {
|
if (!input.form.reading_method) {
|
||||||
|
|||||||
Reference in New Issue
Block a user