Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
getme
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
amal
getme
Commits
e34368fe
Commit
e34368fe
authored
Feb 06, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'muhsin' into 'master'
Muhsin See merge request
!56
parents
5fb85ba7
6abb0eb2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
329 additions
and
375 deletions
+329
-375
nearby.page.scss
src/app/nearby/nearby.page.scss
+107
-152
profile.page.scss
src/app/profile/profile.page.scss
+167
-168
auth.service.ts
src/config/auth.service.ts
+55
-55
No files found.
src/app/nearby/nearby.page.scss
View file @
e34368fe
.nearby_map
{
.nearby_map
{
width
:
100%
;
height
:
100vh
;
.overlay
{
position
:
absolute
;
top
:
0px
;
left
:
0px
;
right
:
0px
;
bottom
:
0px
;
background
:
rgba
(
29
,
27
,
130
,
0
.2
);
}
agm-map
{
width
:
100%
;
width
:
100%
;
height
:
100vh
;
height
:
100%
;
.overlay
{
position
:
relative
;
position
:
absolute
;
}
top
:
0px
;
.click_marker
{
left
:
0px
;
min-width
:
200px
;
right
:
0px
;
padding
:
10px
;
bottom
:
0px
;
h5
{
background
:
rgba
(
29
,
27
,
130
,
0
.2
);
margin
:
0px
;
}
padding
:
0px
;
agm-map
{
width
:
100%
;
height
:
100%
;
position
:
relative
;
}
}
.click_marker
{
p
{
min-width
:
200px
;
margin
:
0px
;
padding
:
10px
;
padding
:
0px
;
h5
{
margin
:
0px
;
padding
:
0px
;
}
p
{
margin
:
0px
;
padding
:
0px
;
}
}
}
}
}
}
.add_address_wrapper
{
.add_address_wrapper
{
position
:
fixed
;
position
:
fixed
;
bottom
:
0px
;
bottom
:
0px
;
left
:
0px
;
left
:
0px
;
right
:
0px
;
right
:
0px
;
padding
:
20px
;
padding
:
20px
;
border-top-left-radius
:
15px
;
border-top-left-radius
:
15px
;
border-top-right-radius
:
15px
;
border-top-right-radius
:
15px
;
background
:
#fff
;
background
:
#fff
;
-webkit-box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
-webkit-box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
-moz-box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
-moz-box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
box-shadow
:
0px
-2px
5px
0px
rgba
(
0
,
0
,
0
,
0
.2
);
h5
{
h5
{
color
:
rgba
(
41
,
40
,
91
,
1
);
color
:
rgba
(
41
,
40
,
91
,
1
);
margin
:
0px
;
margin
:
0px
;
padding
:
0px
;
padding
:
0px
;
font-weight
:
800
;
font-weight
:
800
;
}
}
ul
{
p
{
margin
:
0px
;
}
padding
:
0px
;
input
{
padding-top
:
30px
;
width
:
100%
;
li
{
height
:
45px
;
list-style
:
none
;
border
:
1px
solid
#e1e0eb
;
margin-bottom
:
15px
;
border-radius
:
4px
;
p
{
padding-left
:
10px
;
margin
:
0px
;
padding-right
:
10px
;
padding
:
0px
;
margin-bottom
:
20px
;
color
:
rgba
(
176
,
174
,
199
,
1
);
}
padding-top
:
5px
;
.add_btn
{
padding-bottom
:
5px
;
width
:
100%
;
}
height
:
45px
;
.styled-checkbox
{
background-color
:
#29285b
;
position
:
absolute
;
// take it out of document flow
color
:
#fff
;
opacity
:
0
;
// hide it
border-radius
:
4px
;
&
+
label
{
}
position
:
relative
;
cursor
:
pointer
;
padding
:
0
;
width
:
100%
;
}
// Box.
&
+
label
:before
{
content
:
''
;
margin-right
:
10px
;
display
:
inline-block
;
vertical-align
:
text-top
;
width
:
20px
;
height
:
20px
;
border-radius
:
50%
;
background
:
white
;
border
:
1px
solid
rgba
(
215
,
213
,
228
,
1
);
}
&
:checked
+
label
:before
{
background
:
#29285b
;
}
// Disabled state label.
&
:disabled
+
label
{
color
:
#b8b8b8
;
cursor
:
auto
;
}
// Disabled box.
&
:disabled
+
label
:before
{
box-shadow
:
none
;
background
:
#ddd
;
}
// Checkmark. Could be replaced with an image
&
:checked
+
label
:after
{
content
:
''
;
position
:
absolute
;
left
:
6px
;
top
:
10px
;
background
:
white
;
width
:
2px
;
height
:
2px
;
box-shadow
:
2px
0
0
white
,
4px
0
0
white
,
4px
-2px
0
white
,
4px
-4px
0
white
,
4px
-6px
0
white
,
4px
-8px
0
white
;
transform
:
rotate
(
45deg
);
}
}
}
}
}
}
.styled-checkbox
{
.styled-checkbox
{
position
:
absolute
;
// take it out of document flow
position
:
absolute
;
// take it out of document flow
opacity
:
0
;
// hide it
opacity
:
0
;
// hide it
&
+
label
{
&
+
label
{
position
:
relative
;
position
:
relative
;
cursor
:
pointer
;
cursor
:
pointer
;
padding
:
0
;
padding
:
0
;
}
}
// Box.
// Box.
&
+
label
:before
{
&
+
label
:before
{
content
:
''
;
content
:
''
;
margin-right
:
10px
;
margin-right
:
10px
;
display
:
inline-block
;
display
:
inline-block
;
vertical-align
:
text-top
;
vertical-align
:
text-top
;
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
border-radius
:
10px
;
border-radius
:
10px
;
background
:
white
;
background
:
white
;
border
:
1px
solid
rgba
(
215
,
213
,
228
,
1
);
border
:
1px
solid
rgba
(
215
,
213
,
228
,
1
);
}
}
// Box hover
// Box hover
// Box checked
// Box checked
&
:checked
+
label
:before
{
&
:checked
+
label
:before
{
background
:
#29285b
;
background
:
#29285b
;
}
}
// Disabled state label.
// Disabled state label.
&
:disabled
+
label
{
&
:disabled
+
label
{
color
:
#b8b8b8
;
color
:
#b8b8b8
;
cursor
:
auto
;
cursor
:
auto
;
}
}
// Disabled box.
// Disabled box.
&
:disabled
+
label
:before
{
&
:disabled
+
label
:before
{
box-shadow
:
none
;
box-shadow
:
none
;
background
:
#ddd
;
background
:
#ddd
;
}
}
// Checkmark. Could be replaced with an image
// Checkmark. Could be replaced with an image
&
:checked
+
label
:after
{
&
:checked
+
label
:after
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
left
:
6px
;
left
:
6px
;
top
:
11px
;
top
:
11px
;
background
:
white
;
background
:
white
;
width
:
2px
;
width
:
2px
;
height
:
2px
;
height
:
2px
;
box-shadow
:
2px
0
0
white
,
4px
0
0
white
,
4px
-2px
0
white
,
4px
-4px
0
white
,
4px
-6px
0
white
,
4px
-8px
0
white
;
box-shadow
:
2px
0
0
white
,
4px
0
0
white
,
4px
-2px
0
white
,
4px
-4px
0
white
,
transform
:
rotate
(
45deg
);
4px
-6px
0
white
,
4px
-8px
0
white
;
}
transform
:
rotate
(
45deg
);
}
}
\ No newline at end of file
}
src/app/profile/profile.page.scss
View file @
e34368fe
.profile_wrapper
{
.profile_wrapper
{
.profile_banner
{
.profile_banner
{
width
:
100%
;
background-image
:
url('../../assets/profile_banner.png')
;
background-position
:
center
;
background-repeat
:
no-repeat
;
background-size
:
cover
;
text-align
:
center
;
padding-top
:
40px
;
.profile_circle
{
width
:
100px
;
height
:
100px
;
background-color
:
#fff
;
border-radius
:
50%
;
position
:
relative
;
margin
:
0
auto
;
img
{
width
:
100%
;
width
:
100%
;
background-image
:
url('../../assets/profile_banner.png')
;
height
:
100%
;
background-position
:
center
;
object-fit
:
cover
;
background-repeat
:
no-repeat
;
object-position
:
center
;
border-radius
:
50%
;
}
input
{
width
:
80px
;
height
:
100%
;
opacity
:
0
;
cursor
:
pointer
;
position
:
absolute
;
top
:
0px
;
left
:
0px
;
right
:
0px
;
bottom
:
0px
;
}
.edit
{
width
:
30px
;
height
:
30px
;
border-radius
:
50%
;
object-fit
:
cover
;
object-position
:
center
;
background-color
:
#000
;
background-image
:
url('../../assets/edit_icon.png')
;
background-size
:
cover
;
background-size
:
cover
;
text-align
:
center
;
cursor
:
pointer
;
padding-top
:
40px
;
position
:
absolute
;
.profile_circle
{
top
:
0px
;
width
:
100px
;
right
:
0px
;
height
:
100px
;
}
background-color
:
#fff
;
border-radius
:
50%
;
position
:
relative
;
margin
:
0
auto
;
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
object-position
:
center
;
border-radius
:
50%
;
}
input
{
width
:
80px
;
height
:
100%
;
opacity
:
0
;
cursor
:
pointer
;
position
:
absolute
;
top
:
0px
;
left
:
0px
;
right
:
0px
;
bottom
:
0px
;
}
.edit
{
width
:
30px
;
height
:
30px
;
border-radius
:
50%
;
object-fit
:
cover
;
object-position
:
center
;
background-color
:
#000
;
background-image
:
url('../../assets/edit_icon.png')
;
background-size
:
cover
;
cursor
:
pointer
;
position
:
absolute
;
top
:
0px
;
right
:
0px
;
}
}
h5
{
text-align
:
center
;
color
:
#fff
;
margin
:
0px
;
padding-top
:
15px
;
font-weight
:
600
;
padding-bottom
:
5px
;
}
p
{
color
:
rgba
(
206
,
153
,
76
,
1
);
text-align
:
center
;
margin
:
0px
;
padding-bottom
:
20px
;
font-weight
:
700
;
}
}
}
.account_wrapper
{
h5
{
width
:
calc
(
100%
-
40px
);
text-align
:
center
;
margin
:
0
auto
;
color
:
#fff
;
padding-top
:
20px
;
margin
:
0px
;
padding-bottom
:
100px
;
padding-top
:
15px
;
.account_header
{
font-weight
:
600
;
padding-bottom
:
15px
;
padding-bottom
:
5px
;
h5
{
}
margin
:
0px
;
p
{
padding
:
0px
;
color
:
rgba
(
206
,
153
,
76
,
1
);
color
:
rgba
(
59
,
57
,
77
,
1
);
text-align
:
center
;
font-weight
:
900
;
margin
:
0px
;
}
padding-bottom
:
20px
;
span
{
font-weight
:
700
;
color
:
rgba
(
59
,
57
,
77
,
1
);
}
img
{
}
width
:
20px
;
.account_wrapper
{
}
width
:
calc
(
100%
-
40px
);
}
margin
:
0
auto
;
.ar-span
{
padding-top
:
20px
;
color
:
rgba
(
206
,
153
,
76
,
1
);
padding-bottom
:
100px
;
margin-left
:
10px
;
.account_header
{
}
padding-bottom
:
15px
;
}
h5
{
p
{
margin
:
0px
;
margin
:
0px
;
padding
:
0px
;
padding
:
0px
;
color
:
rgba
(
59
,
57
,
77
,
1
);
color
:
rgba
(
176
,
174
,
199
,
1
);
font-weight
:
900
;
font-size
:
18px
;
}
}
span
{
h6
{
color
:
rgba
(
59
,
57
,
77
,
1
);
margin
:
0px
;
img
{
padding
:
0px
;
width
:
20px
;
color
:
rgba
(
59
,
57
,
77
,
1
);
font-size
:
18px
;
ion-icon
{
color
:
rgba
(
176
,
174
,
199
,
1
);
}
}
}
.row
{
}
padding-bottom
:
20px
;
}
.ar-span
{
color
:
rgba
(
206
,
153
,
76
,
1
);
margin-left
:
10px
;
}
p
{
margin
:
0px
;
padding
:
0px
;
color
:
rgba
(
176
,
174
,
199
,
1
);
font-size
:
18px
;
}
h6
{
margin
:
0px
;
padding
:
0px
;
color
:
rgba
(
59
,
57
,
77
,
1
);
font-size
:
18px
;
ion-icon
{
color
:
rgba
(
176
,
174
,
199
,
1
);
}
}
.row
{
padding-bottom
:
20px
;
}
hr
{
border-bottom
:
1px
solid
rgba
(
176
,
174
,
199
,
0
.5
);
height
:
0px
;
border-top
:
none
;
margin-top
:
15px
;
margin-bottom
:
15px
;
}
}
.logout-pop-wrapper
{
height
:
100vh
;
width
:
100%
;
position
:
fixed
;
top
:
0px
;
left
:
0px
;
right
:
0px
;
bottom
:
0px
;
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
z-index
:
99
;
.logout_inner
{
margin
:
0
auto
;
width
:
280px
;
padding
:
10px
;
padding-left
:
15px
;
padding-right
:
15px
;
padding-bottom
:
15px
;
background-color
:
#fff
;
position
:
relative
;
-webkit-box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
-moz-box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
top
:
50%
;
border-radius
:
10px
;
h4
{
text-align
:
center
;
color
:
rgba
(
59
,
57
,
77
,
1
);
margin
:
0px
;
font-weight
:
bold
;
padding
:
10px
;
font-size
:
18px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.16
);
padding-bottom
:
20px
;
}
p
{
text-align
:
center
;
}
.logout_footer
{
padding-top
:
10px
;
button
{
border-radius
:
8px
;
height
:
40px
;
width
:
48%
;
color
:
#fff
;
font-size
:
15px
;
font-weight
:
lighter
;
text-transform
:
uppercase
;
}
}
hr
{
.btn-cancel
{
border-bottom
:
1px
solid
rgba
(
176
,
174
,
199
,
0
.5
);
border
:
1px
solid
#29285b
;
height
:
0px
;
background-color
:
#29285b
;
border-top
:
none
;
margin-top
:
15px
;
margin-bottom
:
15px
;
}
}
}
.btn-logout
{
.logout-pop-wrapper
{
background-color
:
#fff
;
height
:
100vh
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.16
);
width
:
100%
;
color
:
#000
;
position
:
fixed
;
top
:
0px
;
left
:
0px
;
right
:
0px
;
bottom
:
0px
;
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
z-index
:
99
;
.logout_inner
{
margin
:
0
auto
;
width
:
280px
;
padding
:
10px
;
padding-left
:
15px
;
padding-right
:
15px
;
padding-bottom
:
15px
;
background-color
:
#fff
;
position
:
relative
;
-webkit-box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
-moz-box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
box-shadow
:
0px
1px
5px
0px
rgba
(
0
,
0
,
0
,
0
.3
);
top
:
50%
;
border-radius
:
10px
;
h4
{
text-align
:
center
;
color
:
rgba
(
59
,
57
,
77
,
1
);
margin
:
0px
;
font-weight
:
bold
;
padding
:
10px
;
font-size
:
18px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.16
);
padding-bottom
:
20px
;
}
p
{
text-align
:
center
;
}
.logout_footer
{
padding-top
:
10px
;
button
{
border-radius
:
8px
;
height
:
40px
;
width
:
48%
;
color
:
#fff
;
font-size
:
15px
;
font-weight
:
lighter
;
text-transform
:
uppercase
;
}
.btn-cancel
{
border
:
1px
solid
#29285B
;
background-color
:
#29285B
;
}
.btn-logout
{
background-color
:
#fff
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.16
);
color
:
#000
;
}
}
}
}
}
}
}
}
}
\ No newline at end of file
}
src/config/auth.service.ts
View file @
e34368fe
import
{
Injectable
}
from
"@angular/core"
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
User
,
Signup
,
Address
}
from
"./services/user"
;
import
{
User
,
Signup
,
Address
}
from
'./services/user'
;
import
{
auth
}
from
"firebase/app"
;
import
{
auth
}
from
'firebase/app'
;
import
{
Router
,
ActivatedRoute
}
from
"@angular/router"
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
AngularFireAuth
}
from
"@angular/fire/auth"
;
import
{
AngularFireAuth
}
from
'@angular/fire/auth'
;
import
{
import
{
AngularFirestore
,
AngularFirestore
,
AngularFirestoreDocument
,
AngularFirestoreDocument
,
AngularFirestoreCollection
AngularFirestoreCollection
}
from
"@angular/fire/firestore"
;
}
from
'@angular/fire/firestore'
;
import
{
ServiceService
}
from
"./../config/service.service"
;
import
{
ServiceService
}
from
'./../config/service.service'
;
import
{
SubjectService
}
from
"./../config/subject.service"
;
import
{
SubjectService
}
from
'./../config/subject.service'
;
import
{
GooglePlus
}
from
"@ionic-native/google-plus/ngx"
;
import
{
GooglePlus
}
from
'@ionic-native/google-plus/ngx'
;
import
{
take
}
from
"rxjs/operators"
;
import
{
take
}
from
'rxjs/operators'
;
import
{
from
}
from
"rxjs"
;
import
{
from
}
from
'rxjs'
;
@
Injectable
({
@
Injectable
({
providedIn
:
"root"
providedIn
:
'root'
})
})
export
class
AuthService
{
export
class
AuthService
{
loader
:
boolean
;
loader
:
boolean
;
...
@@ -30,33 +30,33 @@ export class AuthService {
...
@@ -30,33 +30,33 @@ export class AuthService {
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
type
=
1
;
this
.
type
=
1
;
this
.
afAuth
.
authState
.
subscribe
(
user
=>
{
this
.
afAuth
.
authState
.
subscribe
(
user
=>
{
console
.
log
(
"here"
);
console
.
log
(
'here'
);
console
.
log
(
user
);
console
.
log
(
user
);
if
(
user
)
{
if
(
user
)
{
this
.
subjectService
.
sendLoginData
(
false
);
this
.
subjectService
.
sendLoginData
(
false
);
this
.
userData
=
user
;
this
.
userData
=
user
;
console
.
log
(
this
.
userData
);
console
.
log
(
this
.
userData
);
this
.
service
.
set
(
"user"
,
JSON
.
stringify
(
this
.
userData
));
this
.
service
.
set
(
'user'
,
JSON
.
stringify
(
this
.
userData
));
this
.
SetUserData
(
user
);
this
.
SetUserData
(
user
);
this
.
loader
=
false
;
this
.
loader
=
false
;
if
(
this
.
type
===
1
)
{
if
(
this
.
type
===
1
)
{
this
.
router
.
navigateByUrl
(
"home"
);
this
.
router
.
navigateByUrl
(
'home'
);
}
else
{
}
else
{
this
.
router
.
navigateByUrl
(
"verification"
);
this
.
router
.
navigateByUrl
(
'verification'
);
}
}
}
else
{
}
else
{
console
.
log
(
"here too"
);
console
.
log
(
'here too'
);
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
subjectService
.
sendLoginData
(
true
);
this
.
subjectService
.
sendLoginData
(
true
);
this
.
service
.
set
(
"user"
,
null
);
this
.
service
.
set
(
'user'
,
null
);
JSON
.
parse
(
localStorage
.
getItem
(
"user"
));
JSON
.
parse
(
localStorage
.
getItem
(
'user'
));
this
.
router
.
navigateByUrl
(
"login"
);
this
.
router
.
navigateByUrl
(
'login'
);
}
}
});
});
}
}
get
isLoggedIn
():
boolean
{
get
isLoggedIn
():
boolean
{
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
"user"
));
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
'user'
));
return
user
!==
null
&&
user
.
emailVerified
!==
false
?
true
:
false
;
return
user
!==
null
&&
user
.
emailVerified
!==
false
?
true
:
false
;
}
}
userData
:
any
;
userData
:
any
;
...
@@ -70,21 +70,21 @@ export class AuthService {
...
@@ -70,21 +70,21 @@ export class AuthService {
return
this
.
afAuth
.
auth
return
this
.
afAuth
.
auth
.
signInWithEmailAndPassword
(
email
,
password
)
.
signInWithEmailAndPassword
(
email
,
password
)
.
then
(
result
=>
{
.
then
(
result
=>
{
console
.
log
(
"success"
);
console
.
log
(
'success'
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
this
.
SetUserData
(
result
.
user
);
this
.
SetUserData
(
result
.
user
);
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
service
.
showToast
(
error
.
message
,
"bottom"
,
"my-error"
,
1000
);
this
.
service
.
showToast
(
error
.
message
,
'bottom'
,
'my-error'
,
1000
);
});
});
}
}
public
async
verify
(
otp
:
string
)
{
public
async
verify
(
otp
:
string
)
{
this
.
loader
=
true
;
this
.
loader
=
true
;
const
custRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
custRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
"customers"
,
'customers'
,
ref
=>
ref
.
where
(
"otp"
,
"=="
,
otp
).
where
(
"uid"
,
"=="
,
this
.
userData
.
uid
)
ref
=>
ref
.
where
(
'otp'
,
'=='
,
otp
).
where
(
'uid'
,
'=='
,
this
.
userData
.
uid
)
);
);
custRef
custRef
.
valueChanges
()
.
valueChanges
()
...
@@ -92,18 +92,18 @@ export class AuthService {
...
@@ -92,18 +92,18 @@ export class AuthService {
.
subscribe
((
value
:
User
[])
=>
{
.
subscribe
((
value
:
User
[])
=>
{
if
(
value
.
length
>
0
)
{
if
(
value
.
length
>
0
)
{
this
.
afs
this
.
afs
.
collection
(
"customers"
)
.
collection
(
'customers'
)
.
doc
(
this
.
userData
.
uid
)
.
doc
(
this
.
userData
.
uid
)
.
update
({
otp
:
""
,
phoneVerified
:
true
});
.
update
({
otp
:
''
,
phoneVerified
:
true
});
this
.
service
.
set
(
"type"
,
1
);
this
.
service
.
set
(
'type'
,
1
);
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
router
.
navigateByUrl
(
"nearby"
);
this
.
router
.
navigateByUrl
(
'nearby'
);
}
else
{
}
else
{
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
service
.
showToast
(
this
.
service
.
showToast
(
"Please input valid OTP"
,
'Please input valid OTP'
,
"bottom"
,
'bottom'
,
"my-error"
,
'my-error'
,
1000
1000
);
);
}
}
...
@@ -112,7 +112,7 @@ export class AuthService {
...
@@ -112,7 +112,7 @@ export class AuthService {
profilePic
(
pic
)
{
profilePic
(
pic
)
{
this
.
afs
this
.
afs
.
collection
(
"customers"
)
.
collection
(
'customers'
)
.
doc
(
this
.
userData
.
uid
)
.
doc
(
this
.
userData
.
uid
)
.
update
({
profilePhoto
:
pic
});
.
update
({
profilePhoto
:
pic
});
}
}
...
@@ -123,7 +123,7 @@ export class AuthService {
...
@@ -123,7 +123,7 @@ export class AuthService {
this
.
afAuth
.
auth
this
.
afAuth
.
auth
.
signInWithPopup
(
new
auth
.
GoogleAuthProvider
())
.
signInWithPopup
(
new
auth
.
GoogleAuthProvider
())
.
then
(
result
=>
{
.
then
(
result
=>
{
console
.
log
(
"success"
);
console
.
log
(
'success'
);
console
.
log
(
result
.
additionalUserInfo
.
isNewUser
);
console
.
log
(
result
.
additionalUserInfo
.
isNewUser
);
if
(
if
(
result
.
additionalUserInfo
&&
result
.
additionalUserInfo
&&
...
@@ -150,11 +150,11 @@ export class AuthService {
...
@@ -150,11 +150,11 @@ export class AuthService {
.
signInWithPopup
(
new
auth
.
FacebookAuthProvider
())
.
signInWithPopup
(
new
auth
.
FacebookAuthProvider
())
.
then
(
result
=>
{
.
then
(
result
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
console
.
log
(
"success"
);
console
.
log
(
'success'
);
console
.
log
(
result
);
console
.
log
(
result
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
this
.
service
.
showToast
(
err
.
message
,
"bottom"
,
"my-error"
,
1000
);
this
.
service
.
showToast
(
err
.
message
,
'bottom'
,
'my-error'
,
1000
);
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
This
.
loader
=
false
;
This
.
loader
=
false
;
...
@@ -181,7 +181,7 @@ export class AuthService {
...
@@ -181,7 +181,7 @@ export class AuthService {
loginType
:
value
.
loginType
loginType
:
value
.
loginType
};
};
this
.
loggedUser
=
userData
;
this
.
loggedUser
=
userData
;
this
.
service
.
set
(
"userData"
,
JSON
.
stringify
(
this
.
loggedUser
));
this
.
service
.
set
(
'userData'
,
JSON
.
stringify
(
this
.
loggedUser
));
this
.
subjectService
.
sendUserData
(
JSON
.
stringify
(
this
.
loggedUser
));
this
.
subjectService
.
sendUserData
(
JSON
.
stringify
(
this
.
loggedUser
));
console
.
log
(
this
.
loggedUser
);
console
.
log
(
this
.
loggedUser
);
});
});
...
@@ -191,9 +191,9 @@ export class AuthService {
...
@@ -191,9 +191,9 @@ export class AuthService {
this
.
loader
=
true
;
this
.
loader
=
true
;
return
this
.
afAuth
.
auth
.
signOut
().
then
(()
=>
{
return
this
.
afAuth
.
auth
.
signOut
().
then
(()
=>
{
this
.
subjectService
.
sendLoginData
(
true
);
this
.
subjectService
.
sendLoginData
(
true
);
this
.
service
.
remove
(
"user"
);
this
.
service
.
remove
(
'user'
);
this
.
loader
=
false
;
this
.
loader
=
false
;
console
.
log
(
"logout"
);
console
.
log
(
'logout'
);
});
});
}
}
...
@@ -201,9 +201,9 @@ export class AuthService {
...
@@ -201,9 +201,9 @@ export class AuthService {
this
.
type
=
2
;
this
.
type
=
2
;
console
.
log
(
userData
.
user
);
console
.
log
(
userData
.
user
);
const
currencyData
=
{
const
currencyData
=
{
currId
:
"123"
,
currId
:
'123'
,
currName
:
"Australian dollar"
,
currName
:
'Australian dollar'
,
symbol
:
"A$"
symbol
:
'A$'
};
};
const
otp
=
Math
.
floor
(
1000
+
Math
.
random
()
*
9000
);
const
otp
=
Math
.
floor
(
1000
+
Math
.
random
()
*
9000
);
userData
=
userData
.
user
;
userData
=
userData
.
user
;
...
@@ -223,11 +223,11 @@ export class AuthService {
...
@@ -223,11 +223,11 @@ export class AuthService {
this
.
userPostData
=
postData
;
this
.
userPostData
=
postData
;
console
.
log
(
postData
);
console
.
log
(
postData
);
this
.
afs
this
.
afs
.
collection
(
"customers"
)
.
collection
(
'customers'
)
.
doc
(
userData
.
uid
)
.
doc
(
userData
.
uid
)
.
set
(
postData
)
.
set
(
postData
)
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
"successs"
);
console
.
log
(
'successs'
);
});
});
}
}
...
@@ -242,15 +242,15 @@ export class AuthService {
...
@@ -242,15 +242,15 @@ export class AuthService {
console
.
log
(
result
.
user
);
console
.
log
(
result
.
user
);
this
.
afAuth
.
auth
.
currentUser
.
sendEmailVerification
();
this
.
afAuth
.
auth
.
currentUser
.
sendEmailVerification
();
const
currencyData
=
{
const
currencyData
=
{
currId
:
"123"
,
currId
:
'123'
,
currName
:
"Australian dollar"
,
currName
:
'Australian dollar'
,
symbol
:
"A$"
symbol
:
'A$'
};
};
const
custData
=
result
.
user
;
const
custData
=
result
.
user
;
const
postData
:
User
=
{
const
postData
:
User
=
{
uid
:
custData
.
uid
,
uid
:
custData
.
uid
,
status
:
true
,
status
:
true
,
profilePhoto
:
""
,
profilePhoto
:
''
,
phoneVerified
:
false
,
phoneVerified
:
false
,
phone
:
userData
.
phone
,
phone
:
userData
.
phone
,
name
:
userData
.
name
,
name
:
userData
.
name
,
...
@@ -263,11 +263,11 @@ export class AuthService {
...
@@ -263,11 +263,11 @@ export class AuthService {
this
.
userPostData
=
postData
;
this
.
userPostData
=
postData
;
console
.
log
(
postData
);
console
.
log
(
postData
);
this
.
afs
this
.
afs
.
collection
(
"customers"
)
.
collection
(
'customers'
)
.
doc
(
custData
.
uid
)
.
doc
(
custData
.
uid
)
.
set
(
postData
)
.
set
(
postData
)
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
"successs"
);
console
.
log
(
'successs'
);
});
});
this
.
loader
=
false
;
this
.
loader
=
false
;
})
})
...
@@ -282,7 +282,7 @@ export class AuthService {
...
@@ -282,7 +282,7 @@ export class AuthService {
console
.
log
(
this
.
userData
.
uid
);
console
.
log
(
this
.
userData
.
uid
);
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
afs
this
.
afs
.
collection
(
"address"
)
.
collection
(
'address'
)
.
add
({
.
add
({
uid
:
this
.
userData
.
uid
uid
:
this
.
userData
.
uid
})
})
...
@@ -306,13 +306,13 @@ export class AuthService {
...
@@ -306,13 +306,13 @@ export class AuthService {
const
neworderId
=
docRef
.
id
;
const
neworderId
=
docRef
.
id
;
console
.
log
(
addrData
);
console
.
log
(
addrData
);
this
.
afs
this
.
afs
.
collection
(
"address"
)
.
collection
(
'address'
)
.
doc
(
neworderId
)
.
doc
(
neworderId
)
.
set
(
addrData
)
.
set
(
addrData
)
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
"Address add Successfully"
);
console
.
log
(
'Address add Successfully'
);
this
.
service
.
set
(
"user"
,
JSON
.
stringify
(
this
.
userData
));
this
.
service
.
set
(
'user'
,
JSON
.
stringify
(
this
.
userData
));
this
.
router
.
navigateByUrl
(
"home"
);
this
.
router
.
navigateByUrl
(
'home'
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
...
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