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
aab71349
Commit
aab71349
authored
Jul 11, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
july-10 See merge request alen/CMC-driver!12
parents
6d1cb9c4
09c28336
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
72 additions
and
32 deletions
+72
-32
app.component.ts
src/app/app.component.ts
+2
-2
docupdate.ts
src/pages/docupdate/docupdate.ts
+19
-17
home.ts
src/pages/home/home.ts
+3
-0
quickride.html
src/pages/quickride/quickride.html
+5
-4
quickride.scss
src/pages/quickride/quickride.scss
+3
-0
quickride.ts
src/pages/quickride/quickride.ts
+14
-2
signin.ts
src/pages/signin/signin.ts
+1
-1
uploaddoc.html
src/pages/uploaddoc/uploaddoc.html
+1
-1
uploaddoc.ts
src/pages/uploaddoc/uploaddoc.ts
+14
-5
common.service.ts
src/providers/common.service.ts
+10
-0
No files found.
src/app/app.component.ts
View file @
aab71349
...
...
@@ -143,9 +143,9 @@ export class MyApp {
var
additionalData
=
data
.
notification
.
payload
.
additionalData
this
.
storage
.
get
(
'driver_data'
).
then
((
user_data
)
=>
{
if
(
user_data
)
this
.
nav
.
setRoot
(
'QuickridePage'
,
{
id
:
additionalData
.
bookingId
})
this
.
nav
.
push
(
'QuickridePage'
,
{
id
:
additionalData
.
bookingId
,
from
:
additionalData
.
from
})
else
this
.
nav
.
setRoot
(
'SigninPage'
,
{
id
:
additionalData
.
bookingId
})
this
.
nav
.
setRoot
(
'SigninPage'
,
{
id
:
additionalData
.
bookingId
,
from
:
additionalData
.
from
})
})
});
...
...
src/pages/docupdate/docupdate.ts
View file @
aab71349
...
...
@@ -4,6 +4,7 @@ import { Myservice } from "../../providers/myservice";
import
{
Storage
}
from
"@ionic/storage"
;
import
{
driver
}
from
"../../models/mymodel"
;
import
{
Toast
}
from
'@ionic-native/toast'
;
import
{
dataService
}
from
"../../providers/common.service"
;
@
IonicPage
()
@
Component
({
...
...
@@ -14,27 +15,28 @@ export class DocupdatePage {
title
:
string
=
this
.
navParams
.
get
(
'title'
)
formdata
=
new
FormData
();
filename
:
string
;
local
:
driver
myData
=
{
'id'
:
''
,
'secret_key'
:
'My_key'
,
'field'
:
this
.
navParams
.
get
(
'title'
)
}
local
:
driver
;
fileData
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
toast
:
Toast
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
toast
:
Toast
,
private
comService
:
dataService
)
{
}
ionViewDidEnter
()
{
this
.
fileData
=
this
.
comService
.
getdocData
();
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
)
{
this
.
myservice
.
hide_loader
()
this
.
local
=
data
this
.
myData
.
id
=
data
.
id
this
.
myservice
.
load_post
({
id
:
data
.
id
,
field
:
this
.
title
},
'getDocument'
).
subscribe
(
response
=>
{
this
.
myservice
.
hide_loader
()
if
(
response
.
status
==
'success'
)
{
document
.
getElementById
(
"upld_btn"
).
textContent
=
'UPDATE'
this
.
fileData
=
response
.
data
}
else
document
.
getElementById
(
"upld_btn"
).
textContent
=
'UPLOAD'
})
// if (response.status == 'success') {
// document.getElementById("upld_btn").textContent = 'UPDATE'
// this.fileData = response.data
// }
// else{
// document.getElementById("upld_btn").textContent = 'UPLOAD'
// }
}
})
}
...
...
@@ -61,16 +63,16 @@ export class DocupdatePage {
upload
()
{
this
.
myservice
.
show_loader
()
this
.
formdata
.
append
(
'data'
,
JSON
.
stringify
(
this
.
myData
));
//
this.formdata.append('data', JSON.stringify(this.myData));
if
(
this
.
fileData
)
this
.
formdata
.
append
(
'id'
,
JSON
.
stringify
(
this
.
fileData
.
id
));
this
.
myservice
.
fileUpload
(
this
.
formdata
,
'driverDocUpload'
).
subscribe
(
resp
=>
{
this
.
myservice
.
hide_loader
()
if
(
resp
.
status
==
'success'
)
{
// this.toast.show(resp
onse
.message, '2000', 'center').subscribe(toast => {
//
console.log(toast);
//
});
// this.toast.show(resp.message, '2000', 'center').subscribe(toast => {
//
console.log(toast);
//
});
}
else
this
.
myservice
.
show_alert
(
''
,
resp
.
message
);
...
...
src/pages/home/home.ts
View file @
aab71349
...
...
@@ -19,6 +19,9 @@ baseurl = this.myservice.base_url
}
ionViewDidEnter
(){
if
(
this
.
navParams
.
get
(
'id'
))
this
.
navCtrl
.
push
(
'QuickridePage'
,
{
id
:
this
.
navParams
.
get
(
'id'
),
from
:
this
.
navParams
.
get
(
'from'
)
})
this
.
myservice
.
show_loader
()
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
){
...
...
src/pages/quickride/quickride.html
View file @
aab71349
...
...
@@ -14,7 +14,7 @@
<h5>
You have a ride request
</h5>
<hr>
<div
class=
"jr_search_profile"
>
<img
>
<img
[
src
]=
baseUrl
+
rideDetail
?.
image
>
</div>
<div
class=
"jr_search_profile_detail"
>
<br>
...
...
@@ -39,12 +39,13 @@
<div
class=
"jr_clear"
></div>
</li>
</div>
<p
class=
"time"
>
Day :
<strong>
{{rideDetail?.pickup_date| date:'dd/MM/yy'}} - {{rideDetail?.pickup_time}}
</strong></p>
<div
class=
"jr_bottom_button_bay"
>
<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>
<button
ion-button
class=
"cab_footer_btn floatLeft accept"
(
click
)="
accept
()"
*
ngIf=
"!pickUp"
>
Accept
</button>
<button
ion-button
class=
"cab_footer_btn floatRight reject"
(
click
)="
reject
()"
*
ngIf=
"!pickUp"
>
Reject
</button>
<button
ion-button
class=
"cab_footer_btn width100"
(
click
)="
pick
()"
*
ngIf=
"pickUp
"
>
Pick Up
</button>
</div>
</div>
...
...
src/pages/quickride/quickride.scss
View file @
aab71349
...
...
@@ -399,4 +399,7 @@ margin-top:10px;
background
:
url("../assets/img/greydot.png")
;
}
.width100
{
width
:
100%
!
important
}
.time
{
color
:
#595959
;
font-weight
:
400
;}
.time
strong
{
font-size
:
15px
;}
}
src/pages/quickride/quickride.ts
View file @
aab71349
...
...
@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
driver
}
from
"../../models/mymodel"
;
import
{
dataService
}
from
"../../providers/common.service"
;
@
IonicPage
()
@
Component
({
...
...
@@ -13,8 +14,9 @@ export class QuickridePage {
bookingId
=
this
.
navParams
.
get
(
'id'
)
rideDetail
:
any
;
local
:
driver
baseUrl
=
this
.
myservice
.
base_url
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
data
:
dataService
)
{
}
ionViewDidEnter
()
{
...
...
@@ -38,6 +40,8 @@ export class QuickridePage {
var
temp
=
this
.
rideDetail
.
drop_area
.
split
(
','
)
this
.
rideDetail
.
to
=
temp
[
0
]
this
.
rideDetail
.
toAd
=
this
.
rideDetail
.
drop_area
this
.
data
.
setrideData
(
this
.
rideDetail
)
}
})
}
...
...
@@ -45,13 +49,21 @@ export class QuickridePage {
accept
(){
this
.
myservice
.
load_post
({
bookingId
:
this
.
bookingId
,
driverId
:
this
.
local
.
id
},
'rideAccept'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
){
this
.
navCtrl
.
pop
()
}
else
{
this
.
myservice
.
show_alert
(
''
,
'Please try again'
)
}
})
}
reject
(){
this
.
navCtrl
.
pop
();
}
pick
(){
this
.
myservice
.
show_loader
()
this
.
navCtrl
.
push
(
'UserlocationPage'
)
}
back
(){
...
...
src/pages/signin/signin.ts
View file @
aab71349
...
...
@@ -40,7 +40,7 @@ export class SigninPage {
This
.
myservice
.
hide_loader
();
This
.
events
.
publish
(
'driver:profile'
,
response
[
0
].
data
);
if
(
This
.
navParams
.
get
(
'id'
))
{
this
.
navCtrl
.
setRoot
(
'
QuickridePage'
,
{
id
:
This
.
navParams
.
get
(
'id
'
)
})
this
.
navCtrl
.
setRoot
(
'
HomePage'
,
{
id
:
This
.
navParams
.
get
(
'id'
),
from
:
This
.
navParams
.
get
(
'from
'
)
})
}
else
This
.
navCtrl
.
setRoot
(
'HomePage'
)
...
...
src/pages/uploaddoc/uploaddoc.html
View file @
aab71349
...
...
@@ -22,7 +22,7 @@
<div
class=
"upload_doc_circle"
>
</div>
<div
class=
"upload_doc_detail"
>
{{doc}}
{{doc
.document_type
}}
</div>
<div
class=
"clear"
></div>
</ion-label>
...
...
src/pages/uploaddoc/uploaddoc.ts
View file @
aab71349
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
dataService
}
from
"../../providers/common.service"
;
@
IonicPage
()
@
Component
({
...
...
@@ -9,14 +9,23 @@ import { Myservice } from "../../providers/myservice";
templateUrl
:
'uploaddoc.html'
,
})
export
class
UploaddocPage
{
docs
=
[
'License'
,
'Vehicle Insurance'
,
'Tax'
,
'Registration'
]
docs
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
comService
:
dataService
)
{
}
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
)
{
ionViewDidEnter
(){
this
.
myservice
.
load_post
({},
'getAllDocument'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
){
this
.
docs
=
resp
.
data
}
})
}
uploadDoc
(
name
){
uploadDoc
(
data
){
this
.
comService
.
setdocData
(
data
);
this
.
myservice
.
show_loader
()
this
.
navCtrl
.
push
(
"DocupdatePage"
,
{
title
:
nam
e
});
this
.
navCtrl
.
push
(
"DocupdatePage"
,
{
title
:
data
.
document_typ
e
});
}
}
src/providers/common.service.ts
View file @
aab71349
...
...
@@ -6,6 +6,7 @@ export class dataService {
rideData
:
any
;
waypointData
:
any
;
rateData
:
any
;
docData
:
any
;
constructor
()
{
}
...
...
@@ -33,5 +34,13 @@ rateData:any;
return
this
.
rateData
;
}
public
setdocData
(
val
){
this
.
docData
=
val
;
}
public
getdocData
(){
return
this
.
docData
;
}
}
\ No newline at end of file
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