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
7486f779
Commit
7486f779
authored
Jun 08, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search
parent
55dcbc33
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
196 additions
and
146 deletions
+196
-146
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
+42
-15
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 @
7486f779
...
...
@@ -91,6 +91,10 @@ export class MyApp {
this
.
nav
.
setRoot
(
page
);
this
.
events
.
publish
(
'user:profile'
,
''
);
}
else
if
(
page
==
'MytripsPage'
){
this
.
myservice
.
show_loader
()
this
.
nav
.
setRoot
(
page
);
}
else
this
.
nav
.
setRoot
(
page
);
}
...
...
src/models/mymodel.ts
View file @
7486f779
...
...
@@ -9,6 +9,7 @@ export class user{
name
:
string
image
:
string
dial_code
:
string
token
:
string
}
export
class
cartype
{
car_type
:
string
...
...
@@ -18,4 +19,11 @@ export class cartype{
extrahour
:
string
id
:
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 @
7486f779
...
...
@@ -13,10 +13,10 @@
<input
class=
"cab_coupon_input"
placeholder=
"Enter Coupon Code"
formControlName=
"promocode"
>
</div>
</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> -->
<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
class=
"cab_coupon_content"
>
<p>
Payment Details
</p>
...
...
src/pages/addcoupon/addcoupon.ts
View file @
7486f779
...
...
@@ -3,6 +3,8 @@ import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angu
import
{
Validators
,
FormBuilder
,
FormGroup
}
from
"@angular/forms"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
Component
({
...
...
@@ -13,17 +15,26 @@ export class AddcouponPage {
promoForm
:
FormGroup
rate
=
this
.
navParams
.
get
(
'rate'
).
split
(
' to '
);
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
({
promocode
:
[
''
],
amount
:
[
''
]
amount
:
[
''
],
userid
:
[
''
]
})
}
ionViewDidLoad
()
{
console
.
log
(
this
.
rate
)
console
.
log
(
'ionViewDidLoad AddcouponPage'
);
ionViewDidEnter
()
{
this
.
booking
=
this
.
data
.
getbookingData
()
this
.
booking
.
promocode
=
null
;
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
;
}
})
}
goBack
()
{
...
...
@@ -33,9 +44,11 @@ export class AddcouponPage {
pay
()
{
// let modal = this.modalCtrl.create('ConfirmridePage');
// modal.present();
var
booking
=
this
.
data
.
getbookingData
()
if
(
booking
.
type
==
'later'
)
this
.
data
.
setbookingData
(
this
.
booking
)
if
(
this
.
booking
.
type
==
'later'
){
this
.
myservice
.
show_loader
()
this
.
navCtrl
.
push
(
'ConfirmridePage'
);
}
else
this
.
navCtrl
.
push
(
''
);
}
...
...
@@ -43,10 +56,13 @@ export class AddcouponPage {
checkCode
()
{
this
.
myservice
.
show_loader
();
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
.
hide_loader
()
if
(
response
.
status
==
'success'
)
{
this
.
promo
=
response
.
data
this
.
promoBtn
=
true
;
this
.
booking
.
promocode
=
this
.
promoForm
.
value
.
promocode
}
else
{
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
...
...
src/pages/confirmride/confirmride.html
View file @
7486f779
...
...
@@ -10,8 +10,8 @@
<img
src=
"assets/img/booking.png"
>
</div>
<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-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>
src/pages/confirmride/confirmride.ts
View file @
7486f779
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
{
dataService
}
from
"../../providers/common.service"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
user
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
Component
({
...
...
@@ -11,25 +12,51 @@ import { dataService } from "../../providers/common.service";
})
export
class
ConfirmridePage
{
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
()
{
var
book
=
this
.
data
.
getbookingData
()
console
.
log
(
book
)
this
.
myservice
.
load_post
({
book_date
:
book
.
date
,},
''
)
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
)
{
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
()
}
})
}
})
}
dismiss
()
{
this
.
viewCtrl
.
dismiss
();
public
initializeBackButtonCustomHandler
():
void
{
this
.
unregisterBackButtonAction
=
this
.
platform
.
registerBackButtonAction
(()
=>
{
// this.customHandleBackButton();
},
10
);
}
ionViewWillLeave
()
{
this
.
unregisterBackButtonAction
&&
this
.
unregisterBackButtonAction
();
}
dismiss
()
{
this
.
navCtrl
.
setRoot
(
'HomePage'
)
}
home
()
{
this
.
navCtrl
.
setRoot
(
'HomePage'
)
}
payment
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'PaymentPage'
);
modal
.
present
();
this
.
viewCtrl
.
dismiss
()
}
}
src/pages/home/home.ts
View file @
7486f779
...
...
@@ -4,10 +4,11 @@ import { Storage } from "@ionic/storage";
import
{
Geolocation
}
from
'@ionic-native/geolocation'
;
import
{
fireService
}
from
"../../providers/firebase.service"
;
import
{
AngularFireDatabase
}
from
'angularfire2/database'
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
*
as
firebase
from
'firebase'
;
import
{
Validators
,
FormGroup
,
FormBuilder
}
from
'@angular/forms'
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
user
}
from
"../../models/mymodel"
;
declare
var
google
;
@
IonicPage
()
...
...
@@ -28,8 +29,10 @@ export class HomePage {
driverMarkers
=
[]
locForm
:
FormGroup
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
({
pickLoc
:
[
''
,
Validators
.
required
],
dropLoc
:
[
''
,
Validators
.
required
]
...
...
@@ -37,6 +40,14 @@ export class HomePage {
}
ionViewDidEnter
()
{
this
.
data
.
setbookingData
(
''
)
this
.
storage
.
get
(
'user_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
}
})
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
this
.
geocoder
=
new
google
.
maps
.
Geocoder
();
this
.
loadMap
(
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
...
...
@@ -45,7 +56,8 @@ export class HomePage {
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
)
// console.log(results)
This
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
results
[
0
].
formatted_address
)
This
.
p_lat
=
resp
.
coords
.
latitude
This
.
p_lng
=
resp
.
coords
.
longitude
}
...
...
@@ -102,18 +114,23 @@ export class HomePage {
map
:
this
.
map
,
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
)
{
this
.
p_lat
=
lat
this
.
p_lng
=
lng
this
.
markers
[
1
]
=
marker
this
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
place
.
formatted_address
)
this
.
locForm
.
controls
[
'pickLoc'
].
setValue
(
place
.
name
)
}
else
if
(
type
==
1
)
{
this
.
d_lat
=
lat
this
.
d_lng
=
lng
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
)
{
...
...
@@ -128,7 +145,6 @@ export class HomePage {
}
else
{
this
.
loadMap
(
lat
,
lng
)
console
.
log
(
'121212'
)
}
}
...
...
@@ -180,6 +196,11 @@ export class HomePage {
modal
.
onDidDismiss
(
data
=>
{
if
(
data
){
let
modal1
=
this
.
modalCtrl
.
create
(
'RidenowPage'
,{
type
:
data
});
modal1
.
onDidDismiss
(
dat
=>
{
if
(
dat
){
this
.
navCtrl
.
push
(
'AddcouponPage'
,
{
rate
:
dat
});
}
})
modal1
.
present
();
}
})
...
...
src/pages/mytrips/mytrips.html
View file @
7486f779
...
...
@@ -20,61 +20,20 @@
<ion-slides
pager=
"false"
#
mySlider
class=
"hm_service_slide"
(
ionSlideDidChange
)="
slideChanged
()"
>
<ion-slide>
<ul>
<li
(
click
)="
open_page
('
TripdetailsPage
')"
>
<h6>
11 AM from taana to Mumbai Airport Domestic Terminal
</h6>
<p>
Today
<span>
11:30pm
</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>
<li
(
click
)="
open_page
('
TripdetailsPage
')"
>
<!-- <h6>{{ride.pickup_time}} from {{ride.pickup_area}} to {{ride.drop_area}}</h6>
<p>{{ride.pickup_date}}<span></span></p> -->
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
</ul>
</ion-slide>
<ion-slide>
<ul>
<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>
<ul
*
ngIf=
"trips"
>
<li
ngFor=
"let ride of trips?.upcoming"
>
<!-- -->
<h6>
{{ride.pickup_time}} from {{ride.pickup_area}} to {{ride.drop_area}}
</h6>
<p>
{{ride.pickup_date}}
<span></span></p>
<ion-icon
name=
"ios-arrow-forward-outline"
></ion-icon>
<div
class=
"clear"
></div>
</li>
...
...
src/pages/mytrips/mytrips.ts
View file @
7486f779
import
{
Component
,
ViewChild
}
from
'@angular/core'
;
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
()
@
Component
({
selector
:
'page-mytrips'
,
...
...
@@ -11,15 +15,19 @@ export class MytripsPage {
showNext
:
any
;
currentIndex
:
any
;
slidertab
:
any
;
local
:
user
allTrips
:
any
;
upTrips
:
any
;
compTrips
:
any
;
trips
:
any
;
@
ViewChild
(
Content
)
content
:
Content
;
@
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
;
console
.
log
(
"id"
,
id
);
setTimeout
(()
=>
{
this
.
goToSlide
(
id
);
},
500
)
...
...
@@ -27,8 +35,27 @@ export class MytripsPage {
}
ionViewDidLoad
()
{
console
.
log
(
'ionViewDidLoad MytripsPage'
);
ionViewDidEnter
()
{
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
)
{
...
...
src/pages/ridenow/ridenow.ts
View file @
7486f779
...
...
@@ -20,7 +20,7 @@ export class RidenowPage {
ionViewDidEnter
()
{
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
=>
{
if
(
response
.
status
==
'success'
){
this
.
rates
=
response
.
data
...
...
@@ -52,18 +52,14 @@ export class RidenowPage {
});
}
confirm
()
{
let
modal
=
this
.
modalCtrl
.
create
(
'ConfirmridePage'
);
modal
.
present
();
}
dismiss
()
{
this
.
viewCtrl
.
dismiss
();
}
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');
// modal.present();
}
...
...
src/pages/ridepop/ridepop.ts
View file @
7486f779
...
...
@@ -36,37 +36,37 @@ export class RidepopPage {
}
bookLater
(){
//
this.datePicker.show({
//
date: new Date(),
//
mode: 'datetime',
//
minDate: new Date(),
//
allowOldDates:false,
//
androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
//
}).then(
//
date =>{
//
if (date < new Date()){
//
this.myservice.show_alert('Error','Please select a valid date')
//
}
//
else{
//
console.log('1', date)
this
.
datePicker
.
show
({
date
:
new
Date
(),
mode
:
'datetime'
,
minDate
:
new
Date
(),
allowOldDates
:
false
,
androidTheme
:
this
.
datePicker
.
ANDROID_THEMES
.
THEME_HOLO_DARK
}).
then
(
date
=>
{
if
(
date
<
new
Date
()){
this
.
myservice
.
show_alert
(
'Error'
,
'Please select a valid date'
)
}
else
{
console
.
log
(
'1'
,
date
)
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
.
type
=
'
ride
'
this
.
locData
.
type
=
'
later
'
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
viewCtrl
.
dismiss
(
'later'
);
//
}
//
},
//
err => console.log('Error occurred while getting date: ', err)
//
);
}
},
err
=>
console
.
log
(
'Error occurred while getting date: '
,
err
)
);
}
bookNow
(){
this
.
locData
=
this
.
data
.
getbookingData
()
this
.
locData
.
date
=
new
Date
()
this
.
locData
.
carDetails
=
this
.
carTypes
[
this
.
carIndex
]
this
.
locData
.
type
=
'
later
'
this
.
locData
.
type
=
'
ride
'
this
.
data
.
setbookingData
(
this
.
locData
);
this
.
viewCtrl
.
dismiss
(
'ride'
);
}
...
...
src/pages/searchride/searchride.html
View file @
7486f779
...
...
@@ -13,33 +13,9 @@
<div
class=
"cab_search_result_page"
>
<p>
Popular Search
</p>
<ul>
<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>
<h5>
Mumbai International Airport Terminal
</h5>
<h6>
Santacruz Bay,Mumbai,India
</h6>
<li
*
ngFor=
"let search of searches"
>
<h5>
{{search.keyword}}
</h5>
<h6>
{{search.location}}
</h6>
</li>
</ul>
</div>
...
...
src/pages/searchride/searchride.ts
View file @
7486f779
import
{
Component
}
from
'@angular/core'
;
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
()
@
Component
({
selector
:
'page-searchride'
,
templateUrl
:
'searchride.html'
,
})
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
()
{
console
.
log
(
'ionViewDidLoad SearchridePage'
);
ionViewDidEnter
()
{
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
()
...
...
src/providers/common.service.ts
View file @
7486f779
...
...
@@ -3,8 +3,8 @@ import { Injectable } from '@angular/core';
@
Injectable
()
export
class
dataService
{
bookingData
:
Object
;
rateData
:
Object
;
bookingData
:
any
;
rateData
:
any
;
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