ordering-ui-react-native 0.12.76 → 0.12.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -333,144 +333,147 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
333
333
|
onClickButton={() => navigation.navigate('Orders')}
|
|
334
334
|
/>
|
|
335
335
|
)}
|
|
336
|
-
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<
|
|
348
|
-
keyboardShouldPersistTaps="handled"
|
|
349
|
-
showsVerticalScrollIndicator={false}
|
|
350
|
-
>
|
|
351
|
-
{order?.order_group && order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
|
|
352
|
-
<OrderDetailsInformation key={order?.id} order={order} isOrderGroup lastOrder={hash?.length === i + 1} />
|
|
353
|
-
)) : (
|
|
354
|
-
<OrderDetailsInformation order={order} />
|
|
355
|
-
)}
|
|
356
|
-
</OrderDetailsContainer>
|
|
357
|
-
{showFloatButtonsPickUp[order?.status] && (
|
|
358
|
-
<FloatingButton
|
|
359
|
-
disabled={props.order?.loading}
|
|
360
|
-
btnText={t('PICKUP_FAILED', 'Pickup failed')}
|
|
361
|
-
isSecondaryBtn={false}
|
|
362
|
-
secondButtonClick={() =>
|
|
363
|
-
handleChangeOrderStatus && handleChangeOrderStatus(9)
|
|
364
|
-
}
|
|
365
|
-
firstButtonClick={() =>
|
|
366
|
-
handleViewActionOrder && handleViewActionOrder('pickupFailed')
|
|
367
|
-
}
|
|
368
|
-
secondBtnText={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
369
|
-
secondButton={true}
|
|
370
|
-
firstColorCustom={theme.colors.red}
|
|
371
|
-
secondColorCustom={theme.colors.green}
|
|
372
|
-
widthButton={'45%'}
|
|
373
|
-
/>
|
|
374
|
-
)}
|
|
375
|
-
{(order?.status === 9 || order?.status === 19) && (
|
|
336
|
+
{!((!order || Object.keys(order).length === 0) &&
|
|
337
|
+
(props.order?.error?.length < 1 || !props.order?.error)) && (
|
|
338
|
+
<View style={{ flex: 1 }}>
|
|
339
|
+
<OrderHeaderComponent
|
|
340
|
+
order={order}
|
|
341
|
+
handleOpenMapView={handleOpenMapView}
|
|
342
|
+
handleOpenMessagesForBusiness={handleOpenMessagesForBusiness}
|
|
343
|
+
getOrderStatus={getOrderStatus}
|
|
344
|
+
handleArrowBack={handleArrowBack}
|
|
345
|
+
logisticOrderStatus={logisticOrderStatus}
|
|
346
|
+
/>
|
|
347
|
+
{order && Object.keys(order).length > 0 && (props.order?.error?.length < 1 || !props.order?.error) && (
|
|
376
348
|
<>
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
349
|
+
<OrderDetailsContainer
|
|
350
|
+
keyboardShouldPersistTaps="handled"
|
|
351
|
+
showsVerticalScrollIndicator={false}
|
|
352
|
+
>
|
|
353
|
+
{order?.order_group && order?.order_group_id && order?.isLogistic ? order?.order_group?.orders.map((order: any, i: number, hash: any) => (
|
|
354
|
+
<OrderDetailsInformation key={order?.id} order={order} isOrderGroup lastOrder={hash?.length === i + 1} />
|
|
355
|
+
)) : (
|
|
356
|
+
<OrderDetailsInformation order={order} />
|
|
357
|
+
)}
|
|
358
|
+
</OrderDetailsContainer>
|
|
359
|
+
{showFloatButtonsPickUp[order?.status] && (
|
|
360
|
+
<FloatingButton
|
|
361
|
+
disabled={props.order?.loading}
|
|
362
|
+
btnText={t('PICKUP_FAILED', 'Pickup failed')}
|
|
363
|
+
isSecondaryBtn={false}
|
|
364
|
+
secondButtonClick={() =>
|
|
365
|
+
handleChangeOrderStatus && handleChangeOrderStatus(9)
|
|
366
|
+
}
|
|
367
|
+
firstButtonClick={() =>
|
|
368
|
+
handleViewActionOrder && handleViewActionOrder('pickupFailed')
|
|
369
|
+
}
|
|
370
|
+
secondBtnText={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
371
|
+
secondButton={true}
|
|
372
|
+
firstColorCustom={theme.colors.red}
|
|
373
|
+
secondColorCustom={theme.colors.green}
|
|
374
|
+
widthButton={'45%'}
|
|
375
|
+
/>
|
|
376
|
+
)}
|
|
377
|
+
{(order?.status === 9 || order?.status === 19) && (
|
|
378
|
+
<>
|
|
379
|
+
<FloatingButton
|
|
380
|
+
disabled={props.order?.loading}
|
|
381
|
+
btnText={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
382
|
+
isSecondaryBtn={false}
|
|
383
|
+
secondButtonClick={() =>
|
|
384
|
+
handleChangeOrderStatus && handleChangeOrderStatus(11)
|
|
385
|
+
}
|
|
386
|
+
firstButtonClick={() =>
|
|
387
|
+
handleViewActionOrder && handleViewActionOrder('deliveryFailed')
|
|
388
|
+
}
|
|
389
|
+
secondBtnText={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
390
|
+
secondButton={true}
|
|
391
|
+
firstColorCustom={theme.colors.red}
|
|
392
|
+
secondColorCustom={theme.colors.green}
|
|
393
|
+
widthButton={'45%'}
|
|
394
|
+
/>
|
|
395
|
+
</>
|
|
396
|
+
)}
|
|
397
|
+
{showFloatButtonsAcceptOrReject[order?.status] && (
|
|
398
|
+
<FloatingButton
|
|
399
|
+
btnText={t('REJECT', 'Reject')}
|
|
400
|
+
isSecondaryBtn={false}
|
|
401
|
+
secondButtonClick={() => (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))) ? handleAcceptLogisticOrder(order) : handleViewActionOrder('accept')}
|
|
402
|
+
firstButtonClick={() => order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status)) ? handleRejectLogisticOrder() : handleViewActionOrder('reject')}
|
|
403
|
+
secondBtnText={t('ACCEPT', 'Accept')}
|
|
404
|
+
secondButton={true}
|
|
405
|
+
firstColorCustom={theme.colors.red}
|
|
406
|
+
secondColorCustom={theme.colors.green}
|
|
407
|
+
widthButton={'45%'}
|
|
408
|
+
/>
|
|
409
|
+
)}
|
|
410
|
+
</>
|
|
411
|
+
)}
|
|
412
|
+
{openModalForMapView && (
|
|
413
|
+
<OModal
|
|
414
|
+
open={openModalForMapView}
|
|
415
|
+
onClose={() => handleOpenMapView()}
|
|
416
|
+
entireModal
|
|
417
|
+
customClose>
|
|
418
|
+
<DriverMap
|
|
419
|
+
navigation={navigation}
|
|
420
|
+
order={order}
|
|
421
|
+
orderStatus={getOrderStatus(order?.status, t)?.value || ''}
|
|
422
|
+
location={locationMarker}
|
|
423
|
+
readOnly
|
|
424
|
+
updateDriverPosition={updateDriverPosition}
|
|
425
|
+
driverUpdateLocation={driverUpdateLocation}
|
|
426
|
+
setDriverUpdateLocation={setDriverUpdateLocation}
|
|
427
|
+
handleViewActionOrder={handleViewActionOrder}
|
|
428
|
+
isBusinessMarker={isBusinessMarker}
|
|
429
|
+
isToFollow={isToFollow}
|
|
430
|
+
showAcceptOrReject={
|
|
431
|
+
showFloatButtonsAcceptOrReject[order?.status]
|
|
383
432
|
}
|
|
384
|
-
|
|
385
|
-
|
|
433
|
+
handleOpenMapView={handleOpenMapView}
|
|
434
|
+
/>
|
|
435
|
+
</OModal>
|
|
436
|
+
)}
|
|
437
|
+
{openModalForBusiness && (
|
|
438
|
+
<OModal
|
|
439
|
+
open={openModalForBusiness}
|
|
440
|
+
order={order}
|
|
441
|
+
title={`${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id}`}
|
|
442
|
+
entireModal
|
|
443
|
+
onClose={() => handleCloseModal()}>
|
|
444
|
+
<Chat
|
|
445
|
+
type={
|
|
446
|
+
openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER
|
|
386
447
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
widthButton={'45%'}
|
|
448
|
+
orderId={order?.id}
|
|
449
|
+
messages={messages}
|
|
450
|
+
order={order}
|
|
451
|
+
setMessages={setMessages}
|
|
392
452
|
/>
|
|
393
|
-
|
|
453
|
+
</OModal>
|
|
394
454
|
)}
|
|
395
|
-
{
|
|
396
|
-
<
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
455
|
+
{openModalForAccept && (
|
|
456
|
+
<OModal
|
|
457
|
+
open={openModalForAccept}
|
|
458
|
+
onClose={() => setOpenModalForAccept(false)}
|
|
459
|
+
entireModal
|
|
460
|
+
customClose>
|
|
461
|
+
<AcceptOrRejectOrder
|
|
462
|
+
handleUpdateOrder={handleChangeOrderStatus}
|
|
463
|
+
closeModal={setOpenModalForAccept}
|
|
464
|
+
customerCellphone={order?.customer?.cellphone}
|
|
465
|
+
loading={props.order?.loading}
|
|
466
|
+
action={actionOrder}
|
|
467
|
+
orderId={order?.id}
|
|
468
|
+
notShowCustomerPhone
|
|
469
|
+
actions={actions}
|
|
470
|
+
orderTitle={orderTitle}
|
|
471
|
+
appTitle={appTitle}
|
|
472
|
+
/>
|
|
473
|
+
</OModal>
|
|
407
474
|
)}
|
|
408
|
-
|
|
409
|
-
)}
|
|
410
|
-
{openModalForMapView && (
|
|
411
|
-
<OModal
|
|
412
|
-
open={openModalForMapView}
|
|
413
|
-
onClose={() => handleOpenMapView()}
|
|
414
|
-
entireModal
|
|
415
|
-
customClose>
|
|
416
|
-
<DriverMap
|
|
417
|
-
navigation={navigation}
|
|
418
|
-
order={order}
|
|
419
|
-
orderStatus={getOrderStatus(order?.status, t)?.value || ''}
|
|
420
|
-
location={locationMarker}
|
|
421
|
-
readOnly
|
|
422
|
-
updateDriverPosition={updateDriverPosition}
|
|
423
|
-
driverUpdateLocation={driverUpdateLocation}
|
|
424
|
-
setDriverUpdateLocation={setDriverUpdateLocation}
|
|
425
|
-
handleViewActionOrder={handleViewActionOrder}
|
|
426
|
-
isBusinessMarker={isBusinessMarker}
|
|
427
|
-
isToFollow={isToFollow}
|
|
428
|
-
showAcceptOrReject={
|
|
429
|
-
showFloatButtonsAcceptOrReject[order?.status]
|
|
430
|
-
}
|
|
431
|
-
handleOpenMapView={handleOpenMapView}
|
|
432
|
-
/>
|
|
433
|
-
</OModal>
|
|
434
|
-
)}
|
|
435
|
-
{openModalForBusiness && (
|
|
436
|
-
<OModal
|
|
437
|
-
open={openModalForBusiness}
|
|
438
|
-
order={order}
|
|
439
|
-
title={`${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id}`}
|
|
440
|
-
entireModal
|
|
441
|
-
onClose={() => handleCloseModal()}>
|
|
442
|
-
<Chat
|
|
443
|
-
type={
|
|
444
|
-
openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER
|
|
445
|
-
}
|
|
446
|
-
orderId={order?.id}
|
|
447
|
-
messages={messages}
|
|
448
|
-
order={order}
|
|
449
|
-
setMessages={setMessages}
|
|
450
|
-
/>
|
|
451
|
-
</OModal>
|
|
452
|
-
)}
|
|
453
|
-
{openModalForAccept && (
|
|
454
|
-
<OModal
|
|
455
|
-
open={openModalForAccept}
|
|
456
|
-
onClose={() => setOpenModalForAccept(false)}
|
|
457
|
-
entireModal
|
|
458
|
-
customClose>
|
|
459
|
-
<AcceptOrRejectOrder
|
|
460
|
-
handleUpdateOrder={handleChangeOrderStatus}
|
|
461
|
-
closeModal={setOpenModalForAccept}
|
|
462
|
-
customerCellphone={order?.customer?.cellphone}
|
|
463
|
-
loading={props.order?.loading}
|
|
464
|
-
action={actionOrder}
|
|
465
|
-
orderId={order?.id}
|
|
466
|
-
notShowCustomerPhone
|
|
467
|
-
actions={actions}
|
|
468
|
-
orderTitle={orderTitle}
|
|
469
|
-
appTitle={appTitle}
|
|
470
|
-
/>
|
|
471
|
-
</OModal>
|
|
475
|
+
</View>
|
|
472
476
|
)}
|
|
473
|
-
</View>
|
|
474
477
|
{alertState?.open && (
|
|
475
478
|
<Alert
|
|
476
479
|
open={alertState.open}
|
|
@@ -175,7 +175,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
175
175
|
)}
|
|
176
176
|
</>
|
|
177
177
|
</OText>
|
|
178
|
-
{!order?.isLogistic && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
178
|
+
{!order?.isLogistic && order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
179
179
|
<OText size={13}>
|
|
180
180
|
{`${order?.paymethod?.name} - ${order.delivery_type === 1
|
|
181
181
|
? t('DELIVERY', 'Delivery')
|