payment on delivery
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-09 10:45:19 +03:30
parent 77bf29cb3f
commit bda60b7550
7 changed files with 59 additions and 2 deletions
+1
View File
@@ -38,6 +38,7 @@ export type PaymentMethodType = {
export type PriceDetailsType = {
shipping_cost: number;
shipping_cost_on_delivery?: number;
process_cost: number;
total_retail_price: number;
total_payable_price: number;
+1
View File
@@ -34,6 +34,7 @@ export interface PaymentMethod {
export interface PriceDetails {
shipping_cost: number;
shipping_cost_on_delivery?: number;
process_cost: number;
total_retail_price: number;
total_payable_price: number;
+15
View File
@@ -13,6 +13,7 @@ import { TickCircle, Add, Trash } from 'iconsax-react'
import { toast } from 'react-toastify'
import { extractErrorMessage } from '../../helpers/utils'
import { Pages } from '../../config/Pages'
import SwitchComponent from '../../components/Switch'
const CreateShipment: FC = () => {
const navigate = useNavigate()
@@ -25,6 +26,7 @@ const CreateShipment: FC = () => {
costs: [],
deliveryTime: 0,
deliveryType: 'Standard',
payDeliveryFeeOnDelivery: false,
},
validationSchema: Yup.object({
name: Yup.string().required('عنوان روش ارسال الزامی است'),
@@ -134,6 +136,19 @@ const CreateShipment: FC = () => {
{...formik.getFieldProps('description')}
error_text={formik.touched.description && formik.errors.description ? formik.errors.description : ''}
/>
<div className='flex items-center justify-between border border-gray-200 rounded-lg p-4'>
<div>
<div className='font-medium text-gray-900'>پرداخت هزینه ارسال در زمان تحویل</div>
<div className='text-xs text-gray-500 mt-1'>
در صورت فعال بودن، هزینه ارسال در زمان تحویل پرداخت میشود و در پرداخت آنلاین لحاظ نمیگردد.
</div>
</div>
<SwitchComponent
active={formik.values.payDeliveryFeeOnDelivery ?? false}
onChange={(value) => formik.setFieldValue('payDeliveryFeeOnDelivery', value)}
/>
</div>
</div>
</div>
+2
View File
@@ -88,6 +88,7 @@ const ShippingList: FC = () => {
<Td text={'توضیحات'} />
<Td text={'نوع ارسال'} />
<Td text={'زمان ارسال (روز)'} />
<Td text={'پرداخت در محل'} />
<Td text={'هزینه‌ها'} />
<Td text={'عملیات'} />
</tr>
@@ -106,6 +107,7 @@ const ShippingList: FC = () => {
<Td text={shipment.description} />
<Td text={getDeliveryTypeText(shipment.deliveryType)} />
<Td text={shipment.deliveryTime.toString()} />
<Td text={shipment.payDeliveryFeeOnDelivery ? 'بله' : 'خیر'} />
<Td text="">
<div className="text-sm">
{shipment.costs.length > 0 ? (
+15
View File
@@ -13,6 +13,7 @@ import { TickCircle, Add, Trash } from 'iconsax-react'
import { toast } from 'react-toastify'
import { extractErrorMessage } from '../../helpers/utils'
import { Pages } from '../../config/Pages'
import SwitchComponent from '../../components/Switch'
const UpdateShipment: FC = () => {
const { id } = useParams<{ id: string }>()
@@ -27,6 +28,7 @@ const UpdateShipment: FC = () => {
costs: shipmentDetail?.costs || [],
deliveryTime: shipmentDetail?.deliveryTime || 0,
deliveryType: shipmentDetail?.deliveryType || 'Standard',
payDeliveryFeeOnDelivery: shipmentDetail?.payDeliveryFeeOnDelivery ?? false,
},
enableReinitialize: true,
validationSchema: Yup.object({
@@ -170,6 +172,19 @@ const UpdateShipment: FC = () => {
{...formik.getFieldProps('description')}
error_text={formik.touched.description && formik.errors.description ? formik.errors.description : ''}
/>
<div className='flex items-center justify-between border border-gray-200 rounded-lg p-4'>
<div>
<div className='font-medium text-gray-900'>پرداخت هزینه ارسال در زمان تحویل</div>
<div className='text-xs text-gray-500 mt-1'>
در صورت فعال بودن، هزینه ارسال در زمان تحویل پرداخت میشود و در پرداخت آنلاین لحاظ نمیگردد.
</div>
</div>
<SwitchComponent
active={formik.values.payDeliveryFeeOnDelivery ?? false}
onChange={(value) => formik.setFieldValue('payDeliveryFeeOnDelivery', value)}
/>
</div>
</div>
</div>
+3
View File
@@ -16,6 +16,7 @@ export interface Shipper {
costs: Cost[];
deliveryType: "Standard" | "SameDay" | "Express";
deliveryTime: number;
payDeliveryFeeOnDelivery: boolean;
deleted: boolean;
createdAt: string;
updatedAt: string;
@@ -35,6 +36,7 @@ export interface CreateShipper {
description: string;
costs: Cost[];
deliveryTime: number;
payDeliveryFeeOnDelivery?: boolean;
deliveryType?: "Standard" | "SameDay" | "Express";
}
@@ -62,6 +64,7 @@ export interface ShipmentMethod {
costs: Cost[];
deliveryType: string;
deliveryTime: number;
payDeliveryFeeOnDelivery: boolean;
deleted: boolean;
createdAt: string;
updatedAt: string;