Commit 69bdc4fc by Alen Jose

july24

parent a620aff1
...@@ -46,8 +46,8 @@ export class MyApp { ...@@ -46,8 +46,8 @@ export class MyApp {
this.statusBar.styleDefault(); this.statusBar.styleDefault();
this.splashScreen.hide(); this.splashScreen.hide();
// this.enableLoc(); this.enableLoc();
// this.initOnesignal() this.initOnesignal()
this.network.onDisconnect().subscribe(() => { this.network.onDisconnect().subscribe(() => {
......
...@@ -194,7 +194,7 @@ export class MapPage { ...@@ -194,7 +194,7 @@ export class MapPage {
dimage.rotation = heading; dimage.rotation = heading;
marker.setIcon(dimage); marker.setIcon(dimage);
// if (google.maps.geometry.spherical.computeDistanceBetween(myLoc, destLoc) < 50){ if (google.maps.geometry.spherical.computeDistanceBetween(myLoc, destLoc) < 50){
var locRef = firebase.database().ref().child('/drivers/'); var locRef = firebase.database().ref().child('/drivers/');
locRef.orderByChild("id").equalTo((This.driver.driverId)).on("value", function (snapshot) { locRef.orderByChild("id").equalTo((This.driver.driverId)).on("value", function (snapshot) {
...@@ -210,7 +210,7 @@ export class MapPage { ...@@ -210,7 +210,7 @@ export class MapPage {
This.navCtrl.setRoot('PaymentPage') This.navCtrl.setRoot('PaymentPage')
} }
}) })
// } }
This.calculateAndDisplayRoute(directionsService, This.directionsDisplay, myLoc, destLoc); This.calculateAndDisplayRoute(directionsService, This.directionsDisplay, myLoc, destLoc);
}); });
} }
......
...@@ -81,7 +81,7 @@ export class PaymentPage { ...@@ -81,7 +81,7 @@ export class PaymentPage {
if (this.ride.discount) { if (this.ride.discount) {
if (this.ride.discount.slice(-1) == '%') { if (this.ride.discount.slice(-1) == '%') {
var disc_amt = this.ride.discount.slice(0, -1) var disc_amt = this.ride.discount.slice(0, -1)
this.ride.discount = Number(this.ride.amount) * (disc_amt / 100) this.ride.discount = Number(this.ride.amount) * (Number(disc_amt) / 100)
} }
} }
else { else {
......
...@@ -9,8 +9,8 @@ import * as firebase from 'firebase'; ...@@ -9,8 +9,8 @@ import * as firebase from 'firebase';
declare var google; declare var google;
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-ridesummary', selector: 'page-ridesummary',
templateUrl: 'ridesummary.html', templateUrl: 'ridesummary.html',
}) })
export class RidesummaryPage { export class RidesummaryPage {
book: any; book: any;
...@@ -19,73 +19,80 @@ export class RidesummaryPage { ...@@ -19,73 +19,80 @@ export class RidesummaryPage {
local: user local: user
public unregisterBackButtonAction: any; public unregisterBackButtonAction: any;
driver: any; driver: any;
ride:any; ride: any;
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform) { constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.driver = { 'name': 'asd', 'rating': '1','ratingCount':'1','image':''} // this.driver = { 'name': 'asd', 'rating': '1','ratingCount':'1','image':''}
this.ride = { 'km': 30, 'amount': '300','discount':'10%'} // this.ride = { 'km': 30, 'amount': '300','discount':'10%'}
if(this.ride.discount){ // if(this.ride.discount){
if(this.ride.discount.slice(-1) == '%'){ // if(this.ride.discount.slice(-1) == '%'){
var disc_amt = this.ride.discount.slice(0, -1) // var disc_amt = this.ride.discount.slice(0, -1)
this.ride.discount = Number(this.ride.amount) * (disc_amt/100) // this.ride.discount = Number(this.ride.amount) * (disc_amt/100)
console.log() // console.log()
} // }
} // }
// this.initializeBackButtonCustomHandler(); this.initializeBackButtonCustomHandler();
// this.storage.get('user_data').then(data => { this.storage.get('user_data').then(data => {
// if (data) { if (data) {
// this.local = data this.local = data
// this.book = this.data.getbookingData() this.book = this.data.getbookingData()
// console.log(this.book) console.log(this.book)
// this.driver = this.data.getdriverData() this.driver = this.data.getdriverData()
// console.log(this.driver) console.log(this.driver)
// this.geocoder = new google.maps.Geocoder(); this.geocoder = new google.maps.Geocoder();
// for (let i = 0; i < 2; i++) { for (let i = 0; i < 2; i++) {
// if (i == 0) { if (i == 0) {
// var lat = this.book.pickLat var lat = this.book.pickLat
// var lng = this.book.pickLng var lng = this.book.pickLng
// } }
// else { else {
// var lat = this.book.dropLat var lat = this.book.dropLat
// var lng = this.book.dropLng var lng = this.book.dropLng
// } }
// var latlng = new google.maps.LatLng(lat, lng); var latlng = new google.maps.LatLng(lat, lng);
// var This = this; var This = this;
// This.geocoder.geocode({ 'latLng': latlng }, function (results, status) { This.geocoder.geocode({ 'latLng': latlng }, function (results, status) {
// if (status == google.maps.GeocoderStatus.OK) { if (status == google.maps.GeocoderStatus.OK) {
// if (results[0]) { if (results[0]) {
// if (i == 0) { if (i == 0) {
// var temp = This.book.pickArea.split(',') var temp = This.book.pickArea.split(',')
// This.loc.from = temp[0] This.loc.from = temp[0]
// This.loc.fromAd = results[0].formatted_address This.loc.fromAd = results[0].formatted_address
// } }
// else { else {
// var temp = This.book.dropArea.split(',') var temp = This.book.dropArea.split(',')
// This.loc.to = temp[0] This.loc.to = temp[0]
// This.loc.toAd = results[0].formatted_address This.loc.toAd = results[0].formatted_address
// This.zone.run(() => { }); This.zone.run(() => { });
// } }
// } }
// } }
// else { else {
// console.log("Geocoder failed due to: " + status); console.log("Geocoder failed due to: " + status);
// } }
// }); });
// } }
// } }
// }) })
// this.myservice.load_post({ bookingId: this.book.bookingId},'getRideDetails').subscribe(resp=>{ this.myservice.load_post({ bookingId: this.book.bookingId }, 'getRideDetails').subscribe(resp => {
// if(resp.status == 'success'){ if (resp.status == 'success') {
// this.ride = resp.data this.ride = resp.data
// }
// }) if (this.ride.discount) {
if (this.ride.discount.slice(-1) == '%') {
var disc_amt = this.ride.discount.slice(0, -1)
this.ride.discount = Number(this.ride.amount) * (Number(disc_amt) / 100)
}
}
}
})
} }
public initializeBackButtonCustomHandler(): void { public initializeBackButtonCustomHandler(): void {
...@@ -98,8 +105,8 @@ export class RidesummaryPage { ...@@ -98,8 +105,8 @@ export class RidesummaryPage {
this.unregisterBackButtonAction && this.unregisterBackButtonAction(); this.unregisterBackButtonAction && this.unregisterBackButtonAction();
} }
close(){ close() {
this.navCtrl.push('RattingPage',{driver:this.driver}) this.navCtrl.push('RattingPage', { driver: this.driver })
} }
} }
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