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
f5ea0762
Commit
f5ea0762
authored
Jun 11, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
search See merge request !5
parents
55dcbc33
7486f779
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
194 additions
and
144 deletions
+194
-144
app.component.ts
src/app/app.component.ts
+4
-0
mymodel.ts
src/models/mymodel.ts
+9
-0
addcoupon.html
src/pages/addcoupon/addcoupon.html
+2
-2
addcoupon.ts
src/pages/addcoupon/addcoupon.ts
+23
-7
confirmride.html
src/pages/confirmride/confirmride.html
+2
-2
confirmride.ts
src/pages/confirmride/confirmride.ts
+40
-13
home.ts
src/pages/home/home.ts
+27
-6
mytrips.html
src/pages/mytrips/mytrips.html
+8
-49
mytrips.ts
src/pages/mytrips/mytrips.ts
+32
-5
ridenow.ts
src/pages/ridenow/ridenow.ts
+3
-7
ridepop.ts
src/pages/ridepop/ridepop.ts
+20
-20
searchride.html
src/pages/searchride/searchride.html
+3
-27
searchride.ts
src/pages/searchride/searchride.ts
+19
-4
common.service.ts
src/providers/common.service.ts
+2
-2
No files found.
src/app/app.component.ts
View file @
f5ea0762
...
@@ -91,6 +91,10 @@ export class MyApp {
...
@@ -91,6 +91,10 @@ export class MyApp {
this
.
nav
.
setRoot
(
page
);
this
.
nav
.
setRoot
(
page
);
this
.
events
.
publish
(
'user:profile'
,
''
);
this
.
events
.
publish
(
'user:profile'
,
''
);
}
}
else
if
(
page
==
'MytripsPage'
){
this
.
myservice
.
show_loader
()
this
.
nav
.
setRoot
(
page
);
}
else
else
this
.
nav
.
setRoot
(
page
);
this
.
nav
.
setRoot
(
page
);
}
}
...
...
src/models/mymodel.ts
View file @
f5ea0762
...
@@ -9,6 +9,7 @@ export class user{
...
@@ -9,6 +9,7 @@ export class user{
name
:
string
name
:
string
image
:
string
image
:
string
dial_code
:
string
dial_code
:
string
token
:
string
}
}
export
class
cartype
{
export
class
cartype
{
car_type
:
string
car_type
:
string
...
@@ -19,3 +20,10 @@ export class cartype{
...
@@ -19,3 +20,10 @@ export class cartype{
id
:
string
id
:
string
car_image
:
string
car_image
:
string
}
}
export
class
search
{
id
:
string
userid
:
string
keyword
:
string
location
:
string
date
:
Date
}
\ No newline at end of file
src/pages/addcoupon/addcoupon.html
View file @
f5ea0762
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
<input
class=
"cab_coupon_input"
placeholder=
"Enter Coupon Code"
formControlName=
"promocode"
>
<input
class=
"cab_coupon_input"
placeholder=
"Enter Coupon Code"
formControlName=
"promocode"
>
</div>
</div>
</form>
</form>
<
p
*
ngIf=
""
>
You don’t seem to have any valid coupons.
<br
>
<
!-- <p *ngIf="">You don’t seem to have any valid coupons.<br> --
>
<!-- Invite your friends. Unlock free ride coupons</p> -->
<!-- Invite your friends. Unlock free ride coupons</p> -->
<div
class=
"cab_coupon_box"
>
<div
class=
"cab_coupon_box"
>
<button
ion-button
class=
"cab_coupon_apply"
(
click
)="
checkCode
()"
>
Apply
</button>
<button
ion-button
class=
"cab_coupon_apply"
(
click
)="
checkCode
()"
[
disabled
]="
promoBtn
"
>
Apply
</button>
</div>
</div>
<div
class=
"cab_coupon_content"
>
<div
class=
"cab_coupon_content"
>
<p>
Payment Details
</p>
<p>
Payment Details
</p>
...
...
src/pages/addcoupon/addcoupon.ts
View file @
f5ea0762
...
@@ -3,6 +3,8 @@ import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angu
...
@@ -3,6 +3,8 @@ import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angu
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"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -13,17 +15,26 @@ export class AddcouponPage {
...
@@ -13,17 +15,26 @@ export class AddcouponPage {
promoForm
:
FormGroup
promoForm
:
FormGroup
rate
=
this
.
navParams
.
get
(
'rate'
).
split
(
' to '
);
rate
=
this
.
navParams
.
get
(
'rate'
).
split
(
' to '
);
promo
=
{
'amount'
:
Number
(
this
.
rate
[
0
]),
discount
:
'0'
}
promo
=
{
'amount'
:
Number
(
this
.
rate
[
0
]),
discount
:
'0'
}
local
:
user
;
promoBtn
:
boolean
=
false
;
booking
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
modalCtrl
:
ModalController
,
private
formBuilder
:
FormBuilder
,
private
myservice
:
Myservice
,
private
data
:
dataService
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
modalCtrl
:
ModalController
,
private
formBuilder
:
FormBuilder
,
private
myservice
:
Myservice
,
private
data
:
dataService
,
private
storage
:
Storage
)
{
this
.
promoForm
=
this
.
formBuilder
.
group
({
this
.
promoForm
=
this
.
formBuilder
.
group
({
promocode
:
[
''
],
promocode
:
[
''
],
amount
:
[
''
]
amount
:
[
''
],
userid
:
[
''
]
})
})
}
}
ionViewDidLoad
()
{
ionViewDidEnter
()
{
console
.
log
(
this
.
rate
)
this
.
booking
=
this
.
data
.
getbookingData
()
console
.
log
(
'ionViewDidLoad AddcouponPage'
);
this
.
booking
.
promocode
=
null
;
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
;
}
})
}
}
goBack
()
{
goBack
()
{
...
@@ -33,9 +44,11 @@ export class AddcouponPage {
...
@@ -33,9 +44,11 @@ export class AddcouponPage {
pay
()
{
pay
()
{
// let modal = this.modalCtrl.create('ConfirmridePage');
// let modal = this.modalCtrl.create('ConfirmridePage');
// modal.present();
// modal.present();
var
booking
=
this
.
data
.
getbookingData
()
this
.
data
.
setbookingData
(
this
.
booking
)
if
(
booking
.
type
==
'later'
)
if
(
this
.
booking
.
type
==
'later'
){
this
.
myservice
.
show_loader
()
this
.
navCtrl
.
push
(
'ConfirmridePage'
);
this
.
navCtrl
.
push
(
'ConfirmridePage'
);
}
else
else
this
.
navCtrl
.
push
(
''
);
this
.
navCtrl
.
push
(
''
);
}
}
...
@@ -43,10 +56,13 @@ export class AddcouponPage {
...
@@ -43,10 +56,13 @@ export class AddcouponPage {
checkCode
()
{
checkCode
()
{
this
.
myservice
.
show_loader
();
this
.
myservice
.
show_loader
();
this
.
promoForm
.
controls
[
'amount'
].
setValue
(
this
.
rate
)
this
.
promoForm
.
controls
[
'amount'
].
setValue
(
this
.
rate
)
this
.
promoForm
.
controls
[
'userid'
].
setValue
(
this
.
local
.
id
)
this
.
myservice
.
load_post
(
this
.
promoForm
.
value
,
'checkPromocode'
).
subscribe
(
response
=>
{
this
.
myservice
.
load_post
(
this
.
promoForm
.
value
,
'checkPromocode'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
this
.
myservice
.
hide_loader
()
if
(
response
.
status
==
'success'
)
{
if
(
response
.
status
==
'success'
)
{
this
.
promo
=
response
.
data
this
.
promo
=
response
.
data
this
.
promoBtn
=
true
;
this
.
booking
.
promocode
=
this
.
promoForm
.
value
.
promocode
}
}
else
{
else
{
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
...
...
src/pages/confirmride/confirmride.html
View file @
f5ea0762
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
<img
src=
"assets/img/booking.png"
>
<img
src=
"assets/img/booking.png"
>
</div>
</div>
<p
class=
"text_white textCenter cab_confirm_p"
>
Your booking has been confirmed
<br>
<p
class=
"text_white textCenter cab_confirm_p"
>
Your booking has been confirmed
<br>
on
</p>
on
{{book?.date|date:'fullDate'}}
</p>
</ion-content>
</ion-content>
<ion-footer>
<ion-footer>
<button
ion-button
class=
"cab_footer_btn width100 theme_bgcolor text_white"
(
click
)="
payment
()"
>
OKAY
</button>
<button
ion-button
class=
"cab_footer_btn width100 theme_bgcolor text_white"
(
click
)="
home
()"
>
OKAY
</button>
</ion-footer>
</ion-footer>
src/pages/confirmride/confirmride.ts
View file @
f5ea0762
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
,
Platform
}
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
{
user
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
...
@@ -11,25 +12,51 @@ import { dataService } from "../../providers/common.service";
...
@@ -11,25 +12,51 @@ import { dataService } from "../../providers/common.service";
})
})
export
class
ConfirmridePage
{
export
class
ConfirmridePage
{
type
=
this
.
navParams
.
get
(
'type'
)
type
=
this
.
navParams
.
get
(
'type'
)
local
:
user
book
:
any
public
unregisterBackButtonAction
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
public
modalCtrl
:
ModalController
,
private
myservice
:
Myservice
,
private
data
:
dataService
)
{
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
)
{
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
var
book
=
this
.
data
.
getbookingData
()
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
console
.
log
(
book
)
if
(
data
)
{
this
.
myservice
.
load_post
({
book_date
:
book
.
date
,},
''
)
this
.
local
=
data
;
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
}
this
.
myservice
.
load_post
(
bdata
,
'book_cab'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
if
(
response
.
status
==
'success'
)
{
this
.
initializeBackButtonCustomHandler
();
}
else
{
this
.
myservice
.
show_alert
(
'Failed'
,
'Please try again'
)
this
.
navCtrl
.
pop
()
}
})
}
})
}
public
initializeBackButtonCustomHandler
():
void
{
this
.
unregisterBackButtonAction
=
this
.
platform
.
registerBackButtonAction
(()
=>
{
// this.customHandleBackButton();
},
10
);
}
ionViewWillLeave
()
{
this
.
unregisterBackButtonAction
&&
this
.
unregisterBackButtonAction
();
}
}
dismiss
()
dismiss
()
{
{
this
.
navCtrl
.
setRoot
(
'HomePage'
)
this
.
viewCtrl
.
dismiss
();
}
}
payment
()
{
home
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'PaymentPage'
);
this
.
navCtrl
.
setRoot
(
'HomePage'
)
modal
.
present
();
this
.
viewCtrl
.
dismiss
()
}
}
}
}
src/pages/home/home.ts
View file @
f5ea0762
...
@@ -4,10 +4,11 @@ import { Storage } from "@ionic/storage";
...
@@ -4,10 +4,11 @@ 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"
;
import
{
AngularFireDatabase
}
from
'angularfire2/database'
;
import
{
AngularFireDatabase
}
from
'angularfire2/database'
;
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"
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
user
}
from
"../../models/mymodel"
;
declare
var
google
;
declare
var
google
;
@
IonicPage
()
@
IonicPage
()
...
@@ -28,8 +29,10 @@ export class HomePage {
...
@@ -28,8 +29,10 @@ export class HomePage {
driverMarkers
=
[]
driverMarkers
=
[]
locForm
:
FormGroup
locForm
:
FormGroup
geocoder
:
any
;
geocoder
:
any
;
local
:
user
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
)
{
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
]
...
@@ -37,6 +40,14 @@ export class HomePage {
...
@@ -37,6 +40,14 @@ export class HomePage {
}
}
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
data
.
setbookingData
(
''
)
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
}
})
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
this
.
geocoder
=
new
google
.
maps
.
Geocoder
();
this
.
geocoder
=
new
google
.
maps
.
Geocoder
();
this
.
loadMap
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
this
.
loadMap
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
...
@@ -45,7 +56,8 @@ export class HomePage {
...
@@ -45,7 +56,8 @@ export class HomePage {
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
])
{
This
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
results
[
3
].
formatted_address
)
// console.log(results)
This
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
results
[
0
].
formatted_address
)
This
.
p_lat
=
resp
.
coords
.
latitude
This
.
p_lat
=
resp
.
coords
.
latitude
This
.
p_lng
=
resp
.
coords
.
longitude
This
.
p_lng
=
resp
.
coords
.
longitude
}
}
...
@@ -103,17 +115,22 @@ export class HomePage {
...
@@ -103,17 +115,22 @@ export class HomePage {
position
:
{
lat
:
lat
,
lng
:
lng
}
position
:
{
lat
:
lat
,
lng
:
lng
}
});
});
var
search
=
place
.
formatted_address
this
.
myservice
.
load_post
({
'keyword'
:
place
.
name
,
'userid'
:
this
.
local
.
id
,
'location'
:
search
},
'setSearch'
).
subscribe
(
response
=>
{
})
if
(
type
==
0
)
{
if
(
type
==
0
)
{
this
.
p_lat
=
lat
this
.
p_lat
=
lat
this
.
p_lng
=
lng
this
.
p_lng
=
lng
this
.
markers
[
1
]
=
marker
this
.
markers
[
1
]
=
marker
this
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
place
.
formatted_address
)
this
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
place
.
name
)
}
}
else
if
(
type
==
1
)
{
else
if
(
type
==
1
)
{
this
.
d_lat
=
lat
this
.
d_lat
=
lat
this
.
d_lng
=
lng
this
.
d_lng
=
lng
this
.
markers
[
2
]
=
marker
this
.
markers
[
2
]
=
marker
this
.
locForm
.
controls
[
'dropLoc'
].
setValue
(
place
.
formatted_address
)
this
.
locForm
.
controls
[
'dropLoc'
].
setValue
(
place
.
name
)
}
}
if
(
this
.
p_lat
&&
this
.
d_lat
)
{
if
(
this
.
p_lat
&&
this
.
d_lat
)
{
...
@@ -128,7 +145,6 @@ export class HomePage {
...
@@ -128,7 +145,6 @@ export class HomePage {
}
}
else
{
else
{
this
.
loadMap
(
lat
,
lng
)
this
.
loadMap
(
lat
,
lng
)
console
.
log
(
'121212'
)
}
}
}
}
...
@@ -180,6 +196,11 @@ export class HomePage {
...
@@ -180,6 +196,11 @@ export class HomePage {
modal
.
onDidDismiss
(
data
=>
{
modal
.
onDidDismiss
(
data
=>
{
if
(
data
){
if
(
data
){
let
modal1
=
this
.
modalCtrl
.
create
(
'RidenowPage'
,{
type
:
data
});
let
modal1
=
this
.
modalCtrl
.
create
(
'RidenowPage'
,{
type
:
data
});
modal1
.
onDidDismiss
(
dat
=>
{
if
(
dat
){
this
.
navCtrl
.
push
(
'AddcouponPage'
,
{
rate
:
dat
});
}
})
modal1
.
present
();
modal1
.
present
();
}
}
})
})
...
...
src/pages/mytrips/mytrips.html
View file @
f5ea0762
...
@@ -20,61 +20,20 @@
...
@@ -20,61 +20,20 @@
<ion-slides
pager=
"false"
#
mySlider
class=
"hm_service_slide"
(
ionSlideDidChange
)="
slideChanged
()"
>
<ion-slides
pager=
"false"
#
mySlider
class=
"hm_service_slide"
(
ionSlideDidChange
)="
slideChanged
()"
>
<ion-slide>
<ion-slide>
<ul>
<ul>
<li
(
click
)="
open_page
('
TripdetailsPage
')"
>
<li
(
click
)="
open_page
('
TripdetailsPage
')"
>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<!-- <h6>{{ride.pickup_time}} from {{ride.pickup_area}} to {{ride.drop_area}}</h6>
<p>
Today
<span>
11:30pm
</span></p>
<p>{{ride.pickup_date}}<span></span></p> -->
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</li>
</li>
</ul>
</ul>
</ion-slide>
</ion-slide>
<ion-slide>
<ion-slide>
<ul>
<ul
*
ngIf=
"trips"
>
<li>
<li
ngFor=
"let ride of trips?.upcoming"
>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<!-- -->
<p>
Today
</p>
<h6>
{{ride.pickup_time}} from {{ride.pickup_area}} to {{ride.drop_area}}
</h6>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<p>
{{ride.pickup_date}}
<span></span></p>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
<li>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
</p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</li>
</li>
...
...
src/pages/mytrips/mytrips.ts
View file @
f5ea0762
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
}
from
'ionic-angular'
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
selector
:
'page-mytrips'
,
selector
:
'page-mytrips'
,
...
@@ -11,15 +15,19 @@ export class MytripsPage {
...
@@ -11,15 +15,19 @@ export class MytripsPage {
showNext
:
any
;
showNext
:
any
;
currentIndex
:
any
;
currentIndex
:
any
;
slidertab
:
any
;
slidertab
:
any
;
local
:
user
allTrips
:
any
;
upTrips
:
any
;
compTrips
:
any
;
trips
:
any
;
@
ViewChild
(
Content
)
content
:
Content
;
@
ViewChild
(
Content
)
content
:
Content
;
@
ViewChild
(
'mySlider'
)
slider
:
Slides
;
@
ViewChild
(
'mySlider'
)
slider
:
Slides
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
)
{
let
id
=
this
.
navParams
.
get
(
"id"
)
;
let
id
=
0
;
this
.
slidertab
=
id
;
this
.
slidertab
=
id
;
console
.
log
(
"id"
,
id
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
goToSlide
(
id
);
this
.
goToSlide
(
id
);
},
500
)
},
500
)
...
@@ -27,8 +35,27 @@ export class MytripsPage {
...
@@ -27,8 +35,27 @@ export class MytripsPage {
}
}
ionViewDidLoad
()
{
ionViewDidEnter
()
{
console
.
log
(
'ionViewDidLoad MytripsPage'
);
console
.
log
(
1
)
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
)
{
this
.
local
=
data
;
this
.
myservice
.
load_post
({
'token'
:
this
.
local
.
token
},
'myTrips'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
if
(
response
.
status
==
'success'
)
{
this
.
trips
=
response
// this.allTrips = response.all
console
.
log
(
this
.
trips
)
// this.upTrips = response.upcoming
// this.compTrips = response.completed
}
else
{
this
.
myservice
.
show_alert
(
'Failed'
,
'Please try again'
)
}
})
}
})
}
}
goToSlide
(
id
)
{
goToSlide
(
id
)
{
...
...
src/pages/ridenow/ridenow.ts
View file @
f5ea0762
...
@@ -20,7 +20,7 @@ export class RidenowPage {
...
@@ -20,7 +20,7 @@ export class RidenowPage {
ionViewDidEnter
()
{
ionViewDidEnter
()
{
this
.
details
=
this
.
data
.
getbookingData
()
this
.
details
=
this
.
data
.
getbookingData
()
console
.
log
(
this
.
details
)
//
console.log(this.details)
this
.
myservice
.
load_post
({
time
:
this
.
details
.
date
,
type
:
this
.
details
.
carDetails
.
car_type
},
'getRate'
).
subscribe
(
response
=>
{
this
.
myservice
.
load_post
({
time
:
this
.
details
.
date
,
type
:
this
.
details
.
carDetails
.
car_type
},
'getRate'
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
){
if
(
response
.
status
==
'success'
){
this
.
rates
=
response
.
data
this
.
rates
=
response
.
data
...
@@ -52,18 +52,14 @@ export class RidenowPage {
...
@@ -52,18 +52,14 @@ export class RidenowPage {
});
});
}
}
confirm
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'ConfirmridePage'
);
modal
.
present
();
}
dismiss
()
dismiss
()
{
{
this
.
viewCtrl
.
dismiss
();
this
.
viewCtrl
.
dismiss
();
}
}
addcoupon
()
{
addcoupon
()
{
this
.
navCtrl
.
push
(
'AddcouponPage'
,{
rate
:
this
.
totRate
});
this
.
viewCtrl
.
dismiss
(
this
.
totRate
);
// this.navCtrl.push('AddcouponPage',{rate:this.totRate});
// let modal = this.modalCtrl.create('AddcouponPage');
// let modal = this.modalCtrl.create('AddcouponPage');
// modal.present();
// modal.present();
}
}
...
...
src/pages/ridepop/ridepop.ts
View file @
f5ea0762
...
@@ -36,37 +36,37 @@ export class RidepopPage {
...
@@ -36,37 +36,37 @@ 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
=>
{
//
if (date < new Date()){
if
(
date
<
new
Date
()){
//
this.myservice.show_alert('Error','Please select a valid date')
this
.
myservice
.
show_alert
(
'Error'
,
'Please select a valid date'
)
//
}
}
//
else{
else
{
//
console.log('1', date)
console
.
log
(
'1'
,
date
)
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
.
date
=
new
Date
()
//date
this
.
locData
.
date
=
date
//new Date()
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
locData
.
type
=
'
ride
'
this
.
locData
.
type
=
'
later
'
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
viewCtrl
.
dismiss
(
'later'
);
this
.
viewCtrl
.
dismiss
(
'later'
);
//
}
}
//
},
},
//
err => console.log('Error occurred while getting date: ', err)
err
=>
console
.
log
(
'Error occurred while getting date: '
,
err
)
//
);
);
}
}
bookNow
(){
bookNow
(){
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
.
date
=
new
Date
()
this
.
locData
.
date
=
new
Date
()
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
locData
.
type
=
'
later
'
this
.
locData
.
type
=
'
ride
'
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
viewCtrl
.
dismiss
(
'ride'
);
this
.
viewCtrl
.
dismiss
(
'ride'
);
}
}
...
...
src/pages/searchride/searchride.html
View file @
f5ea0762
...
@@ -13,33 +13,9 @@
...
@@ -13,33 +13,9 @@
<div
class=
"cab_search_result_page"
>
<div
class=
"cab_search_result_page"
>
<p>
Popular Search
</p>
<p>
Popular Search
</p>
<ul>
<ul>
<li>
<li
*
ngFor=
"let search of searches"
>
<h5>
Mumbai International Airport Terminal
</h5>
<h5>
{{search.keyword}}
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
<h6>
{{search.location}}
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
<li>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
...
src/pages/searchride/searchride.ts
View file @
f5ea0762
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
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
,
search
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
IonicPage
()
@
Component
({
@
Component
({
selector
:
'page-searchride'
,
selector
:
'page-searchride'
,
templateUrl
:
'searchride.html'
,
templateUrl
:
'searchride.html'
,
})
})
export
class
SearchridePage
{
export
class
SearchridePage
{
local
:
user
searches
:
Array
<
search
>
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewCtrl
:
ViewController
,
private
myservice
:
Myservice
,
private
storage
:
Storage
)
{
}
}
ionViewDidLoad
()
{
ionViewDidEnter
()
{
console
.
log
(
'ionViewDidLoad SearchridePage'
);
this
.
myservice
.
show_loader
()
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
this
.
myservice
.
load_post
({
userid
:
this
.
local
.
id
},
'getSearches'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
if
(
response
.
status
==
'success'
){
this
.
searches
=
response
.
data
}
})
}
})
}
}
dismiss
()
dismiss
()
...
...
src/providers/common.service.ts
View file @
f5ea0762
...
@@ -3,8 +3,8 @@ import { Injectable } from '@angular/core';
...
@@ -3,8 +3,8 @@ import { Injectable } from '@angular/core';
@
Injectable
()
@
Injectable
()
export
class
dataService
{
export
class
dataService
{
bookingData
:
Object
;
bookingData
:
any
;
rateData
:
Object
;
rateData
:
any
;
constructor
()
{
}
constructor
()
{
}
...
...
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