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
212d4c0f
Commit
212d4c0f
authored
Jun 07, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
later See merge request !3
parents
05c4fced
bbee4626
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
125 additions
and
49 deletions
+125
-49
app.module.ts
src/app/app.module.ts
+4
-0
essential.scss
src/assets/css/essential.scss
+5
-2
home.html
src/pages/home/home.html
+2
-4
home.ts
src/pages/home/home.ts
+24
-7
ratecard.ts
src/pages/ratecard/ratecard.ts
+5
-1
ridenow.html
src/pages/ridenow/ridenow.html
+2
-2
ridenow.ts
src/pages/ridenow/ridenow.ts
+15
-5
ridepop.html
src/pages/ridepop/ridepop.html
+1
-2
ridepop.ts
src/pages/ridepop/ridepop.ts
+33
-21
common.service.ts
src/providers/common.service.ts
+29
-0
subject.service.ts
src/providers/subject.service.ts
+5
-5
No files found.
src/app/app.module.ts
View file @
212d4c0f
...
@@ -18,6 +18,8 @@ import { AngularFireDatabase } from 'angularfire2/database';
...
@@ -18,6 +18,8 @@ import { AngularFireDatabase } from 'angularfire2/database';
import
{
Geolocation
}
from
'@ionic-native/geolocation'
;
import
{
Geolocation
}
from
'@ionic-native/geolocation'
;
import
{
DatePicker
}
from
'@ionic-native/date-picker'
;
import
{
DatePicker
}
from
'@ionic-native/date-picker'
;
import
{
LocationAccuracy
}
from
'@ionic-native/location-accuracy'
;
import
{
LocationAccuracy
}
from
'@ionic-native/location-accuracy'
;
import
{
SubjectService
}
from
"../providers/subject.service"
;
import
{
dataService
}
from
"../providers/common.service"
;
export
const
firebaseConfig
=
{
export
const
firebaseConfig
=
{
apiKey
:
"AIzaSyDLrbLd4RCCh86xuTVu7-cfJ28We_cG1sU"
,
apiKey
:
"AIzaSyDLrbLd4RCCh86xuTVu7-cfJ28We_cG1sU"
,
...
@@ -56,6 +58,8 @@ export const firebaseConfig = {
...
@@ -56,6 +58,8 @@ export const firebaseConfig = {
Geolocation
,
Geolocation
,
DatePicker
,
DatePicker
,
LocationAccuracy
,
LocationAccuracy
,
SubjectService
,
dataService
,
]
]
})
})
export
class
AppModule
{}
export
class
AppModule
{}
src/assets/css/essential.scss
View file @
212d4c0f
...
@@ -183,4 +183,7 @@
...
@@ -183,4 +183,7 @@
.edit_circle
{
width
:
30px
;
height
:
30px
;
position
:absolute
;
top
:
0px
;
right
:
0px
;
background-color
:
#f7941e
;
color
:
#fff
;
text-align
:center
;
border-radius
:
50%
;
padding
:
7px
;}
.edit_circle
{
width
:
30px
;
height
:
30px
;
position
:absolute
;
top
:
0px
;
right
:
0px
;
background-color
:
#f7941e
;
color
:
#fff
;
text-align
:center
;
border-radius
:
50%
;
padding
:
7px
;}
.edit_circle
input
{
width
:
100%
;
opacity
:
0
;
z-index
:
99
;
position
:
absolute
;
right
:
0px
;}
.edit_circle
input
{
width
:
100%
;
opacity
:
0
;
z-index
:
99
;
position
:
absolute
;
right
:
0px
;}
.edit_circle
ion-icon
{
position
:
absolute
;
top
:
6px
;
right
:
8px
;}
.edit_circle
ion-icon
{
position
:
absolute
;
top
:
6px
;
right
:
8px
;}
\ No newline at end of file
.picker-wrapper
{
background
:
#ff9000
!
important
;}
.picker-toolbar
{
background
:
#ff9000
!
important
;}
.single_btn
{
width
:
100%
!
important
}
\ No newline at end of file
src/pages/home/home.html
View file @
212d4c0f
...
@@ -19,10 +19,8 @@
...
@@ -19,10 +19,8 @@
</div>
</div>
</form>
</form>
<div
class=
"cab_footer_btn_bay"
>
<div
class=
"cab_footer_btn_bay"
>
<button
ion-button
class=
"cab_footer_btn floatRight"
(
click
)="
ridenow
()"
>
RIDE NOW
</button>
<button
ion-button
class=
"cab_footer_btn single_btn"
(
click
)="
ridemore
()"
[
disabled
]="
locForm
.
invalid
"
>
BOOK A RIDE
</button>
<!-- [disabled]="locForm.invalid" -->
<!-- -->
<button
ion-button
class=
"cab_footer_btn floatLeft"
(
click
)="
ridemore
()"
>
RIDE LATER
</button>
<!-- [disabled]="locForm.invalid" -->
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
</ion-footer>
</ion-footer>
src/pages/home/home.ts
View file @
212d4c0f
...
@@ -7,6 +7,7 @@ import { AngularFireDatabase } from 'angularfire2/database';
...
@@ -7,6 +7,7 @@ import { AngularFireDatabase } from 'angularfire2/database';
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
*
as
firebase
from
'firebase'
;
import
*
as
firebase
from
'firebase'
;
import
{
Validators
,
FormGroup
,
FormBuilder
}
from
'@angular/forms'
import
{
Validators
,
FormGroup
,
FormBuilder
}
from
'@angular/forms'
import
{
dataService
}
from
"../../providers/common.service"
;
declare
var
google
;
declare
var
google
;
@
IonicPage
()
@
IonicPage
()
...
@@ -26,8 +27,9 @@ export class HomePage {
...
@@ -26,8 +27,9 @@ export class HomePage {
markers
=
[]
markers
=
[]
driverMarkers
=
[]
driverMarkers
=
[]
locForm
:
FormGroup
locForm
:
FormGroup
geocoder
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
modalCtrl
:
ModalController
,
public
storage
:
Storage
,
private
geolocation
:
Geolocation
,
private
firebase
:
fireService
,
private
db
:
AngularFireDatabase
,
private
myservice
:
Myservice
,
private
formBuilder
:
FormBuilder
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
modalCtrl
:
ModalController
,
public
storage
:
Storage
,
private
geolocation
:
Geolocation
,
private
firebase
:
fireService
,
private
db
:
AngularFireDatabase
,
private
myservice
:
Myservice
,
private
formBuilder
:
FormBuilder
,
private
data
:
dataService
)
{
this
.
locForm
=
this
.
formBuilder
.
group
({
this
.
locForm
=
this
.
formBuilder
.
group
({
pickLoc
:
[
''
,
Validators
.
required
],
pickLoc
:
[
''
,
Validators
.
required
],
dropLoc
:
[
''
,
Validators
.
required
]
dropLoc
:
[
''
,
Validators
.
required
]
...
@@ -36,7 +38,22 @@ export class HomePage {
...
@@ -36,7 +38,22 @@ export class HomePage {
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
this
.
geocoder
=
new
google
.
maps
.
Geocoder
();
this
.
loadMap
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
this
.
loadMap
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
var
latlng
=
new
google
.
maps
.
LatLng
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
var
This
=
this
;
This
.
geocoder
.
geocode
({
'latLng'
:
latlng
},
function
(
results
,
status
)
{
if
(
status
==
google
.
maps
.
GeocoderStatus
.
OK
)
{
if
(
results
[
0
])
{
This
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
results
[
3
].
formatted_address
)
This
.
p_lat
=
resp
.
coords
.
latitude
This
.
p_lng
=
resp
.
coords
.
longitude
}
}
else
{
console
.
log
(
"Geocoder failed due to: "
+
status
);
}
});
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'Error getting location'
,
error
);
console
.
log
(
'Error getting location'
,
error
);
});
});
...
@@ -73,7 +90,7 @@ export class HomePage {
...
@@ -73,7 +90,7 @@ export class HomePage {
}
}
fillAddress
(
autocomplete
,
type
)
{
fillAddress
(
autocomplete
,
type
)
{
if
(
this
.
markers
)
{
if
(
this
.
markers
.
length
==
3
)
{
this
.
markers
[
0
].
setMap
(
null
);
this
.
markers
[
0
].
setMap
(
null
);
}
}
var
place
=
autocomplete
.
getPlace
();
var
place
=
autocomplete
.
getPlace
();
...
@@ -108,6 +125,7 @@ export class HomePage {
...
@@ -108,6 +125,7 @@ export class HomePage {
}
}
else
{
else
{
this
.
loadMap
(
lat
,
lng
)
this
.
loadMap
(
lat
,
lng
)
console
.
log
(
'121212'
)
}
}
}
}
...
@@ -134,7 +152,9 @@ export class HomePage {
...
@@ -134,7 +152,9 @@ export class HomePage {
}
}
calculateAndDisplayRoute
(
directionsService
,
directionsDisplay
,
start
,
dest
)
{
calculateAndDisplayRoute
(
directionsService
,
directionsDisplay
,
start
,
dest
)
{
for
(
var
i
=
0
;
i
<
this
.
markers
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
markers
.
length
;
i
++
)
{
if
(
this
.
markers
[
i
])
this
.
markers
[
i
].
setMap
(
null
);
this
.
markers
[
i
].
setMap
(
null
);
}
}
directionsService
.
route
({
directionsService
.
route
({
...
@@ -151,15 +171,12 @@ export class HomePage {
...
@@ -151,15 +171,12 @@ export class HomePage {
}
}
ridemore
()
{
ridemore
()
{
var
data
=
{
pickLat
:
this
.
p_lat
,
pickLng
:
this
.
p_lng
,
dropLat
:
this
.
d_lat
,
dropLng
:
this
.
d_lng
}
this
.
data
.
setbookingData
(
data
)
let
modal
=
this
.
modalCtrl
.
create
(
'RidepopPage'
);
let
modal
=
this
.
modalCtrl
.
create
(
'RidepopPage'
);
modal
.
present
();
modal
.
present
();
}
}
ridenow
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'RidenowPage'
);
modal
.
present
();
}
searchride
()
{
searchride
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'SearchridePage'
);
let
modal
=
this
.
modalCtrl
.
create
(
'SearchridePage'
);
modal
.
present
();
modal
.
present
();
...
...
src/pages/ratecard/ratecard.ts
View file @
212d4c0f
import
{
Component
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
}
from
'ionic-angular'
;
import
{
dataService
}
from
"../../providers/common.service"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -7,8 +8,11 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
...
@@ -7,8 +8,11 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
templateUrl
:
'ratecard.html'
,
templateUrl
:
'ratecard.html'
,
})
})
export
class
RatecardPage
{
export
class
RatecardPage
{
rates
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
private
data
:
dataService
)
{
this
.
rates
=
this
.
data
.
getrateData
()
console
.
log
(
this
.
rates
)
}
}
ionViewDidLoad
()
{
ionViewDidLoad
()
{
...
...
src/pages/ridenow/ridenow.html
View file @
212d4c0f
...
@@ -7,10 +7,10 @@
...
@@ -7,10 +7,10 @@
<ion-grid>
<ion-grid>
<ion-row>
<ion-row>
<ion-col
col-6
style=
"border-right: 1px solid #fff;"
>
<ion-col
col-6
style=
"border-right: 1px solid #fff;"
>
<div
class=
"cab_pop_detail_left floatLeft
c1
"
></div>
<div
class=
"cab_pop_detail_left floatLeft
"
[
style
.
backgroundImage
]="'
url
('+
details
?.
carDetails
.
car_image
+')'
"
></div>
<div
class=
"cab_pop_details floatLeft textLeft"
>
<div
class=
"cab_pop_details floatLeft textLeft"
>
<strong>
Cab Type
</strong>
<strong>
Cab Type
</strong>
<h5>
Sedan
</h5>
<h5>
{{details?.carDetails?.car_type}}
</h5>
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</ion-col>
</ion-col>
...
...
src/pages/ridenow/ridenow.ts
View file @
212d4c0f
import
{
Component
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
,
ModalController
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
,
ModalController
}
from
'ionic-angular'
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
selector
:
'page-ridenow'
,
selector
:
'page-ridenow'
,
templateUrl
:
'ridenow.html'
,
templateUrl
:
'ridenow.html'
,
})
})
export
class
RidenowPage
{
export
class
RidenowPage
{
details
:
any
;
rates
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
public
modalCtrl
:
ModalController
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
public
modalCtrl
:
ModalController
,
private
data
:
dataService
,
private
myservice
:
Myservice
)
{
}
}
ionViewDidLoad
()
{
ionViewDidEnter
()
{
console
.
log
(
'ionViewDidLoad RidenowPage'
);
this
.
details
=
this
.
data
.
getbookingData
()
console
.
log
(
this
.
details
)
this
.
myservice
.
load_post
({
time
:
this
.
details
.
date
,
type
:
this
.
details
.
carDetails
.
car_type
},
'getRate'
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
this
.
rates
=
response
.
data
}
})
}
}
confirm
()
{
confirm
()
{
...
@@ -31,7 +40,8 @@ export class RidenowPage {
...
@@ -31,7 +40,8 @@ export class RidenowPage {
}
}
ratecard
()
{
ratecard
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'RatecardPage'
);
this
.
data
.
setrateData
(
this
.
rates
)
let
modal
=
this
.
modalCtrl
.
create
(
'RatecardPage'
,);
modal
.
present
();
modal
.
present
();
}
}
...
...
src/pages/ridepop/ridepop.html
View file @
212d4c0f
...
@@ -35,10 +35,9 @@
...
@@ -35,10 +35,9 @@
</ion-content>
</ion-content>
<ion-footer>
<ion-footer>
<div
class=
"cab_footer_btn_bay"
>
<div
class=
"cab_footer_btn_bay"
>
<button
ion-button
class=
"cab_footer_btn floatRight"
(
click
)="
dismiss
()"
>
CANCEL RIDE
<button
ion-button
class=
"cab_footer_btn floatRight"
(
click
)="
bookNow
()"
>
RIDE NOW
</button>
</button>
<button
ion-button
class=
"cab_footer_btn floatLeft"
(
click
)="
bookLater
()"
>
RIDE LATER
<button
ion-button
class=
"cab_footer_btn floatLeft"
(
click
)="
bookLater
()"
>
RIDE LATER
<ion-datetime
min=
"{{cur_date}}"
max=
"{{max_date}}"
displayFormat=
"MMM DD YYYY"
[(
ngModel
)]="
myDate
"
></ion-datetime>
</button>
</button>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
...
...
src/pages/ridepop/ridepop.ts
View file @
212d4c0f
import
{
Component
}
from
'@angular/core'
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
View
Controller
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
ViewController
,
Modal
Controller
}
from
'ionic-angular'
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
cartype
}
from
"../../models/mymodel"
;
import
{
cartype
}
from
"../../models/mymodel"
;
import
{
DatePicker
}
from
'@ionic-native/date-picker'
;
import
{
DatePicker
}
from
'@ionic-native/date-picker'
;
import
{
dataService
}
from
"../../providers/common.service"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -12,14 +13,9 @@ import { DatePicker } from '@ionic-native/date-picker';
...
@@ -12,14 +13,9 @@ import { DatePicker } from '@ionic-native/date-picker';
export
class
RidepopPage
{
export
class
RidepopPage
{
carTypes
:
Array
<
cartype
>
carTypes
:
Array
<
cartype
>
carIndex
:
number
=
0
;
carIndex
:
number
=
0
;
cur_date
:
any
;
locData
:
any
;
max_date
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
private
myservice
:
Myservice
,
private
datePicker
:
DatePicker
,
private
data
:
dataService
,
public
modalCtrl
:
ModalController
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
private
myservice
:
Myservice
,
private
datePicker
:
DatePicker
)
{
var
now
=
new
Date
();
this
.
cur_date
=
now
.
toISOString
()
var
year
=
now
.
getFullYear
();
this
.
max_date
=
(
year
+
10
)
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
...
@@ -40,18 +36,34 @@ export class RidepopPage {
...
@@ -40,18 +36,34 @@ export class RidepopPage {
}
}
bookLater
(){
bookLater
(){
this
.
datePicker
.
show
({
// this.datePicker.show({
date
:
new
Date
(),
// date: new Date(),
mode
:
'datetime'
,
// mode: 'datetime',
minDate
:
new
Date
(),
// minDate: new Date(),
allowOldDates
:
false
,
// allowOldDates:false,
androidTheme
:
this
.
datePicker
.
ANDROID_THEMES
.
THEME_HOLO_DARK
// androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
}).
then
(
// }).then(
date
=>
{
// date =>{
console
.
log
(
'1st'
,
date
)
// if (date < new Date()){
},
// this.myservice.show_alert('Error','Please select a valid date')
err
=>
console
.
log
(
'Error occurred while getting date: '
,
err
)
// }
);
// else{
// console.log('1', date)
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
.
date
=
new
Date
()
//date
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
data
.
setbookingData
(
this
.
locData
);
let
modal
=
this
.
modalCtrl
.
create
(
'RidenowPage'
);
modal
.
present
();
// }
// },
// err => console.log('Error occurred while getting date: ', err)
// );
}
bookNow
(){
}
}
dismiss
()
dismiss
()
...
...
src/providers/common.service.ts
0 → 100644
View file @
212d4c0f
import
{
Injectable
}
from
'@angular/core'
;
@
Injectable
()
export
class
dataService
{
bookingData
:
Object
;
rateData
:
Object
;
constructor
()
{
}
public
setbookingData
(
val
){
this
.
bookingData
=
val
;
}
public
getbookingData
(){
return
this
.
bookingData
;
}
public
setrateData
(
val
){
this
.
rateData
=
val
;
}
public
getrateData
(){
return
this
.
rateData
;
}
}
\ No newline at end of file
src/providers/subject.service.ts
View file @
212d4c0f
...
@@ -4,17 +4,17 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
...
@@ -4,17 +4,17 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@
Injectable
()
@
Injectable
()
export
class
SubjectService
{
export
class
SubjectService
{
private
search
Subject
=
new
BehaviorSubject
<
any
>
(
null
);
private
loc
Subject
=
new
BehaviorSubject
<
any
>
(
null
);
private
docSubjects
=
new
BehaviorSubject
<
any
>
(
null
);
private
docSubjects
=
new
BehaviorSubject
<
any
>
(
null
);
private
querySubjects
=
new
BehaviorSubject
<
any
>
(
null
);
private
querySubjects
=
new
BehaviorSubject
<
any
>
(
null
);
send
Search
Data
(
searchData
:
any
)
{
send
Loc
Data
(
searchData
:
any
)
{
this
.
search
Subject
.
next
(
searchData
);
this
.
loc
Subject
.
next
(
searchData
);
}
}
get
Search
Data
():
Observable
<
any
>
{
get
Loc
Data
():
Observable
<
any
>
{
return
this
.
search
Subject
.
asObservable
();
return
this
.
loc
Subject
.
asObservable
();
}
}
sendDocData
(
docData
:
any
)
{
sendDocData
(
docData
:
any
)
{
...
...
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