Commit 29e7fbd8 authored by alish's avatar alish
Browse files

feat: back to product on processing order

parent 3fdfee32
Loading
Loading
Loading
Loading
+26 −19
Original line number Diff line number Diff line
@@ -9,6 +9,12 @@
	>
		<div class="top">{{ 'TO' | translate }}: {{ customerAddress }}</div>
		<div class="bottom">{{ createdAt | date: 'short' }}</div>
		<span *ngIf="inProcessing">
			<small class="delivery-time pending">{{
				'PENDING' | translate
			}}</small>
		</span>
		<span *ngIf="!inProcessing">
			<span *ngIf="!isTakeaway">
				<small *ngIf="deliveryTime" class="delivery-time">
					{{ deliveryTime }}</small
@@ -29,6 +35,7 @@
			<small *ngIf="isTakeaway" class="delivery-time">{{
				'COMPLETED' | translate
			}}</small>
		</span>
	</section>

	<section class="total-price">${{ totalPrice || '0' }}</section>
+5 −0
Original line number Diff line number Diff line
@@ -25,11 +25,16 @@
			display: inline-block;
			color: #000000;
			opacity: 0.54;
			margin-right: 3px;
		}

		.delivery-time {
			color: #008f0e;
			opacity: 0.73;

			&.pending {
				color: #488aff;
			}
		}

		.order-issue {
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ export class OrderComponent {
		);
	}

	get inProcessing() {
		return this.order && this.order.status < OrderStatus.Delivered;
	}

	get isTakeaway() {
		return (
			this.order &&
+1 −1
Original line number Diff line number Diff line
<e-cu-order-info-header (back)="undo()"></e-cu-order-info-header>
<e-cu-order-info-header (back)="backToProducts()"></e-cu-order-info-header>

<ion-content
	class="info-container brand-dark"
+12 −4
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ export class OrderInfoPage implements OnInit, OnDestroy {

	public modalOpen: boolean;
	public modalChange = new EventEmitter<boolean>();

	private clearOrder = true;
	private readonly ngDestroy$ = new Subject<void>();

	private _pageSubscriptions: Subscription[] = [];
@@ -274,9 +276,12 @@ export class OrderInfoPage implements OnInit, OnDestroy {
	}

	undo() {
		// this.showCancelOrderInfoModal();
		this.showCancelOrderInfoModal();
	}

		this.router.navigate(['/products']);
	backToProducts() {
		this.clearOrder = false;
		this.router.navigateByUrl('/products', { skipLocationChange: true });
	}

	private async showCancelOrderInfoModal(): Promise<void> {
@@ -294,9 +299,12 @@ export class OrderInfoPage implements OnInit, OnDestroy {
	async closePopup() {
		localStorage.removeItem('startDate');
		localStorage.removeItem('endTime');

		if (this.clearOrder) {
			this.store.orderId = null;
			this.router.navigate(['/products']);
		}
	}

	// For delivery-status
	private _trackOrder() {
Loading