Commit 09c28336 by Alen Jose

july-10

parent b713fec9
...@@ -143,9 +143,9 @@ export class MyApp { ...@@ -143,9 +143,9 @@ export class MyApp {
var additionalData = data.notification.payload.additionalData var additionalData = data.notification.payload.additionalData
this.storage.get('driver_data').then((user_data) => { this.storage.get('driver_data').then((user_data) => {
if(user_data) if(user_data)
this.nav.setRoot('QuickridePage', { id: additionalData.bookingId}) this.nav.push('QuickridePage', { id: additionalData.bookingId, from: additionalData.from})
else else
this.nav.setRoot('SigninPage', { id: additionalData.bookingId }) this.nav.setRoot('SigninPage', { id: additionalData.bookingId, from: additionalData.from })
}) })
}); });
......
...@@ -4,6 +4,7 @@ import { Myservice } from "../../providers/myservice"; ...@@ -4,6 +4,7 @@ import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel"; import { driver } from "../../models/mymodel";
import { Toast } from '@ionic-native/toast'; import { Toast } from '@ionic-native/toast';
import { dataService } from "../../providers/common.service";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -14,27 +15,28 @@ export class DocupdatePage { ...@@ -14,27 +15,28 @@ export class DocupdatePage {
title: string = this.navParams.get('title') title: string = this.navParams.get('title')
formdata = new FormData(); formdata = new FormData();
filename: string; filename: string;
local: driver local: driver;
myData = { 'id': '', 'secret_key': 'My_key', 'field': this.navParams.get('title') }
fileData: any; fileData: any;
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast) { constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast, private comService: dataService) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.fileData = this.comService.getdocData();
this.storage.get('driver_data').then(data => { this.storage.get('driver_data').then(data => {
if (data) { if (data) {
this.myservice.hide_loader()
this.local = data this.local = data
this.myData.id = data.id
this.myservice.load_post({ id: data.id, field: this.title }, 'getDocument').subscribe(response => { // if (response.status == 'success') {
this.myservice.hide_loader() // document.getElementById("upld_btn").textContent = 'UPDATE'
if (response.status == 'success') { // this.fileData = response.data
document.getElementById("upld_btn").textContent = 'UPDATE' // }
this.fileData = response.data // else{
} // document.getElementById("upld_btn").textContent = 'UPLOAD'
else // }
document.getElementById("upld_btn").textContent = 'UPLOAD'
})
} }
}) })
} }
...@@ -61,16 +63,16 @@ export class DocupdatePage { ...@@ -61,16 +63,16 @@ export class DocupdatePage {
upload() { upload() {
this.myservice.show_loader() this.myservice.show_loader()
this.formdata.append('data', JSON.stringify(this.myData)); // this.formdata.append('data', JSON.stringify(this.myData));
if (this.fileData) if (this.fileData)
this.formdata.append('id', JSON.stringify(this.fileData.id)); this.formdata.append('id', JSON.stringify(this.fileData.id));
this.myservice.fileUpload(this.formdata, 'driverDocUpload').subscribe(resp => { this.myservice.fileUpload(this.formdata, 'driverDocUpload').subscribe(resp => {
this.myservice.hide_loader() this.myservice.hide_loader()
if (resp.status == 'success') { if (resp.status == 'success') {
// this.toast.show(response.message, '2000', 'center').subscribe(toast => { // this.toast.show(resp.message, '2000', 'center').subscribe(toast => {
// console.log(toast); // console.log(toast);
// }); // });
} }
else else
this.myservice.show_alert('', resp.message); this.myservice.show_alert('', resp.message);
......
...@@ -19,6 +19,9 @@ baseurl = this.myservice.base_url ...@@ -19,6 +19,9 @@ baseurl = this.myservice.base_url
} }
ionViewDidEnter(){ ionViewDidEnter(){
if (this.navParams.get('id'))
this.navCtrl.push('QuickridePage', { id: this.navParams.get('id'), from: this.navParams.get('from') })
this.myservice.show_loader() this.myservice.show_loader()
this.storage.get('driver_data').then(data=>{ this.storage.get('driver_data').then(data=>{
if(data){ if(data){
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<h5>You have a ride request</h5> <h5>You have a ride request</h5>
<hr> <hr>
<div class="jr_search_profile"> <div class="jr_search_profile">
<img > <img [src]=baseUrl+rideDetail?.image >
</div> </div>
<div class="jr_search_profile_detail"> <div class="jr_search_profile_detail">
<br> <br>
...@@ -39,12 +39,13 @@ ...@@ -39,12 +39,13 @@
<div class="jr_clear"></div> <div class="jr_clear"></div>
</li> </li>
</div> </div>
<p class="time">Day : <strong>{{rideDetail?.pickup_date| date:'dd/MM/yy'}} - {{rideDetail?.pickup_time}}</strong></p>
<div class="jr_bottom_button_bay"> <div class="jr_bottom_button_bay">
<button ion-button class="cab_footer_btn floatLeft accept" (click)="accept()">Accept</button> <button ion-button class="cab_footer_btn floatLeft accept" (click)="accept()" *ngIf="!pickUp">Accept</button>
<button ion-button class="cab_footer_btn floatRight reject" (click)="reject()">Reject</button> <button ion-button class="cab_footer_btn floatRight reject" (click)="reject()" *ngIf="!pickUp">Reject</button>
<button ion-button class="cab_footer_btn width100" (click)="accept()">Pick Up</button> <button ion-button class="cab_footer_btn width100" (click)="pick()" *ngIf="pickUp">Pick Up</button>
</div> </div>
</div> </div>
......
...@@ -399,4 +399,7 @@ margin-top:10px; ...@@ -399,4 +399,7 @@ margin-top:10px;
background: url("../assets/img/greydot.png"); background: url("../assets/img/greydot.png");
} }
.width100{width: 100% !important} .width100{width: 100% !important}
.time{ color: #595959;
font-weight: 400;}
.time strong{font-size: 15px;}
} }
...@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular'; ...@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel"; import { driver } from "../../models/mymodel";
import { dataService } from "../../providers/common.service";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -13,8 +14,9 @@ export class QuickridePage { ...@@ -13,8 +14,9 @@ export class QuickridePage {
bookingId = this.navParams.get('id') bookingId = this.navParams.get('id')
rideDetail:any; rideDetail:any;
local:driver local:driver
baseUrl = this.myservice.base_url
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage) { constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private data: dataService) {
} }
ionViewDidEnter() { ionViewDidEnter() {
...@@ -38,6 +40,8 @@ export class QuickridePage { ...@@ -38,6 +40,8 @@ export class QuickridePage {
var temp = this.rideDetail.drop_area.split(',') var temp = this.rideDetail.drop_area.split(',')
this.rideDetail.to = temp[0] this.rideDetail.to = temp[0]
this.rideDetail.toAd = this.rideDetail.drop_area this.rideDetail.toAd = this.rideDetail.drop_area
this.data.setrideData(this.rideDetail)
} }
}) })
} }
...@@ -45,13 +49,21 @@ export class QuickridePage { ...@@ -45,13 +49,21 @@ export class QuickridePage {
accept(){ accept(){
this.myservice.load_post({ bookingId: this.bookingId,driverId:this.local.id},'rideAccept').subscribe(resp=>{ this.myservice.load_post({ bookingId: this.bookingId,driverId:this.local.id},'rideAccept').subscribe(resp=>{
if(resp.status == 'success'){ if(resp.status == 'success'){
this.navCtrl.pop()
}
else{
this.myservice.show_alert('','Please try again')
} }
}) })
} }
reject(){ reject(){
this.navCtrl.pop();
}
pick(){
this.myservice.show_loader()
this.navCtrl.push('UserlocationPage')
} }
back(){ back(){
......
...@@ -40,7 +40,7 @@ export class SigninPage { ...@@ -40,7 +40,7 @@ export class SigninPage {
This.myservice.hide_loader(); This.myservice.hide_loader();
This.events.publish('driver:profile', response[0].data); This.events.publish('driver:profile', response[0].data);
if (This.navParams.get('id')) { if (This.navParams.get('id')) {
this.navCtrl.setRoot('QuickridePage', { id: This.navParams.get('id') }) this.navCtrl.setRoot('HomePage', { id: This.navParams.get('id'), from: This.navParams.get('from') })
} }
else else
This.navCtrl.setRoot('HomePage') This.navCtrl.setRoot('HomePage')
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="upload_doc_circle"> <div class="upload_doc_circle">
</div> </div>
<div class="upload_doc_detail"> <div class="upload_doc_detail">
{{doc}} {{doc.document_type}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</ion-label> </ion-label>
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service";
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -9,14 +9,23 @@ import { Myservice } from "../../providers/myservice"; ...@@ -9,14 +9,23 @@ import { Myservice } from "../../providers/myservice";
templateUrl: 'uploaddoc.html', templateUrl: 'uploaddoc.html',
}) })
export class UploaddocPage { export class UploaddocPage {
docs = ['License','Vehicle Insurance','Tax', 'Registration'] docs:any;
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private comService:dataService) {
}
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice) { ionViewDidEnter(){
this.myservice.load_post({},'getAllDocument').subscribe(resp=>{
if(resp.status == 'success'){
this.docs = resp.data
}
})
} }
uploadDoc(name){ uploadDoc(data){
this.comService.setdocData(data);
this.myservice.show_loader() this.myservice.show_loader()
this.navCtrl.push("DocupdatePage",{title:name}); this.navCtrl.push("DocupdatePage", { title: data.document_type});
} }
} }
...@@ -6,6 +6,7 @@ export class dataService { ...@@ -6,6 +6,7 @@ export class dataService {
rideData:any; rideData:any;
waypointData:any; waypointData:any;
rateData:any; rateData:any;
docData:any;
constructor() { } constructor() { }
...@@ -33,5 +34,13 @@ rateData:any; ...@@ -33,5 +34,13 @@ rateData:any;
return this.rateData; return this.rateData;
} }
public setdocData(val){
this.docData = val;
}
public getdocData(){
return this.docData;
}
} }
\ No newline at end of file
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