Commit 9db80bc1 by Adarsh K

awaiting customer approval

parent c026171d
......@@ -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" />
......
......@@ -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();
});
}
......
......@@ -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>
......
......@@ -85,11 +85,15 @@ export class RiderloungePage implements OnInit {
next(status: number) {
this.myorder.rideStatus(status).then((data) => {
if (status === 7) {
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');
} else {
this.slides.slideNext();
}
});
}
this.slides.slideNext();
this.myorder.selItem.orderStatus = status;
});
}
......
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment