ordering-ui-react-native 0.16.52-release → 0.16.53-release
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
|
@@ -519,6 +519,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
519
519
|
style={{ borderRadius: 7, height: 45 }}
|
|
520
520
|
parentStyle={{ width: '100%' }}
|
|
521
521
|
textStyle={{color: '#FFF', fontSize: 18 }}
|
|
522
|
+
isDisabled={!rejectReason && showTextArea}
|
|
522
523
|
onClick={() => handleAcceptOrReject()}
|
|
523
524
|
/>
|
|
524
525
|
</View>
|
|
@@ -39,6 +39,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
39
39
|
|
|
40
40
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
41
41
|
const viewMapStatus = [9, 18, 19, 23]
|
|
42
|
+
const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
|
|
43
|
+
const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
|
|
42
44
|
|
|
43
45
|
const handlePressOrder = (order: any) => {
|
|
44
46
|
if (order?.locked && isLogisticOrder) return
|
|
@@ -242,8 +244,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
242
244
|
/>
|
|
243
245
|
</AcceptOrRejectOrderStyle>
|
|
244
246
|
)}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
{_ordersGrouped[k][0]?.status === 7 && (
|
|
248
|
+
<View>
|
|
247
249
|
<OButton
|
|
248
250
|
text={t('READY_FOR_PICKUP', 'Ready for pickup')}
|
|
249
251
|
bgColor={theme.colors.primaryLight}
|
|
@@ -257,10 +259,51 @@ export const PreviousOrders = (props: any) => {
|
|
|
257
259
|
_ordersGrouped[k].map((o: any) => o.id),
|
|
258
260
|
)}
|
|
259
261
|
/>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
</View>
|
|
263
|
+
)}
|
|
264
|
+
{(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
|
|
265
|
+
_ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
266
|
+
(
|
|
267
|
+
<AcceptOrRejectOrderStyle>
|
|
268
|
+
<OButton
|
|
269
|
+
text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
|
|
270
|
+
bgColor={theme.colors.btnBGWhite}
|
|
271
|
+
borderColor={theme.colors.btnBGWhite}
|
|
272
|
+
imgRightSrc={null}
|
|
273
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
274
|
+
parentStyle={{ width: '100%' }}
|
|
275
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
276
|
+
onClick={() => handleChangeOrderStatus(
|
|
277
|
+
3,
|
|
278
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
279
|
+
)}
|
|
280
|
+
/>
|
|
281
|
+
</AcceptOrRejectOrderStyle>
|
|
282
|
+
)}
|
|
283
|
+
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
284
|
+
(
|
|
285
|
+
<AcceptOrRejectOrderStyle>
|
|
286
|
+
<OButton
|
|
287
|
+
text={t('ORDER_NOT_READY', 'Order not ready')}
|
|
288
|
+
bgColor={theme.colors.red}
|
|
289
|
+
borderColor={theme.colors.red}
|
|
290
|
+
imgRightSrc={null}
|
|
291
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
292
|
+
parentStyle={{ width: '100%' }}
|
|
293
|
+
textStyle={{ color: theme.colors.white, fontSize: 12 }}
|
|
294
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
295
|
+
action: 'notReady',
|
|
296
|
+
order: _ordersGrouped[k][0],
|
|
297
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
298
|
+
handleChangeOrderStatus
|
|
299
|
+
})}
|
|
300
|
+
/>
|
|
301
|
+
</AcceptOrRejectOrderStyle>
|
|
302
|
+
)}
|
|
303
|
+
{viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
|
|
304
|
+
props.appTitle?.text?.includes('Business') &&
|
|
305
|
+
(
|
|
306
|
+
<View>
|
|
264
307
|
<OButton
|
|
265
308
|
text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
|
|
266
309
|
bgColor={theme.colors.primaryLight}
|
|
@@ -271,8 +314,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
271
314
|
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
272
315
|
onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
|
|
273
316
|
/>
|
|
274
|
-
|
|
275
|
-
|
|
317
|
+
</View>
|
|
318
|
+
)}
|
|
276
319
|
{_ordersGrouped[k][0]?.status === 4 &&
|
|
277
320
|
![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
|
|
278
321
|
(
|
|
@@ -323,6 +366,70 @@ export const PreviousOrders = (props: any) => {
|
|
|
323
366
|
})}
|
|
324
367
|
/>
|
|
325
368
|
)}
|
|
369
|
+
{deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
|
|
370
|
+
<AcceptOrRejectOrderStyle>
|
|
371
|
+
<OButton
|
|
372
|
+
text={t('PICKUP_FAILED', 'Pickup failed')}
|
|
373
|
+
bgColor={theme.colors.danger100}
|
|
374
|
+
borderColor={theme.colors.danger100}
|
|
375
|
+
imgRightSrc={null}
|
|
376
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
377
|
+
parentStyle={{ width: '45%' }}
|
|
378
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
379
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
380
|
+
action: 'pickupFailed',
|
|
381
|
+
order: _ordersGrouped[k][0],
|
|
382
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
383
|
+
handleChangeOrderStatus
|
|
384
|
+
})}
|
|
385
|
+
/>
|
|
386
|
+
<OButton
|
|
387
|
+
text={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
388
|
+
bgColor={theme.colors.success100}
|
|
389
|
+
borderColor={theme.colors.success100}
|
|
390
|
+
imgRightSrc={null}
|
|
391
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
392
|
+
parentStyle={{ width: '45%' }}
|
|
393
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
394
|
+
onClick={() => handleChangeOrderStatus(
|
|
395
|
+
9,
|
|
396
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
397
|
+
)}
|
|
398
|
+
/>
|
|
399
|
+
</AcceptOrRejectOrderStyle>
|
|
400
|
+
)}
|
|
401
|
+
{deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
|
|
402
|
+
<AcceptOrRejectOrderStyle>
|
|
403
|
+
<OButton
|
|
404
|
+
text={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
405
|
+
bgColor={theme.colors.danger100}
|
|
406
|
+
borderColor={theme.colors.danger100}
|
|
407
|
+
imgRightSrc={null}
|
|
408
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
409
|
+
parentStyle={{ width: '45%' }}
|
|
410
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
411
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
412
|
+
action: 'deliveryFailed',
|
|
413
|
+
order: _ordersGrouped[k][0],
|
|
414
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
415
|
+
handleChangeOrderStatus
|
|
416
|
+
})}
|
|
417
|
+
/>
|
|
418
|
+
<OButton
|
|
419
|
+
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
420
|
+
bgColor={theme.colors.success100}
|
|
421
|
+
borderColor={theme.colors.success100}
|
|
422
|
+
imgRightSrc={null}
|
|
423
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
424
|
+
parentStyle={{ width: '45%' }}
|
|
425
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
426
|
+
onClick={() => handleChangeOrderStatus(
|
|
427
|
+
11,
|
|
428
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
429
|
+
)}
|
|
430
|
+
/>
|
|
431
|
+
</AcceptOrRejectOrderStyle>
|
|
432
|
+
)}
|
|
326
433
|
</OrdersGroupedItem>
|
|
327
434
|
))}
|
|
328
435
|
</View>
|
|
@@ -33,7 +33,7 @@ export const NotificationIcon = styled.View`
|
|
|
33
33
|
export const AcceptOrRejectOrder = styled.View`
|
|
34
34
|
flex-direction: row;
|
|
35
35
|
justify-content: space-between;
|
|
36
|
-
margin:
|
|
36
|
+
margin: ${(props: any) => props.m ?? 10}px;
|
|
37
37
|
`
|
|
38
38
|
export const Timestatus = styled.View`
|
|
39
39
|
position: relative;;
|