Commit 1bb6dcf9 by Alen Jose

Merge branch 'alen' into 'master'

aug-2 See merge request alen/CMC-driver!23
parents 34fa9446 a1536d27
......@@ -21,5 +21,59 @@
"ridedetail":{
"Ride Details":"Ride Details",
"Pick Up":"Pick Up"
},
"quickride":{
"Quick Ride":"Quick Ride",
"You have a ride request":"You have a ride request",
"Date":"Date",
"Accept":"Accept",
"Reject":"Reject",
"Secret key miss match":"Secret key miss match",
"Please try again":"Please try again",
"Successfully Accepted" : "Successfully Accepted",
"Sorry, The ride is gone":"Sorry, The ride is gone"
},
"reject":{
"Cancellation Reason":"Cancellation Reason",
"Pickup location too far":"Pickup location too far",
"Cannot serve at the requested time":"Cannot serve at the requested time",
"Other":"Other",
"Cancel":"Cancel",
"Submit":"Submit",
"Cancelled Successfully":"Cancelled Successfully",
"Please try again":"Please try again",
"Secret key miss match":"Secret key miss match"
},
"userloc":{
"User Location":"User Location",
"From":"From",
"To":"To",
"Start Ride":"Start Ride",
"Finish Ride":"Finish Ride",
"Please try again":"Please try again",
"Secret key miss match":"Secret key miss match"
},
"profile":{
"Profile":"Profile",
"My Profile":"My Profile",
"Name":"Name",
"Enter a valid Name":"Enter a valid Name",
"Username":"Username",
"Enter a valid Username":"Enter a valid Username",
"Mobile Number":"Mobile Number",
"Enter a valid Mobile":"Enter a valid Mobile",
"Email":"Email",
"Enter a valid Email":"Enter a valid Email",
"Date of Birth":"Date of Birth",
"Select your DOB":"Select your DOB",
"Male":"Male",
"Female":"Female",
"License Number":"License Number",
"Enter a valid License Number":"Enter a valid License Number",
"Car Type":"Car Type",
"Select a valid Car Type":"Select a valid Car Type",
"Car Number":"Car Number",
"Enter a valid Car Number":"Enter a valid Car Number",
"SAVE":"SAVE"
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
<ul>
<li *ngFor="let up of upcoming" (click)="rideDetails(up)">
<div class="home_content_circle">
<img [src]=baseurl+up.image />
<img [src]=up.image />
</div>
<div class="home_content_detail">
<h5>{{up.username}}</h5>
......@@ -46,7 +46,7 @@
<ul>
<li *ngFor="let comp of completed" (click)="rideDetails(comp)">
<div class="home_content_circle">
<img [src]=baseurl+comp.image />
<img [src]=comp.image />
</div>
<div class="home_content_detail">
<h5>{{comp.username}}</h5>
......
......@@ -3,13 +3,13 @@
<ion-icon name="menu"></ion-icon>
</button>
<div class="nav_header_title floatLeft">
Profile
{{'profile.Profile'|translate}}
</div>
<div class="clear"></div>
</ion-header>
<ion-content padding>
<div class="myprofile_wrapper">
<h4>My Profile</h4>
<h4>{{'profile.My Profile'|translate}}</h4>
<hr>
<br>
<form [formGroup]="editForm">
......@@ -22,50 +22,50 @@
</div>
<div class="signup_form_content">
<ion-item>
<ion-input type="text" placeholder="Name" formControlName="name"></ion-input>
<ion-input type="text" placeholder="{{'profile.Name'|translate}}" formControlName="name"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.name.invalid && (editForm.get('name').dirty || editForm.get('name').touched)">
Enter a valid Name
{{'profile.Enter a valid Name'|translate}}
</div>
<ion-item>
<ion-input type="text" placeholder="Username" formControlName="username"></ion-input>
<ion-input type="text" placeholder="{{'profile.Username'|translate}}" formControlName="username"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.username.invalid && (editForm.get('username').dirty || editForm.get('username').touched)">
Enter a valid Username
{{'profile.Enter a valid Username'|translate}}
</div>
<ion-item>
<ion-input type="number" placeholder="Mobile Number" formControlName="phone"></ion-input>
<ion-input type="number" placeholder="{{'profile.Mobile Number'|translate}}" formControlName="phone"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.phone.invalid && (editForm.get('phone').dirty || editForm.get('phone').touched)">
Enter a valid Mobile
{{'profile.Enter a valid Mobile'|translate}}
</div>
<ion-item>
<ion-input type="email" placeholder="Email" formControlName="email"></ion-input>
<ion-input type="email" placeholder="{{'profile.Email'|translate}}" formControlName="email"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.email.invalid && (editForm.get('email').dirty || editForm.get('email').touched)">
Enter a valid Email
{{'profile.Enter a valid Email'|translate}}
</div>
<ion-item>
<ion-datetime displayFormat="DD MMM YYYY" placeholder="Date of Birth" min="1950" max={{maxDate}} formControlName="dob">
<ion-datetime displayFormat="DD MMM YYYY" placeholder="{{'profile.Date of Birth'|translate}}" min="1950" max={{maxDate}} formControlName="dob">
</ion-datetime>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.dob.invalid && (editForm.get('dob').dirty || editForm.get('dob').touched)">
Select your DOB
{{'profile.Select your DOB'|translate}}
</div>
<div radio-group formControlName="gender" class="gender_radio">
<div class="floatLeft">
<ion-radio value="male" checked class="floatLeft"></ion-radio>
<ion-label class="floatLeft">Male</ion-label>
<ion-label class="floatLeft">{{'profile.Male'|translate}}</ion-label>
<div class="clear"></div>
</div>
<div class="floatLeft">
<ion-radio value="female" class="floatLeft"></ion-radio>
<ion-label class="floatLeft">Female</ion-label>
<ion-label class="floatLeft">{{'profile.Female'|translate}}</ion-label>
<div class="clear"></div>
</div>
<div class="clear"></div>
......@@ -73,32 +73,32 @@
<ion-item>
<ion-input type="text" placeholder="License Number" formControlName="license"></ion-input>
<ion-input type="text" placeholder="{{'profile.License Number'|translate}}" formControlName="license"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.license.invalid && (editForm.get('license').dirty || editForm.get('license').touched)">
Enter a valid License Number
{{'profile.Enter a valid License Number'|translate}}
</div>
<ion-item>
<ion-select formControlName="cartype" placeholder="Car Type">
<ion-select formControlName="cartype" placeholder="{{'profile.Car Type'|translate}}">
<ion-option value={{car.car_type}} *ngFor="let car of cars">{{car.car_type}}</ion-option>
</ion-select>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.cartype.invalid && (editForm.get('cartype').dirty || editForm.get('cartype').touched)">
Select a valid Car Type
{{'profile.Select a valid Car Type'|translate}}
</div>
<ion-item>
<ion-input type="text" placeholder="Car Number" formControlName="car_no"></ion-input>
<ion-input type="text" placeholder="{{'profile.Car Number'|translate}}" formControlName="car_no"></ion-input>
</ion-item>
<div class="er_req textCenter" *ngIf="editForm.controls.car_no.invalid && (editForm.get('car_no').dirty || editForm.get('car_no').touched)">
Enter a valid Car Number
{{'profile.Enter a valid Car Number'|translate}}
</div>
<br>
<!-- <button ion-button class="primary theme_dark_bg" (click)="updateProfile()">SAVE</button> -->
<div class="jr_bottom_button_bay">
<button ion-button class="cab_footer_btn" (click)="updateProfile()">SAVE</button>
<button ion-button class="cab_footer_btn" (click)="updateProfile()">{{'profile.SAVE'|translate}}</button>
</div>
</div>
</form>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { MyprofilePage } from './myprofile';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { MyprofilePage } from './myprofile';
],
imports: [
IonicPageModule.forChild(MyprofilePage),
TranslateModule
],
})
export class MyprofilePageModule {}
......@@ -8,6 +8,7 @@ import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel";
import { Toast } from '@ionic-native/toast';
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
......@@ -23,8 +24,9 @@ export class MyprofilePage {
codes: Array<dialcode>;
cars:any;
maxDate:any;
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private formBuilder: FormBuilder, private http: Http, private orderbyPipe: OrderbyPipe, private myservice: Myservice, private storage: Storage, public events: Events, private toast: Toast) {
constructor(public navCtrl: NavController, public navParams: NavParams, private formBuilder: FormBuilder, private http: Http, private orderbyPipe: OrderbyPipe, private myservice: Myservice, private storage: Storage, public events: Events, private toast: Toast, private translate: TranslateService) {
this.maxDate = new Date().getFullYear()
......@@ -51,6 +53,7 @@ export class MyprofilePage {
}
ionViewDidEnter() {
this.langTrans()
this.storage.get('driver_data').then(data=>{
if(data){
this.local = data;
......@@ -80,6 +83,18 @@ export class MyprofilePage {
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
fileChange(event) {
let fileList: FileList = event.target.files;
if (fileList.length > 0) {
......
......@@ -3,7 +3,7 @@
<ion-icon name="ios-arrow-back" (click)="back()"></ion-icon>
</button>
<div class="nav_header_title floatLeft">
Quick Ride
{{'quickride.Quick Ride'|translate}}
</div>
<div class="clear"></div>
</ion-header>
......@@ -11,10 +11,10 @@
<div class="jr_profile_content1">
<div class="jr_search_bottom_bay jr_padding0" >
<h5>You have a ride request</h5>
<h5>{{'quickride.You have a ride request'|translate}}</h5>
<hr>
<div class="jr_search_profile">
<img [src]=baseUrl+rideDetail?.image >
<img [src]=rideDetail?.image >
</div>
<div class="jr_search_profile_detail">
<br>
......@@ -39,12 +39,12 @@
<div class="jr_clear"></div>
</li>
</div>
<p class="time">Day : <strong>{{rideDetail?.pickup_date| date:'dd/MM/yy'}} - {{rideDetail?.pickup_time}}</strong></p>
<p class="time">{{'quickride.Date'|translate}} : <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 floatLeft accept" (click)="accept()">{{'quickride.Accept'|translate}}</button>
<button ion-button class="cab_footer_btn floatRight reject" (click)="reject()">{{'quickride.Reject'|translate}}</button>
<!-- <button ion-button class="cab_footer_btn width100" (click)="pick()" *ngIf="pickUp">Pick Up</button> -->
</div>
</div>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { QuickridePage } from './quickride';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { QuickridePage } from './quickride';
],
imports: [
IonicPageModule.forChild(QuickridePage),
TranslateModule
],
})
export class QuickridePageModule {}
......@@ -5,6 +5,7 @@ import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel";
import { dataService } from "../../providers/common.service";
import { Toast } from "@ionic-native/toast";
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
......@@ -16,12 +17,15 @@ export class QuickridePage {
rideDetail: any;
local: driver
baseUrl = this.myservice.base_url
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private data: dataService, private toast: Toast, private modalCtrl: ModalController, public alertCtrl: AlertController) {
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private data: dataService, private toast: Toast, private modalCtrl: ModalController, public alertCtrl: AlertController, private translate: TranslateService) {
}
ionViewDidEnter() {
this.langTrans()
this.storage.get('driver_data').then(data => {
if (data) {
this.local = data;
......@@ -44,21 +48,40 @@ export class QuickridePage {
this.data.setrideData(this.rideDetail)
}
else
this.myservice.show_alert('',resp.message)
else{
this.translate.get(['quickride.' + resp.message]).subscribe(value => {
this.myservice.show_alert('', value['quickride.' + resp.message])
})
}
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
accept() {
this.myservice.load_post({ bookingId: this.bookingId, driverId: this.local.id }, 'rideAccept').subscribe(resp => {
if (resp.status == 'success') {
this.toast.show(resp.message, '2000', 'center').subscribe(toast => {
console.log(toast);
});
this.translate.get(['quickride.' + resp.message]).subscribe(value => {
this.toast.show(value['quickride.'+resp.message], '2000', 'center').subscribe(toast => {
console.log(toast);
});
})
this.navCtrl.pop()
}
else {
this.myservice.show_alert('', resp.message)
this.translate.get(['quickride.' + resp.message]).subscribe(value => {
this.myservice.show_alert('', value['quickride.' + resp.message])
})
}
})
}
......
......@@ -3,7 +3,7 @@
<div class="hm_cancel_pop_main">
<div class="hm_cancel_pop_upper">
<img src="assets/img/hm_ques_mark.png">
<p>Cancellation Reason</p>
<p>{{'reject.Cancellation Reason'|translate}}</p>
</div>
<div class="hm_cancel_pop_lower">
<ul>
......@@ -13,7 +13,7 @@
<ion-radio value="Pickup location too far"></ion-radio>
</div>
<div class="hm_cancel_reason">
Pickup location too far
{{'reject.Pickup location too far'|translate}}
</div>
<div class="hm_clear"></div>
</li>
......@@ -22,7 +22,7 @@
<ion-radio value="Cannot serve at the requested time"></ion-radio>
</div>
<div class="hm_cancel_reason">
Cannot serve at the requested time
{{'reject.Cannot serve at the requested time'|translate}}
</div>
<div class="hm_clear"></div>
</li>
......@@ -32,7 +32,7 @@
<ion-radio value="Other"></ion-radio>
</div>
<div class="hm_cancel_reason">
Other
{{'reject.Other'|translate}}
</div>
<div class="hm_clear"></div>
</li>
......@@ -40,8 +40,8 @@
</ion-list>
</ul>
<div class="hm_cancel_bottom_bay">
<li class="hm_cancel_cancel" (click)="dismiss()">Cancel</li>
<li class="hm_cancel_submit" (click)="submit()">Submit</li>
<li class="hm_cancel_cancel" (click)="dismiss()">{{'reject.Cancel'|translate}}</li>
<li class="hm_cancel_submit" (click)="submit()">{{'reject.Submit'|translate}}</li>
</div>
</div>
</div>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { RejectPage } from './reject';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { RejectPage } from './reject';
],
imports: [
IonicPageModule.forChild(RejectPage),
TranslateModule
],
})
export class RejectPageModule {}
......@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
import { Myservice } from '../../providers/myservice';
import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel";
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
......@@ -12,17 +13,32 @@ import { driver } from "../../models/mymodel";
export class RejectPage {
reason:any;
local:driver
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewctrl: ViewController, private myservice: Myservice, private storage:Storage) {
constructor(public navCtrl: NavController, public navParams: NavParams, public viewctrl: ViewController, private myservice: Myservice, private storage: Storage, private translate: TranslateService) {
}
ionViewDidEnter() {
this.langTrans()
this.storage.get('driver_data').then(data=>{
if(data)
this.local = data
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
dismiss(){
this.viewctrl.dismiss();
}
......@@ -35,7 +51,9 @@ export class RejectPage {
this.viewctrl.dismiss(response.message);
}
else {
this.myservice.show_alert('Error', response.message)
this.translate.get(['reject.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['reject.' + response.message])
})
}
})
......
......@@ -2,23 +2,23 @@
<button ion-button class="nav_btn theme_color floatLeft" (click)="back()">
<ion-icon name="ios-arrow-back"></ion-icon>
</button>
<div class="nav_header_title floatLeft">User Location</div>
<div class="nav_header_title floatLeft">{{'userloc.User Location'|translate}}</div>
<div class="clear"></div>
</ion-header>
<ion-content>
<div #map id="map"></div>
<div class="jr_bottom_distance_card" *ngIf="temp">
<div class="jr_bottom_inside">
<input class="jr_dest_input from" placeholder="From" [(ngModel)]="loc.from" [readonly]="true">
<input class="jr_dest_input to" placeholder="To" [(ngModel)]="loc.to" [readonly]="true">
<input class="jr_dest_input from" placeholder="{{'userloc.From'|translate}}" [(ngModel)]="loc.from" [readonly]="true">
<input class="jr_dest_input to" placeholder="{{'userloc.To'|translate}}" [(ngModel)]="loc.to" [readonly]="true">
</div>
</div>
</ion-content>
<ion-footer>
<div class="jr_bottom_button_bay" *ngIf="!started">
<button ion-button class="cab_footer_btn" (click)="startRide()">Start Ride</button>
<button ion-button class="cab_footer_btn" (click)="startRide()">{{'userloc.Start Ride'|translate}}</button>
</div>
<div class="jr_bottom_button_bay" *ngIf="temp && started">
<button ion-button class="cab_footer_btn" (click)="complete()">Finish Ride</button>
<button ion-button class="cab_footer_btn" (click)="complete()">{{'userloc.Finish Ride'|translate}}</button>
</div>
</ion-footer>
\ No newline at end of file
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { UserlocationPage } from './userlocation';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { UserlocationPage } from './userlocation';
],
imports: [
IonicPageModule.forChild(UserlocationPage),
TranslateModule
],
})
export class UserlocationPageModule {}
......@@ -7,6 +7,7 @@ import { driver } from "../../models/mymodel";
import { Storage } from "@ionic/storage";
import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service";
import { TranslateService } from "@ngx-translate/core";
declare var google;
......@@ -35,12 +36,14 @@ export class UserlocationPage {
count: number = 0;
tempPos: any;
destmarker: any;
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private geolocation: Geolocation, private db: AngularFireDatabase, private storage: Storage, private myservice: Myservice, private menu: MenuController, private data: dataService, public events: Events) {
constructor(public navCtrl: NavController, public navParams: NavParams, private geolocation: Geolocation, private db: AngularFireDatabase, private storage: Storage, private myservice: Myservice, private menu: MenuController, private data: dataService, public events: Events, private translate: TranslateService) {
this.loadMap()
}
ionViewDidEnter() {
this.langTrans()
this.events.publish('driver:locOff', '');
......@@ -70,6 +73,18 @@ export class UserlocationPage {
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
loadMap() {
this.geolocation.getCurrentPosition().then((resp) => {
......@@ -260,8 +275,11 @@ export class UserlocationPage {
This.ride = response.data
This.data.setrateData(This.ride)
}
else
this.myservice.show_alert('',response.message)
else{
this.translate.get(['userloc.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['userloc.' + response.message])
})
}
})
}
})
......
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