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
2687a883
Commit
2687a883
authored
Mar 10, 2020
by
Arjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into arjunlatest
parents
80e14d79
a01b6e82
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
44 deletions
+85
-44
cart.page.html
src/app/cart/cart.page.html
+26
-13
cart.page.ts
src/app/cart/cart.page.ts
+33
-28
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 @
2687a883
...
@@ -68,7 +68,8 @@
...
@@ -68,7 +68,8 @@
<p
class=
"textLeft"
>
Total Price:
</p>
<p
class=
"textLeft"
>
Total Price:
</p>
</ion-col>
</ion-col>
<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>
</p>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -113,7 +114,8 @@
...
@@ -113,7 +114,8 @@
<ion-row>
<ion-row>
<ion-col
class=
"p0"
>
<ion-col
class=
"p0"
>
<h6>
<h6>
{{addressService.custAddress.building}},
<br
/>
{{addressService.custAddress.landmark}},
{{addressService.custAddress.building}},
<br
/>
{{addressService.custAddress.landmark}},
<br
/>
{{addressService.custAddress.address}}
<br
/>
{{addressService.custAddress.address}}
</h6>
</h6>
</ion-col>
</ion-col>
...
@@ -133,7 +135,8 @@
...
@@ -133,7 +135,8 @@
</label>
</label>
</div> -->
</div> -->
<div
class=
"payment_method"
>
<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"
>
<label
for=
"paypal"
>
<p>
PayPal
</p>
<p>
PayPal
</p>
</label>
</label>
...
@@ -142,7 +145,8 @@
...
@@ -142,7 +145,8 @@
<input class="card_no borderNone widthFull" placeholder="PayPal ID" />
<input class="card_no borderNone widthFull" placeholder="PayPal ID" />
</div> -->
</div> -->
<div
class=
"payment_method"
>
<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"
>
<label
for=
"afterpay"
>
<p>
AfterPay
</p>
<p>
AfterPay
</p>
</label>
</label>
...
@@ -152,7 +156,8 @@
...
@@ -152,7 +156,8 @@
<input class="cv_number" placeholder="CVV" />
<input class="cv_number" placeholder="CVV" />
</div> -->
</div> -->
<div
class=
"payment_method"
>
<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"
>
<label
for=
"payk"
>
<p>
PayK
</p>
<p>
PayK
</p>
</label>
</label>
...
@@ -178,7 +183,8 @@
...
@@ -178,7 +183,8 @@
<hr
/>
<hr
/>
<div
class=
"coupon_code"
>
<div
class=
"coupon_code"
>
<div
class=
"promo-row"
>
<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
APPLY
</button>
</button>
</div>
</div>
...
@@ -252,7 +258,8 @@
...
@@ -252,7 +258,8 @@
</div>
</div>
<div
class=
"checkout"
(
click
)="
next
(
1
)"
>
CHECKOUT
</div>
<div
class=
"checkout"
(
click
)="
next
(
1
)"
>
CHECKOUT
</div>
</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
PAY
</div>
</div>
...
@@ -283,7 +290,8 @@
...
@@ -283,7 +290,8 @@
</ion-grid>
</ion-grid>
</div>
</div>
<ion-content
class=
"sort_wrappper"
>
<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-marker
[
latitude
]="
lat
"
[
longitude
]="
lng
"
></agm-marker>
</agm-map>
</agm-map>
<div
class=
"add_address_wrapper"
>
<div
class=
"add_address_wrapper"
>
...
@@ -292,12 +300,16 @@
...
@@ -292,12 +300,16 @@
<span
class=
"floatRight"
(
click
)="
istoggle
();
goToPage
('
nearby
')"
>
ADD NEW
</span>
<span
class=
"floatRight"
(
click
)="
istoggle
();
goToPage
('
nearby
')"
>
ADD NEW
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</h5>
</h5>
<ul
*
ngIf=
"addressService.nearestList && addressService.nearestList.length > 0"
>
<ul
*
ngIf=
"addressService.addressList && addressService.addressList.length > 0"
>
<li
*
ngFor=
"let address of addressService.nearestList; let i = index"
class=
"no-devlivery"
>
<li
*
ngFor=
"let address of addressService.addressList; let i = index"
<h4>
DELIVERS TO
</h4>
[
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"
>
<div
class=
"floatLeft"
>
{{address.default}}
{{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>
<label
for=
"styled-checkbox-{{i}}"
>
{{address.addressType}}
</label>
</div>
</div>
<div
class=
"floatLeft"
>
<div
class=
"floatLeft"
>
...
@@ -308,7 +320,8 @@
...
@@ -308,7 +320,8 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</li>
</li>
</ul>
</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>
<!-- <div class="loader" *ngIf="loader">
<!-- <div class="loader" *ngIf="loader">
...
...
src/app/cart/cart.page.ts
View file @
2687a883
...
@@ -183,7 +183,7 @@ export class CartPage implements OnInit {
...
@@ -183,7 +183,7 @@ export class CartPage implements OnInit {
setDefault
(
addressId
:
any
,
index
:
number
)
{
setDefault
(
addressId
:
any
,
index
:
number
)
{
console
.
log
(
'loading....'
);
console
.
log
(
'loading....'
);
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
addressService
.
custAddress
=
this
.
addressService
.
nearest
List
[
index
];
this
.
addressService
.
custAddress
=
this
.
addressService
.
address
List
[
index
];
console
.
log
(
this
.
custAddress
);
console
.
log
(
this
.
custAddress
);
this
.
istoggle
();
this
.
istoggle
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -200,32 +200,36 @@ export class CartPage implements OnInit {
...
@@ -200,32 +200,36 @@ export class CartPage implements OnInit {
console
.
log
(
index
);
console
.
log
(
index
);
if
(
index
===
2
)
{
if
(
index
===
2
)
{
if
(
this
.
addressService
.
custAddress
!==
undefined
)
{
if
(
this
.
addressService
.
custAddress
!==
undefined
)
{
const
otherCharges
=
{
if
(
this
.
addressService
.
custAddress
.
nearest
===
true
)
{
deliveryCharge
:
this
.
deliveryCharge
,
const
otherCharges
=
{
taxAmount
:
this
.
taxAmount
,
deliveryCharge
:
this
.
deliveryCharge
,
discount
:
this
.
discount
,
taxAmount
:
this
.
taxAmount
,
discountApplied
:
this
.
discountApplied
===
1
?
true
:
false
,
discount
:
this
.
discount
,
totalAmt
:
this
.
totalAmt
,
discountApplied
:
this
.
discountApplied
===
1
?
true
:
false
,
custAddress
:
this
.
addressService
.
custAddress
,
totalAmt
:
this
.
totalAmt
,
paymentMethod
:
this
.
paymentMethod
custAddress
:
this
.
addressService
.
custAddress
,
};
paymentMethod
:
this
.
paymentMethod
const
state
=
this
.
orderService
};
.
checkOut
(
const
state
=
this
.
orderService
this
.
cartService
.
carts
,
.
checkOut
(
otherCharges
,
this
.
cartService
.
carts
,
this
.
addressService
.
centerLoc
otherCharges
,
)
this
.
addressService
.
centerLoc
.
then
(
data
=>
{
)
this
.
cartService
.
cartCenter
=
''
;
.
then
(
data
=>
{
const
cartCount
=
this
.
orderService
.
cartCount
;
this
.
cartService
.
cartCenter
=
''
;
const
timer
=
(
cartCount
-
1
)
*
20
+
60
;
const
cartCount
=
this
.
orderService
.
cartCount
;
const
totalTime
=
this
.
add_minutes
(
timer
);
const
timer
=
(
cartCount
-
1
)
*
20
+
60
;
console
.
log
(
'ready for slide'
);
const
totalTime
=
this
.
add_minutes
(
timer
);
this
.
timeinterval
=
setInterval
(()
=>
{
console
.
log
(
'ready for slide'
);
This
.
getDeliveryTime
(
totalTime
.
getTime
());
this
.
timeinterval
=
setInterval
(()
=>
{
},
1000
);
This
.
getDeliveryTime
(
totalTime
.
getTime
());
this
.
slides
.
slideNext
();
},
1000
);
});
this
.
slides
.
slideNext
();
});
}
else
{
this
.
service
.
showToast
(
'Not delivered to the selected location'
,
'top'
,
'my-error'
,
1000
);
}
}
else
{
}
else
{
this
.
istoggle
();
this
.
istoggle
();
}
}
...
@@ -321,7 +325,8 @@ export class CartPage implements OnInit {
...
@@ -321,7 +325,8 @@ export class CartPage implements OnInit {
}
}
this
.
discount
.
toFixed
(
2
);
this
.
discount
.
toFixed
(
2
);
}
else
{
}
else
{
this
.
discountApplied
=
2
;
this
.
discountApplied
=
0
;
this
.
discount
=
0
;
}
}
});
});
}
}
...
...
src/app/nearby/nearby.page.ts
View file @
2687a883
...
@@ -120,12 +120,14 @@ export class NearbyPage implements OnInit {
...
@@ -120,12 +120,14 @@ export class NearbyPage implements OnInit {
mapReady
(
map
)
{
mapReady
(
map
)
{
map
.
addListener
(
'dragend'
,
()
=>
{
map
.
addListener
(
'dragend'
,
()
=>
{
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
this
.
getAddress
(
this
.
newCenterLat
,
this
.
newCenterLng
);
});
});
}
}
centerChange
(
e
)
{
centerChange
(
e
)
{
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
);
}
}
goToPage
(
path
,
data
=
null
)
{
goToPage
(
path
,
data
=
null
)
{
...
...
src/config/address.service.ts
View file @
2687a883
...
@@ -42,7 +42,8 @@ export class AddressService {
...
@@ -42,7 +42,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
false
};
};
this
.
addressList
.
push
(
address
);
this
.
addressList
.
push
(
address
);
});
});
...
@@ -72,7 +73,8 @@ export class AddressService {
...
@@ -72,7 +73,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
false
};
};
this
.
defaultAdd
=
address
;
this
.
defaultAdd
=
address
;
console
.
log
(
this
.
defaultAdd
);
console
.
log
(
this
.
defaultAdd
);
...
@@ -203,7 +205,8 @@ export class AddressService {
...
@@ -203,7 +205,8 @@ export class AddressService {
defaultVal
:
item
.
defaultVal
,
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
addressId
:
item
.
addressId
,
nearest
:
true
};
};
this
.
nearestList
.
push
(
address
);
this
.
nearestList
.
push
(
address
);
});
});
...
@@ -212,6 +215,23 @@ export class AddressService {
...
@@ -212,6 +215,23 @@ export class AddressService {
}
else
{
}
else
{
// alert('No Orders Found');
// 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
{
}
else
{
console
.
log
(
'No such document!'
);
console
.
log
(
'No such document!'
);
...
...
src/config/services/address.ts
View file @
2687a883
...
@@ -22,4 +22,5 @@ export interface AddressList {
...
@@ -22,4 +22,5 @@ export interface AddressList {
building
:
string
;
building
:
string
;
latLng
:
any
;
latLng
:
any
;
landmark
:
string
;
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