From dd660a2ec5a0959e57f04d15d84a2f1f811b177a Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Mon, 11 May 2026 18:09:31 +0330 Subject: [PATCH] add direct_price in DealProduct --- src/models/products.ts | 1 + .../base/products/components/DealProduct.vue | 235 +++--- .../products/components/DealProduct_old.vue | 719 ++++++++++++++++++ 3 files changed, 854 insertions(+), 101 deletions(-) create mode 100644 src/views/base/products/components/DealProduct_old.vue diff --git a/src/models/products.ts b/src/models/products.ts index e92b736..f94dcf2 100644 --- a/src/models/products.ts +++ b/src/models/products.ts @@ -17,6 +17,7 @@ export interface Product { percent_fee_sell: number | undefined cash_fee_buy: number | undefined cash_fee_sell: number | undefined + direct_price: number | undefined reading_method: any created_at: any updated_at: any diff --git a/src/views/base/products/components/DealProduct.vue b/src/views/base/products/components/DealProduct.vue index e8222d2..a892a1e 100644 --- a/src/views/base/products/components/DealProduct.vue +++ b/src/views/base/products/components/DealProduct.vue @@ -4,12 +4,12 @@
-
خرید {{ props?.ProductItem?.title }}
-
@@ -29,7 +29,7 @@
{{ !isBuy ? 'قیمت فروش' : 'قیمت خرید' }}
- {{ usePriceWithoutType(isBuy ? ((props?.ProductItem?.price ?? 0) + (props?.ProductItem?.cash_fee_buy ?? 0)) : ((props?.ProductItem?.price ?? 0) - (props?.ProductItem?.cash_fee_sell ?? 0))) }} + {{ isBuy ? usePriceWithoutType(buyTotalPrice) : usePriceWithoutType(sellTotalPrice) }}
ریال
@@ -61,17 +61,17 @@ - + size="large" type="text" inputmode="numeric" @onchange="handleGoldValueChange" /> - + size="large" type="text" inputmode="numeric" @onchange="handleGoldValueChange" />
@@ -118,48 +118,48 @@
{{ !isBuy ? 'فروش' : 'خرید' }}
- - +
+ {{ form.method == "cash" ? "ریال" : "گرم" }} +
+
+
+ --> + @@ -191,11 +191,12 @@
قیمت:
- {{ usePriceWithoutType(isBuy ? props?.ProductItem.price ?? 0 : props?.ProductItem?.sellPrice ?? 0) }} + {{ usePriceWithoutType(props?.ProductItem?.price) }}
ریال
+
کارمزد:
@@ -203,7 +204,6 @@ buyFee }}
-
{{ sellFee }} @@ -212,10 +212,11 @@
ریال
+
{{ isBuy ? 'قیمت قابل پرداخت:' : 'مبلغ دریافتی:' }}
-
{{ usePriceWithoutType(payablePrice.toFixed(0)) }}
+
{{ usePriceWithoutType(form.goldCash ?? 0) }}
ریال
@@ -227,38 +228,34 @@ + +