Commit 2687af45 by Alen Jose

aug-3

parent a1536d27
import { Component, ViewChild } from '@angular/core';
import { Nav, Platform, AlertController, Events,Toggle } from 'ionic-angular';
import { Nav, Platform, AlertController, Events, Toggle } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Network } from '@ionic-native/network';
......@@ -79,7 +79,7 @@ export class MyApp {
}
})
this.events.subscribe('driver:locOff',_=>{
this.events.subscribe('driver:locOff', _ => {
this.locSubs.unsubscribe();
})
......@@ -97,17 +97,17 @@ export class MyApp {
this.rootPage = 'LandingPage'
}
})
this.splashScreen.hide();
});
}
statusChange() {
if (this.status == true)
var stat = 'online'
else
var stat = 'offline'
firebase.database().ref("drivers/" + this.pushId + "/").update({ status: stat })
if (this.status == true)
var stat = 'online'
else
var stat = 'offline'
firebase.database().ref("drivers/" + this.pushId + "/").update({ status: stat })
}
checkStatus() {
......@@ -129,21 +129,21 @@ export class MyApp {
This.status = false
});
var intr = setInterval(()=>{
var intr = setInterval(() => {
This.myservice.load_post({ id: This.local.id }, 'getMyStatus').subscribe(resp => {
if (resp.status == 'success') {
if (resp.data.user_status == "Active"){
if (resp.data.user_status == "Active") {
console.log('act')
This.ionToggle.disabled = false;
clearInterval(intr);
}
else{
else {
console.log('inact')
This.ionToggle.disabled = true;
}
}
})
},20000)
}, 20000)
// This.setlocalNotification();
}
......@@ -157,7 +157,7 @@ export class MyApp {
initOnesignal() {
this.oneSignal.startInit('ec007986-ae84-45fb-a770-f5be1e203acd', '151146703576');
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification);
this.oneSignal.handleNotificationReceived().subscribe(() => {
// do something when notification is received
......@@ -168,8 +168,8 @@ export class MyApp {
// do something when a notification is opened
var additionalData = data.notification.payload.additionalData
this.storage.get('driver_data').then((user_data) => {
if(user_data)
this.nav.push('QuickridePage', { id: additionalData.bookingId, from: additionalData.from})
if (user_data)
this.nav.push('QuickridePage', { id: additionalData.bookingId, from: additionalData.from })
else
this.nav.setRoot('SigninPage', { id: additionalData.bookingId, from: additionalData.from })
})
......@@ -180,21 +180,21 @@ export class MyApp {
enableLoc() {
this.locationAccuracy.canRequest().then((canRequest: boolean) => {
// if (canRequest) {
// the accuracy option will be ignored by iOS
this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(
() => console.log('Request successful'),
error => console.log('Error requesting location permissions', error)
);
// the accuracy option will be ignored by iOS
this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(
() => console.log('Request successful'),
error => console.log('Error requesting location permissions', error)
);
// }
});
}
setlocalNotification(){
setlocalNotification() {
this.myservice.load_post({ id: this.local.id }, 'getMyRides').subscribe(response => {
if (response.status == 'success') {
var upcoming = response.data.upcoming
......@@ -204,27 +204,27 @@ export class MyApp {
id: i,
text: 'Ride Notification',
title: 'CMC-Driver',
trigger: { at: new Date(upcoming[i].pickup_date + ' ' +upcoming[i].pickup_time) },
trigger: { at: new Date(upcoming[i].pickup_date + ' ' + upcoming[i].pickup_time) },
led: 'FF0000',
sound: 'file://assets/sounds/request.mp3',
data: upcoming[i],
vibrate:true,
vibrate: true,
})
if(i == upcoming.length-1){
if (i == upcoming.length - 1) {
this.localNotifications.schedule(arr);
}
}
}
})
this.localNotifications.on('click').subscribe(rideData=>{
this.localNotifications.on('click').subscribe(rideData => {
this.data.setrideData(rideData.data)
this.nav.push('RidedetailsPage')
})
}
liveLoc(){
liveLoc() {
this.locSubs = this.geolocation.watchPosition().filter((p) => p.coords !== undefined) //Filter Out Errors
.subscribe(position => {
firebase.database().ref("drivers/" + this.pushId + "/").update({ lat: Number(position.coords.latitude), lng: Number(position.coords.longitude) })
......@@ -235,6 +235,7 @@ export class MyApp {
languageTrans() {
this.storage.get('lang').then(data => {
console.log(data)
if (data) {
this.translate.use(data);
this.lang = data;
......
......@@ -4,76 +4,172 @@
"No Internet Connection": "No Internet Connection",
"Quit": "Quit",
"Cancel": "Cancel",
"Online":"Online",
"My Rides":"My Rides",
"Documents":"Documents",
"Change Password":"Change Password",
"Online": "Online",
"My Rides": "My Rides",
"Documents": "Documents",
"Change Password": "Change Password",
"Logout": "Logout"
},
"home":{
"My Rides":"My Rides",
"Upcoming":"Upcoming",
"Completed":"Completed",
"No rides found":"No rides found",
"Please try again!":"Please try again!",
"Secret key miss match" :"Secret key miss match"
"home": {
"My Rides": "My Rides",
"Upcoming": "Upcoming",
"Completed": "Completed",
"No rides found": "No rides found",
"Please try again!": "Please try again!",
"Secret key miss match": "Secret key miss match"
},
"ridedetail":{
"Ride Details":"Ride Details",
"Pick Up":"Pick Up"
"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"
"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"
"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",
"Please try again": "Please try again",
"Secret key miss match": "Secret key miss match",
"Please choose image with .jpg/.jpeg/.png extension": "Please choose image with .jpg/.jpeg/.png extension",
"Profile Updated Successfully": "Profile Updated Successfully"
},
"uploaddoc": {
"Documents": "Documents",
"Upload Docs": "Upload Docs",
"Please upload your documents to get": "Please upload your documents to get",
"Approved": "Approved",
"Please try again": "Please try again",
"Secret key miss match": "Secret key miss match"
},
"docupdate": {
"Your documents must be readable": "Your documents must be readable",
"and clear": "and clear",
"Processing": "Processing",
"DONE": "DONE",
"VIEW": "VIEW",
"UPDATE": "UPDATE",
"UPLOAD": "UPLOAD",
"Please choose file with .jpg/.jpeg/.png/.pdf extension": "Please choose file with .jpg/.jpeg/.png/.pdf extension",
"Document Uploaded Successfully": "Document Uploaded Successfully",
"Please try again": "Please try again",
"Secret key miss match": "Secret key miss match",
"Please select a file to upload": "Please select a file to upload"
},
"forgot": {
"Forgot Password": "Forgot Password",
"Email": "Email",
"Enter a valid Email": "Enter a valid Email",
"Sent recovery password": "Sent recovery password",
"A temporary password has been sent to the email address you have provided": "A temporary password has been sent to the email address you have provided",
"Email ID doesnot exist": "Email ID doesnot exist",
"Secret key miss match": "Secret key miss match"
},
"changepass": {
"Change Password": "Change Password",
"Current password": "Current password",
"Minimum 6 characters": "Minimum 6 characters",
"New password": "New password",
"Confirm password": "Confirm password",
"Password mismatches": "Password mismatches",
"Proceed": "Proceed",
"Successfully Updated": "Successfully Updated",
"Incorrect Password": "Incorrect Password",
"Please try again": "Please try again",
"Secret key miss match": "Secret key miss match"
},
"landing": {
"New User ? Sign up now!": "New User ? Sign up now!",
"Sign in": "Sign in"
},
"payment": {
"Payment Details": "Payment Details",
"Pickup Point": "Pickup Point",
"Drop Point": "Drop Point",
"Ride Details": "Ride Details",
"Distance": "Distance",
"Hours": "Hours",
"Total": "Total",
"Discount": "Discount",
"Due after service": "Due after service",
"Completed": "Completed",
"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"
"signin": {
"Login": "Login",
"Mobile Number": "Mobile Number",
"Enter a valid Mobile": "Enter a valid Mobile",
"Password": "Password",
"Minimum 6 characters": "Minimum 6 characters",
"Sign In": "Sign In",
"Forgot Password": "Forgot Password",
"Successfully Logged in": "Successfully Logged in",
"Unknown credential , please try again": "Unknown credential , please try again"
},
"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"
"signup": {
"Sign Up": "Sign Up",
"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",
"Password": "Password",
"Minimum 6 characters": "Minimum 6 characters",
"Confirm Password": "Confirm Password",
"Password mismatches": "Password mismatches",
"I accept terms & condition": "I accept terms & condition",
"Please accept terms & conditions": "Please accept terms & conditions",
"Successfully registered":"Successfully registered",
"User Name or Email id Already exists":"User Name or Email id Already exists"
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
<ion-icon name="menu"></ion-icon>
</button>
<div class="nav_header_title floatLeft">
Change Password
{{'changepass.Change Password'|translate}}
</div>
<div class="clear"></div>
</ion-header>
......@@ -14,24 +14,24 @@
<form [formGroup]="pswdForm">
<ion-list>
<ion-item>
<ion-input type="password" placeholder="Current password" formControlName="current"></ion-input>
<ion-input type="password" placeholder="{{'changepass.Current password'|translate}}" formControlName="current"></ion-input>
</ion-item>
<div class="er_req" *ngIf="pswdForm.controls.current.invalid && (pswdForm.get('current').dirty || pswdForm.get('current').touched)">
Minimum 6 characters
{{'changepass.Minimum 6 characters'|translate}}
</div>
<ion-item>
<ion-input type="password" placeholder="New password" formControlName="new"></ion-input>
<ion-input type="password" placeholder="{{'changepass.New password'|translate}}" formControlName="new"></ion-input>
</ion-item>
<div class="er_req" *ngIf="pswdForm.controls.new.invalid && (pswdForm.get('new').dirty || pswdForm.get('new').touched)">
Minimum 6 characters
{{'changepass.Minimum 6 characters'|translate}}
</div>
<ion-item>
<ion-input type="password" placeholder="Confirm password" formControlName="confirm"></ion-input>
<ion-input type="password" placeholder="{{'changepass.Confirm password'|translate}}" formControlName="confirm"></ion-input>
</ion-item>
<div class="er_req" *ngIf="pswdForm.controls.confirm.invalid && (pswdForm.get('confirm').dirty || pswdForm.get('confirm').touched)">
Password mismatches
{{'changepass.Password mismatches'|translate}}
</div>
<button ion-button class="cab_sign_btn" (click)="change()">Proceed</button>
<button ion-button class="cab_sign_btn" (click)="change()">{{'changepass.Proceed'|translate}}</button>
</ion-list>
</form>
</ion-card-content>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ChangepassPage } from './changepass';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { ChangepassPage } from './changepass';
],
imports: [
IonicPageModule.forChild(ChangepassPage),
TranslateModule
],
})
export class ChangepassPageModule {}
......@@ -5,6 +5,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({
......@@ -14,8 +15,9 @@ import { Toast } from '@ionic-native/toast';
export class ChangepassPage {
pswdForm: FormGroup
local: driver
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, public storage: Storage, private formbuilder: FormBuilder, private toast: Toast) {
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, public storage: Storage, private formbuilder: FormBuilder, private toast: Toast, private translate: TranslateService) {
this.pswdForm = this.formbuilder.group({
current: ['', Validators.compose([Validators.required, Validators.minLength(6)])],
......@@ -26,6 +28,7 @@ export class ChangepassPage {
}
ionViewDidEnter() {
this.langTrans()
this.storage.get('driver_data').then(data => {
if (data != null) {
......@@ -35,19 +38,35 @@ export class ChangepassPage {
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
change() {
this.myservice.show_loader();
this.myservice.load_post(this.pswdForm.value, 'changePassword').subscribe(response => {
this.myservice.hide_loader()
if (response.status == 'success') {
this.pswdForm.reset();
this.toast.show(response.message, '2000', 'center').subscribe(toast => {
this.translate.get(['changepass.' + response.message]).subscribe(value => {
this.toast.show(value['changepass.' + response.message], '2000', 'center').subscribe(toast => {
console.log(toast);
});
})
}
else {
this.pswdForm.reset();
this.myservice.show_alert('', response.message)
this.translate.get(['changepass.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['changepass.' + response.message])
})
}
})
}
......
......@@ -13,8 +13,8 @@
<h4>{{title}}</h4>
<hr>
<br>
<p>Your documents must be readable<br>
and clear</p>
<p>{{'docupdate.Your documents must be readable'|translate}}<br>
{{'docupdate.and clear'|translate}}</p>
<button ion-button class="upload_btn" id="upld_btn" *ngIf="fileData?.fileStatus=='0' || fileData?.fileStatus=='3'">{{butonName}}
<input type="file" (change)="fileChange($event)" accept="application/pdf,image/*">
</button>
......@@ -23,11 +23,11 @@
</div>
<h6>{{filename}}</h6>
<h5 *ngIf="fileData?.fileStatus=='1'">Processing</h5>
<h5 *ngIf="fileData?.fileStatus=='1'">{{'docupdate.Processing'|translate}}</h5>
</div>
<div class="jr_bottom_button_bay">
<button ion-button class="cab_footer_btn" (click)="upload()" *ngIf="fileData?.fileStatus=='0' || fileData?.fileStatus=='3'">DONE</button>
<button ion-button class="cab_footer_btn" (click)="view()" *ngIf="fileData?.fileStatus!='0'">view</button>
<button ion-button class="cab_footer_btn" (click)="upload()" *ngIf="fileData?.fileStatus=='0' || fileData?.fileStatus=='3'">{{'docupdate.DONE'|translate}}</button>
<button ion-button class="cab_footer_btn" (click)="view()" *ngIf="fileData?.fileStatus!='0'">{{'docupdate.VIEW'|translate}}</button>
</div>
</ion-content>
<!-- <ion-footer padding>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { DocupdatePage } from './docupdate';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { DocupdatePage } from './docupdate';
],
imports: [
IonicPageModule.forChild(DocupdatePage),
TranslateModule
],
})
export class DocupdatePageModule {}
......@@ -9,6 +9,7 @@ import { PhotoViewer } from '@ionic-native/photo-viewer';
import { FileOpener } from '@ionic-native/file-opener';
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
import { File } from '@ionic-native/file';
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
......@@ -23,12 +24,14 @@ export class DocupdatePage {
fileData: any;
baseUrl: string = this.myservice.base_url
myData = { 'secret_key': 'My_key' }
butonName:string;
butonName: string;
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast, private comService: dataService, private photoViewer: PhotoViewer, private fileOpener: FileOpener, private transfer: FileTransfer, private file: File) {
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast, private comService: dataService, private photoViewer: PhotoViewer, private fileOpener: FileOpener, private transfer: FileTransfer, private file: File, private translate: TranslateService) {
}
ionViewDidEnter() {
this.langTrans()
this.fileData = this.comService.getdocData();
console.log(this.fileData)
......@@ -36,17 +39,33 @@ export class DocupdatePage {
if (data) {
this.myservice.hide_loader()
this.local = data
if (this.fileData.fileStatus == '3') {
this.butonName = 'UPDATE'
this.translate.get(['docupdate.UPDATE']).subscribe(value => {
this.butonName = value['docupdate.UPDATE']
})
}
else if (this.fileData.fileStatus == '0') {
this.butonName = 'UPLOAD'
this.translate.get(['docupdate.UPLOAD']).subscribe(value => {
this.butonName = value['docupdate.UPLOAD']
})
}
}
})
}
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) {
......@@ -62,12 +81,14 @@ export class DocupdatePage {
this.formdata.append('image', file, file.name);
}
else {
this.myservice.show_alert('', 'Please choose file with .jpg/.jpeg/.png/.pdf extension')
this.translate.get(['docupdate.Please choose file with .jpg/.jpeg/.png/.pdf extension']).subscribe(value => {
this.myservice.show_alert('', value['docupdate.Please choose file with .jpg/.jpeg/.png/.pdf extension'])
})
}
}
}
upload() {
upload() {
if (this.filename) {
this.myservice.show_loader()
this.formdata.append('data', JSON.stringify(this.myData));
......@@ -78,16 +99,24 @@ export class DocupdatePage {
this.myservice.hide_loader()
if (resp.status == 'success') {
this.navCtrl.pop();
this.toast.show(resp.message, '2000', 'center').subscribe(toast => {
this.translate.get(['docupdate.' + resp.message]).subscribe(value => {
this.toast.show(value['docupdate.' + resp.message], '2000', 'center').subscribe(toast => {
console.log(toast);
});
})
}
else {
this.translate.get(['docupdate.' + resp.message]).subscribe(value => {
this.myservice.show_alert('', value['docupdate.' + resp.message])
})
}
else
this.myservice.show_alert('', resp.message);
})
}
else
this.myservice.show_alert('','Please select a file to upload')
else{
this.translate.get(['docupdate.Please select a file to upload']).subscribe(value => {
this.myservice.show_alert('', value['docupdate.Please select a file to upload'])
})
}
}
view() {
......
......@@ -5,17 +5,17 @@
</ion-header>
<ion-content padding class="themelogin_background">
<div class="cab_login_wrapper">
<h4>Forgot Password</h4>
<h4>{{'forgot.Forgot Password'|translate}}</h4>
<hr>
<br>
<div class="cab_form">
<form [formGroup]="forgotForm">
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input floatRight cab_mail" type="email" placeholder="Email" formControlName="email">
<input class="cab_phone_input floatRight cab_mail" type="email" placeholder="{{'forgot.Email'|translate}}" formControlName="email">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="forgotForm.controls.email.invalid && (forgotForm.get('email').dirty || forgotForm.get('email').touched)">
Enter a valid Email
{{'forgot.Enter a valid Email'|translate}}
</div>
</div>
</div>
......@@ -23,7 +23,7 @@
<br>
<br>
<div class="cab_form_row">
<button ion-button class="cab_sign_btn" (click)="forgot()" [disabled]="forgotForm.invalid">Sent recovery password</button>
<button ion-button class="cab_sign_btn" (click)="forgot()" [disabled]="forgotForm.invalid">{{'forgot.Sent recovery password'|translate}}</button>
</div>
</div>
</div>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ForgotPage } from './forgot';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { ForgotPage } from './forgot';
],
imports: [
IonicPageModule.forChild(ForgotPage),
TranslateModule
],
})
export class ForgotPageModule {}
......@@ -2,7 +2,8 @@ import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { FormGroup, Validators, FormBuilder } from '@angular/forms'
import { Myservice } from '../../providers/myservice'
import { TranslateService } from "@ngx-translate/core";
import { Storage } from "@ionic/storage";
@IonicPage()
@Component({
......@@ -11,24 +12,45 @@ import { Myservice } from '../../providers/myservice'
})
export class ForgotPage {
forgotForm: FormGroup
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private formbuilder: FormBuilder, private myservice: Myservice) {
constructor(public navCtrl: NavController, public navParams: NavParams, private formbuilder: FormBuilder, private myservice: Myservice, private translate: TranslateService, public storage:Storage) {
this.forgotForm = this.formbuilder.group({
email: ['', Validators.compose([Validators.required, Validators.pattern("[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}")])],
from:['driver']
})
}
ionViewDidEnter(){
this.langTrans()
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
forgot() {
this.myservice.show_loader()
this.myservice.load_post(this.forgotForm.value, 'Forget_password').subscribe(response => {
this.myservice.hide_loader()
if (response.status == 'success') {
this.myservice.show_alert('', response.message)
this.translate.get(['forgot.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['forgot.' + response.message])
})
this.navCtrl.pop();
}
else {
this.myservice.show_alert('', response.message)
this.translate.get(['forgot.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['forgot.' + response.message])
})
}
})
}
......
......@@ -5,10 +5,10 @@
</div>
<div class="cab_form">
<div class="cab_form_row">
<button ion-button class="cab_sign_btn" (click)="open_page('SignupPage')">New User ? Sign up now!</button>
<button ion-button class="cab_sign_btn" (click)="open_page('SignupPage')">{{'landing.New User ? Sign up now!'|translate}}</button>
</div>
<div class="cab_form_row">
<button ion-button class="cab_sign_btn1" (click)="open_page('SigninPage')">Sign in</button>
<button ion-button class="cab_sign_btn1" (click)="open_page('SigninPage')">{{'landing.Sign in'|translate}}</button>
</div>
<!-- <div class="cab_form_row textCenter">
<p (click)="forgot()">Forgot Password</p>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LandingPage } from './landing';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { LandingPage } from './landing';
],
imports: [
IonicPageModule.forChild(LandingPage),
TranslateModule
],
})
export class LandingPageModule {}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { TranslateService } from "@ngx-translate/core";
import { Storage } from '@ionic/storage'
@IonicPage()
@Component({
......@@ -7,16 +9,30 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
templateUrl: 'landing.html',
})
export class LandingPage {
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams) {
constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, private translate: TranslateService) {
}
open_page(page){
this.navCtrl.push(page);
}
ionViewDidLoad() {
console.log('ionViewDidLoad LandingPage');
ionViewDidEnter() {
this.langTrans()
}
langTrans() {
this.storage.get('lang').then(lang => {
// if (lang != null) {
// this.translate.use(lang)
// this.lang = lang;
// }
// else {
// this.translate.use('en')
// }
this.lang = 'ar'
})
}
}
<!--
Generated template for the ListPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>list</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
</ion-content>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ListPage } from './list';
@NgModule({
declarations: [
ListPage,
],
imports: [
IonicPageModule.forChild(ListPage),
],
})
export class ListPageModule {}
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
* Generated class for the ListPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-list',
templateUrl: 'list.html',
})
export class ListPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ListPage');
}
}
......@@ -19,15 +19,15 @@ export class MyprofilePage {
editForm: FormGroup
imagechange: boolean = false;
fileUri: any;
local:driver;
local: driver;
formdata = new FormData();
codes: Array<dialcode>;
cars:any;
maxDate:any;
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, private translate: TranslateService) {
this.maxDate = new Date().getFullYear()
this.editForm = this.formBuilder.group({
......@@ -36,13 +36,13 @@ export class MyprofilePage {
email: ['', Validators.compose([Validators.required, Validators.pattern("[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}")])],
dial_code: ['', Validators.required],
phone: ['', Validators.compose([Validators.required, this.myservice.checkLimit(10000000, 999999999999999)])],
image:[''],
image: [''],
secret_key: ['My_key'],
license:['',Validators.required],
cartype:['',Validators.required],
car_no:['',Validators.required],
dob:['',Validators.required],
gender:['',Validators.required],
license: ['', Validators.required],
cartype: ['', Validators.required],
car_no: ['', Validators.required],
dob: ['', Validators.required],
gender: ['', Validators.required],
})
this.http.get('dial-codes.json')
......@@ -54,30 +54,33 @@ export class MyprofilePage {
ionViewDidEnter() {
this.langTrans()
this.storage.get('driver_data').then(data=>{
if(data){
this.storage.get('driver_data').then(data => {
if (data) {
this.local = data;
this.myservice.load_post({id:data.id}, 'getdriverDetails').subscribe(resp => {
this.myservice.load_post({ id: data.id }, 'getdriverDetails').subscribe(resp => {
if (resp.status == 'success') {
this.editForm.controls['name'].setValue(resp.data.name)
this.editForm.controls['username'].setValue(resp.data.user_name)
this.editForm.controls['email'].setValue(resp.data.email)
this.editForm.controls['dial_code'].setValue(resp.data.dial_code)
this.editForm.controls['phone'].setValue(resp.data.phone)
this.editForm.controls['image'].setValue(this.myservice.base_url+resp.data.image)
this.editForm.controls['image'].setValue(this.myservice.base_url + resp.data.image)
this.editForm.controls['car_no'].setValue(resp.data.car_no)
this.editForm.controls['cartype'].setValue(resp.data.car_type)
this.editForm.controls['dob'].setValue(resp.data.dob)
this.editForm.controls['gender'].setValue(resp.data.gender)
this.editForm.controls['license'].setValue(resp.data.license_no)
}
else
this.myservice.show_alert('',resp.message)
else {
this.translate.get(['profile.' + resp.message]).subscribe(value => {
this.myservice.show_alert('', value['profile.' + resp.message])
})
}
})
}
})
this.myservice.load_post({},'getCarTypes').subscribe(resp=>{
if(resp.status == 'success'){
this.myservice.load_post({}, 'getCarTypes').subscribe(resp => {
if (resp.status == 'success') {
this.cars = resp.data
}
})
......@@ -114,12 +117,14 @@ export class MyprofilePage {
this.imagechange = true;
}
else {
this.myservice.show_alert('','Please choose image with .jpg/.jpeg/.png extension')
this.translate.get(['profile.Please choose image with .jpg/.jpeg/.png extension']).subscribe(value => {
this.myservice.show_alert('', value['profile.Please choose image with .jpg/.jpeg/.png extension'])
})
}
}
}
updateProfile(){
updateProfile() {
this.myservice.show_loader()
this.formdata.append('data', JSON.stringify(this.editForm.value));
this.formdata.append('id', JSON.stringify(this.local.id));
......@@ -127,20 +132,24 @@ export class MyprofilePage {
this.myservice.hide_loader()
if (response.status == 'success') {
this.local = response.data
if (this.imagechange == true){
if (this.imagechange == true) {
this.local.image = this.local.image.startsWith("http") ? this.local.image : this.myservice.base_url + this.local.image;
}
this.events.publish('driver:profile', this.local);
this.toast.show(response.message, '2000', 'center').subscribe(toast => {
this.translate.get(['profile.' + response.message]).subscribe(value => {
this.toast.show(value['profile.' + response.message], '2000', 'center').subscribe(toast => {
console.log(toast);
});
}
else {
this.myservice.show_alert('', response.message)
}
})
}
else {
this.translate.get(['profile.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['profile.' + response.message])
})
}
})
}
......
......@@ -2,17 +2,17 @@
<button ion-button class="nav_btn theme_color floatLeft"(click)="dismiss()">
<ion-icon name="ios-arrow-back"></ion-icon>
</button>
<div class="nav_header_title floatLeft">Payment Details</div>
<div class="nav_header_title floatLeft">{{'payment.Payment Details'|translate}}</div>
<div class="clear"></div>
</ion-header>
<ion-content padding class="cab_coupon_bg">
<div class="cab_trip_detail_wrapper">
<h4 class="text_white">Pickup Point</h4>
<h4 class="text_white">{{'payment.Pickup Point'|translate}}</h4>
<p class="floatLeft textLeft width50">{{book.from}}</p>
<!-- <p class="floatRight textRight width50">11 :23 am, 02-08-2017</p> -->
<div class="clear"></div>
<br>
<h4 class="text_white">Drop Point</h4>
<h4 class="text_white">{{'payment.Drop Point'translate}}</h4>
<p class="floatLeft textLeft width50">{{book.to}}</p>
<!-- <p class="floatRight textRight width50">12 :00 am, 02-08-2017</p> -->
<div class="clear"></div>
......@@ -21,33 +21,33 @@
</div>
<div class="cab_coupon_content">
<p style="padding-top: 0px;margin-top: 0px;margin-bottom: 0px;">Ride Details</p>
<p style="padding-top: 0px;margin-top: 0px;margin-bottom: 0px;">{{'payment.Ride Details'|translate}}</p>
<li>
<div class="child textLeft">Distance</div>
<div class="child textLeft">{{'payment.Distance'|translate}}</div>
<div class="child textRight">Rs. {{details?.distance}}</div>
<div class="clear"></div>
</li>
<li>
<div class="child textLeft">Hours</div>
<div class="child textLeft">{{'payment.Hours'|translate}}</div>
<div class="child textRight">Rs. {{details?.hours}}</div>
<div class="clear"></div>
</li>
</div>
<div class="cab_coupon_content">
<p style="padding-top: 0px;margin-top: 0px;margin-bottom: 0px;">Payment Details</p>
<p style="padding-top: 0px;margin-top: 0px;margin-bottom: 0px;">{{'payment.Payment Details'|translate}}</p>
<li>
<div class="child textLeft">Total</div>
<div class="child textLeft">{{'payment.Total'|translate}}</div>
<div class="child textRight">Rs. {{details?.bfor_deduction}}</div>
<div class="clear"></div>
</li>
<li>
<div class="child textLeft">Discount</div>
<div class="child textLeft">{{'payment.Discount'|translate}}</div>
<div class="child textRight">Rs. {{book?.discount}}</div>
<div class="clear"></div>
</li>
<li>
<div class="child textLeft">Due after service</div>
<div class="child textLeft">{{'payment.Due after service'|translate}}</div>
<div class="child textRight">Rs. {{details?.amount}}</div>
<div class="clear"></div>
</li>
......@@ -56,9 +56,9 @@
</ion-content>
<ion-footer>
<div class="theme_bgcolor p10 text_white">
<p class="floatLeft text_size_18">Total</p>
<p class="floatLeft text_size_18">{{'payment.Total'|translate}}</p>
<p class="floatRight text_size_18">Rs.{{details?.amount}}</p>
<div class="clear"></div>
</div>
<button ion-button class="cab_footer_btn width100 text_white" (click)="done()">Completed</button>
<button ion-button class="cab_footer_btn width100 text_white" (click)="done()">{{'payment.Completed'|translate}}</button>
</ion-footer>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { PaymentPage } from './payment';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { PaymentPage } from './payment';
],
imports: [
IonicPageModule.forChild(PaymentPage),
TranslateModule
],
})
export class PaymentPageModule {}
......@@ -4,6 +4,8 @@ import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice";
import * as firebase from 'firebase';
import { DatePipe } from '@angular/common';
import { TranslateService } from "@ngx-translate/core";
import { Storage } from '@ionic/storage'
declare var google;
@IonicPage()
......@@ -20,11 +22,25 @@ export class PaymentPage {
waypoints = this.data.getwaypointData()
rate = this.data.getrateData();
details:any;
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private myservice: Myservice, public platform: Platform, private datePipe: DatePipe) {
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private myservice: Myservice, public platform: Platform, private datePipe: DatePipe, public storage: Storage, private translate: TranslateService) {
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
ionViewDidEnter() {
this.langTrans()
// this.myservice.hide_loader();
this.initializeBackButtonCustomHandler();
......@@ -84,8 +100,11 @@ export class PaymentPage {
This.details.bfor_deduction = amount;
This.details.hours = hDisplay + mDisplay;
}
else
This.myservice.show_alert('',response.message)
else{
This.translate.get(['payment.' + response.message]).subscribe(value => {
This.myservice.show_alert('', value['payment.' + response.message])
})
}
})
} else {
window.alert('Directions request failed due to ' + status);
......
......@@ -4,7 +4,7 @@
<div class="cab_logo">
<img src="assets/img/cab_logo.png" style="width: 120px;">
</div>
<h4>Login</h4>
<h4>{{'signin.Login'|translate}}</h4>
<hr>
<br>
<div class="cab_form">
......@@ -14,20 +14,20 @@
<select class="cab_phone_code floatLeft" formControlName="dial_code">
<option *ngFor="let code of codes" value=+{{code.dialCode}}>+{{code.dialCode}}</option>
</select>
<input class="cab_phone_input floatRight cab_call" placeholder="Mobile Number" formControlName="mobile" type="number">
<input class="cab_phone_input floatRight cab_call" placeholder="{{'signin.Mobile Number'|translate}}" formControlName="mobile" type="number">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signinForm.controls.mobile.invalid && (signinForm.get('mobile').dirty || signinForm.get('mobile').touched)">
Enter a valid Mobile
{{'signin.Enter a valid Mobile'|translate}}
</div>
</div>
</div>
<br>
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_pass width100" placeholder="Password" type="password" formControlName="password">
<input class="cab_phone_input cab_pass width100" placeholder="{{'signin.Password'|translate}}" type="password" formControlName="password">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signinForm.controls.password.invalid && (signinForm.get('password').dirty || signinForm.get('password').touched)">
Minimum 6 characters
{{'signin.Minimum 6 characters'|translate}}
</div>
</div>
</div>
......@@ -35,11 +35,11 @@
<br>
<br>
<div class="cab_form_row">
<button ion-button class="cab_sign_btn" (click)="login()">Sign In</button>
<button ion-button class="cab_sign_btn" (click)="login()">{{'signin.Sign In'|translate}}</button>
</div>
<br>
<div class="cab_form_row textCenter">
<p (click)="forgot()">Forgot Password</p>
<p (click)="forgot()">{{'signin.Forgot Password'|translate}}</p>
</div>
</div>
</div>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SigninPage } from './signin';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { SigninPage } from './signin';
],
imports: [
IonicPageModule.forChild(SigninPage),
TranslateModule
],
})
export class SigninPageModule {}
......@@ -6,6 +6,8 @@ import { dialcode } from "../../models/mymodel";
import { OrderbyPipe } from '../../providers/sort-pipe';
import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage";
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
selector: 'page-signin',
......@@ -14,8 +16,9 @@ import { Storage } from "@ionic/storage";
export class SigninPage {
codes: Array<dialcode>;
signinForm: FormGroup
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) {
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 translate: TranslateService) {
this.signinForm = this.formBuilder.group({
mobile: ['', Validators.compose([Validators.required, this.myservice.checkLimit(10000000, 999999999999999)])],
dial_code: ['+91', Validators.required],
......@@ -29,6 +32,22 @@ export class SigninPage {
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
ionViewDidEnter() {
this.langTrans()
}
login() {
this.myservice.show_loader()
this.myservice.load_post(this.signinForm.value, 'driver_login').subscribe(response => {
......@@ -48,7 +67,9 @@ export class SigninPage {
}
else {
this.myservice.hide_loader();
this.myservice.show_alert('', response[0].message)
this.translate.get(['signin.' + response[0].message]).subscribe(value => {
this.myservice.show_alert('', value['signin.' + response[0].message])
})
}
})
}
......
......@@ -5,27 +5,27 @@
</ion-header>
<ion-content padding class="themelogin_background">
<div class="cab_login_wrapper">
<h4>Sign Up</h4>
<h4>{{'signup.Sign Up'|translate}}</h4>
<hr>
<br>
<div class="cab_form">
<form [formGroup]="signupForm">
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_user width100" placeholder="Name" formControlName="name">
<input class="cab_phone_input cab_user width100" placeholder="{{'signup.Name'|translate}}" formControlName="name">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.name.invalid && (signupForm.get('name').dirty || signupForm.get('name').touched)">
Enter a valid Name
{{'signup.Enter a valid Name'|translate}}
</div>
</div>
</div>
<br>
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_user width100" placeholder="Username" formControlName="username">
<input class="cab_phone_input cab_user width100" placeholder="{{'signup.Username'|translate}}" formControlName="username">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.username.invalid && (signupForm.get('username').dirty || signupForm.get('username').touched)">
Enter a valid Username
{{'signup.Enter a valid Username'|translate}}
</div>
</div>
</div>
......@@ -35,40 +35,40 @@
<select class="cab_phone_code floatLeft" formControlName="dial_code">
<option *ngFor="let code of codes" value=+{{code.dialCode}}>+{{code.dialCode}}</option>
</select>
<input class="cab_phone_input floatRight cab_call" placeholder="Mobile Number" formControlName="phone" type="number">
<input class="cab_phone_input floatRight cab_call" placeholder="{{'signup.Mobile Number'|translate}}" formControlName="phone" type="number">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.phone.invalid && (signupForm.get('phone').dirty || signupForm.get('phone').touched)">
Enter a valid Mobile
{{'signup.Enter a valid Mobile'|translate}}
</div>
</div>
</div>
<br>
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_mail width100" placeholder="Email" formControlName="email" type="email">
<input class="cab_phone_input cab_mail width100" placeholder="{{'signup.Email'|translate}}" formControlName="email" type="email">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.email.invalid && (signupForm.get('email').dirty || signupForm.get('email').touched)">
Enter a valid Email
{{'signup.Enter a valid Email'|translate}}
</div>
</div>
</div>
<br>
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_pass width100" placeholder="Password" formControlName="password" type="password">
<input class="cab_phone_input cab_pass width100" placeholder="{{'signup.Password'|translate}}" formControlName="password" type="password">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.password.invalid && (signupForm.get('password').dirty || signupForm.get('password').touched)">
Minimum 6 characters
{{'signup.Minimum 6 characters'|translate}}
</div>
</div>
</div>
<br>
<div class="cab_form_row">
<div class="cab_phone_number">
<input class="cab_phone_input cab_confirmpass width100" placeholder="Confirm Password" type="password" formControlName="confirm">
<input class="cab_phone_input cab_confirmpass width100" placeholder="{{'signup.Confirm Password'|translate}}" type="password" formControlName="confirm">
<div class="clear"></div>
<div class="er_req textCenter" *ngIf="signupForm.controls.confirm.invalid && (signupForm.get('confirm').dirty || signupForm.get('confirm').touched)">
Password mismatches
{{'signup.Password mismatches'|translate}}
</div>
</div>
</div>
......@@ -76,19 +76,19 @@
<div class="cab_form_row textCenter">
<ion-item style="width:100% !important;">
<ion-label>
<p>I accept terms & condition</p>
<p>{{'signup.I accept terms & condition'|translate}}</p>
</ion-label>
<ion-checkbox formControlName="terms"></ion-checkbox>
</ion-item>
<div class="er_req textCenter" *ngIf="signupForm.controls.terms.invalid && (signupForm.get('terms').dirty || signupForm.get('terms').touched)">
Please accept terms & conditions
{{'signup.Please accept terms & conditions'|translate}}
</div>
</div>
</form>
<br>
<div class="cab_form_row">
<button ion-button class="cab_sign_btn" (click)="register()" [disabled]="signupForm.invalid">Sign Up</button>
<button ion-button class="cab_sign_btn" (click)="register()" [disabled]="signupForm.invalid">{{'signup.Sign Up'|translate}}</button>
</div>
<br>
</div>
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SignupPage } from './signup';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { SignupPage } from './signup';
],
imports: [
IonicPageModule.forChild(SignupPage),
TranslateModule
],
})
export class SignupPageModule {}
......@@ -8,6 +8,8 @@ import { Myservice } from "../../providers/myservice";
import { OneSignal } from "@ionic-native/onesignal";
import { fireService } from "../../providers/firebase.service";
import { Geolocation } from '@ionic-native/geolocation';
import { TranslateService } from "@ngx-translate/core";
import { Storage } from "@ionic/storage";
@IonicPage()
@Component({
......@@ -17,8 +19,9 @@ import { Geolocation } from '@ionic-native/geolocation';
export class SignupPage {
signupForm: FormGroup
codes: Array<dialcode>;
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private formBuilder: FormBuilder, private http: Http, private orderbyPipe: OrderbyPipe, private myservice: Myservice, private onesignal: OneSignal, private firebase: fireService, private geolocation: Geolocation) {
constructor(public navCtrl: NavController, public navParams: NavParams, private formBuilder: FormBuilder, private http: Http, private orderbyPipe: OrderbyPipe, private myservice: Myservice, private onesignal: OneSignal, private firebase: fireService, private geolocation: Geolocation, private translate: TranslateService, private storage: Storage) {
this.signupForm = this.formBuilder.group({
name: ['', Validators.compose([Validators.required, Validators.minLength(3)])],
......@@ -39,8 +42,20 @@ export class SignupPage {
})
}
ionViewDidLoad() {
console.log('ionViewDidLoad SignupPage');
ionViewDidEnter() {
this.langTrans()
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
back() {
......@@ -65,7 +80,9 @@ export class SignupPage {
this.navCtrl.setRoot("SigninPage");
}
else {
this.myservice.show_alert('', response.message)
this.translate.get(['signup.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['signup.' + response.message])
})
}
})
})
......
......@@ -3,16 +3,16 @@
<ion-icon name="menu"></ion-icon>
</button>
<div class="nav_header_title floatLeft">
Documents
{{'uploaddoc.Documents'|translate}}
</div>
<div class="clear"></div>
</ion-header>
<ion-content padding>
<div class="sign_up_wrapper">
<h4>Upload Docs</h4>
<h4>{{'uploaddoc.Upload Docs'|translate}}</h4>
<hr>
<p>Please upload your documents to get<br>
Approved</p>
<p>{{'uploaddoc.Please upload your documents to get'|translate}}<br>
{{'uploaddoc.Approved'|translate}}</p>
<div class="upload_doc_list">
<ion-list radio-group>
<ion-item *ngFor="let doc of docs; let i = index;">
......
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { UploaddocPage } from './uploaddoc';
import { TranslateModule } from "@ngx-translate/core";
@NgModule({
declarations: [
......@@ -8,6 +9,7 @@ import { UploaddocPage } from './uploaddoc';
],
imports: [
IonicPageModule.forChild(UploaddocPage),
TranslateModule
],
})
export class UploaddocPageModule {}
......@@ -4,6 +4,7 @@ import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service";
import { Storage } from "@ionic/storage";
import { driver } from "../../models/mymodel";
import { TranslateService } from "@ngx-translate/core";
@IonicPage()
@Component({
......@@ -13,11 +14,14 @@ import { driver } from "../../models/mymodel";
export class UploaddocPage {
docs:any;
local:driver
lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private comService:dataService, private storage:Storage) {
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private comService: dataService, private storage: Storage, private translate: TranslateService) {
}
ionViewDidEnter(){
this.langTrans()
this.storage.get('driver_data').then(data=>{
this.local = data
......@@ -25,12 +29,27 @@ export class UploaddocPage {
if(resp.status == 'success'){
this.docs = resp.data
}
else
this.myservice.show_alert('',resp.message)
else{
this.translate.get(['uploaddoc.' + resp.message]).subscribe(value => {
this.myservice.show_alert('', value['uploaddoc.' + resp.message])
})
}
})
})
}
langTrans() {
this.storage.get('lang').then(lang => {
if (lang != null) {
this.translate.use(lang)
this.lang = lang;
}
else {
this.translate.use('en')
}
})
}
uploadDoc(data){
this.comService.setdocData(data);
this.myservice.show_loader()
......
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