Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Callmycab-Userapp
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kevin
Callmycab-Userapp
Commits
72c92560
Commit
72c92560
authored
Jun 21, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
june 20 See merge request alen/CMC_revamp!11
parents
1844f945
a9c1d65f
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
207 additions
and
91 deletions
+207
-91
config.xml
config.xml
+2
-2
package.json
package.json
+0
-0
addcoupon.ts
src/pages/addcoupon/addcoupon.ts
+1
-0
confirmride.ts
src/pages/confirmride/confirmride.ts
+1
-1
home.ts
src/pages/home/home.ts
+15
-11
map.ts
src/pages/map/map.ts
+28
-4
payment.html
src/pages/payment/payment.html
+1
-1
payment.ts
src/pages/payment/payment.ts
+89
-11
ridedetail.ts
src/pages/ridedetail/ridedetail.ts
+2
-1
ridesummary.html
src/pages/ridesummary/ridesummary.html
+10
-11
ridesummary.scss
src/pages/ridesummary/ridesummary.scss
+1
-1
ridesummary.ts
src/pages/ridesummary/ridesummary.ts
+57
-48
No files found.
config.xml
View file @
72c92560
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"com.techware.cmc"
version=
"0.0.1"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"com.techware.cmc
_revamp
"
version=
"0.0.1"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
CMC
</name>
<name>
CMC
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
@@ -102,5 +102,5 @@
...
@@ -102,5 +102,5 @@
<plugin
name=
"cordova-plugin-x-toast"
spec=
"^2.6.2"
/>
<plugin
name=
"cordova-plugin-x-toast"
spec=
"^2.6.2"
/>
<plugin
name=
"ionic-plugin-keyboard"
spec=
"^2.2.1"
/>
<plugin
name=
"ionic-plugin-keyboard"
spec=
"^2.2.1"
/>
<plugin
name=
"mx.ferreyra.callnumber"
spec=
"~0.0.2"
/>
<plugin
name=
"mx.ferreyra.callnumber"
spec=
"~0.0.2"
/>
<engine
name=
"android"
spec=
"
latest
"
/>
<engine
name=
"android"
spec=
"
7.1.0
"
/>
</widget>
</widget>
package.json
View file @
72c92560
src/pages/addcoupon/addcoupon.ts
View file @
72c92560
...
@@ -63,6 +63,7 @@ export class AddcouponPage {
...
@@ -63,6 +63,7 @@ export class AddcouponPage {
this
.
promo
=
response
.
data
this
.
promo
=
response
.
data
this
.
promoBtn
=
true
;
this
.
promoBtn
=
true
;
this
.
booking
.
promocode
=
this
.
promoForm
.
value
.
promocode
this
.
booking
.
promocode
=
this
.
promoForm
.
value
.
promocode
this
.
booking
.
discount
=
this
.
promo
.
discount
}
}
else
{
else
{
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
...
...
src/pages/confirmride/confirmride.ts
View file @
72c92560
...
@@ -27,7 +27,7 @@ export class ConfirmridePage {
...
@@ -27,7 +27,7 @@ export class ConfirmridePage {
this
.
book
=
this
.
data
.
getbookingData
()
this
.
book
=
this
.
data
.
getbookingData
()
console
.
log
(
this
.
book
)
console
.
log
(
this
.
book
)
var
bdata
=
{
'book_date'
:
this
.
book
.
date
,
'drop_area'
:
this
.
book
.
dropArea
,
'pickup_area'
:
this
.
book
.
pickArea
,
'taxi_type'
:
this
.
book
.
carDetails
.
car_type
,
'amount'
:
''
,
'km'
:
''
,
'promocode'
:
this
.
book
.
promocode
,
'token'
:
this
.
local
.
token
,
'userid'
:
this
.
local
.
id
,
'type'
:
'later'
,
'drivers'
:
[]
}
var
bdata
=
{
'book_date'
:
this
.
book
.
date
,
'drop_area'
:
this
.
book
.
dropArea
,
'pickup_area'
:
this
.
book
.
pickArea
,
'taxi_type'
:
this
.
book
.
carDetails
.
car_type
,
'amount'
:
''
,
'km'
:
''
,
'promocode'
:
this
.
book
.
promocode
,
'token'
:
this
.
local
.
token
,
'userid'
:
this
.
local
.
id
,
'type'
:
'later'
,
'drivers'
:
[]
,
'discount'
:
this
.
book
.
discount
?
this
.
book
.
discount
:
0
}
this
.
myservice
.
load_post
(
bdata
,
'book_cab'
).
subscribe
(
response
=>
{
this
.
myservice
.
load_post
(
bdata
,
'book_cab'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
this
.
myservice
.
hide_loader
()
...
...
src/pages/home/home.ts
View file @
72c92560
...
@@ -228,20 +228,24 @@ export class HomePage {
...
@@ -228,20 +228,24 @@ export class HomePage {
}
}
searchride
()
{
searchride
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'SearchridePage'
);
this
.
navCtrl
.
push
(
'PaymentPage'
)
modal
.
onDidDismiss
(
data
=>
{
// let modal = this.modalCtrl.create('SearchridePage');
if
(
data
){
// modal.onDidDismiss(data=>{
var
directionsService
=
new
google
.
maps
.
DirectionsService
;
// if(data){
// this.locForm.controls['pickLoc'].setValue(data.pickloc)
// this.locForm.controls['dropLoc'].setValue(data.droploc)
this
.
directionsDisplay
.
setMap
(
this
.
map
)
;
// var directionsService = new google.maps.DirectionsService
;
var
start
=
new
google
.
maps
.
LatLng
(
data
.
picklat
,
data
.
picklng
);
// this.directionsDisplay.setMap(this.map);
var
dest
=
new
google
.
maps
.
LatLng
(
data
.
droplat
,
data
.
droplng
);
this
.
calculateAndDisplayRoute
(
directionsService
,
this
.
directionsDisplay
,
start
,
dest
);
// var start = new google.maps.LatLng(data.picklat, data.picklng);
}
// var dest = new google.maps.LatLng(data.droplat, data.droplng);
})
modal
.
present
();
// this.calculateAndDisplayRoute(directionsService, this.directionsDisplay, start, dest);
// }
// })
// modal.present();
}
}
ionViewWillLeave
(){
ionViewWillLeave
(){
...
...
src/pages/map/map.ts
View file @
72c92560
...
@@ -52,19 +52,30 @@ export class MapPage {
...
@@ -52,19 +52,30 @@ export class MapPage {
var
directionsService
=
new
google
.
maps
.
DirectionsService
;
var
directionsService
=
new
google
.
maps
.
DirectionsService
;
This
.
directionsDisplay
.
setMap
(
This
.
map
);
This
.
directionsDisplay
.
setMap
(
This
.
map
);
This
.
directionsDisplay
.
setOptions
({
suppressMarkers
:
true
});
var
pickLoc
=
new
google
.
maps
.
LatLng
(
This
.
bookData
.
pickLat
,
This
.
bookData
.
pickLng
);
var
pickLoc
=
new
google
.
maps
.
LatLng
(
This
.
bookData
.
pickLat
,
This
.
bookData
.
pickLng
);
var
driverLoc
=
new
google
.
maps
.
LatLng
(
res_arr
[
0
].
lat
,
res_arr
[
0
].
lng
);
var
driverLoc
=
new
google
.
maps
.
LatLng
(
res_arr
[
0
].
lat
,
res_arr
[
0
].
lng
);
var
dimage
=
{
url
:
'assets/img/map_label.png'
,
scaledSize
:
new
google
.
maps
.
Size
(
50
,
22
),
origin
:
new
google
.
maps
.
Point
(
0
,
0
),
anchor
:
new
google
.
maps
.
Point
(
25
,
12
)
};
var
marker
=
new
google
.
maps
.
Marker
({
position
:
driverLoc
,
map
:
This
.
map
,
icon
:
dimage
});
This
.
calculateAndDisplayRoute
(
directionsService
,
This
.
directionsDisplay
,
pickLoc
,
driverLoc
);
This
.
calculateAndDisplayRoute
(
directionsService
,
This
.
directionsDisplay
,
pickLoc
,
driverLoc
);
}
}
});
});
}
}
// ionViewDidLoad() {
// this.loadMap();
// }
loadMap
(
lat
,
lng
){
loadMap
(
lat
,
lng
){
let
latLng
=
new
google
.
maps
.
LatLng
(
lat
,
lng
);
let
latLng
=
new
google
.
maps
.
LatLng
(
lat
,
lng
);
...
@@ -118,6 +129,19 @@ export class MapPage {
...
@@ -118,6 +129,19 @@ export class MapPage {
var
destLoc
=
new
google
.
maps
.
LatLng
(
This
.
bookData
.
dropLat
,
This
.
bookData
.
dropLng
);
var
destLoc
=
new
google
.
maps
.
LatLng
(
This
.
bookData
.
dropLat
,
This
.
bookData
.
dropLng
);
var
myLoc
=
new
google
.
maps
.
LatLng
(
position
.
coords
.
latitude
,
position
.
coords
.
longitude
);
var
myLoc
=
new
google
.
maps
.
LatLng
(
position
.
coords
.
latitude
,
position
.
coords
.
longitude
);
var
dimage
=
{
url
:
'assets/img/map_label.png'
,
scaledSize
:
new
google
.
maps
.
Size
(
50
,
22
),
origin
:
new
google
.
maps
.
Point
(
0
,
0
),
anchor
:
new
google
.
maps
.
Point
(
25
,
12
)
};
var
marker
=
new
google
.
maps
.
Marker
({
position
:
myLoc
,
map
:
This
.
map
,
icon
:
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/'
);
...
...
src/pages/payment/payment.html
View file @
72c92560
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<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 Details
</p>
<li>
<li>
<div
class=
"child textLeft"
>
Total
</div>
<div
class=
"child textLeft"
>
Total
</div>
<div
class=
"child textRight"
>
$ 150
</div>
<div
class=
"child textRight"
>
Rs. {{ride.?amount}}
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</li>
</li>
<li>
<li>
...
...
src/pages/payment/payment.ts
View file @
72c92560
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
NgZone
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
Platform
}
from
'ionic-angular'
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
}
from
"../../models/mymodel"
;
import
*
as
firebase
from
'firebase'
;
declare
var
google
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -9,21 +15,93 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
...
@@ -9,21 +15,93 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
})
})
export
class
PaymentPage
{
export
class
PaymentPage
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
)
{
book
:
any
;
geocoder
:
any
;
loc
=
{
from
:
''
,
to
:
''
,
fromAd
:
''
,
toAd
:
''
}
local
:
user
public
unregisterBackButtonAction
:
any
;
driver
:
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
)
{
}
ionViewDidEnter
()
{
this
.
driver
=
{
'name'
:
'asd'
,
'rating'
:
'1'
,
'ratingCount'
:
'1'
,
'image'
:
''
}
this
.
ride
=
{
'km'
:
30
,
'amount'
:
'300'
,
'discount'
:
'10%'
}
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
)
*
(
disc_amt
/
100
)
console
.
log
()
}
}
// this.initializeBackButtonCustomHandler();
// this.storage.get('user_data').then(data => {
// if (data) {
// this.local = data
// this.book = this.data.getbookingData()
// console.log(this.book)
// this.driver = this.data.getdriverData()
// console.log(this.driver)
// this.geocoder = new google.maps.Geocoder();
// for (let i = 0; i < 2; i++) {
// if (i == 0) {
// var lat = this.book.pickLat
// var lng = this.book.pickLng
// }
// else {
// var lat = this.book.dropLat
// var lng = this.book.dropLng
// }
// var latlng = new google.maps.LatLng(lat, lng);
// var This = this;
// This.geocoder.geocode({ 'latLng': latlng }, function (results, status) {
// if (status == google.maps.GeocoderStatus.OK) {
// if (results[0]) {
// if (i == 0) {
// var temp = This.book.pickArea.split(',')
// This.loc.from = temp[0]
// This.loc.fromAd = results[0].formatted_address
// }
// else {
// var temp = This.book.dropArea.split(',')
// This.loc.to = temp[0]
// This.loc.toAd = results[0].formatted_address
// This.zone.run(() => { });
// }
// }
// }
// else {
// console.log("Geocoder failed due to: " + status);
// }
// });
// }
// }
// })
// this.myservice.load_post({ bookingId: 10/*this.book.bookingId*/},'getRideDetails').subscribe(resp=>{
// if(resp.status == 'success'){
// this.ride = resp.data
// }
// })
}
}
ionViewDidLoad
()
{
public
initializeBackButtonCustomHandler
():
void
{
console
.
log
(
'ionViewDidLoad PaymentPage'
);
this
.
unregisterBackButtonAction
=
this
.
platform
.
registerBackButtonAction
(()
=>
{
// this.customHandleBackButton();
},
10
);
}
}
dismiss
()
ionViewWillLeave
()
{
{
this
.
unregisterBackButtonAction
&&
this
.
unregisterBackButtonAction
();
this
.
viewCtrl
.
dismiss
();
}
}
open_page
(
page
){
close
()
{
this
.
navCtrl
.
push
(
page
);
this
.
navCtrl
.
push
(
'RattingPage'
,
{
driver
:
this
.
driver
})
this
.
viewCtrl
.
dismiss
();
}
}
}
}
src/pages/ridedetail/ridedetail.ts
View file @
72c92560
...
@@ -34,9 +34,10 @@ export class RidedetailPage {
...
@@ -34,9 +34,10 @@ export class RidedetailPage {
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
.
findDrivers
()
this
.
findDrivers
()
var
bdata
=
{
'book_date'
:
this
.
book
.
date
,
'drop_area'
:
this
.
book
.
dropArea
,
'pickup_area'
:
this
.
book
.
pickArea
,
'taxi_type'
:
this
.
book
.
carDetails
.
car_type
,
'amount'
:
''
,
'km'
:
''
,
'promocode'
:
this
.
book
.
promocode
,
'token'
:
this
.
local
.
token
,
'userid'
:
this
.
local
.
id
,
'type'
:
'now'
,
'drivers'
:[]
}
var
bdata
=
{
'book_date'
:
this
.
book
.
date
,
'drop_area'
:
this
.
book
.
dropArea
,
'pickup_area'
:
this
.
book
.
pickArea
,
'taxi_type'
:
this
.
book
.
carDetails
.
car_type
,
'amount'
:
''
,
'km'
:
''
,
'promocode'
:
this
.
book
.
promocode
,
'token'
:
this
.
local
.
token
,
'userid'
:
this
.
local
.
id
,
'type'
:
'now'
,
'drivers'
:
[],
'discount'
:
this
.
book
.
discount
?
this
.
book
.
discount
:
0
}
this
.
loader
=
this
.
loadingCtrl
.
create
({
this
.
loader
=
this
.
loadingCtrl
.
create
({
content
:
"Searching for driver"
content
:
"Searching for driver"
...
...
src/pages/ridesummary/ridesummary.html
View file @
72c92560
...
@@ -68,26 +68,25 @@
...
@@ -68,26 +68,25 @@
<ion-row>
<ion-row>
<!-- <ion-col col-2 class="jr_padding0">
<!-- <ion-col col-2 class="jr_padding0">
<div class="jr_car_info_photo"><img src="assets/img/jr_car_img.png"></div>
<div class="jr_car_info_photo"><img src="assets/img/jr_car_img.png"></div>
</ion-col>
</ion-col>
-->
<ion-col col-4 class="">
<ion-col
col-4
class=
"
jr_padding0
"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<h6>Audi A8</h6>
<p>
Total
</p>
<p>Blue
<h6>
{{ride?.km}} km
</h6>
Luxury</p>
</div>
</div>
<div
class=
"jr_clear"
></div>
<div
class=
"jr_clear"
></div>
</ion-col>
-->
</ion-col>
<ion-col
col-
3
class=
"jr_padding0"
>
<ion-col
col-
4
class=
"jr_padding0"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<p>
Total
</p>
<p>
Discount
</p>
<h6>
{{ride.km}} km
</h6>
<h6>
Rs. {{ride?.discount}}
</h6>
</div>
</div>
<div
class=
"jr_clear"
></div>
<div
class=
"jr_clear"
></div>
</ion-col>
</ion-col>
<ion-col
col-
3
class=
"jr_padding0 right"
>
<ion-col
col-
4
class=
"jr_padding0 right"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<p>
Total Price
</p>
<p>
Total Price
</p>
<h6>
Rs. {{ride.amount}}
</h6>
<h6>
Rs. {{ride
?
.amount}}
</h6>
</div>
</div>
<div
class=
"jr_clear"
></div>
<div
class=
"jr_clear"
></div>
</ion-col>
</ion-col>
...
...
src/pages/ridesummary/ridesummary.scss
View file @
72c92560
...
@@ -411,7 +411,7 @@ font-weight: 400;
...
@@ -411,7 +411,7 @@ font-weight: 400;
.jr_car_info_photo
{
float
:
left
;
width
:
50px
;
height
:
50px
;
border-radius
:
50%
;}
.jr_car_info_photo
{
float
:
left
;
width
:
50px
;
height
:
50px
;
border-radius
:
50%
;}
.jr_car_info_photo
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
50%
;
object-fit
:
cover
;
object-position
:
center
;}
.jr_car_info_photo
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
50%
;
object-fit
:
cover
;
object-position
:
center
;}
.jr_car_info_detail
{
float
:
left
;
padding
:
10px
;
padding-left
:
20px
;
padding-top
:
0px
;}
.jr_car_info_detail
{
float
:
left
;
padding
:
10px
;
padding-left
:
20px
;
padding-top
:
0px
;}
.jr_car_info_detail
h6
{
margin
:
0px
;}
.jr_car_info_detail
h6
{
margin
:
0px
;
text-align
:
center
}
.jr_car_info_detail
p
{
margin
:
0px
;
padding
:
0px
;}
.jr_car_info_detail
p
{
margin
:
0px
;
padding
:
0px
;}
.jr_car_info_detail
p
img
{
width
:
20px
;}
.jr_car_info_detail
p
img
{
width
:
20px
;}
.jr_report
{
height
:
35px
;
border
:
1px
solid
#000000
;
border-radius
:
20px
;
padding-left
:
20px
;
padding-right
:
20px
;
text-transform
:
capitalize
;
background
:
transparent
;
color
:
#000000
;}
.jr_report
{
height
:
35px
;
border
:
1px
solid
#000000
;
border-radius
:
20px
;
padding-left
:
20px
;
padding-right
:
20px
;
text-transform
:
capitalize
;
background
:
transparent
;
color
:
#000000
;}
...
...
src/pages/ridesummary/ridesummary.ts
View file @
72c92560
...
@@ -25,58 +25,67 @@ export class RidesummaryPage {
...
@@ -25,58 +25,67 @@ export class RidesummaryPage {
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
initializeBackButtonCustomHandler
();
this
.
driver
=
{
'name'
:
'asd'
,
'rating'
:
'1'
,
'ratingCount'
:
'1'
,
'image'
:
''
}
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
this
.
ride
=
{
'km'
:
30
,
'amount'
:
'300'
,
'discount'
:
'10%'
}
if
(
data
)
{
if
(
this
.
ride
.
discount
){
this
.
local
=
data
if
(
this
.
ride
.
discount
.
slice
(
-
1
)
==
'%'
){
this
.
book
=
this
.
data
.
getbookingData
()
var
disc_amt
=
this
.
ride
.
discount
.
slice
(
0
,
-
1
)
console
.
log
(
this
.
book
)
this
.
ride
.
discount
=
Number
(
this
.
ride
.
amount
)
*
(
disc_amt
/
100
)
console
.
log
()
}
}
// this.initializeBackButtonCustomHandler();
// this.storage.get('user_data').then(data => {
// if (data) {
// this.local = data
// this.book = this.data.getbookingData()
// 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
}
//
}
})
//
})
}
}
public
initializeBackButtonCustomHandler
():
void
{
public
initializeBackButtonCustomHandler
():
void
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment