Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
2dc7dc93
Commit
2dc7dc93
authored
5 years ago
by
Ratnadeep Rajendra Kharade
Browse files
Options
Download
Email Patches
Plain Diff
removed loader page.
parent
ca481f3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/app/auth/login/login.page.ts
+3
-3
src/app/auth/login/login.page.ts
src/app/hirebike/hirebike.page.ts
+9
-9
src/app/hirebike/hirebike.page.ts
src/app/home/home.page.ts
+7
-6
src/app/home/home.page.ts
src/app/myreservation/myreservation.page.ts
+4
-4
src/app/myreservation/myreservation.page.ts
with
23 additions
and
22 deletions
+23
-22
src/app/auth/login/login.page.ts
+
3
-
3
View file @
2dc7dc93
...
...
@@ -42,7 +42,7 @@ export class LoginPage implements OnInit {
"
email
"
:
this
.
username
,
"
password
"
:
this
.
password
});
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
loginApi
.
subscribe
((
data
)
=>
{
//console.log('my data: ', data);
...
...
@@ -50,11 +50,11 @@ export class LoginPage implements OnInit {
this
.
restService
.
isLoginPage
=
false
;
this
.
userService
.
setUsername
(
this
.
username
);
this
.
router
.
navigateByUrl
(
'
/home
'
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
},
(
error
)
=>
{
console
.
log
(
JSON
.
stringify
(
error
));
this
.
correctCredentials
=
true
;
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
});
}
register
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/hirebike/hirebike.page.ts
+
9
-
9
View file @
2dc7dc93
...
...
@@ -160,7 +160,7 @@ export class HirebikePage implements OnInit {
}
getReservedBike
()
{
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
//call reserved bike api
...
...
@@ -182,15 +182,15 @@ export class HirebikePage implements OnInit {
//pass reserved bike subject here map
this
.
gotReservedBikeSubject
.
next
(
resp
.
data
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
},
(
reservedBikeError
)
=>
{
console
.
log
(
reservedBikeError
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
});
}
},
(
bikeDetailsError
)
=>
{
console
.
log
(
bikeDetailsError
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
});
});
}
...
...
@@ -202,12 +202,12 @@ export class HirebikePage implements OnInit {
let
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
Trip Started
"
);
this
.
isBikeHired
=
true
;
},
(
error
)
=>
{
console
.
log
(
error
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
This is ongoing Trip
"
);
});
});
...
...
@@ -220,18 +220,18 @@ export class HirebikePage implements OnInit {
}
CancelTrip
()
{
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/rent
'
+
'
?bikeId=
'
+
this
.
bikeDetails
.
id
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
delete
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
Trip Ended!
"
);
},
(
error
)
=>
{
console
.
log
(
error
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
No Ongong Trip to End
"
)
});
});
...
...
This diff is collapsed.
Click to expand it.
src/app/home/home.page.ts
+
7
-
6
View file @
2dc7dc93
...
...
@@ -145,7 +145,7 @@ export class HomePage implements OnInit, OnDestroy {
}
getBikesList
()
{
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/bikes
'
+
'
?lat=
'
+
this
.
currentUserPosition
.
lat
+
'
&lng=
'
+
this
.
currentUserPosition
.
lng
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
...
...
@@ -158,9 +158,10 @@ export class HomePage implements OnInit, OnDestroy {
this
.
reverseGeocode
(
this
.
platform
,
this
.
bikes
[
i
].
lat
,
this
.
bikes
[
i
].
lon
,
i
);
}
this
.
showBikesOnMap
();
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
},
(
error
)
=>
{
console
.
log
(
error
)
this
.
loadingService
.
hideLoader
();});
//this.loadingService.hideLoader();
});
});
}
...
...
@@ -260,7 +261,7 @@ export class HomePage implements OnInit, OnDestroy {
reserveBike
()
{
//this.selectedBike=bikeS;
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/reservation
'
+
'
?bikeId=
'
+
this
.
selectedBike
.
id
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
...
...
@@ -270,10 +271,10 @@ export class HomePage implements OnInit, OnDestroy {
this
.
isBikeReserved
=
true
;
this
.
toastService
.
showToast
(
"
Reservation Successful!
"
);
this
.
router
.
navigateByUrl
(
'
/myreservation
'
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
},
(
error
)
=>
{
console
.
log
(
error
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
Only one bike may be reserved or rented at a time
"
);
});
});
...
...
This diff is collapsed.
Click to expand it.
src/app/myreservation/myreservation.page.ts
+
4
-
4
View file @
2dc7dc93
...
...
@@ -131,7 +131,7 @@ export class MyreservationPage implements OnInit {
}
getReservedBike
()
{
this
.
loadingService
.
showLoader
();
//
this.loadingService.showLoader();
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
//call reserved bike api
...
...
@@ -147,7 +147,7 @@ export class MyreservationPage implements OnInit {
let
bikeDetailsApi
=
this
.
httpClient
.
get
(
bikeDetailsUrl
,
{
headers
});
bikeDetailsApi
.
subscribe
((
resp
:
any
)
=>
{
console
.
log
(
'
Bike Details
'
,
resp
);
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
this
.
bikeDetails
=
resp
.
data
;
this
.
reverseGeocode
(
this
.
platform
,
this
.
bikeDetails
.
lat
,
this
.
bikeDetails
.
lon
);
this
.
isBikeReserved
=
true
;
...
...
@@ -163,13 +163,13 @@ export class MyreservationPage implements OnInit {
console
.
log
(
error
.
message
);
});
},
(
reservedBikeError
)
=>
{
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
console
.
log
(
reservedBikeError
);
this
.
isBikeReserved
=
false
;
});
}
},
(
bikeDetailsError
)
=>
{
this
.
loadingService
.
hideLoader
();
//
this.loadingService.hideLoader();
console
.
log
(
bikeDetailsError
)
this
.
isBikeReserved
=
false
;
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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