Commit 023fe33b by Alen Jose

sidemenu lang change

parent 1b58d58c
...@@ -128,16 +128,19 @@ export class MyApp { ...@@ -128,16 +128,19 @@ export class MyApp {
} }
languageTrans() { languageTrans() {
this.storage.get('lang').then(data => { var This = this;
setTimeout(function () {
This.storage.get('lang').then(data => {
if (data) { if (data) {
this.translate.use(data); This.translate.use(data);
this.lang = data; This.lang = data;
} }
else { else {
this.translate.setDefaultLang('en'); This.translate.setDefaultLang('en');
} }
this.lang_trans() This.lang_trans()
}) })
}, 500)
} }
lang_trans() { lang_trans() {
...@@ -149,8 +152,8 @@ export class MyApp { ...@@ -149,8 +152,8 @@ export class MyApp {
}) })
} }
presentPopover() { changeLang(lang) {
let popover = this.popoverCtrl.create('PopoverPage'); this.storage.set('lang', lang);
popover.present(); this.events.publish('driver:lang', lang);
} }
} }
\ No newline at end of file
<ion-menu [content]="content"> <ion-menu [content]="content">
<ion-content class="cab_sidemenu_bg"> <ion-content class="cab_sidemenu_bg">
<div class="cab_sidemenu_wrapper"> <div class="cab_sidemenu_wrapper">
<select [(ngModel)]="lang" (change)="changeLang(lang)">
<option value="en">EN</option>
</select>
<div menuClose class="cab_profile_banner" (click)="open_page('ProfilePage')" *ngIf="local"> <div menuClose class="cab_profile_banner" (click)="open_page('ProfilePage')" *ngIf="local">
<div class="cab_profile_picture"> <div class="cab_profile_picture">
<img [src]=local.image> <img [src]=local.image>
...@@ -14,7 +17,7 @@ ...@@ -14,7 +17,7 @@
<li menuClose class="trip" (click)="open_page('MytripsPage')">{{'sidemenu.My Trips'|translate}}</li> <li menuClose class="trip" (click)="open_page('MytripsPage')">{{'sidemenu.My Trips'|translate}}</li>
<!-- <li menuClose class="settings" (click)="open_page('SettingsPage')">Settings</li> --> <!-- <li menuClose class="settings" (click)="open_page('SettingsPage')">Settings</li> -->
<li menuClose class="logout" (click)="open_page('LandingPage')">{{'sidemenu.Logout'|translate}}</li> <li menuClose class="logout" (click)="open_page('LandingPage')">{{'sidemenu.Logout'|translate}}</li>
<li menuClose class="langtr" (click)="presentPopover()">{{'sidemenu.Language'|translate}}</li> <!-- <li menuClose class="langtr" (click)="presentPopover()">{{'sidemenu.Language'|translate}}</li> -->
</ul> </ul>
</div> </div>
</div> </div>
......
...@@ -8,7 +8,19 @@ ...@@ -8,7 +8,19 @@
//Essentail SCSS// //Essentail SCSS//
.cab_sidemenu_bg{background:#4d4d4d;background-size: cover !important;background-position: center !important;} .cab_sidemenu_bg{background:#4d4d4d;background-size: cover !important;background-position: center !important;}
.cab_sidemenu_wrapper{width:100%;height:100%;} .cab_sidemenu_wrapper{width:100%;height:100%; position: relative;
select{
width: 75px;
height: 30px;
background: transparent;
border: 2px solid #fff;
border-radius: 20px;
position: absolute;
top: 30px;
right: 30px;
color: #fff;
padding-left: 10px;
}}
.cab_profile_banner{width:100%;padding-top:80px;} .cab_profile_banner{width:100%;padding-top:80px;}
.cab_profile_picture{width:100px;height:100px;margin:0 auto;border:2px solid #f7941e;background-size: 25px !important;border-radius:50%;background: url("../assets/img/avatar.png");background-position: center;background-repeat: no-repeat;} .cab_profile_picture{width:100px;height:100px;margin:0 auto;border:2px solid #f7941e;background-size: 25px !important;border-radius:50%;background: url("../assets/img/avatar.png");background-position: center;background-repeat: no-repeat;}
.cab_profile_banner h6{color:#fff;margin:0px;font-size:16px;font-weight: 400;padding-bottom: 7px;padding-top: 15px;padding-left:10px;padding-right:10px;text-align: center;} .cab_profile_banner h6{color:#fff;margin:0px;font-size:16px;font-weight: 400;padding-bottom: 7px;padding-top: 15px;padding-left:10px;padding-right:10px;text-align: center;}
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular'; import { IonicPage, NavController, NavParams, ModalController,MenuController } from 'ionic-angular';
import { Validators, FormBuilder, FormGroup } from "@angular/forms"; import { Validators, FormBuilder, FormGroup } from "@angular/forms";
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
...@@ -21,7 +21,7 @@ export class AddcouponPage { ...@@ -21,7 +21,7 @@ export class AddcouponPage {
booking:any; booking:any;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController, private formBuilder: FormBuilder, private myservice: Myservice, private data: dataService, private storage: Storage, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController, private formBuilder: FormBuilder, private myservice: Myservice, private data: dataService, private storage: Storage, private translate: TranslateService, private menu:MenuController) {
this.promoForm = this.formBuilder.group({ this.promoForm = this.formBuilder.group({
promocode: [''], promocode: [''],
amount: [''], amount: [''],
...@@ -30,6 +30,7 @@ export class AddcouponPage { ...@@ -30,6 +30,7 @@ export class AddcouponPage {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -85,4 +86,7 @@ export class AddcouponPage { ...@@ -85,4 +86,7 @@ export class AddcouponPage {
}) })
} }
ionViewWillLeave() {
this.menu.swipeEnable(true)
}
} }
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ViewController, ModalController, Platform } from 'ionic-angular'; import { IonicPage, NavController, NavParams, ViewController, ModalController, Platform, MenuController } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
...@@ -18,10 +18,11 @@ export class ConfirmridePage { ...@@ -18,10 +18,11 @@ export class ConfirmridePage {
public unregisterBackButtonAction: any; public unregisterBackButtonAction: any;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, private myservice: Myservice, private data: dataService, private storage: Storage, public platform: Platform, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, private myservice: Myservice, private data: dataService, private storage: Storage, public platform: Platform, private translate: TranslateService, private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('user_data').then(data => { this.storage.get('user_data').then(data => {
if (data) { if (data) {
this.local = data; this.local = data;
...@@ -67,6 +68,7 @@ export class ConfirmridePage { ...@@ -67,6 +68,7 @@ export class ConfirmridePage {
ionViewWillLeave() { ionViewWillLeave() {
this.unregisterBackButtonAction && this.unregisterBackButtonAction(); this.unregisterBackButtonAction && this.unregisterBackButtonAction();
this.menu.swipeEnable(true)
} }
dismiss() { dismiss() {
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams,MenuController } from 'ionic-angular';
import { FormGroup, Validators, FormBuilder } from '@angular/forms' import { FormGroup, Validators, FormBuilder } from '@angular/forms'
import { Myservice } from '../../providers/myservice' import { Myservice } from '../../providers/myservice'
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
...@@ -15,7 +15,7 @@ export class ForgotPage { ...@@ -15,7 +15,7 @@ export class ForgotPage {
forgotForm: FormGroup forgotForm: FormGroup
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private formbuilder: FormBuilder, private myservice: Myservice, private translate: TranslateService, private storage:Storage) { constructor(public navCtrl: NavController, public navParams: NavParams, private formbuilder: FormBuilder, private myservice: Myservice, private translate: TranslateService, private storage:Storage, private menu:MenuController) {
this.forgotForm = this.formbuilder.group({ 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,}")])], email: ['', Validators.compose([Validators.required, Validators.pattern("[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}")])],
...@@ -24,6 +24,7 @@ export class ForgotPage { ...@@ -24,6 +24,7 @@ export class ForgotPage {
} }
ionViewDidEnter(){ ionViewDidEnter(){
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -53,5 +54,8 @@ export class ForgotPage { ...@@ -53,5 +54,8 @@ export class ForgotPage {
}) })
} }
ionViewWillLeave(){
this.menu.swipeEnable(true)
}
} }
import { Component, ViewChild, ElementRef } from '@angular/core'; import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular'; import { IonicPage, NavController, NavParams, ModalController,Events } from 'ionic-angular';
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { Geolocation } from '@ionic-native/geolocation'; import { Geolocation } from '@ionic-native/geolocation';
import { fireService } from "../../providers/firebase.service"; import { fireService } from "../../providers/firebase.service";
...@@ -37,15 +37,21 @@ export class HomePage { ...@@ -37,15 +37,21 @@ export class HomePage {
temp: number = 0; temp: number = 0;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController, public storage: Storage, private geolocation: Geolocation, private firebase: fireService, private db: AngularFireDatabase, private formBuilder: FormBuilder, private data: dataService, private myservice: Myservice, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, public modalCtrl: ModalController, public storage: Storage, private geolocation: Geolocation, private firebase: fireService, private db: AngularFireDatabase, private formBuilder: FormBuilder, private data: dataService, private myservice: Myservice, private translate: TranslateService, private events:Events) {
this.locForm = this.formBuilder.group({ this.locForm = this.formBuilder.group({
pickLoc: ['', Validators.required], pickLoc: ['', Validators.required],
dropLoc: ['', Validators.required] dropLoc: ['', Validators.required]
}) })
this.events.subscribe('user:lang', data => {
setTimeout(() => {
this.langTrans();
}, 500);
})
} }
ionViewDidEnter() { langTrans(){
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -55,7 +61,10 @@ export class HomePage { ...@@ -55,7 +61,10 @@ export class HomePage {
this.translate.use('en') this.translate.use('en')
} }
}) })
}
ionViewDidEnter() {
this.langTrans();
this.data.setbookingData('') this.data.setbookingData('')
this.storage.get('user_data').then(data => { this.storage.get('user_data').then(data => {
......
import { Component, ViewChild, ElementRef } from '@angular/core'; import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams,MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import * as firebase from 'firebase'; import * as firebase from 'firebase';
import { Geolocation } from '@ionic-native/geolocation'; import { Geolocation } from '@ionic-native/geolocation';
...@@ -29,10 +29,11 @@ export class MapPage { ...@@ -29,10 +29,11 @@ export class MapPage {
userMarkers: any; userMarkers: any;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private geolocation: Geolocation, private myservice: Myservice, private translate: TranslateService, private storage:Storage) { constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private geolocation: Geolocation, private myservice: Myservice, private translate: TranslateService, private storage:Storage, private menu :MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -247,5 +248,6 @@ export class MapPage { ...@@ -247,5 +248,6 @@ export class MapPage {
ionViewWillLeave() { ionViewWillLeave() {
this.locSubs.unsubscribe(); this.locSubs.unsubscribe();
this.menu.swipeEnable(true)
} }
} }
import { Component,ViewChild } from '@angular/core'; import { Component,ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams,Content,Slides } from 'ionic-angular'; import { IonicPage, NavController, NavParams,Content,Slides,Events } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { user } from "../../models/mymodel"; import { user } from "../../models/mymodel";
...@@ -26,7 +26,7 @@ export class MytripsPage { ...@@ -26,7 +26,7 @@ export class MytripsPage {
@ViewChild(Content) content: Content; @ViewChild(Content) content: Content;
@ViewChild('mySlider') slider: Slides; @ViewChild('mySlider') slider: Slides;
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private translate: TranslateService, private events:Events) {
let id = 0; let id = 0;
this.slidertab = id; this.slidertab = id;
...@@ -35,9 +35,14 @@ export class MytripsPage { ...@@ -35,9 +35,14 @@ export class MytripsPage {
}, 500) }, 500)
this.slidertab = 0; this.slidertab = 0;
this.events.subscribe('user:lang', data => {
setTimeout(() => {
this.langTrans();
}, 500);
})
} }
ionViewDidEnter() { langTrans(){
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -47,6 +52,10 @@ export class MytripsPage { ...@@ -47,6 +52,10 @@ export class MytripsPage {
this.translate.use('en') this.translate.use('en')
} }
}) })
}
ionViewDidEnter() {
this.langTrans();
this.storage.get('user_data').then(data => { this.storage.get('user_data').then(data => {
if (data) { if (data) {
......
import { Component, NgZone } from '@angular/core'; import { Component, NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular'; import { IonicPage, NavController, NavParams, Platform, MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
...@@ -25,10 +25,11 @@ export class PaymentPage { ...@@ -25,10 +25,11 @@ export class PaymentPage {
ride: any; ride: any;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, private translate: TranslateService,private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -119,6 +120,7 @@ export class PaymentPage { ...@@ -119,6 +120,7 @@ export class PaymentPage {
ionViewWillLeave() { ionViewWillLeave() {
this.unregisterBackButtonAction && this.unregisterBackButtonAction(); this.unregisterBackButtonAction && this.unregisterBackButtonAction();
this.menu.swipeEnable(true)
} }
close() { close() {
......
...@@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; ...@@ -10,7 +10,7 @@ import { TranslateService } from '@ngx-translate/core';
templateUrl: 'popover.html', templateUrl: 'popover.html',
}) })
export class PopoverPage { export class PopoverPage {
languages = [{ 'name': 'English', 'code': 'en' }]//code will be same as filename ol lang languages = [{ 'name': 'English', 'code': 'en' }]//code will be same as filename of lang
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, public storage: Storage, public events: Events, private myservice: Myservice, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, public storage: Storage, public events: Events, private myservice: Myservice, private translate: TranslateService) {
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,Events } from 'ionic-angular'; import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
import { Validators, FormGroup, FormBuilder } from '@angular/forms' import { Validators, FormGroup, FormBuilder } from '@angular/forms'
import { Myservice } from '../../providers/myservice' import { Myservice } from '../../providers/myservice'
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
...@@ -14,10 +14,10 @@ import { TranslateService } from '@ngx-translate/core'; ...@@ -14,10 +14,10 @@ import { TranslateService } from '@ngx-translate/core';
templateUrl: 'profile.html', templateUrl: 'profile.html',
}) })
export class ProfilePage { export class ProfilePage {
profileForm:FormGroup profileForm: FormGroup
codes: any; codes: any;
local:user local: user
image:boolean = false; image: boolean = false;
formdata = new FormData(); formdata = new FormData();
lang: string = 'en'; lang: string = 'en';
...@@ -31,7 +31,7 @@ export class ProfilePage { ...@@ -31,7 +31,7 @@ export class ProfilePage {
password: ['', Validators.compose([Validators.minLength(6)])],//, password: ['', Validators.compose([Validators.minLength(6)])],//,
new: [''],//Validators.compose([ Validators.minLength(6)]) new: [''],//Validators.compose([ Validators.minLength(6)])
confirm: [''],// Validators.compose([]), this.MatchPassword.bind(this) confirm: [''],// Validators.compose([]), this.MatchPassword.bind(this)
image:[''], image: [''],
secret_key: ['My_key'] secret_key: ['My_key']
}) })
...@@ -40,10 +40,15 @@ export class ProfilePage { ...@@ -40,10 +40,15 @@ export class ProfilePage {
this.codes = response.json().dialCodes this.codes = response.json().dialCodes
this.codes = this.orderbyPipe.transform(this.codes, 'dialCode'); this.codes = this.orderbyPipe.transform(this.codes, 'dialCode');
}) })
}
ionViewDidEnter(){ this.events.subscribe('user:lang', data => {
setTimeout(() => {
this.langTrans();
}, 500);
})
}
langTrans() {
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -53,9 +58,12 @@ export class ProfilePage { ...@@ -53,9 +58,12 @@ export class ProfilePage {
this.translate.use('en') this.translate.use('en')
} }
}) })
}
this.storage.get('user_data').then(data=>{ ionViewDidEnter() {
if(data){ this.langTrans();
this.storage.get('user_data').then(data => {
if (data) {
this.local = data this.local = data
this.profileForm.controls['name'].setValue(this.local.name) this.profileForm.controls['name'].setValue(this.local.name)
this.profileForm.controls['email'].setValue(this.local.email) this.profileForm.controls['email'].setValue(this.local.email)
...@@ -71,18 +79,18 @@ export class ProfilePage { ...@@ -71,18 +79,18 @@ export class ProfilePage {
}) })
} }
update(){ update() {
if(this.profileForm.value.password.length>0){ if (this.profileForm.value.password.length > 0) {
this.profileForm.controls["new"].setValidators([Validators.minLength(6), Validators.required]); this.profileForm.controls["new"].setValidators([Validators.minLength(6), Validators.required]);
this.profileForm.controls["confirm"].setValidators([Validators.required]), this.MatchPassword.bind(this); this.profileForm.controls["confirm"].setValidators([Validators.required]), this.MatchPassword.bind(this);
this.profileForm.controls["confirm"].setAsyncValidators(this.MatchPassword.bind(this)) this.profileForm.controls["confirm"].setAsyncValidators(this.MatchPassword.bind(this))
} }
if(this.profileForm.valid){ if (this.profileForm.valid) {
this.myservice.show_loader() this.myservice.show_loader()
this.formdata.append('data', JSON.stringify(this.profileForm.value)); this.formdata.append('data', JSON.stringify(this.profileForm.value));
this.formdata.append('id', JSON.stringify(this.local.id)); this.formdata.append('id', JSON.stringify(this.local.id));
this.myservice.fileUpload(this.formdata,'update_user').subscribe(response=>{ this.myservice.fileUpload(this.formdata, 'update_user').subscribe(response => {
if(response.status=='success'){ if (response.status == 'success') {
this.local = response.data this.local = response.data
var This = this var This = this
setTimeout(() => { setTimeout(() => {
...@@ -90,7 +98,7 @@ export class ProfilePage { ...@@ -90,7 +98,7 @@ export class ProfilePage {
This.events.publish('user:profile', This.local); This.events.publish('user:profile', This.local);
}, 500); }, 500);
} }
else{ else {
this.myservice.hide_loader() this.myservice.hide_loader()
this.translate.get(['profile.' + response.message]).subscribe(value => { this.translate.get(['profile.' + response.message]).subscribe(value => {
this.myservice.show_alert('', value['profile.' + response.message]) this.myservice.show_alert('', value['profile.' + response.message])
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angular'; import { IonicPage, NavController, NavParams,ViewController,MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
...@@ -13,12 +13,13 @@ export class RatecardPage { ...@@ -13,12 +13,13 @@ export class RatecardPage {
rates:any; rates:any;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, private data: dataService, private translate: TranslateService, private storage: Storage) { constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, private data: dataService, private translate: TranslateService, private storage: Storage, private menu:MenuController) {
this.rates = this.data.getrateData() this.rates = this.data.getrateData()
console.log(this.rates) console.log(this.rates)
} }
ionViewDidEnter(){ ionViewDidEnter(){
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -35,4 +36,8 @@ export class RatecardPage { ...@@ -35,4 +36,8 @@ export class RatecardPage {
this.viewCtrl.dismiss(); this.viewCtrl.dismiss();
} }
ionViewWillLeave() {
this.menu.swipeEnable(true)
}
} }
import { Component, NgZone } from '@angular/core'; import { Component, NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform, LoadingController, AlertController } from 'ionic-angular'; import { IonicPage, NavController, NavParams, Platform, LoadingController, AlertController, MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
...@@ -28,11 +28,11 @@ export class RidedetailPage { ...@@ -28,11 +28,11 @@ export class RidedetailPage {
lang: string = 'en'; lang: string = 'en';
baseUrl :string = this.myservice.base_url baseUrl :string = this.myservice.base_url
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, public loadingCtrl: LoadingController, private alertCtrl: AlertController, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, public loadingCtrl: LoadingController, private alertCtrl: AlertController, private translate: TranslateService, private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -224,6 +224,7 @@ export class RidedetailPage { ...@@ -224,6 +224,7 @@ export class RidedetailPage {
ionViewWillLeave() { ionViewWillLeave() {
this.unregisterBackButtonAction && this.unregisterBackButtonAction(); this.unregisterBackButtonAction && this.unregisterBackButtonAction();
this.menu.swipeEnable(true)
} }
track() { track() {
......
import { Component,NgZone } from '@angular/core'; import { Component,NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams,ViewController,ModalController } from 'ionic-angular'; import { IonicPage, NavController, NavParams,ViewController,ModalController,MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
...@@ -17,10 +17,11 @@ export class RidenowPage { ...@@ -17,10 +17,11 @@ export class RidenowPage {
totRate:string; totRate:string;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, private data: dataService, private myservice: Myservice, private zone: NgZone, private translate: TranslateService, private storage: Storage) { constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, public modalCtrl: ModalController, private data: dataService, private myservice: Myservice, private zone: NgZone, private translate: TranslateService, private storage: Storage, private menu :MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -76,9 +77,6 @@ export class RidenowPage { ...@@ -76,9 +77,6 @@ export class RidenowPage {
addcoupon() { addcoupon() {
this.viewCtrl.dismiss(this.totRate); this.viewCtrl.dismiss(this.totRate);
// this.navCtrl.push('AddcouponPage',{rate:this.totRate});
// let modal = this.modalCtrl.create('AddcouponPage');
// modal.present();
} }
ratecard() { ratecard() {
...@@ -87,4 +85,8 @@ export class RidenowPage { ...@@ -87,4 +85,8 @@ export class RidenowPage {
modal.present(); modal.present();
} }
ionViewWillLeave() {
this.menu.swipeEnable(true)
}
} }
import { Component, NgZone } from '@angular/core'; import { Component, NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular'; import { IonicPage, NavController, NavParams, Platform,MenuController } from 'ionic-angular';
import { dataService } from "../../providers/common.service"; import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
...@@ -24,10 +24,11 @@ export class RidesummaryPage { ...@@ -24,10 +24,11 @@ export class RidesummaryPage {
lang: string = 'en'; lang: string = 'en';
baseUrl:string = this.myservice.base_url baseUrl:string = this.myservice.base_url
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform, private translate: TranslateService, private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -111,6 +112,7 @@ export class RidesummaryPage { ...@@ -111,6 +112,7 @@ export class RidesummaryPage {
ionViewWillLeave() { ionViewWillLeave() {
this.unregisterBackButtonAction && this.unregisterBackButtonAction(); this.unregisterBackButtonAction && this.unregisterBackButtonAction();
this.menu.swipeEnable(true)
} }
close() { close() {
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ViewController } from 'ionic-angular'; import { IonicPage, NavController, NavParams, ViewController,MenuController } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { user, search } from "../../models/mymodel"; import { user, search } from "../../models/mymodel";
...@@ -16,10 +16,11 @@ export class SearchridePage { ...@@ -16,10 +16,11 @@ export class SearchridePage {
searchText: string; searchText: string;
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, private myservice: Myservice, private storage: Storage, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, public viewCtrl: ViewController, private myservice: Myservice, private storage: Storage, private translate: TranslateService, private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -57,4 +58,7 @@ export class SearchridePage { ...@@ -57,4 +58,7 @@ export class SearchridePage {
this.viewCtrl.dismiss(); this.viewCtrl.dismiss();
} }
ionViewWillLeave() {
this.menu.swipeEnable(true)
}
} }
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams,MenuController } from 'ionic-angular';
import { Myservice } from "../../providers/myservice"; import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage"; import { Storage } from "@ionic/storage";
import { user } from "../../models/mymodel"; import { user } from "../../models/mymodel";
...@@ -17,10 +17,11 @@ export class TripdetailsPage { ...@@ -17,10 +17,11 @@ export class TripdetailsPage {
local:user local:user
lang: string = 'en'; lang: string = 'en';
constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast, private callNumber: CallNumber, private translate: TranslateService) { constructor(public navCtrl: NavController, public navParams: NavParams, private myservice: Myservice, private storage: Storage, private toast: Toast, private callNumber: CallNumber, private translate: TranslateService, private menu:MenuController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.menu.swipeEnable(false)
this.storage.get('lang').then(lang => { this.storage.get('lang').then(lang => {
if (lang != null) { if (lang != null) {
this.translate.use(lang) this.translate.use(lang)
...@@ -95,4 +96,7 @@ export class TripdetailsPage { ...@@ -95,4 +96,7 @@ export class TripdetailsPage {
}) })
} }
ionViewWillLeave() {
this.menu.swipeEnable(true)
}
} }
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