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
a01b6e82
Commit
a01b6e82
authored
Mar 09, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'adarsh' into 'master'
Adarsh See merge request
!92
parents
e100c692
706d46bb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
18 deletions
+59
-18
cart.page.html
src/app/cart/cart.page.html
+26
-13
cart.page.ts
src/app/cart/cart.page.ts
+7
-2
nearby.page.ts
src/app/nearby/nearby.page.ts
+2
-0
address.service.ts
src/config/address.service.ts
+23
-3
address.ts
src/config/services/address.ts
+1
-0
No files found.
src/app/cart/cart.page.html
View file @
a01b6e82
...
...
@@ -68,7 +68,8 @@
<p
class=
"textLeft"
>
Total Price:
</p>
</ion-col>
<ion-col>
<p
class=
"textRight"
>
A$ {{service.formatNumber(cartService.cartTotal.toFixed(2))}}
<p
class=
"textRight"
>
A$
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}
</p>
</ion-col>
</ion-row>
...
...
@@ -113,7 +114,8 @@
<ion-row>
<ion-col
class=
"p0"
>
<h6>
{{addressService.custAddress.building}},
<br
/>
{{addressService.custAddress.landmark}},
{{addressService.custAddress.building}},
<br
/>
{{addressService.custAddress.landmark}},
<br
/>
{{addressService.custAddress.address}}
</h6>
</ion-col>
...
...
@@ -133,7 +135,8 @@
</label>
</div> -->
<div
class=
"payment_method"
>
<input
type=
"radio"
name=
"payments"
id=
"paypal"
name=
"radio-group"
(
click
)="
getwaypaypal
()"
checked=
"true"
/>
<input
type=
"radio"
name=
"payments"
id=
"paypal"
name=
"radio-group"
(
click
)="
getwaypaypal
()"
checked=
"true"
/>
<label
for=
"paypal"
>
<p>
PayPal
</p>
</label>
...
...
@@ -142,7 +145,8 @@
<input class="card_no borderNone widthFull" placeholder="PayPal ID" />
</div> -->
<div
class=
"payment_method"
>
<input
type=
"radio"
name=
"payments"
id=
"afterpay"
name=
"radio-group"
(
click
)="
getwayafterpay
()"
/>
<input
type=
"radio"
name=
"payments"
id=
"afterpay"
name=
"radio-group"
(
click
)="
getwayafterpay
()"
/>
<label
for=
"afterpay"
>
<p>
AfterPay
</p>
</label>
...
...
@@ -152,7 +156,8 @@
<input class="cv_number" placeholder="CVV" />
</div> -->
<div
class=
"payment_method"
>
<input
type=
"radio"
name=
"payments"
id=
"payk"
name=
"radio-group"
(
click
)="
getwaypayk
()"
/>
<input
type=
"radio"
name=
"payments"
id=
"payk"
name=
"radio-group"
(
click
)="
getwaypayk
()"
/>
<label
for=
"payk"
>
<p>
PayK
</p>
</label>
...
...
@@ -178,7 +183,8 @@
<hr
/>
<div
class=
"coupon_code"
>
<div
class=
"promo-row"
>
<input
class=
""
placeholder=
"COUPON CODE: GET50"
#
promo
/><button
class=
"add_btn apply_btn"
(
click
)="
promoApply
(
promo
.
value
)"
>
<input
class=
""
placeholder=
"COUPON CODE: GET50"
#
promo
/><button
class=
"add_btn apply_btn"
(
click
)="
promoApply
(
promo
.
value
)"
>
APPLY
</button>
</div>
...
...
@@ -252,7 +258,8 @@
</div>
<div
class=
"checkout"
(
click
)="
next
(
1
)"
>
CHECKOUT
</div>
</div>
<div
class=
"footer_btn"
*
ngIf=
"cartService.carts && cartService.carts.length > 0"
[
hidden
]="
currentIndex
!=
1
"
(
click
)="
next
(
2
);"
>
<div
class=
"footer_btn"
*
ngIf=
"cartService.carts && cartService.carts.length > 0"
[
hidden
]="
currentIndex
!=
1
"
(
click
)="
next
(
2
);"
>
PAY
</div>
...
...
@@ -283,7 +290,8 @@
</ion-grid>
</div>
<ion-content
class=
"sort_wrappper"
>
<agm-map
[
zoom
]="
20
"
[
latitude
]="
lat
"
[
longitude
]="
lng
"
[
disableDefaultUI
]="
false
"
[
zoomControl
]="
false
"
[
backgroundColor
]="'
rgba
(
29
,
27
,
130
,
0
.
2
)'"
>
<agm-map
[
zoom
]="
20
"
[
latitude
]="
lat
"
[
longitude
]="
lng
"
[
disableDefaultUI
]="
false
"
[
zoomControl
]="
false
"
[
backgroundColor
]="'
rgba
(
29
,
27
,
130
,
0
.
2
)'"
>
<agm-marker
[
latitude
]="
lat
"
[
longitude
]="
lng
"
></agm-marker>
</agm-map>
<div
class=
"add_address_wrapper"
>
...
...
@@ -292,12 +300,16 @@
<span
class=
"floatRight"
(
click
)="
istoggle
();
goToPage
('
nearby
')"
>
ADD NEW
</span>
<div
class=
"clear"
></div>
</h5>
<ul
*
ngIf=
"addressService.nearestList && addressService.nearestList.length > 0"
>
<li
*
ngFor=
"let address of addressService.nearestList; let i = index"
class=
"no-devlivery"
>
<h4>
DELIVERS TO
</h4>
<ul
*
ngIf=
"addressService.addressList && addressService.addressList.length > 0"
>
<li
*
ngFor=
"let address of addressService.addressList; let i = index"
[
ngClass
]="{'
no-devlivery
'
:
!
address
.
nearest
}"
>
<h4
*
ngIf=
"address.nearest === true"
>
DELIVERS TO
</h4>
<h4
*
ngIf=
"address.nearest === false"
>
NO DELIVERS TO
</h4>
<div
class=
"floatLeft"
>
{{address.default}}
<input
class=
"styled-checkbox"
name=
"addressId"
id=
"styled-checkbox-{{i}}"
type=
"radio"
(
click
)="
setDefault
(
address
.
addressId
,
i
)"
[
value
]="
address
.
addressId
"
#
addressType
[
checked
]="
address
.
defaultVal =
=
1
"
/>
<input
class=
"styled-checkbox"
name=
"addressId"
id=
"styled-checkbox-{{i}}"
type=
"radio"
(
click
)="
setDefault
(
address
.
addressId
,
i
)"
[
value
]="
address
.
addressId
"
#
addressType
[
checked
]="
address
.
defaultVal =
=
1
"
/>
<label
for=
"styled-checkbox-{{i}}"
>
{{address.addressType}}
</label>
</div>
<div
class=
"floatLeft"
>
...
...
@@ -308,7 +320,8 @@
<div
class=
"clear"
></div>
</li>
</ul>
<div
class=
"textCenter"
*
ngIf=
"addressService.nearestList && addressService.nearestList.length === 0"
>
No Address Found in the nearest center
</div>
<div
class=
"textCenter"
*
ngIf=
"addressService.addressList && addressService.addressList.length === 0"
>
No
Address Found
</div>
</div>
<!-- <div class="loader" *ngIf="loader">
...
...
src/app/cart/cart.page.ts
View file @
a01b6e82
...
...
@@ -183,7 +183,7 @@ export class CartPage implements OnInit {
setDefault
(
addressId
:
any
,
index
:
number
)
{
console
.
log
(
'loading....'
);
this
.
loader
=
true
;
this
.
addressService
.
custAddress
=
this
.
addressService
.
nearest
List
[
index
];
this
.
addressService
.
custAddress
=
this
.
addressService
.
address
List
[
index
];
console
.
log
(
this
.
custAddress
);
this
.
istoggle
();
setTimeout
(()
=>
{
...
...
@@ -200,6 +200,7 @@ export class CartPage implements OnInit {
console
.
log
(
index
);
if
(
index
===
2
)
{
if
(
this
.
addressService
.
custAddress
!==
undefined
)
{
if
(
this
.
addressService
.
custAddress
.
nearest
===
true
)
{
const
otherCharges
=
{
deliveryCharge
:
this
.
deliveryCharge
,
taxAmount
:
this
.
taxAmount
,
...
...
@@ -227,6 +228,9 @@ export class CartPage implements OnInit {
this
.
slides
.
slideNext
();
});
}
else
{
this
.
service
.
showToast
(
'Not delivered to the selected location'
,
'top'
,
'my-error'
,
1000
);
}
}
else
{
this
.
istoggle
();
}
}
else
{
...
...
@@ -321,7 +325,8 @@ export class CartPage implements OnInit {
}
this
.
discount
.
toFixed
(
2
);
}
else
{
this
.
discountApplied
=
2
;
this
.
discountApplied
=
0
;
this
.
discount
=
0
;
}
});
}
...
...
src/app/nearby/nearby.page.ts
View file @
a01b6e82
...
...
@@ -120,12 +120,14 @@ export class NearbyPage implements OnInit {
mapReady
(
map
)
{
map
.
addListener
(
'dragend'
,
()
=>
{
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
});
}
centerChange
(
e
)
{
console
.
log
(
e
);
this
.
newCenterLat
=
e
.
lat
;
this
.
newCenterLng
=
e
.
lng
;
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
}
goToPage
(
path
,
data
=
null
)
{
...
...
src/config/address.service.ts
View file @
a01b6e82
...
...
@@ -42,7 +42,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
false
};
this
.
addressList
.
push
(
address
);
});
...
...
@@ -72,7 +73,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
false
};
this
.
defaultAdd
=
address
;
console
.
log
(
this
.
defaultAdd
);
...
...
@@ -203,7 +205,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
true
};
this
.
nearestList
.
push
(
address
);
});
...
...
@@ -212,6 +215,23 @@ export class AddressService {
}
else
{
// alert('No Orders Found');
}
if
(
this
.
addressList
.
length
>
0
&&
this
.
nearestList
.
length
>
0
)
{
this
.
addressList
.
forEach
((
address
)
=>
{
const
index
=
this
.
nearestList
.
findIndex
(
x
=>
x
.
addressId
===
address
.
addressId
);
if
(
index
>=
0
)
{
address
.
nearest
=
true
;
}
});
}
console
.
log
(
this
.
addressList
);
this
.
addressList
=
this
.
addressList
.
sort
((
a
:
any
,
b
:
any
)
=>
{
return
b
.
nearest
-
a
.
nearest
;
});
console
.
log
(
this
.
addressList
);
});
}
else
{
console
.
log
(
'No such document!'
);
...
...
src/config/services/address.ts
View file @
a01b6e82
...
...
@@ -22,4 +22,5 @@ export interface AddressList {
building
:
string
;
latLng
:
any
;
landmark
:
string
;
nearest
:
boolean
;
}
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