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
a9c1d65f
Commit
a9c1d65f
authored
Jun 20, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
june 20
parent
1844f945
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
211 additions
and
94 deletions
+211
-94
config.xml
config.xml
+2
-2
package.json
package.json
+2
-1
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
+91
-13
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 @
a9c1d65f
<?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>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
@@ -102,5 +102,5 @@
<plugin
name=
"cordova-plugin-x-toast"
spec=
"^2.6.2"
/>
<plugin
name=
"ionic-plugin-keyboard"
spec=
"^2.2.1"
/>
<plugin
name=
"mx.ferreyra.callnumber"
spec=
"~0.0.2"
/>
<engine
name=
"android"
spec=
"
latest
"
/>
<engine
name=
"android"
spec=
"
7.1.0
"
/>
</widget>
package.json
View file @
a9c1d65f
...
...
@@ -91,4 +91,4 @@
"android"
]
}
}
}
\ No newline at end of file
src/pages/addcoupon/addcoupon.ts
View file @
a9c1d65f
...
...
@@ -63,6 +63,7 @@ export class AddcouponPage {
this
.
promo
=
response
.
data
this
.
promoBtn
=
true
;
this
.
booking
.
promocode
=
this
.
promoForm
.
value
.
promocode
this
.
booking
.
discount
=
this
.
promo
.
discount
}
else
{
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
...
...
src/pages/confirmride/confirmride.ts
View file @
a9c1d65f
...
...
@@ -27,7 +27,7 @@ export class ConfirmridePage {
this
.
book
=
this
.
data
.
getbookingData
()
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
.
hide_loader
()
...
...
src/pages/home/home.ts
View file @
a9c1d65f
...
...
@@ -228,20 +228,24 @@ export class HomePage {
}
searchride
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'SearchridePage'
);
modal
.
onDidDismiss
(
data
=>
{
if
(
data
){
var
directionsService
=
new
google
.
maps
.
DirectionsService
;
this
.
navCtrl
.
push
(
'PaymentPage'
)
// let modal = this.modalCtrl.create('SearchridePage');
// modal.onDidDismiss(data=>{
// 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
);
var
dest
=
new
google
.
maps
.
LatLng
(
data
.
droplat
,
data
.
droplng
);
// this.directionsDisplay.setMap(this.map);
this
.
calculateAndDisplayRoute
(
directionsService
,
this
.
directionsDisplay
,
start
,
dest
);
}
})
modal
.
present
();
// var start = new google.maps.LatLng(data.picklat, data.picklng);
// var dest = new google.maps.LatLng(data.droplat, data.droplng);
// this.calculateAndDisplayRoute(directionsService, this.directionsDisplay, start, dest);
// }
// })
// modal.present();
}
ionViewWillLeave
(){
...
...
src/pages/map/map.ts
View file @
a9c1d65f
...
...
@@ -52,19 +52,30 @@ export class MapPage {
var
directionsService
=
new
google
.
maps
.
DirectionsService
;
This
.
directionsDisplay
.
setMap
(
This
.
map
);
This
.
directionsDisplay
.
setOptions
({
suppressMarkers
:
true
});
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
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
);
}
});
}
// ionViewDidLoad() {
// this.loadMap();
// }
loadMap
(
lat
,
lng
){
let
latLng
=
new
google
.
maps
.
LatLng
(
lat
,
lng
);
...
...
@@ -118,6 +129,19 @@ export class MapPage {
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
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){
var
locRef
=
firebase
.
database
().
ref
().
child
(
'/drivers/'
);
...
...
src/pages/payment/payment.html
View file @
a9c1d65f
...
...
@@ -23,7 +23,7 @@
<p
style=
"padding-top: 0px;margin-top: 0px;margin-bottom: 0px;"
>
Payment Details
</p>
<li>
<div
class=
"child textLeft"
>
Total
</div>
<div
class=
"child textRight"
>
$ 150
</div>
<div
class=
"child textRight"
>
Rs. {{ride.?amount}}
</div>
<div
class=
"clear"
></div>
</li>
<li>
...
...
src/pages/payment/payment.ts
View file @
a9c1d65f
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
}
from
'ionic-angular'
;
import
{
Component
,
NgZone
}
from
'@angular/core'
;
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
()
@
Component
({
...
...
@@ -9,21 +15,93 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
})
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
)
{
}
ionViewDidLoad
()
{
console
.
log
(
'ionViewDidLoad PaymentPage'
);
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
// }
// })
}
dismiss
()
{
this
.
viewCtrl
.
dismiss
();
public
initializeBackButtonCustomHandler
():
void
{
this
.
unregisterBackButtonAction
=
this
.
platform
.
registerBackButtonAction
(()
=>
{
// this.customHandleBackButton();
},
10
);
}
ionViewWillLeave
()
{
this
.
unregisterBackButtonAction
&&
this
.
unregisterBackButtonAction
();
}
open_page
(
page
){
this
.
navCtrl
.
push
(
page
);
this
.
viewCtrl
.
dismiss
();
close
()
{
this
.
navCtrl
.
push
(
'RattingPage'
,
{
driver
:
this
.
driver
})
}
}
src/pages/ridedetail/ridedetail.ts
View file @
a9c1d65f
...
...
@@ -34,9 +34,10 @@ export class RidedetailPage {
this
.
local
=
data
this
.
book
=
this
.
data
.
getbookingData
()
console
.
log
(
this
.
book
)
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
({
content
:
"Searching for driver"
...
...
src/pages/ridesummary/ridesummary.html
View file @
a9c1d65f
...
...
@@ -68,26 +68,25 @@
<ion-row>
<!-- <ion-col col-2 class="jr_padding0">
<div class="jr_car_info_photo"><img src="assets/img/jr_car_img.png"></div>
</ion-col>
<ion-col col-4 class="">
</ion-col>
-->
<ion-col
col-4
class=
"
jr_padding0
"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<h6>Audi A8</h6>
<p>Blue
Luxury</p>
<p>
Total
</p>
<h6>
{{ride?.km}} km
</h6>
</div>
<div
class=
"jr_clear"
></div>
</ion-col>
-->
<ion-col
col-
3
class=
"jr_padding0"
>
</ion-col>
<ion-col
col-
4
class=
"jr_padding0"
>
<div
class=
"jr_car_info_detail jr_padding0"
>
<p>
Total
</p>
<h6>
{{ride.km}} km
</h6>
<p>
Discount
</p>
<h6>
Rs. {{ride?.discount}}
</h6>
</div>
<div
class=
"jr_clear"
></div>
</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"
>
<p>
Total Price
</p>
<h6>
Rs. {{ride.amount}}
</h6>
<h6>
Rs. {{ride
?
.amount}}
</h6>
</div>
<div
class=
"jr_clear"
></div>
</ion-col>
...
...
src/pages/ridesummary/ridesummary.scss
View file @
a9c1d65f
...
...
@@ -411,7 +411,7 @@ font-weight: 400;
.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_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
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
;}
...
...
src/pages/ridesummary/ridesummary.ts
View file @
a9c1d65f
...
...
@@ -25,58 +25,67 @@ export class RidesummaryPage {
}
ionViewDidEnter
()
{
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
=
{
'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.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.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
:
this
.
book
.
bookingId
},
'getRideDetails'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
){
this
.
ride
=
resp
.
data
}
})
//
this.myservice.load_post({ bookingId: this.book.bookingId},'getRideDetails').subscribe(resp=>{
//
if(resp.status == 'success'){
//
this.ride = resp.data
//
}
//
})
}
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