From 9db80bc120f845f49526bace97faf333a2503f6d Mon Sep 17 00:00:00 2001 From: Adarsh K <adarsh@techware.in> Date: Wed, 4 Sep 2019 16:04:05 +0530 Subject: [PATCH] awaiting customer approval --- config.xml | 2 ++ src/app/app.component.ts | 3 ++- src/app/riderlounge/riderlounge.page.html | 19 +++++++++++++++++++ src/app/riderlounge/riderlounge.page.ts | 12 ++++++++---- src/config/myorder.service.ts | 7 +++++++ 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/config.xml b/config.xml index 941cce6..ecb15eb 100644 --- a/config.xml +++ b/config.xml @@ -14,6 +14,8 @@ <preference name="ScrollEnabled" value="false" /> <preference name="android-minSdkVersion" value="19" /> <preference name="BackupWebStorage" value="none" /> + <preference name="orientation" value="portrait" /> + <preference name="ShowSplashScreenSpinner" value="false"/> <preference name="SplashMaintainAspectRatio" value="true" /> <preference name="FadeSplashScreenDuration" value="300" /> <preference name="SplashShowOnlyFirstTime" value="false" /> diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ccae707..73b186e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -21,7 +21,8 @@ export class AppComponent { this.platform.ready().then(() => { this.statusBar.styleDefault(); this.splashScreen.hide(); - this.statusBar.overlaysWebView(false); + this.statusBar.overlaysWebView(true); + this.statusBar.hide(); }); } diff --git a/src/app/riderlounge/riderlounge.page.html b/src/app/riderlounge/riderlounge.page.html index fc1c029..a2cc015 100644 --- a/src/app/riderlounge/riderlounge.page.html +++ b/src/app/riderlounge/riderlounge.page.html @@ -143,6 +143,25 @@ </div> </div> </ion-slide> + + <ion-slide> + <div class="order_acceptance"> + <div class="order_acceptance_inner"> + <div class="order_place pt0"> + <div class="order_place_image"></div> + <div class="order_place_detail" style="width: calc(100% - 90px);"> + <h5>John Doe</h5> + <p>{{order.deliveryAddress}}</p> + </div> + <div class="toggle_btn floatRight" (click)="goToPage('ridedetails')"></div> + <div class="clear"></div> + </div> + <hr> + Awaiting for customer approval + <div class="clear"></div> + </div> + </div> + </ion-slide> </ion-slides> </div> </div> diff --git a/src/app/riderlounge/riderlounge.page.ts b/src/app/riderlounge/riderlounge.page.ts index c2d8771..13f7ad1 100644 --- a/src/app/riderlounge/riderlounge.page.ts +++ b/src/app/riderlounge/riderlounge.page.ts @@ -85,11 +85,15 @@ export class RiderloungePage implements OnInit { next(status: number) { this.myorder.rideStatus(status).then((data) => { if (status === 7) { - this.myorder.rideChange(this.myorder.selItem.orderId, 0); - this.goToPage('complete'); - } else { - this.slides.slideNext(); + this.myorder.getStatus(this.myorder.selItem.orderId).subscribe((res) => { + console.log(res); + if (res[0].orderStatus === 9) { + this.myorder.rideChange(this.myorder.selItem.orderId, 0); + this.goToPage('complete'); + } + }); } + this.slides.slideNext(); this.myorder.selItem.orderStatus = status; }); } diff --git a/src/config/myorder.service.ts b/src/config/myorder.service.ts index f3b4879..9fea5a9 100644 --- a/src/config/myorder.service.ts +++ b/src/config/myorder.service.ts @@ -3,6 +3,7 @@ import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection import { Myorder } from './services/myorder'; import { ServiceService } from './../config/service.service'; import * as firebase from 'firebase'; +import { Observable, Subject } from 'rxjs'; @Injectable({ providedIn: 'root' @@ -17,6 +18,7 @@ export class MyordersService { public afs: AngularFirestore, public service: ServiceService ) { + this.riderId = 'LVIMCEdUOGMzYxISL5OkMUPD35Q2'; const users = this.service.get('user').then((data) => { if (data) { data = JSON.parse(data); @@ -97,6 +99,11 @@ export class MyordersService { } } + public getStatus(orderId): Observable<any> { + const orderRef: AngularFirestoreCollection<any> = this.afs.collection('orders', ref => ref.where('orderId', '==', orderId)); + return orderRef.valueChanges(); + } + public async rideReject(riderId: string) { this.afs.collection('orders').doc(riderId).update({riderId: ''}).then(() => { console.log('Booking Rejected'); -- libgit2 0.27.1