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
1bb6dcf9
Commit
1bb6dcf9
authored
Aug 03, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
aug-2 See merge request alen/CMC-driver!23
parents
34fa9446
a1536d27
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
191 additions
and
53 deletions
+191
-53
en.json
src/assets/i18n/en.json
+55
-0
home.html
src/pages/home/home.html
+2
-2
myprofile.html
src/pages/myprofile/myprofile.html
+21
-21
myprofile.module.ts
src/pages/myprofile/myprofile.module.ts
+2
-0
myprofile.ts
src/pages/myprofile/myprofile.ts
+16
-1
quickride.html
src/pages/quickride/quickride.html
+6
-6
quickride.module.ts
src/pages/quickride/quickride.module.ts
+2
-0
quickride.ts
src/pages/quickride/quickride.ts
+30
-7
reject.html
src/pages/reject/reject.html
+6
-6
reject.module.ts
src/pages/reject/reject.module.ts
+2
-0
reject.ts
src/pages/reject/reject.ts
+20
-2
userlocation.html
src/pages/userlocation/userlocation.html
+6
-5
userlocation.module.ts
src/pages/userlocation/userlocation.module.ts
+2
-0
userlocation.ts
src/pages/userlocation/userlocation.ts
+21
-3
No files found.
src/assets/i18n/en.json
View file @
1bb6dcf9
...
...
@@ -21,5 +21,59 @@
"ridedetail"
:{
"Ride Details"
:
"Ride Details"
,
"Pick Up"
:
"Pick Up"
},
"quickride"
:{
"Quick Ride"
:
"Quick Ride"
,
"You have a ride request"
:
"You have a ride request"
,
"Date"
:
"Date"
,
"Accept"
:
"Accept"
,
"Reject"
:
"Reject"
,
"Secret key miss match"
:
"Secret key miss match"
,
"Please try again"
:
"Please try again"
,
"Successfully Accepted"
:
"Successfully Accepted"
,
"Sorry, The ride is gone"
:
"Sorry, The ride is gone"
},
"reject"
:{
"Cancellation Reason"
:
"Cancellation Reason"
,
"Pickup location too far"
:
"Pickup location too far"
,
"Cannot serve at the requested time"
:
"Cannot serve at the requested time"
,
"Other"
:
"Other"
,
"Cancel"
:
"Cancel"
,
"Submit"
:
"Submit"
,
"Cancelled Successfully"
:
"Cancelled Successfully"
,
"Please try again"
:
"Please try again"
,
"Secret key miss match"
:
"Secret key miss match"
},
"userloc"
:{
"User Location"
:
"User Location"
,
"From"
:
"From"
,
"To"
:
"To"
,
"Start Ride"
:
"Start Ride"
,
"Finish Ride"
:
"Finish Ride"
,
"Please try again"
:
"Please try again"
,
"Secret key miss match"
:
"Secret key miss match"
},
"profile"
:{
"Profile"
:
"Profile"
,
"My Profile"
:
"My Profile"
,
"Name"
:
"Name"
,
"Enter a valid Name"
:
"Enter a valid Name"
,
"Username"
:
"Username"
,
"Enter a valid Username"
:
"Enter a valid Username"
,
"Mobile Number"
:
"Mobile Number"
,
"Enter a valid Mobile"
:
"Enter a valid Mobile"
,
"Email"
:
"Email"
,
"Enter a valid Email"
:
"Enter a valid Email"
,
"Date of Birth"
:
"Date of Birth"
,
"Select your DOB"
:
"Select your DOB"
,
"Male"
:
"Male"
,
"Female"
:
"Female"
,
"License Number"
:
"License Number"
,
"Enter a valid License Number"
:
"Enter a valid License Number"
,
"Car Type"
:
"Car Type"
,
"Select a valid Car Type"
:
"Select a valid Car Type"
,
"Car Number"
:
"Car Number"
,
"Enter a valid Car Number"
:
"Enter a valid Car Number"
,
"SAVE"
:
"SAVE"
}
}
\ No newline at end of file
src/pages/home/home.html
View file @
1bb6dcf9
...
...
@@ -23,7 +23,7 @@
<ul>
<li
*
ngFor=
"let up of upcoming"
(
click
)="
rideDetails
(
up
)"
>
<div
class=
"home_content_circle"
>
<img
[
src
]=
baseurl
+
up
.
image
/>
<img
[
src
]=
up
.
image
/>
</div>
<div
class=
"home_content_detail"
>
<h5>
{{up.username}}
</h5>
...
...
@@ -46,7 +46,7 @@
<ul>
<li
*
ngFor=
"let comp of completed"
(
click
)="
rideDetails
(
comp
)"
>
<div
class=
"home_content_circle"
>
<img
[
src
]=
baseurl
+
comp
.
image
/>
<img
[
src
]=
comp
.
image
/>
</div>
<div
class=
"home_content_detail"
>
<h5>
{{comp.username}}
</h5>
...
...
src/pages/myprofile/myprofile.html
View file @
1bb6dcf9
...
...
@@ -3,13 +3,13 @@
<ion-icon
name=
"menu"
></ion-icon>
</button>
<div
class=
"nav_header_title floatLeft"
>
Profile
{{'profile.Profile'|translate}}
</div>
<div
class=
"clear"
></div>
</ion-header>
<ion-content
padding
>
<div
class=
"myprofile_wrapper"
>
<h4>
My Profile
</h4>
<h4>
{{'profile.My Profile'|translate}}
</h4>
<hr>
<br>
<form
[
formGroup
]="
editForm
"
>
...
...
@@ -22,50 +22,50 @@
</div>
<div
class=
"signup_form_content"
>
<ion-item>
<ion-input
type=
"text"
placeholder=
"
Name
"
formControlName=
"name"
></ion-input>
<ion-input
type=
"text"
placeholder=
"
{{'profile.Name'|translate}}
"
formControlName=
"name"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.name.invalid && (editForm.get('name').dirty || editForm.get('name').touched)"
>
Enter a valid Name
{{'profile.Enter a valid Name'|translate}}
</div>
<ion-item>
<ion-input
type=
"text"
placeholder=
"
Username
"
formControlName=
"username"
></ion-input>
<ion-input
type=
"text"
placeholder=
"
{{'profile.Username'|translate}}
"
formControlName=
"username"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.username.invalid && (editForm.get('username').dirty || editForm.get('username').touched)"
>
Enter a valid Username
{{'profile.Enter a valid Username'|translate}}
</div>
<ion-item>
<ion-input
type=
"number"
placeholder=
"
Mobile Number
"
formControlName=
"phone"
></ion-input>
<ion-input
type=
"number"
placeholder=
"
{{'profile.Mobile Number'|translate}}
"
formControlName=
"phone"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.phone.invalid && (editForm.get('phone').dirty || editForm.get('phone').touched)"
>
Enter a valid Mobile
{{'profile.Enter a valid Mobile'|translate}}
</div>
<ion-item>
<ion-input
type=
"email"
placeholder=
"
Email
"
formControlName=
"email"
></ion-input>
<ion-input
type=
"email"
placeholder=
"
{{'profile.Email'|translate}}
"
formControlName=
"email"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.email.invalid && (editForm.get('email').dirty || editForm.get('email').touched)"
>
Enter a valid Email
{{'profile.Enter a valid Email'|translate}}
</div>
<ion-item>
<ion-datetime
displayFormat=
"DD MMM YYYY"
placeholder=
"
Date of Birth
"
min=
"1950"
max=
{{maxDate}}
formControlName=
"dob"
>
<ion-datetime
displayFormat=
"DD MMM YYYY"
placeholder=
"
{{'profile.Date of Birth'|translate}}
"
min=
"1950"
max=
{{maxDate}}
formControlName=
"dob"
>
</ion-datetime>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.dob.invalid && (editForm.get('dob').dirty || editForm.get('dob').touched)"
>
Select your DOB
{{'profile.Select your DOB'|translate}}
</div>
<div
radio-group
formControlName=
"gender"
class=
"gender_radio"
>
<div
class=
"floatLeft"
>
<ion-radio
value=
"male"
checked
class=
"floatLeft"
></ion-radio>
<ion-label
class=
"floatLeft"
>
Male
</ion-label>
<ion-label
class=
"floatLeft"
>
{{'profile.Male'|translate}}
</ion-label>
<div
class=
"clear"
></div>
</div>
<div
class=
"floatLeft"
>
<ion-radio
value=
"female"
class=
"floatLeft"
></ion-radio>
<ion-label
class=
"floatLeft"
>
Female
</ion-label>
<ion-label
class=
"floatLeft"
>
{{'profile.Female'|translate}}
</ion-label>
<div
class=
"clear"
></div>
</div>
<div
class=
"clear"
></div>
...
...
@@ -73,32 +73,32 @@
<ion-item>
<ion-input
type=
"text"
placeholder=
"
License Number
"
formControlName=
"license"
></ion-input>
<ion-input
type=
"text"
placeholder=
"
{{'profile.License Number'|translate}}
"
formControlName=
"license"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.license.invalid && (editForm.get('license').dirty || editForm.get('license').touched)"
>
Enter a valid License Number
{{'profile.Enter a valid License Number'|translate}}
</div>
<ion-item>
<ion-select
formControlName=
"cartype"
placeholder=
"
Car Type
"
>
<ion-select
formControlName=
"cartype"
placeholder=
"
{{'profile.Car Type'|translate}}
"
>
<ion-option
value=
{{car.car_type}}
*
ngFor=
"let car of cars"
>
{{car.car_type}}
</ion-option>
</ion-select>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.cartype.invalid && (editForm.get('cartype').dirty || editForm.get('cartype').touched)"
>
Select a valid Car Type
{{'profile.Select a valid Car Type'|translate}}
</div>
<ion-item>
<ion-input
type=
"text"
placeholder=
"
Car Number
"
formControlName=
"car_no"
></ion-input>
<ion-input
type=
"text"
placeholder=
"
{{'profile.Car Number'|translate}}
"
formControlName=
"car_no"
></ion-input>
</ion-item>
<div
class=
"er_req textCenter"
*
ngIf=
"editForm.controls.car_no.invalid && (editForm.get('car_no').dirty || editForm.get('car_no').touched)"
>
Enter a valid Car Number
{{'profile.Enter a valid Car Number'|translate}}
</div>
<br>
<!-- <button ion-button class="primary theme_dark_bg" (click)="updateProfile()">SAVE</button> -->
<div
class=
"jr_bottom_button_bay"
>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
updateProfile
()"
>
SAVE
</button>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
updateProfile
()"
>
{{'profile.SAVE'|translate}}
</button>
</div>
</div>
</form>
...
...
src/pages/myprofile/myprofile.module.ts
View file @
1bb6dcf9
import
{
NgModule
}
from
'@angular/core'
;
import
{
IonicPageModule
}
from
'ionic-angular'
;
import
{
MyprofilePage
}
from
'./myprofile'
;
import
{
TranslateModule
}
from
"@ngx-translate/core"
;
@
NgModule
({
declarations
:
[
...
...
@@ -8,6 +9,7 @@ import { MyprofilePage } from './myprofile';
],
imports
:
[
IonicPageModule
.
forChild
(
MyprofilePage
),
TranslateModule
],
})
export
class
MyprofilePageModule
{}
src/pages/myprofile/myprofile.ts
View file @
1bb6dcf9
...
...
@@ -8,6 +8,7 @@ import { Myservice } from "../../providers/myservice";
import
{
Storage
}
from
"@ionic/storage"
;
import
{
driver
}
from
"../../models/mymodel"
;
import
{
Toast
}
from
'@ionic-native/toast'
;
import
{
TranslateService
}
from
"@ngx-translate/core"
;
@
IonicPage
()
@
Component
({
...
...
@@ -23,8 +24,9 @@ export class MyprofilePage {
codes
:
Array
<
dialcode
>
;
cars
:
any
;
maxDate
:
any
;
lang
:
string
=
'en'
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
formBuilder
:
FormBuilder
,
private
http
:
Http
,
private
orderbyPipe
:
OrderbyPipe
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
public
events
:
Events
,
private
toast
:
Toast
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
formBuilder
:
FormBuilder
,
private
http
:
Http
,
private
orderbyPipe
:
OrderbyPipe
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
public
events
:
Events
,
private
toast
:
Toast
,
private
translate
:
TranslateService
)
{
this
.
maxDate
=
new
Date
().
getFullYear
()
...
...
@@ -51,6 +53,7 @@ export class MyprofilePage {
}
ionViewDidEnter
()
{
this
.
langTrans
()
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
){
this
.
local
=
data
;
...
...
@@ -80,6 +83,18 @@ export class MyprofilePage {
})
}
langTrans
()
{
this
.
storage
.
get
(
'lang'
).
then
(
lang
=>
{
if
(
lang
!=
null
)
{
this
.
translate
.
use
(
lang
)
this
.
lang
=
lang
;
}
else
{
this
.
translate
.
use
(
'en'
)
}
})
}
fileChange
(
event
)
{
let
fileList
:
FileList
=
event
.
target
.
files
;
if
(
fileList
.
length
>
0
)
{
...
...
src/pages/quickride/quickride.html
View file @
1bb6dcf9
...
...
@@ -3,7 +3,7 @@
<ion-icon
name=
"ios-arrow-back"
(
click
)="
back
()"
></ion-icon>
</button>
<div
class=
"nav_header_title floatLeft"
>
Quick Ride
{{'quickride.Quick Ride'|translate}}
</div>
<div
class=
"clear"
></div>
</ion-header>
...
...
@@ -11,10 +11,10 @@
<div
class=
"jr_profile_content1"
>
<div
class=
"jr_search_bottom_bay jr_padding0"
>
<h5>
You have a ride request
</h5>
<h5>
{{'quickride.You have a ride request'|translate}}
</h5>
<hr>
<div
class=
"jr_search_profile"
>
<img
[
src
]=
baseUrl
+
rideDetail
?.
image
>
<img
[
src
]=
rideDetail
?.
image
>
</div>
<div
class=
"jr_search_profile_detail"
>
<br>
...
...
@@ -39,12 +39,12 @@
<div
class=
"jr_clear"
></div>
</li>
</div>
<p
class=
"time"
>
Day
:
<strong>
{{rideDetail?.pickup_date| date:'dd/MM/yy'}} - {{rideDetail?.pickup_time}}
</strong></p>
<p
class=
"time"
>
{{'quickride.Date'|translate}}
:
<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 floatLeft accept"
(
click
)="
accept
()"
>
{{'quickride.Accept'|translate}}
</button>
<button
ion-button
class=
"cab_footer_btn floatRight reject"
(
click
)="
reject
()"
>
{{'quickride.Reject'|translate}}
</button>
<!-- <button ion-button class="cab_footer_btn width100" (click)="pick()" *ngIf="pickUp">Pick Up</button> -->
</div>
</div>
...
...
src/pages/quickride/quickride.module.ts
View file @
1bb6dcf9
import
{
NgModule
}
from
'@angular/core'
;
import
{
IonicPageModule
}
from
'ionic-angular'
;
import
{
QuickridePage
}
from
'./quickride'
;
import
{
TranslateModule
}
from
"@ngx-translate/core"
;
@
NgModule
({
declarations
:
[
...
...
@@ -8,6 +9,7 @@ import { QuickridePage } from './quickride';
],
imports
:
[
IonicPageModule
.
forChild
(
QuickridePage
),
TranslateModule
],
})
export
class
QuickridePageModule
{}
src/pages/quickride/quickride.ts
View file @
1bb6dcf9
...
...
@@ -5,6 +5,7 @@ import { Storage } from "@ionic/storage";
import
{
driver
}
from
"../../models/mymodel"
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
Toast
}
from
"@ionic-native/toast"
;
import
{
TranslateService
}
from
"@ngx-translate/core"
;
@
IonicPage
()
@
Component
({
...
...
@@ -16,12 +17,15 @@ export class QuickridePage {
rideDetail
:
any
;
local
:
driver
baseUrl
=
this
.
myservice
.
base_url
lang
:
string
=
'en'
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
data
:
dataService
,
private
toast
:
Toast
,
private
modalCtrl
:
ModalController
,
public
alertCtrl
:
AlertController
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
data
:
dataService
,
private
toast
:
Toast
,
private
modalCtrl
:
ModalController
,
public
alertCtrl
:
AlertController
,
private
translate
:
TranslateService
)
{
}
ionViewDidEnter
()
{
this
.
langTrans
()
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
)
{
this
.
local
=
data
;
...
...
@@ -44,21 +48,40 @@ export class QuickridePage {
this
.
data
.
setrideData
(
this
.
rideDetail
)
}
else
this
.
myservice
.
show_alert
(
''
,
resp
.
message
)
else
{
this
.
translate
.
get
([
'quickride.'
+
resp
.
message
]).
subscribe
(
value
=>
{
this
.
myservice
.
show_alert
(
''
,
value
[
'quickride.'
+
resp
.
message
])
})
}
})
}
langTrans
()
{
this
.
storage
.
get
(
'lang'
).
then
(
lang
=>
{
if
(
lang
!=
null
)
{
this
.
translate
.
use
(
lang
)
this
.
lang
=
lang
;
}
else
{
this
.
translate
.
use
(
'en'
)
}
})
}
accept
()
{
this
.
myservice
.
load_post
({
bookingId
:
this
.
bookingId
,
driverId
:
this
.
local
.
id
},
'rideAccept'
).
subscribe
(
resp
=>
{
if
(
resp
.
status
==
'success'
)
{
this
.
toast
.
show
(
resp
.
message
,
'2000'
,
'center'
).
subscribe
(
toast
=>
{
console
.
log
(
toast
);
});
this
.
translate
.
get
([
'quickride.'
+
resp
.
message
]).
subscribe
(
value
=>
{
this
.
toast
.
show
(
value
[
'quickride.'
+
resp
.
message
],
'2000'
,
'center'
).
subscribe
(
toast
=>
{
console
.
log
(
toast
);
});
})
this
.
navCtrl
.
pop
()
}
else
{
this
.
myservice
.
show_alert
(
''
,
resp
.
message
)
this
.
translate
.
get
([
'quickride.'
+
resp
.
message
]).
subscribe
(
value
=>
{
this
.
myservice
.
show_alert
(
''
,
value
[
'quickride.'
+
resp
.
message
])
})
}
})
}
...
...
src/pages/reject/reject.html
View file @
1bb6dcf9
...
...
@@ -3,7 +3,7 @@
<div
class=
"hm_cancel_pop_main"
>
<div
class=
"hm_cancel_pop_upper"
>
<img
src=
"assets/img/hm_ques_mark.png"
>
<p>
Cancellation Reason
</p>
<p>
{{'reject.Cancellation Reason'|translate}}
</p>
</div>
<div
class=
"hm_cancel_pop_lower"
>
<ul>
...
...
@@ -13,7 +13,7 @@
<ion-radio
value=
"Pickup location too far"
></ion-radio>
</div>
<div
class=
"hm_cancel_reason"
>
Pickup location too far
{{'reject.Pickup location too far'|translate}}
</div>
<div
class=
"hm_clear"
></div>
</li>
...
...
@@ -22,7 +22,7 @@
<ion-radio
value=
"Cannot serve at the requested time"
></ion-radio>
</div>
<div
class=
"hm_cancel_reason"
>
Cannot serve at the requested time
{{'reject.Cannot serve at the requested time'|translate}}
</div>
<div
class=
"hm_clear"
></div>
</li>
...
...
@@ -32,7 +32,7 @@
<ion-radio
value=
"Other"
></ion-radio>
</div>
<div
class=
"hm_cancel_reason"
>
Other
{{'reject.Other'|translate}}
</div>
<div
class=
"hm_clear"
></div>
</li>
...
...
@@ -40,8 +40,8 @@
</ion-list>
</ul>
<div
class=
"hm_cancel_bottom_bay"
>
<li
class=
"hm_cancel_cancel"
(
click
)="
dismiss
()"
>
Cancel
</li>
<li
class=
"hm_cancel_submit"
(
click
)="
submit
()"
>
Submit
</li>
<li
class=
"hm_cancel_cancel"
(
click
)="
dismiss
()"
>
{{'reject.Cancel'|translate}}
</li>
<li
class=
"hm_cancel_submit"
(
click
)="
submit
()"
>
{{'reject.Submit'|translate}}
</li>
</div>
</div>
</div>
...
...
src/pages/reject/reject.module.ts
View file @
1bb6dcf9
import
{
NgModule
}
from
'@angular/core'
;
import
{
IonicPageModule
}
from
'ionic-angular'
;
import
{
RejectPage
}
from
'./reject'
;
import
{
TranslateModule
}
from
"@ngx-translate/core"
;
@
NgModule
({
declarations
:
[
...
...
@@ -8,6 +9,7 @@ import { RejectPage } from './reject';
],
imports
:
[
IonicPageModule
.
forChild
(
RejectPage
),
TranslateModule
],
})
export
class
RejectPageModule
{}
src/pages/reject/reject.ts
View file @
1bb6dcf9
...
...
@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams,ViewController } from 'ionic-angula
import
{
Myservice
}
from
'../../providers/myservice'
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
driver
}
from
"../../models/mymodel"
;
import
{
TranslateService
}
from
"@ngx-translate/core"
;
@
IonicPage
()
@
Component
({
...
...
@@ -12,17 +13,32 @@ import { driver } from "../../models/mymodel";
export
class
RejectPage
{
reason
:
any
;
local
:
driver
lang
:
string
=
'en'
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewctrl
:
ViewController
,
private
myservice
:
Myservice
,
private
storage
:
Storag
e
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
viewctrl
:
ViewController
,
private
myservice
:
Myservice
,
private
storage
:
Storage
,
private
translate
:
TranslateServic
e
)
{
}
ionViewDidEnter
()
{
this
.
langTrans
()
this
.
storage
.
get
(
'driver_data'
).
then
(
data
=>
{
if
(
data
)
this
.
local
=
data
})
}
langTrans
()
{
this
.
storage
.
get
(
'lang'
).
then
(
lang
=>
{
if
(
lang
!=
null
)
{
this
.
translate
.
use
(
lang
)
this
.
lang
=
lang
;
}
else
{
this
.
translate
.
use
(
'en'
)
}
})
}
dismiss
(){
this
.
viewctrl
.
dismiss
();
}
...
...
@@ -35,7 +51,9 @@ export class RejectPage {
this
.
viewctrl
.
dismiss
(
response
.
message
);
}
else
{
this
.
myservice
.
show_alert
(
'Error'
,
response
.
message
)
this
.
translate
.
get
([
'reject.'
+
response
.
message
]).
subscribe
(
value
=>
{
this
.
myservice
.
show_alert
(
''
,
value
[
'reject.'
+
response
.
message
])
})
}
})
...
...
src/pages/userlocation/userlocation.html
View file @
1bb6dcf9
...
...
@@ -2,23 +2,23 @@
<button
ion-button
class=
"nav_btn theme_color floatLeft"
(
click
)="
back
()"
>
<ion-icon
name=
"ios-arrow-back"
></ion-icon>
</button>
<div
class=
"nav_header_title floatLeft"
>
User Location
</div>
<div
class=
"nav_header_title floatLeft"
>
{{'userloc.User Location'|translate}}
</div>
<div
class=
"clear"
></div>
</ion-header>
<ion-content>
<div
#
map
id=
"map"
></div>
<div
class=
"jr_bottom_distance_card"
*
ngIf=
"temp"
>
<div
class=
"jr_bottom_inside"
>
<input
class=
"jr_dest_input from"
placeholder=
"
From
"
[(
ngModel
)]="
loc
.
from
"
[
readonly
]="
true
"
>
<input
class=
"jr_dest_input to"
placeholder=
"
To
"
[(
ngModel
)]="
loc
.
to
"
[
readonly
]="
true
"
>
<input
class=
"jr_dest_input from"
placeholder=
"
{{'userloc.From'|translate}}
"
[(
ngModel
)]="
loc
.
from
"
[
readonly
]="
true
"
>
<input
class=
"jr_dest_input to"
placeholder=
"
{{'userloc.To'|translate}}
"
[(
ngModel
)]="
loc
.
to
"
[
readonly
]="
true
"
>
</div>
</div>
</ion-content>
<ion-footer>
<div
class=
"jr_bottom_button_bay"
*
ngIf=
"!started"
>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
startRide
()"
>
Start Ride
</button>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
startRide
()"
>
{{'userloc.Start Ride'|translate}}
</button>
</div>
<div
class=
"jr_bottom_button_bay"
*
ngIf=
"temp && started"
>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
complete
()"
>
Finish Ride
</button>
<button
ion-button
class=
"cab_footer_btn"
(
click
)="
complete
()"
>
{{'userloc.Finish Ride'|translate}}
</button>
</div>
</ion-footer>
\ No newline at end of file
src/pages/userlocation/userlocation.module.ts
View file @
1bb6dcf9
import
{
NgModule
}
from
'@angular/core'
;
import
{
IonicPageModule
}
from
'ionic-angular'
;
import
{
UserlocationPage
}
from
'./userlocation'
;
import
{
TranslateModule
}
from
"@ngx-translate/core"
;
@
NgModule
({
declarations
:
[
...
...
@@ -8,6 +9,7 @@ import { UserlocationPage } from './userlocation';
],
imports
:
[
IonicPageModule
.
forChild
(
UserlocationPage
),
TranslateModule
],
})
export
class
UserlocationPageModule
{}
src/pages/userlocation/userlocation.ts
View file @
1bb6dcf9
...
...
@@ -7,6 +7,7 @@ import { driver } from "../../models/mymodel";
import
{
Storage
}
from
"@ionic/storage"
;
import
{
Myservice
}
from
"../../providers/myservice"
;
import
{
dataService
}
from
"../../providers/common.service"
;
import
{
TranslateService
}
from
"@ngx-translate/core"
;
declare
var
google
;
...
...
@@ -35,12 +36,14 @@ export class UserlocationPage {
count
:
number
=
0
;
tempPos
:
any
;
destmarker
:
any
;
lang
:
string
=
'en'
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
private
db
:
AngularFireDatabase
,
private
storage
:
Storage
,
private
myservice
:
Myservice
,
private
menu
:
MenuController
,
private
data
:
dataService
,
public
events
:
Events
)
{
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
private
db
:
AngularFireDatabase
,
private
storage
:
Storage
,
private
myservice
:
Myservice
,
private
menu
:
MenuController
,
private
data
:
dataService
,
public
events
:
Events
,
private
translate
:
TranslateService
)
{
this
.
loadMap
()
}
ionViewDidEnter
()
{
this
.
langTrans
()
this
.
events
.
publish
(
'driver:locOff'
,
''
);
...
...
@@ -70,6 +73,18 @@ export class UserlocationPage {
})
}
langTrans
()
{
this
.
storage
.
get
(
'lang'
).
then
(
lang
=>
{
if
(
lang
!=
null
)
{
this
.
translate
.
use
(
lang
)
this
.
lang
=
lang
;
}
else
{
this
.
translate
.
use
(
'en'
)
}
})
}
loadMap
()
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
...
...
@@ -260,8 +275,11 @@ export class UserlocationPage {
This
.
ride
=
response
.
data
This
.
data
.
setrateData
(
This
.
ride
)
}
else
this
.
myservice
.
show_alert
(
''
,
response
.
message
)
else
{
this
.
translate
.
get
([
'userloc.'
+
response
.
message
]).
subscribe
(
value
=>
{
this
.
myservice
.
show_alert
(
''
,
value
[
'userloc.'
+
response
.
message
])
})
}
})
}
})
...
...
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