Commit b981c88f by Adarsh K

sprint 2

parent 68241888
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<preference name="android-minSdkVersion" value="19" /> <preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" /> <preference name="BackupWebStorage" value="none" />
<preference name="orientation" value="portrait" /> <preference name="orientation" value="portrait" />
<preference name="ShowSplashScreenSpinner" value="false"/> <preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashMaintainAspectRatio" value="true" /> <preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" /> <preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" /> <preference name="SplashShowOnlyFirstTime" value="false" />
......
...@@ -14,7 +14,7 @@ import { HomePage } from './home.page'; ...@@ -14,7 +14,7 @@ import { HomePage } from './home.page';
IonicModule, IonicModule,
AgmDirectionModule, AgmDirectionModule,
AgmCoreModule.forRoot({ AgmCoreModule.forRoot({
apiKey: 'AIzaSyAK3Av2e2dunqInYEaAVJPmzK5HTi0gubw' apiKey: 'AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE'
}), }),
RouterModule.forChild([ RouterModule.forChild([
{ {
......
...@@ -55,30 +55,22 @@ ...@@ -55,30 +55,22 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<hr> <hr>
<!-- <div class="items_div"> <div class="items_div">
<ion-row> <ion-row *ngFor="let product of order.product">
<ion-col class="textLeft">
<input class="styled-checkbox" id="styled-checkbox-1" type="checkbox" value="value1">
<label for="styled-checkbox-1">Men's Shirt</label>
</ion-col>
<ion-col class="textRight">
<p>AU$ 88</p>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="textLeft"> <ion-col class="textLeft">
<input class="styled-checkbox" id="styled-checkbox-2" type="checkbox" value="value2"> <input class="styled-checkbox" id="styled-checkbox-1" type="checkbox" value="value1" checked disabled>
<label for="styled-checkbox-2">Men's Jeans</label> <label for="styled-checkbox-1">{{product.prodName}}</label>
</ion-col> </ion-col>
<ion-col class="textRight"> <ion-col class="textRight">
<p>AU$ 72</p> <p>A$ {{product.price}}</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> --> </div>
<div class="time"> <div class="time">
<strong>05</strong>Mnt <strong>05</strong>Mnt
</div> </div>
<div class="reach_btn" (click)="next(5)">PRODUCT COLLECTED</div> <div class="reach_btn" (click)="next(5)" *ngIf="shopperState==3">PRODUCT COLLECTED</div>
<div *ngIf="shopperState < 3" class="awaiting_response">Awaiting Product Packed</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -119,23 +111,23 @@ ...@@ -119,23 +111,23 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<hr> <hr>
<!-- <div class="items_div"> <div class="items_div">
<ion-row> <ion-row>
<ion-col class="textLeft"> <ion-col class="textLeft">
<h4>Products</h4> <h4>Products</h4>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row *ngFor="let product of order.product">
<ion-col class="textLeft"> <ion-col class="textLeft">
<label for="styled-checkbox-1">Men's Shirt</label> <label for="styled-checkbox-1">{{product.prodName}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <!-- <ion-row>
<ion-col class="textLeft"> <ion-col class="textLeft">
<label for="styled-checkbox-2">Men's Jeans</label> <label for="styled-checkbox-2">Men's Jeans</label>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
</div> --> </div>
<div class="time"> <div class="time">
<strong>05</strong>Mnt <strong>05</strong>Mnt
</div> </div>
...@@ -158,7 +150,12 @@ ...@@ -158,7 +150,12 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<hr> <hr>
Awaiting Customer Approval <div *ngIf="!retry" class="awaiting_response">Awaiting Customer Approval</div>
<div *ngIf="retry">
<div class="customer_reject">Customer Rejected</div>
<button class="reject_btn" (click)="next(7)">Re-Request</button>
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -307,6 +307,23 @@ ...@@ -307,6 +307,23 @@
border-bottom-left-radius: 15px; border-bottom-left-radius: 15px;
} }
} }
.awaiting_response{
color: #a8a8a8;
padding: 15px;
}
.customer_reject{
color:rgba(255, 71, 87, 1);
padding: 15px;
}
.reject_btn{
width: 100%;
color:rgba(255, 71, 87, 1);
border:1px solid rgba(255, 71, 87, 1);
font-size: 20px;
padding: 15px;
background: transparent;
}
} }
} }
} }
\ No newline at end of file
...@@ -24,6 +24,8 @@ export class RiderloungePage implements OnInit { ...@@ -24,6 +24,8 @@ export class RiderloungePage implements OnInit {
public destination: any; public destination: any;
public renderOptions: any; public renderOptions: any;
public markerOptions: any; public markerOptions: any;
retry = false;
shopperState: number;
deliveryStatus: any; deliveryStatus: any;
...@@ -32,7 +34,10 @@ export class RiderloungePage implements OnInit { ...@@ -32,7 +34,10 @@ export class RiderloungePage implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private location: Location, private location: Location,
public myorder: MyordersService public myorder: MyordersService
) { } ) {
this.retry = false;
this.shopperState = 0;
}
...@@ -83,14 +88,18 @@ export class RiderloungePage implements OnInit { ...@@ -83,14 +88,18 @@ export class RiderloungePage implements OnInit {
next(status: number) { next(status: number) {
this.retry = false;
this.myorder.rideStatus(status).then((data) => { this.myorder.rideStatus(status).then((data) => {
if (status === 7) { if (status === 7 || status === 4) {
this.myorder.getStatus(this.myorder.selItem.orderId).subscribe((res) => { this.myorder.getStatus(this.myorder.selItem.orderId).subscribe((res) => {
console.log(res); console.log(res);
this.shopperState = res[0].shopperState;
if (res[0].orderStatus === 9) { if (res[0].orderStatus === 9) {
this.myorder.rideChange(this.myorder.selItem.orderId, 0); this.myorder.rideChange(this.myorder.selItem.orderId, 0);
this.goToPage('complete'); this.goToPage('complete');
} } else if (res[0].orderStatus === 10) {
this.retry = true;
} else {}
}); });
} }
this.slides.slideNext(); this.slides.slideNext();
......
...@@ -25,9 +25,11 @@ export class AuthService { ...@@ -25,9 +25,11 @@ export class AuthService {
if (user) { if (user) {
this.userData = user; this.userData = user;
this.service.set('user', JSON.stringify(this.userData)); this.service.set('user', JSON.stringify(this.userData));
this.router.navigateByUrl('home');
} else { } else {
this.service.set('user', null); this.service.set('user', null);
JSON.parse(localStorage.getItem('user')); JSON.parse(localStorage.getItem('user'));
this.router.navigateByUrl('login');
} }
}); });
} }
...@@ -35,7 +37,6 @@ export class AuthService { ...@@ -35,7 +37,6 @@ export class AuthService {
public async SignIn(email: string, password: string) { public async SignIn(email: string, password: string) {
return this.afAuth.auth.signInWithEmailAndPassword(email, password).then((result) => { return this.afAuth.auth.signInWithEmailAndPassword(email, password).then((result) => {
console.log('success'); console.log('success');
this.router.navigateByUrl('home');
this.SetUserData(result.user); this.SetUserData(result.user);
}).catch((error) => { }).catch((error) => {
window.alert(error.message); window.alert(error.message);
......
...@@ -47,11 +47,7 @@ export class MyordersService { ...@@ -47,11 +47,7 @@ export class MyordersService {
res.forEach((item) => { res.forEach((item) => {
console.log(item); console.log(item);
const order: Myorder = { const order: Myorder = {
prodName: item.prodName,
color: item.color,
image: item.image,
amount: item.amount, amount: item.amount,
qty: item.qty,
status: item.status, status: item.status,
orderStatus: item.orderStatus, orderStatus: item.orderStatus,
bookDate: item.bookDate, bookDate: item.bookDate,
...@@ -62,7 +58,7 @@ export class MyordersService { ...@@ -62,7 +58,7 @@ export class MyordersService {
riderName: 'John', riderName: 'John',
orderId: item.orderId, orderId: item.orderId,
orderCode: item.orderCode, orderCode: item.orderCode,
size: item.size, product: this.service.key2Array(item.product),
time: '60' time: '60'
}; };
this.orders.push(order); this.orders.push(order);
......
export interface Myorder { export interface Myorder {
amount: string; amount: string;
prodName: any;
image: string;
size: string;
color: string;
qty: number;
bookDate: any; bookDate: any;
pickupAddress: string; pickupAddress: string;
pickupLocation: any; pickupLocation: any;
...@@ -16,5 +11,6 @@ export interface Myorder { ...@@ -16,5 +11,6 @@ export interface Myorder {
orderStatus: number; orderStatus: number;
riderName: string; riderName: string;
time: string; time: string;
product: any;
} }
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