Commit aab71349 by Alen Jose

Merge branch 'alen' into 'master'

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