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
6afa4f28
Commit
6afa4f28
authored
Mar 10, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup
parent
0cce2daf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
changeaddress.page.html
src/app/changeaddress/changeaddress.page.html
+20
-8
changeaddress.page.ts
src/app/changeaddress/changeaddress.page.ts
+18
-3
cart.service.ts
src/config/cart.service.ts
+1
-1
No files found.
src/app/changeaddress/changeaddress.page.html
View file @
6afa4f28
...
...
@@ -20,20 +20,25 @@
<ion-content>
<div
class=
"nearby_map"
>
<div
class=
"map-inner"
>
<agm-map
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
zoom
]="
8
"
[
backgroundColor
]="'
rgba
(
29
,
27
,
130
,
0
.
2
)'"
>
<agm-map
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
zoom
]="
8
"
[
backgroundColor
]="'
rgba
(
29
,
27
,
130
,
0
.
2
)'"
(
mapReady
)="
mapReady
($
event
)"
(
centerChange
)="
centerChange
($
event
)"
>
<agm-marker
[
markerDraggable
]="
true
"
(
dragEnd
)="
markerDragEnd
($
event
)"
></agm-marker>
</agm-map>
<span
class=
"map-pin"
><img
src=
"../../assets/pin.svg"
alt=
""
></span>
</div>
<form
(
ngSubmit
)="
onSubmit
(
addressForm
.
value
);
addressForm
.
reset
()"
#
addressForm=
"ngForm"
method=
"post"
class=
"form-horizontal"
>
<form
(
ngSubmit
)="
onSubmit
(
addressForm
.
value
);
addressForm
.
reset
()"
#
addressForm=
"ngForm"
method=
"post"
class=
"form-horizontal"
>
<div
class=
"add_address_wrapper"
>
<h5>
DELIVERY
</h5>
<p>
{{address}}
</p>
<input
[(
ngModel
)]="
addressForm
.
building
"
name=
"building"
#
building=
"ngModel"
name=
"building"
required
placeholder=
"House No./ Building No"
/>
<input
[(
ngModel
)]="
addressForm
.
building
"
name=
"building"
#
building=
"ngModel"
name=
"building"
required
placeholder=
"House No./ Building No"
/>
<div
class=
"md-errors-spacer"
[
hidden
]="
building
.
valid
||
landmark
.
pristine
"
class=
"ion-padding-start"
>
Building Name is required
</div>
<input
[(
ngModel
)]="
addressForm
.
landmark
"
name=
"landmark"
#
landmark=
"ngModel"
name=
"landmark"
required
placeholder=
"Landmark"
/>
<input
[(
ngModel
)]="
addressForm
.
landmark
"
name=
"landmark"
#
landmark=
"ngModel"
name=
"landmark"
required
placeholder=
"Landmark"
/>
<div
class=
"md-errors-spacer"
[
hidden
]="
landmark
.
valid
||
landmark
.
pristine
"
class=
"ion-padding-start"
>
Landmark is required
</div>
...
...
@@ -41,24 +46,31 @@
<ion-row>
<ion-col>
<h6>
<input
class=
"styled-checkbox"
id=
"styled-check-1"
type=
"radio"
value=
"Home"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<input
class=
"styled-checkbox"
id=
"styled-check-1"
type=
"radio"
value=
"Home"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<label
for=
"styled-check-1"
><span>
Home
</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input
class=
"styled-checkbox"
id=
"styled-check-2"
type=
"radio"
value=
"Work"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<input
class=
"styled-checkbox"
id=
"styled-check-2"
type=
"radio"
value=
"Work"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<label
for=
"styled-check-2"
><span>
Office
</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input
class=
"styled-checkbox"
id=
"styled-check-3"
type=
"radio"
value=
"Other"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<input
class=
"styled-checkbox"
id=
"styled-check-3"
type=
"radio"
value=
"Other"
[(
ngModel
)]="
addressForm
.
addressType
"
name=
"addressType"
#
addressType=
"ngModel"
required
/>
<label
for=
"styled-check-3"
><span>
Others
</span></label>
</h6>
</ion-col>
</ion-row>
<div
class=
"md-errors-spacer"
[
hidden
]="
addressType
.
valid
||
addressType
.
pristine
"
class=
"ion-padding-start"
>
<div
class=
"md-errors-spacer"
[
hidden
]="
addressType
.
valid
||
addressType
.
pristine
"
class=
"ion-padding-start"
>
Address Type is required
</div>
</ion-grid>
...
...
src/app/changeaddress/changeaddress.page.ts
View file @
6afa4f28
...
...
@@ -36,6 +36,8 @@ export class ChangeaddressPage implements OnInit {
addressValid
:
any
;
lat
:
any
;
lng
:
any
;
newCenterLat
:
number
;
newCenterLng
:
number
;
public
searchElementRef
:
ElementRef
;
constructor
(
...
...
@@ -88,6 +90,19 @@ export class ChangeaddressPage implements OnInit {
}
}
mapReady
(
map
)
{
map
.
addListener
(
'dragend'
,
()
=>
{
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
});
}
centerChange
(
e
)
{
console
.
log
(
e
);
this
.
newCenterLat
=
e
.
lat
;
this
.
newCenterLng
=
e
.
lng
;
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
}
markerDragEnd
(
$event
:
MouseEvent
)
{
console
.
log
(
$event
);
this
.
latitude
=
$event
.
coords
.
lat
;
...
...
@@ -126,7 +141,7 @@ export class ChangeaddressPage implements OnInit {
window
.
alert
(
'No results found'
);
}
}
else
{
window
.
alert
(
'Geocoder failed due to: '
+
status
);
//
window.alert('Geocoder failed due to: ' + status);
}
}
);
...
...
@@ -150,7 +165,7 @@ export class ChangeaddressPage implements OnInit {
setTimeout
(()
=>
{
// tslint:disable-next-line:max-line-length
const
distanceNew
=
google
.
maps
.
geometry
.
spherical
.
computeDistanceBetween
(
new
google
.
maps
.
LatLng
(
This
.
latitude
,
This
.
longitude
),
new
google
.
maps
.
LatLng
(
val
.
pickupLocation
.
O
,
val
.
pickupLocation
.
F
));
const
distanceNew
=
google
.
maps
.
geometry
.
spherical
.
computeDistanceBetween
(
new
google
.
maps
.
LatLng
(
This
.
newCenterLat
,
This
.
newCenterLng
),
new
google
.
maps
.
LatLng
(
val
.
pickupLocation
.
O
,
val
.
pickupLocation
.
F
));
const
distanceKM
=
(
distanceNew
/
1000
).
toFixed
(
2
);
if
(
distanceKM
<
This
.
service
.
distance
)
{
const
orderId
=
val
.
orderId
;
...
...
@@ -161,7 +176,7 @@ export class ChangeaddressPage implements OnInit {
landmark
:
data
.
landmark
,
defaultVal
:
0
,
uid
:
This
.
uid
,
latLng
:
new
firebase
.
firestore
.
GeoPoint
(
This
.
latitude
,
This
.
longitude
),
latLng
:
new
firebase
.
firestore
.
GeoPoint
(
This
.
newCenterLat
,
This
.
newCenterLng
),
status
:
true
};
console
.
log
(
postData
,
orderId
);
...
...
src/config/cart.service.ts
View file @
6afa4f28
...
...
@@ -134,7 +134,7 @@ export class CartsService {
}
});
}
else
{
this
.
service
.
showToast
(
'You
r cart is not empty
'
,
'top'
,
'my-error'
,
2000
);
this
.
service
.
showToast
(
'You
have items from another Shopping Centre
'
,
'top'
,
'my-error'
,
2000
);
resolve
(
false
);
}
});
...
...
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