Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Callmycab-Driverapp
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-Driverapp
Commits
b713fec9
Commit
b713fec9
authored
Jul 09, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
july-9
parent
bfdc8e80
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
26 deletions
+77
-26
app.component.ts
src/app/app.component.ts
+10
-4
home.ts
src/pages/home/home.ts
+2
-1
quickride.html
src/pages/quickride/quickride.html
+8
-7
quickride.scss
src/pages/quickride/quickride.scss
+2
-1
quickride.ts
src/pages/quickride/quickride.ts
+42
-4
signin.ts
src/pages/signin/signin.ts
+13
-9
No files found.
src/app/app.component.ts
View file @
b713fec9
...
...
@@ -118,7 +118,7 @@ export class MyApp {
}
})
},
20000
)
This
.
setlocalNotification
();
//
This.setlocalNotification();
}
openPage
(
page
)
{
...
...
@@ -135,11 +135,18 @@ export class MyApp {
this
.
oneSignal
.
handleNotificationReceived
().
subscribe
(()
=>
{
// do something when notification is received
this
.
setlocalNotification
();
});
this
.
oneSignal
.
handleNotificationOpened
().
subscribe
(()
=>
{
this
.
oneSignal
.
handleNotificationOpened
().
subscribe
((
data
)
=>
{
// do something when a notification is opened
// this.nav.setRoot('QuickridePage')
var
additionalData
=
data
.
notification
.
payload
.
additionalData
this
.
storage
.
get
(
'driver_data'
).
then
((
user_data
)
=>
{
if
(
user_data
)
this
.
nav
.
setRoot
(
'QuickridePage'
,
{
id
:
additionalData
.
bookingId
})
else
this
.
nav
.
setRoot
(
'SigninPage'
,
{
id
:
additionalData
.
bookingId
})
})
});
this
.
oneSignal
.
endInit
();
...
...
@@ -192,7 +199,6 @@ export class MyApp {
})
this
.
localNotifications
.
on
(
'click'
).
subscribe
(
rideData
=>
{
console
.
log
(
rideData
)
this
.
data
.
setrideData
(
rideData
.
data
)
this
.
nav
.
push
(
'RidedetailsPage'
)
})
...
...
src/pages/home/home.ts
View file @
b713fec9
...
...
@@ -46,6 +46,7 @@ tab_swap(type) {
rideDetails
(
data
){
this
.
data
.
setrideData
(
data
)
this
.
navCtrl
.
push
(
'RidedetailsPage'
)
// this.navCtrl.push('RidedetailsPage')
this
.
navCtrl
.
setRoot
(
'QuickridePage'
,
{
id
:
'38'
})
}
}
src/pages/quickride/quickride.html
View file @
b713fec9
...
...
@@ -18,7 +18,7 @@
</div>
<div
class=
"jr_search_profile_detail"
>
<br>
<h6>
Lina Rhodes
</h6>
<h6>
{{rideDetail?.username}}
</h6>
</div>
<div
class=
"jr_clear"
></div>
</div>
...
...
@@ -28,22 +28,23 @@
<div
class=
"jr_from_to"
>
<li>
<div
class=
"child1 from"
><div
class=
"jr_box1"
></div></div>
<div
class=
"child2 yellow"
><strong>
Electronic City
</strong>
<p>
fdgsdgsdg
</p></div>
<div
class=
"child2 yellow"
><strong>
{{rideDetail?.from}}
</strong>
<p>
{{rideDetail?.fromAd}}
</p></div>
<div
class=
"jr_clear"
></div>
</li>
<li>
<div
class=
"child1 to"
></div>
<div
class=
"child2 grey"
><strong>
HSR Layout
</strong>
<p>
gfhdfgthj
</p></div>
<div
class=
"child2 grey"
><strong>
{{rideDetail?.to}}
</strong>
<p>
{{rideDetail?.toAd}}
</p></div>
<div
class=
"jr_clear"
></div>
</li>
</div>
<div
class=
"jr_bottom_button_bay"
>
<button
ion-button
class=
"cab_footer_btn floatLeft accept"
>
Accept
</button>
<button
ion-button
class=
"cab_footer_btn floatRight reject"
>
Remove
</button>
<button
ion-button
class=
"cab_footer_btn floatLeft accept"
(
click
)="
accept
()"
>
Accept
</button>
<button
ion-button
class=
"cab_footer_btn floatRight reject"
(
click
)="
reject
()"
>
Reject
</button>
<button
ion-button
class=
"cab_footer_btn width100"
(
click
)="
accept
()"
>
Pick Up
</button>
</div>
</div>
...
...
src/pages/quickride/quickride.scss
View file @
b713fec9
...
...
@@ -397,5 +397,6 @@ margin-top:10px;
}
.grey
{
background
:
url("../assets/img/greydot.png")
;
}
}
.width100
{
width
:
100%
!
important
}
}
src/pages/quickride/quickride.ts
View file @
b713fec9
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
driver
}
from
"../../models/mymodel"
;
@
IonicPage
()
@
Component
({
...
...
@@ -8,12 +10,48 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
templateUrl
:
'quickride.html'
,
})
export
class
QuickridePage
{
bookingId
=
this
.
navParams
.
get
(
'id'
)
rideDetail
:
any
;
local
:
driver
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
)
{
}
ionViewDidLoad
()
{
console
.
log
(
'ionViewDidLoad QuickridePage'
);
ionViewDidEnter
()
{
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
;
}
})
this
.
myservice
.
load_post
({
id
:
this
.
bookingId
},
'getBookingDetails'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
){
this
.
rideDetail
=
resp
.
data
var
tempf
=
this
.
rideDetail
.
pickup_area
.
split
(
','
)
this
.
rideDetail
.
from
=
tempf
[
0
]
this
.
rideDetail
.
fromAd
=
this
.
rideDetail
.
pickup_area
this
.
rideDetail
.
timestamp
=
new
Date
(
this
.
rideDetail
.
pickup_date
+
' '
+
this
.
rideDetail
.
pickup_time
).
getTime
()
var
temp
=
this
.
rideDetail
.
drop_area
.
split
(
','
)
this
.
rideDetail
.
to
=
temp
[
0
]
this
.
rideDetail
.
toAd
=
this
.
rideDetail
.
drop_area
}
})
}
accept
(){
this
.
myservice
.
load_post
({
bookingId
:
this
.
bookingId
,
driverId
:
this
.
local
.
id
},
'rideAccept'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
){
}
})
}
reject
(){
}
back
(){
...
...
src/pages/signin/signin.ts
View file @
b713fec9
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
Events
}
from
'ionic-angular'
;
import
{
IonicPage
,
NavController
,
NavParams
,
Events
}
from
'ionic-angular'
;
import
{
Validators
,
FormBuilder
,
FormGroup
}
from
"@angular/forms"
;
import
{
Http
}
from
'@angular/http'
import
{
dialcode
}
from
"../../models/mymodel"
;
...
...
@@ -29,28 +29,32 @@ export class SigninPage {
})
}
login
(){
login
()
{
this
.
myservice
.
show_loader
()
this
.
myservice
.
load_post
(
this
.
signinForm
.
value
,
'driver_login'
).
subscribe
(
response
=>
{
if
(
response
[
0
].
status
==
'success'
)
{
this
.
myservice
.
load_post
(
this
.
signinForm
.
value
,
'driver_login'
).
subscribe
(
response
=>
{
if
(
response
[
0
].
status
==
'success'
)
{
response
[
0
].
data
.
image
=
response
[
0
].
data
.
image
.
startsWith
(
"http"
)
?
response
[
0
].
data
.
image
:
this
.
myservice
.
base_url
+
response
[
0
].
data
.
image
;
this
.
storage
.
set
(
'driver_data'
,
response
[
0
].
data
)
this
.
storage
.
set
(
'driver_data'
,
response
[
0
].
data
)
var
This
=
this
;
setTimeout
(()
=>
{
This
.
myservice
.
hide_loader
();
This
.
events
.
publish
(
'driver:profile'
,
response
[
0
].
data
);
This
.
navCtrl
.
setRoot
(
'HomePage'
)
if
(
This
.
navParams
.
get
(
'id'
))
{
this
.
navCtrl
.
setRoot
(
'QuickridePage'
,
{
id
:
This
.
navParams
.
get
(
'id'
)
})
}
else
This
.
navCtrl
.
setRoot
(
'HomePage'
)
},
500
);
}
else
{
else
{
this
.
myservice
.
hide_loader
();
this
.
myservice
.
show_alert
(
''
,
response
.
message
)
}
})
}
forgot
()
{
this
.
navCtrl
.
push
(
"ForgotPage"
);
forgot
()
{
this
.
navCtrl
.
push
(
"ForgotPage"
);
}
}
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