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
78ca2550
Commit
78ca2550
authored
Mar 27, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new changes
parent
79995412
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
58 deletions
+50
-58
changeaddress.page.ts
src/app/changeaddress/changeaddress.page.ts
+3
-2
home.page.html
src/app/home/home.page.html
+2
-3
home.page.ts
src/app/home/home.page.ts
+27
-43
nearby.page.ts
src/app/nearby/nearby.page.ts
+8
-4
orderplaced.page.html
src/app/orderplaced/orderplaced.page.html
+8
-5
address.service.ts
src/config/address.service.ts
+2
-1
No files found.
src/app/changeaddress/changeaddress.page.ts
View file @
78ca2550
...
@@ -57,6 +57,7 @@ export class ChangeaddressPage implements OnInit {
...
@@ -57,6 +57,7 @@ export class ChangeaddressPage implements OnInit {
this
.
lat
=
''
;
this
.
lat
=
''
;
this
.
lng
=
''
;
this
.
lng
=
''
;
this
.
type
=
0
;
this
.
type
=
0
;
this
.
zoom
=
16
;
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
if
(
data
)
{
if
(
data
)
{
data
=
JSON
.
parse
(
data
);
data
=
JSON
.
parse
(
data
);
...
@@ -100,7 +101,7 @@ export class ChangeaddressPage implements OnInit {
...
@@ -100,7 +101,7 @@ export class ChangeaddressPage implements OnInit {
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
this
.
latitude
=
position
.
coords
.
latitude
;
this
.
latitude
=
position
.
coords
.
latitude
;
this
.
longitude
=
position
.
coords
.
longitude
;
this
.
longitude
=
position
.
coords
.
longitude
;
this
.
zoom
=
8
;
this
.
zoom
=
16
;
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
});
});
}
}
...
@@ -116,7 +117,7 @@ export class ChangeaddressPage implements OnInit {
...
@@ -116,7 +117,7 @@ export class ChangeaddressPage implements OnInit {
console
.
log
(
e
);
console
.
log
(
e
);
this
.
newCenterLat
=
e
.
lat
;
this
.
newCenterLat
=
e
.
lat
;
this
.
newCenterLng
=
e
.
lng
;
this
.
newCenterLng
=
e
.
lng
;
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
//
this.getAddress(this.newCenterLat, this.newCenterLng);
}
}
markerDragEnd
(
$event
:
MouseEvent
)
{
markerDragEnd
(
$event
:
MouseEvent
)
{
...
...
src/app/home/home.page.html
View file @
78ca2550
...
@@ -195,9 +195,8 @@
...
@@ -195,9 +195,8 @@
</label>
</label>
</div>
</div>
<div>
<div>
<p>
<p>
{{address.building}}
<span
*
ngIf=
"address.landmark && address.landmark!==''"
>
,
{{address.building}},
<span
{{address.landmark}}
</span>
*
ngIf=
"address.landmark && address.landmark!==''"
>
{{address.landmark}},
</span>
<!-- {{address.address}} -->
<!-- {{address.address}} -->
</p>
</p>
</div>
</div>
...
...
src/app/home/home.page.ts
View file @
78ca2550
...
@@ -78,13 +78,15 @@ export class HomePage implements OnInit {
...
@@ -78,13 +78,15 @@ export class HomePage implements OnInit {
this
.
custId
=
data
.
uid
;
this
.
custId
=
data
.
uid
;
this
.
addressService
.
addList
(
data
.
uid
);
this
.
addressService
.
addList
(
data
.
uid
);
this
.
subjectService
.
getAddressStateData
().
subscribe
((
state
)
=>
{
this
.
subjectService
.
getAddressStateData
().
subscribe
((
state
)
=>
{
console
.
log
(
state
);
if
(
state
!==
null
)
{
if
(
state
!==
null
)
{
this
.
addressService
.
defaultAddress
(
data
.
uid
).
then
((
addressData
)
=>
{
this
.
addressService
.
defaultAddress
(
data
.
uid
).
then
((
addressData
)
=>
{
console
.
log
(
this
.
addressService
.
defaultAdd
);
console
.
log
(
this
.
addressService
.
defaultAdd
);
const
latLng
=
this
.
addressService
.
defaultAdd
.
latLng
;
const
latLng
=
this
.
addressService
.
defaultAdd
.
latLng
;
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
this
.
centerService
.
getNearBy
(
latLng
.
latitude
,
latLng
.
longitude
,
this
.
service
.
distance
);
this
.
centerService
.
getNearBy
(
latLng
.
latitude
,
latLng
.
longitude
,
this
.
service
.
distance
);
this
.
getAddress
(
latLng
.
latitude
,
latLng
.
longitude
);
this
.
address
=
this
.
addressService
.
defaultAdd
.
building
;
// this.getAddress(latLng.latitude, latLng.longitude);
});
});
}
}
});
});
...
@@ -107,7 +109,7 @@ export class HomePage implements OnInit {
...
@@ -107,7 +109,7 @@ export class HomePage implements OnInit {
const
This
=
this
;
const
This
=
this
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
This
.
mapsAPILoader
.
load
().
then
(()
=>
{
This
.
mapsAPILoader
.
load
().
then
(()
=>
{
This
.
setCurrentLocation
();
//
This.setCurrentLocation();
This
.
geoCoder
=
new
google
.
maps
.
Geocoder
();
This
.
geoCoder
=
new
google
.
maps
.
Geocoder
();
const
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
This
.
searchElementRef
.
nativeElement
,
{
const
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
This
.
searchElementRef
.
nativeElement
,
{
types
:
[
'address'
]
types
:
[
'address'
]
...
@@ -170,47 +172,29 @@ export class HomePage implements OnInit {
...
@@ -170,47 +172,29 @@ export class HomePage implements OnInit {
setDefault
(
address
:
any
)
{
setDefault
(
address
:
any
)
{
this
.
loader
=
true
;
this
.
loader
=
true
;
if
(
address
.
addressId
!==
''
)
{
this
.
addressService
this
.
addressService
.
setDefaultAddress
(
address
.
addressId
,
this
.
custId
)
.
setDefaultAddress
(
address
.
addressId
,
this
.
custId
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
address
=
address
.
building
;
this
.
address
=
address
.
building
;
this
.
lat
=
address
.
latLng
.
latitude
;
this
.
lat
=
address
.
latLng
.
latitude
;
this
.
lng
=
address
.
latLng
.
longitude
;
this
.
lng
=
address
.
latLng
.
longitude
;
console
.
log
(
address
.
latLng
);
console
.
log
(
address
.
latLng
);
this
.
centerService
.
getNearBy
(
this
.
centerService
.
getNearBy
(
address
.
latLng
.
latitude
,
address
.
latLng
.
latitude
,
address
.
latLng
.
longitude
,
address
.
latLng
.
longitude
,
this
.
service
.
distance
this
.
service
.
distance
);
);
this
.
loader
=
false
;
this
.
loader
=
false
;
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
service
.
showToast
(
this
.
service
.
showToast
(
'Something went wrong please try again!'
,
'Something went wrong please try again!'
,
'top'
,
'top'
,
'my-error'
,
'my-error'
,
1000
1000
);
);
});
});
}
else
{
const
This
=
this
;
This
.
address
=
address
.
building
;
console
.
log
(
address
);
this
.
lat
=
address
.
latLng
.
latitude
;
this
.
lng
=
address
.
latLng
.
longitude
;
console
.
log
(
address
.
latLng
);
this
.
centerService
.
getNearBy
(
address
.
latLng
.
latitude
,
address
.
latLng
.
longitude
,
this
.
service
.
distance
);
setTimeout
(()
=>
{
This
.
loader
=
false
;
},
1000
);
}
}
}
clickSearch
()
{
clickSearch
()
{
...
...
src/app/nearby/nearby.page.ts
View file @
78ca2550
...
@@ -49,6 +49,8 @@ export class NearbyPage implements OnInit {
...
@@ -49,6 +49,8 @@ export class NearbyPage implements OnInit {
public
service
:
ServiceService
,
public
service
:
ServiceService
,
public
authService
:
AuthService
public
authService
:
AuthService
)
{
)
{
this
.
latitude
=
0
;
this
.
longitude
=
0
;
this
.
successState
=
false
;
this
.
successState
=
false
;
this
.
type
=
0
;
this
.
type
=
0
;
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
...
@@ -90,11 +92,7 @@ export class NearbyPage implements OnInit {
...
@@ -90,11 +92,7 @@ export class NearbyPage implements OnInit {
// google maps zoom level
// google maps zoom level
private
setCurrentLocation
()
{
private
setCurrentLocation
()
{
console
.
log
(
'map-called'
);
if
(
'geolocation'
in
navigator
)
{
if
(
'geolocation'
in
navigator
)
{
console
.
log
(
navigator
);
/* this.latitude = -33.87276;
this.longitude = 151.20534; */
this
.
zoom
=
16
;
this
.
zoom
=
16
;
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
...
@@ -138,8 +136,14 @@ export class NearbyPage implements OnInit {
...
@@ -138,8 +136,14 @@ export class NearbyPage implements OnInit {
mapReady
(
map
)
{
mapReady
(
map
)
{
console
.
log
(
'called'
);
console
.
log
(
'called'
);
map
.
addListener
(
'dragend'
,
()
=>
{
map
.
addListener
(
'dragend'
,
()
=>
{
console
.
log
(
this
.
searchElementRef
.
nativeElement
.
value
);
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
const
This
=
this
;
setTimeout
(()
=>
{
This
.
searchElementRef
.
nativeElement
.
value
=
this
.
address
;
},
500
);
});
});
}
}
centerChange
(
e
)
{
centerChange
(
e
)
{
...
...
src/app/orderplaced/orderplaced.page.html
View file @
78ca2550
...
@@ -107,16 +107,18 @@
...
@@ -107,16 +107,18 @@
<div
class=
"delivery-wrap"
>
<div
class=
"delivery-wrap"
>
<h4
class=
"floatLeft"
>
DELIVERY
</h4>
<h4
class=
"floatLeft"
>
DELIVERY
</h4>
<span
class=
"floatRight"
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
><img
<span
class=
"floatRight"
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
><img
class=
"ng-tns-c3-0"
src=
"../../assets/edit.png"
(
click
)="
changeAddress
(
data
.
orderId
)"
/></span>
class=
"ng-tns-c3-0"
src=
"../../assets/edit.png"
(
click
)="
changeAddress
(
data
.
orderId
)"
/></span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
<h5
*
ngIf=
"data.deliveryAddress"
>
<h5
*
ngIf=
"data.deliveryAddress"
>
{{data.deliveryAddress.addressType}}
{{data.deliveryAddress.addressType}},
<!-- ,<br />{{data.deliveryAddress.address}} -->
,
<!-- ,<br />{{data.deliveryAddress.address}} -->
<br
/>
{{data.deliveryAddress.building}}
<span
*
ngIf=
"data.deliveryAddress.landmark && data.deliveryAddress.landmark!==''"
><br
/>
,
<br
/>
{{data.deliveryAddress.building}}
<span
*
ngIf=
"data.deliveryAddress.landmark && data.deliveryAddress.landmark!==''"
><br
/>
,
{{data.deliveryAddress.landmark}}
</span>
{{data.deliveryAddress.landmark}}
</span>
</h5>
</h5>
<!-- <hr /> -->
<!-- <hr /> -->
...
@@ -182,7 +184,8 @@
...
@@ -182,7 +184,8 @@
<ion-footer>
<ion-footer>
<div
class=
"footer-btn"
>
<div
class=
"footer-btn"
>
<button
class=
"cancel_btn"
(
click
)="
cancelOrder
(
data
.
orderId
)"
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
>
<button
class=
"cancel_btn"
(
click
)="
cancelOrder
(
data
.
orderId
)"
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
>
CANCEL THIS ORDER
CANCEL THIS ORDER
</button>
</button>
</div>
</div>
...
...
src/config/address.service.ts
View file @
78ca2550
...
@@ -41,7 +41,7 @@ export class AddressService {
...
@@ -41,7 +41,7 @@ export class AddressService {
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
addressList
=
[];
this
.
addressList
=
[];
const
res
=
value
;
const
res
=
value
;
this
.
getAddressCurrent
();
//
this.getAddressCurrent();
if
(
res
.
length
>
0
)
{
if
(
res
.
length
>
0
)
{
res
.
forEach
(
item
=>
{
res
.
forEach
(
item
=>
{
// console.log(item);
// console.log(item);
...
@@ -169,6 +169,7 @@ export class AddressService {
...
@@ -169,6 +169,7 @@ export class AddressService {
}
}
async
setDefaultAddress
(
addId
:
string
,
userId
:
string
)
{
async
setDefaultAddress
(
addId
:
string
,
userId
:
string
)
{
console
.
log
(
addId
,
userId
);
return
await
new
Promise
(
resolve
=>
{
return
await
new
Promise
(
resolve
=>
{
this
.
afs
this
.
afs
.
collection
(
'address'
,
ref
=>
ref
.
where
(
'uid'
,
'=='
,
userId
))
.
collection
(
'address'
,
ref
=>
ref
.
where
(
'uid'
,
'=='
,
userId
))
...
...
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