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
d54622a7
Commit
d54622a7
authored
Feb 19, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getmi-changes
parent
f64ce3e9
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
349 additions
and
64 deletions
+349
-64
cart.page.html
src/app/cart/cart.page.html
+32
-12
cart.page.ts
src/app/cart/cart.page.ts
+44
-14
changeaddress.page.html
src/app/changeaddress/changeaddress.page.html
+21
-10
changeaddress.page.ts
src/app/changeaddress/changeaddress.page.ts
+29
-1
forgot.page.html
src/app/forgot/forgot.page.html
+2
-11
forgot.page.ts
src/app/forgot/forgot.page.ts
+3
-3
home.page.html
src/app/home/home.page.html
+1
-1
home.page.ts
src/app/home/home.page.ts
+5
-2
myorder.page.html
src/app/myorder/myorder.page.html
+2
-2
myorder.page.ts
src/app/myorder/myorder.page.ts
+4
-0
orderplaced.page.html
src/app/orderplaced/orderplaced.page.html
+10
-5
orderplaced.page.ts
src/app/orderplaced/orderplaced.page.ts
+4
-0
productdetail.page.ts
src/app/productdetail/productdetail.page.ts
+2
-0
address.service.ts
src/config/address.service.ts
+99
-0
auth.service.ts
src/config/auth.service.ts
+24
-2
cart.service.ts
src/config/cart.service.ts
+12
-1
myorder.service.ts
src/config/myorder.service.ts
+41
-0
order.service.ts
src/config/order.service.ts
+2
-0
products.service.ts
src/config/products.service.ts
+6
-0
myorder.ts
src/config/services/myorder.ts
+1
-0
order.ts
src/config/services/order.ts
+1
-0
product.ts
src/config/services/product.ts
+2
-0
wish.service.ts
src/config/wish.service.ts
+2
-0
No files found.
src/app/cart/cart.page.html
View file @
d54622a7
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<img
[
src
]="
carts
.
image
"
onerror=
"this.src=''"
/>
<img
[
src
]="
carts
.
image
"
onerror=
"this.src=''"
/>
</div>
</div>
<div
class=
"cart_detail"
>
<div
class=
"cart_detail"
>
<h4>
{{
carts.prodName
}}
</h4>
<h4>
{{
unEscape(carts.prodName)
}}
</h4>
<h4>
{{carts.size}}, {{carts.color}}
</h4>
<h4>
{{carts.size}}, {{carts.color}}
</h4>
<h5>
A$ {{carts.price}}
</h5>
<h5>
A$ {{carts.price}}
</h5>
</div>
</div>
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
<ion-grid
class=
"p0"
*
ngIf=
"cartService.carts && cartService.carts.length > 0"
>
<ion-grid
class=
"p0"
*
ngIf=
"cartService.carts && cartService.carts.length > 0"
>
<ion-row
*
ngFor=
"let carts of cartService.carts"
>
<ion-row
*
ngFor=
"let carts of cartService.carts"
>
<ion-col
size=
"6"
class=
"p0"
>
<ion-col
size=
"6"
class=
"p0"
>
<h6
class=
"textLeft"
>
{{
carts.prodName
}}
</h6>
<h6
class=
"textLeft"
>
{{
unEscape(carts.prodName)
}}
</h6>
</ion-col>
</ion-col>
<ion-col
size=
"2"
class=
"p0"
>
<ion-col
size=
"2"
class=
"p0"
>
<h6
class=
"textRight"
><strong>
{{carts.qty}} X
</strong></h6>
<h6
class=
"textRight"
><strong>
{{carts.qty}} X
</strong></h6>
...
@@ -116,13 +116,15 @@
...
@@ -116,13 +116,15 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</h5>
</h5>
<div
class=
"payment_method"
>
<div
class=
"payment_method"
>
<input
type=
"radio"
name=
"payments"
id=
"cod"
name=
"radio-group"
checked=
"true"
(
click
)="
getwaycod
()"
/>
<input
type=
"radio"
name=
"payments"
id=
"cod"
name=
"radio-group"
checked=
"true"
(
click
)="
getwaycod
()"
/>
<label
for=
"cod"
>
<label
for=
"cod"
>
<p>
COD
</p>
<p>
COD
</p>
</label>
</label>
</div>
</div>
<div
class=
"payment_method"
>
<div
class=
"payment_method"
>
<input
type=
"radio"
name=
"payments"
id=
"paypal"
name=
"radio-group"
(
click
)="
getwaypaypal
()"
/>
<input
type=
"radio"
name=
"payments"
id=
"paypal"
name=
"radio-group"
(
click
)="
getwaypaypal
()"
/>
<label
for=
"paypal"
>
<label
for=
"paypal"
>
<p>
PayPal
</p>
<p>
PayPal
</p>
</label>
</label>
...
@@ -131,7 +133,8 @@
...
@@ -131,7 +133,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>
...
@@ -141,7 +144,8 @@
...
@@ -141,7 +144,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>
...
@@ -166,7 +170,8 @@
...
@@ -166,7 +170,8 @@
</div> -->
</div> -->
<hr
/>
<hr
/>
<div
class=
"coupon_code"
>
<div
class=
"coupon_code"
>
<input
class=
""
placeholder=
"COUPON CODE: GET50"
#
promo
/><button
class=
"add_btn"
(
click
)="
promoApply
(
promo
.
value
)"
>
<input
class=
""
placeholder=
"COUPON CODE: GET50"
#
promo
/><button
class=
"add_btn"
(
click
)="
promoApply
(
promo
.
value
)"
>
APPLY
APPLY
</button>
</button>
<span
*
ngIf=
"discountApplied"
style=
"color: red"
>
Promocode applied successfully
<span
*
ngIf=
"discountApplied"
style=
"color: red"
>
Promocode applied successfully
...
@@ -237,7 +242,8 @@
...
@@ -237,7 +242,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>
<!-- <div class="footer_btn" [hidden]="currentIndex != 2" (click)="finishpop()">
<!-- <div class="footer_btn" [hidden]="currentIndex != 2" (click)="finishpop()">
...
@@ -262,7 +268,8 @@
...
@@ -262,7 +268,8 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</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"
>
...
@@ -271,11 +278,13 @@
...
@@ -271,11 +278,13 @@
<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.
addressList && addressService.address
List.length > 0"
>
<ul
*
ngIf=
"addressService.
nearestList && addressService.nearest
List.length > 0"
>
<li
*
ngFor=
"let address of addressService.
address
List; let i = index"
>
<li
*
ngFor=
"let address of addressService.
nearest
List; let i = index"
>
<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"
>
...
@@ -286,6 +295,16 @@
...
@@ -286,6 +295,16 @@
<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>
</div>
<!-- <div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div> -->
</ion-content>
</ion-content>
</div>
</div>
\ No newline at end of file
src/app/cart/cart.page.ts
View file @
d54622a7
...
@@ -50,6 +50,7 @@ export class CartPage implements OnInit {
...
@@ -50,6 +50,7 @@ export class CartPage implements OnInit {
totalAmt
:
number
;
totalAmt
:
number
;
bookDate
:
any
;
bookDate
:
any
;
timeinterval
:
any
;
timeinterval
:
any
;
paymentMethod
:
any
;
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
...
@@ -70,13 +71,17 @@ export class CartPage implements OnInit {
...
@@ -70,13 +71,17 @@ export class CartPage implements OnInit {
this
.
taxAmount
=
0
;
this
.
taxAmount
=
0
;
this
.
discountApplied
=
false
;
this
.
discountApplied
=
false
;
this
.
discount
=
0
;
this
.
discount
=
0
;
this
.
paymentMethod
=
'COD'
;
// this.cartService.cartList();
// this.cartService.cartList();
this
.
loader
=
true
;
this
.
loader
=
true
;
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
);
this
.
custId
=
data
.
uid
;
this
.
custId
=
data
.
uid
;
this
.
addressService
.
addList
(
data
.
uid
);
this
.
service
.
get
(
'cartCenter'
).
then
((
centerData
)
=>
{
this
.
addressService
.
defaultAddress
(
this
.
custId
);
this
.
addressService
.
getNearBy
(
centerData
,
this
.
custId
);
});
}
}
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -85,37 +90,51 @@ export class CartPage implements OnInit {
...
@@ -85,37 +90,51 @@ export class CartPage implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
console
.
log
(
this
.
addressService
.
addressList
);
const
This
=
this
;
console
.
log
(
this
.
addressService
.
nearestList
);
setTimeout
(()
=>
{
this
.
setAddress
();
this
.
setAddress
();
},
1000
);
}
}
ionViewWillEnter
()
{
ionViewWillEnter
()
{
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
);
const
This
=
this
;
this
.
cartService
.
cartList
();
this
.
cartService
.
cartList
();
setTimeout
(()
=>
{
if
(
this
.
cartService
.
carts
.
length
>
0
)
{
const
cart
=
this
.
cartService
.
carts
[
0
];
}
},
1000
);
}
}
});
});
}
}
setAddress
()
{
setAddress
()
{
if
(
this
.
addressService
.
addressList
.
length
>
0
)
{
console
.
log
(
this
.
addressService
.
nearestList
);
let
address
=
this
.
addressService
.
addressList
.
find
(
if
(
this
.
addressService
.
nearestList
.
length
>
0
)
{
let
address
=
this
.
addressService
.
nearestList
.
find
(
x
=>
x
.
defaultVal
===
1
x
=>
x
.
defaultVal
===
1
);
);
if
(
!
address
)
{
if
(
!
address
)
{
address
=
this
.
addressService
.
address
List
[
0
];
address
=
this
.
addressService
.
nearest
List
[
0
];
}
}
this
.
loader
=
false
;
this
.
custAddress
=
address
;
this
.
custAddress
=
address
;
}
}
}
}
getwaypaypal
()
{
getwaypaypal
()
{
this
.
gateway
=
1
;
this
.
gateway
=
1
;
this
.
paymentMethod
=
'PayPal'
;
}
}
getwayafterpay
()
{
getwayafterpay
()
{
this
.
gateway
=
2
;
this
.
gateway
=
2
;
this
.
paymentMethod
=
'AfterPay'
;
}
}
getDeliveryCharge
(
amount
)
{
getDeliveryCharge
(
amount
)
{
...
@@ -124,19 +143,21 @@ export class CartPage implements OnInit {
...
@@ -124,19 +143,21 @@ export class CartPage implements OnInit {
}
else
{
}
else
{
this
.
deliveryCharge
=
10
;
this
.
deliveryCharge
=
10
;
}
}
return
this
.
deliveryCharge
;
return
this
.
deliveryCharge
.
toFixed
(
2
)
;
}
}
getTax
(
amount
)
{
getTax
(
amount
)
{
return
(
this
.
taxAmount
=
(
amount
*
10
)
/
100
);
return
Math
.
round
((
this
.
taxAmount
=
(
amount
*
10
)
/
100
)).
toFixed
(
2
);
}
}
getwaypayk
()
{
getwaypayk
()
{
this
.
gateway
=
3
;
this
.
gateway
=
3
;
this
.
paymentMethod
=
'PayK'
;
}
}
getwaycod
()
{
getwaycod
()
{
this
.
gateway
=
4
;
this
.
gateway
=
4
;
this
.
paymentMethod
=
'COD'
;
}
}
async
finishpop
()
{
async
finishpop
()
{
...
@@ -156,10 +177,14 @@ export class CartPage implements OnInit {
...
@@ -156,10 +177,14 @@ export class CartPage implements OnInit {
}
}
setDefault
(
addressId
:
any
,
index
:
number
)
{
setDefault
(
addressId
:
any
,
index
:
number
)
{
console
.
log
(
index
);
console
.
log
(
'loading....'
);
this
.
addressService
.
setDefaultAddress
(
addressId
,
this
.
custId
);
this
.
loader
=
true
;
console
.
log
(
this
.
addressService
.
addressList
[
index
]);
this
.
custAddress
=
this
.
addressService
.
nearestList
[
index
];
this
.
custAddress
=
this
.
addressService
.
addressList
[
index
];
console
.
log
(
this
.
custAddress
);
this
.
istoggle
();
setTimeout
(()
=>
{
this
.
loader
=
false
;
},
1000
);
}
}
next
(
index
:
number
=
null
)
{
next
(
index
:
number
=
null
)
{
...
@@ -177,7 +202,8 @@ export class CartPage implements OnInit {
...
@@ -177,7 +202,8 @@ export class CartPage implements OnInit {
discount
:
this
.
discount
,
discount
:
this
.
discount
,
discountApplied
:
this
.
discountApplied
,
discountApplied
:
this
.
discountApplied
,
totalAmt
:
this
.
totalAmt
,
totalAmt
:
this
.
totalAmt
,
custAddress
:
this
.
custAddress
custAddress
:
this
.
custAddress
,
paymentMethod
:
this
.
paymentMethod
};
};
const
state
=
this
.
orderService
const
state
=
this
.
orderService
.
checkOut
(
this
.
cartService
.
carts
,
otherCharges
)
.
checkOut
(
this
.
cartService
.
carts
,
otherCharges
)
...
@@ -255,7 +281,7 @@ export class CartPage implements OnInit {
...
@@ -255,7 +281,7 @@ export class CartPage implements OnInit {
const
actualTotal
=
const
actualTotal
=
this
.
deliveryCharge
+
this
.
taxAmount
+
total
-
this
.
discount
;
this
.
deliveryCharge
+
this
.
taxAmount
+
total
-
this
.
discount
;
this
.
totalAmt
=
actualTotal
;
this
.
totalAmt
=
actualTotal
;
return
actualTotal
;
return
actualTotal
.
toFixed
(
2
)
;
}
}
promoApply
(
code
)
{
promoApply
(
code
)
{
...
@@ -267,7 +293,7 @@ export class CartPage implements OnInit {
...
@@ -267,7 +293,7 @@ export class CartPage implements OnInit {
if
(
value
[
0
].
type
===
1
)
{
if
(
value
[
0
].
type
===
1
)
{
const
rate
=
value
[
0
].
amount
;
const
rate
=
value
[
0
].
amount
;
const
upto
=
value
[
0
].
amount
;
const
upto
=
value
[
0
].
amount
;
const
percentage
=
(
this
.
cartService
.
cartTotal
*
rate
)
/
100
;
const
percentage
=
Math
.
round
((
this
.
cartService
.
cartTotal
*
rate
)
/
100
).
toFixed
(
2
)
;
this
.
discount
=
percentage
>
upto
?
upto
:
percentage
;
this
.
discount
=
percentage
>
upto
?
upto
:
percentage
;
}
else
{
}
else
{
this
.
discount
=
value
[
0
].
amount
;
this
.
discount
=
value
[
0
].
amount
;
...
@@ -313,4 +339,8 @@ export class CartPage implements OnInit {
...
@@ -313,4 +339,8 @@ export class CartPage implements OnInit {
strTime
strTime
);
);
}
}
unEscape
(
text
:
string
)
{
return
unescape
(
text
);
}
}
}
src/app/changeaddress/changeaddress.page.html
View file @
d54622a7
...
@@ -10,17 +10,21 @@
...
@@ -10,17 +10,21 @@
<ion-content>
<ion-content>
<div
class=
"nearby_map"
>
<div
class=
"nearby_map"
>
<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
)'"
>
<agm-marker
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
markerDraggable
]="
true
"
(
dragEnd
)="
markerDragEnd
($
event
)"
></agm-marker>
<agm-marker
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
markerDraggable
]="
true
"
(
dragEnd
)="
markerDragEnd
($
event
)"
></agm-marker>
</agm-map>
</agm-map>
<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"
>
<div
class=
"add_address_wrapper"
>
<h5>
DELIVERY
</h5>
<h5>
DELIVERY
</h5>
<p>
{{address}}
</p>
<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"
>
<div
class=
"md-errors-spacer"
[
hidden
]="
building
.
valid
||
landmark
.
pristine
"
class=
"ion-padding-start"
>
Building Name is required
Building Name is required
</div>
</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"
>
<div
class=
"md-errors-spacer"
[
hidden
]="
landmark
.
valid
||
landmark
.
pristine
"
class=
"ion-padding-start"
>
Landmark is required
Landmark is required
</div>
</div>
...
@@ -28,29 +32,36 @@
...
@@ -28,29 +32,36 @@
<ion-row>
<ion-row>
<ion-col>
<ion-col>
<h6>
<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>
<label
for=
"styled-check-1"
><span>
Home
</span></label>
</h6>
</h6>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<h6>
<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>
<label
for=
"styled-check-2"
><span>
Office
</span></label>
</h6>
</h6>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<h6>
<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>
<label
for=
"styled-check-3"
><span>
Others
</span></label>
</h6>
</h6>
</ion-col>
</ion-col>
</ion-row>
</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
Address Type is required
</div>
</div>
</ion-grid>
</ion-grid>
<button
class=
"add_btn"
type=
"submit"
[
disabled
]="!
addressForm
.
form
.
valid
"
>
<button
class=
"add_btn"
type=
"submit"
[
disabled
]="!
addressForm
.
form
.
valid
"
*
ngIf=
"locationRest()"
>
ADD
CHANGE
</button>
</button>
</div>
</div>
</form>
</form>
...
...
src/app/changeaddress/changeaddress.page.ts
View file @
d54622a7
...
@@ -11,6 +11,7 @@ import { MapsAPILoader, MouseEvent } from '@agm/core';
...
@@ -11,6 +11,7 @@ import { MapsAPILoader, MouseEvent } from '@agm/core';
import
{
Address
}
from
'./../../config/services/address'
;
import
{
Address
}
from
'./../../config/services/address'
;
import
{
AddressService
}
from
'./../../config/address.service'
;
import
{
AddressService
}
from
'./../../config/address.service'
;
import
{
ServiceService
}
from
'./../../config/service.service'
;
import
{
ServiceService
}
from
'./../../config/service.service'
;
import
{
MyordersService
}
from
'./../../config/myorder.service'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
*
as
firebase
from
'firebase'
;
import
*
as
firebase
from
'firebase'
;
...
@@ -31,6 +32,10 @@ export class ChangeaddressPage implements OnInit {
...
@@ -31,6 +32,10 @@ export class ChangeaddressPage implements OnInit {
uid
:
string
;
uid
:
string
;
type
:
any
;
type
:
any
;
loader
:
boolean
;
loader
:
boolean
;
order
:
any
;
addressValid
:
any
;
lat
:
any
;
lng
:
any
;
public
searchElementRef
:
ElementRef
;
public
searchElementRef
:
ElementRef
;
constructor
(
constructor
(
...
@@ -40,9 +45,13 @@ export class ChangeaddressPage implements OnInit {
...
@@ -40,9 +45,13 @@ export class ChangeaddressPage implements OnInit {
private
mapsAPILoader
:
MapsAPILoader
,
private
mapsAPILoader
:
MapsAPILoader
,
private
ngZone
:
NgZone
,
private
ngZone
:
NgZone
,
public
addressService
:
AddressService
,
public
addressService
:
AddressService
,
public
service
:
ServiceService
public
service
:
ServiceService
,
public
myorder
:
MyordersService
)
{
)
{
this
.
addressValid
=
false
;
this
.
successState
=
false
;
this
.
successState
=
false
;
this
.
lat
=
''
;
this
.
lng
=
''
;
this
.
type
=
0
;
this
.
type
=
0
;
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
if
(
data
)
{
if
(
data
)
{
...
@@ -54,6 +63,9 @@ export class ChangeaddressPage implements OnInit {
...
@@ -54,6 +63,9 @@ export class ChangeaddressPage implements OnInit {
this
.
service
.
get
(
'type'
).
then
(
data
=>
{
this
.
service
.
get
(
'type'
).
then
(
data
=>
{
this
.
type
=
data
;
this
.
type
=
data
;
});
});
this
.
service
.
get
(
'order'
).
then
(
val
=>
{
this
.
order
=
val
;
});
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -83,6 +95,22 @@ export class ChangeaddressPage implements OnInit {
...
@@ -83,6 +95,22 @@ export class ChangeaddressPage implements OnInit {
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
this
.
getAddress
(
this
.
latitude
,
this
.
longitude
);
}
}
locationRest
()
{
if
(
this
.
latitude
&&
this
.
longitude
&&
this
.
order
)
{
if
(
this
.
latitude
!==
this
.
lat
&&
this
.
longitude
!==
this
.
lng
)
{
this
.
lat
=
this
.
latitude
;
this
.
lng
=
this
.
longitude
;
this
.
myorder
.
getNearBy
(
this
.
latitude
,
this
.
longitude
,
this
.
order
.
orderId
).
then
(
resp
=>
{
console
.
log
(
resp
);
if
(
resp
)
{
this
.
addressValid
=
resp
;
}
});
}
}
return
this
.
addressValid
;
}
getAddress
(
latitude
,
longitude
)
{
getAddress
(
latitude
,
longitude
)
{
this
.
geoCoder
.
geocode
(
this
.
geoCoder
.
geocode
(
{
location
:
{
lat
:
latitude
,
lng
:
longitude
}
},
{
location
:
{
lat
:
latitude
,
lng
:
longitude
}
},
...
...
src/app/forgot/forgot.page.html
View file @
d54622a7
...
@@ -11,19 +11,10 @@
...
@@ -11,19 +11,10 @@
<div
class=
"verification_div"
>
<div
class=
"verification_div"
>
<div
class=
"form_div"
>
<div
class=
"form_div"
>
<div
class=
"row"
>
<div
class=
"row"
>
<input
<input
class=
""
type=
"email"
placeholder=
"Type your email Id"
#
emailId
required
/>
class=
""
type=
"email"
placeholder=
"Type your email Id"
#
emailId
required
/>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<button
<button
class=
"login_btn"
(
click
)="
authService
.
resetPassword
(
emailId
.
value
);"
>
class=
"login_btn"
(
click
)="
authService
.
resetPassword
(
emailId
.
value
)"
>
RESET PASSWORD
RESET PASSWORD
</button>
</button>
</div>
</div>
...
...
src/app/forgot/forgot.page.ts
View file @
d54622a7
...
@@ -14,9 +14,9 @@ export class ForgotPage implements OnInit {
...
@@ -14,9 +14,9 @@ export class ForgotPage implements OnInit {
private
route
:
ActivatedRoute
,
private
route
:
ActivatedRoute
,
private
location
:
Location
,
private
location
:
Location
,
public
authService
:
AuthService
public
authService
:
AuthService
)
{}
)
{
}
ngOnInit
()
{}
ngOnInit
()
{
}
goToPage
(
path
,
data
=
null
)
{
goToPage
(
path
,
data
=
null
)
{
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
...
@@ -24,6 +24,6 @@ export class ForgotPage implements OnInit {
...
@@ -24,6 +24,6 @@ export class ForgotPage implements OnInit {
}
}
goBack
()
{
goBack
()
{
this
.
location
.
back
(
);
this
.
router
.
navigateByUrl
(
'login'
);
}
}
}
}
src/app/home/home.page.html
View file @
d54622a7
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
<div
class=
"floatLeft"
>
<div
class=
"floatLeft"
>
{{address.default}}
{{address.default}}
<input
class=
"styled-checkbox"
name=
"addressId"
id=
"styled-checkbox-{{i}}"
type=
"radio"
<input
class=
"styled-checkbox"
name=
"addressId"
id=
"styled-checkbox-{{i}}"
type=
"radio"
(
click
)="
setDefault
(
address
.
addressId
)"
[
value
]="
address
.
addressId
"
#
addressType
(
click
)="
setDefault
(
address
)"
[
value
]="
address
.
addressId
"
#
addressType
[
checked
]="
address
.
defaultVal =
=
1
"
/>
[
checked
]="
address
.
defaultVal =
=
1
"
/>
<label
for=
"styled-checkbox-{{i}}"
>
<label
for=
"styled-checkbox-{{i}}"
>
{{address.addressType}}
{{address.addressType}}
...
...
src/app/home/home.page.ts
View file @
d54622a7
...
@@ -112,9 +112,12 @@ export class HomePage implements OnInit {
...
@@ -112,9 +112,12 @@ export class HomePage implements OnInit {
);
);
}
}
setDefault
(
address
Id
:
any
)
{
setDefault
(
address
:
any
)
{
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
addressService
.
setDefaultAddress
(
addressId
,
this
.
custId
).
then
(()
=>
{
this
.
addressService
.
setDefaultAddress
(
address
.
addressId
,
this
.
custId
).
then
(()
=>
{
this
.
address
=
address
.
address
;
console
.
log
(
address
.
latLng
);
this
.
centerService
.
getNearBy
(
address
.
latLng
.
_lat
,
address
.
latLng
.
_long
,
10
);
this
.
loader
=
false
;
this
.
loader
=
false
;
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
...
...
src/app/myorder/myorder.page.html
View file @
d54622a7
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<img
[
src
]="
product
.
image
"
onerror=
""
/>
<img
[
src
]="
product
.
image
"
onerror=
""
/>
</div>
</div>
<div
class=
"order_detail"
>
<div
class=
"order_detail"
>
<h5
class=
"floatLeft"
>
{{
product.prodName
}}
</h5>
<h5
class=
"floatLeft"
>
{{
unEscape(product.prodName)
}}
</h5>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<h5>
<h5>
<span
*
ngIf=
"product.color !== 'No-Color'"
>
{{product.color}},
<span
*
ngIf=
"product.color !== 'No-Color'"
>
{{product.color}},
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<p
*
ngIf=
"product.price"
>
A$ {{product.price}}
</p>
<p
*
ngIf=
"product.price"
>
A$ {{product.price}}
</p>
</div>
</div>
<div
class=
"order_other"
>
<div
class=
"order_other"
>
<h6
class=
"floatRight"
>
<h6
class=
"floatRight"
*
ngIf=
"order.bookDate"
>
{{ order.bookDate.seconds * 1000 | date:'MMMM dd, y' }}
{{ order.bookDate.seconds * 1000 | date:'MMMM dd, y' }}
</h6>
</h6>
<span
class=
"floatRight"
*
ngIf=
"order.orderStatus < 3 || order.orderStatus >= 7"
<span
class=
"floatRight"
*
ngIf=
"order.orderStatus < 3 || order.orderStatus >= 7"
...
...
src/app/myorder/myorder.page.ts
View file @
d54622a7
...
@@ -115,4 +115,8 @@ export class MyorderPage implements OnInit {
...
@@ -115,4 +115,8 @@ export class MyorderPage implements OnInit {
}
}
}
}
unEscape
(
text
:
string
)
{
return
unescape
(
text
);
}
}
}
src/app/orderplaced/orderplaced.page.html
View file @
d54622a7
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<div
class=
"order_status"
>
<div
class=
"order_status"
>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
<div
class=
"status_div go_green"
>
<div
class=
"status_div go_green"
>
<h4>
Order Placed
</h4>
<h4>
{{data.orderCode}}
</h4>
<h6>
{{ data.bookDate.seconds * 1000 | date:'MMMM dd, y' }}
</h6>
<h6>
{{ data.bookDate.seconds * 1000 | date:'MMMM dd, y' }}
</h6>
</div>
</div>
<!-- <div class="status_gap go_green">
<!-- <div class="status_gap go_green">
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
</span>
</span>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</h5>
</h5>
<p
class=
"prodName"
>
{{
data.product[0].prodName
}}
</p>
<p
class=
"prodName"
>
{{
unEscape(data.product[0].prodName)
}}
</p>
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</li>
</li>
...
@@ -77,17 +77,21 @@
...
@@ -77,17 +77,21 @@
</div>
</div>
<div
class=
"product_detail"
*
ngFor=
"let product of data.product"
>
<div
class=
"product_detail"
*
ngFor=
"let product of data.product"
>
<h6>
<h6>
<span
*
ngIf=
"product.color !== 'No-Color'"
>
{{product.color}},
</span>
<span
*
ngIf=
"product.color !== 'No-Color'"
>
Color:
{{product.color}},
</span>
<span
*
ngIf=
"product.size !== 'Any-Size'"
>
{{product.size}}
</span>
<span
*
ngIf=
"product.size !== 'Any-Size'"
>
Size:
{{product.size}}
</span>
</h6>
</h6>
<h5>
Quantity :
<span>
{{product.qty}}
</span></h5>
<h5>
Quantity :
<span>
{{product.qty}}
</span></h5>
<h5>
<h5>
Amount :
<strong>
A$ {{product.price}}
</strong><span
class=
"afterpay"
>
COD
</span>
Amount :
<strong>
A$ {{product.price}}
</strong><span
class=
"afterpay"
>
{{data.paymentMode}}
</span>
</h5>
</h5>
<h5
*
ngIf=
"data.orderStatus >= 3 && data.orderStatus < 7"
>
<h5
*
ngIf=
"data.orderStatus >= 3 && data.orderStatus < 7"
>
Delivery time :
<span>
{{deliveryTime}}
</span>
Delivery time :
<span>
{{deliveryTime}}
</span>
</h5>
</h5>
<h5>
Order Status :
<span>
{{getStatus(data.orderStatus)}}
</span></h5>
<h5>
Order Status :
<span>
{{getStatus(data.orderStatus)}}
</span></h5>
</div>
<div
class=
"product_detail"
>
<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
...
@@ -95,6 +99,7 @@
...
@@ -95,6 +99,7 @@
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
</div>
</div>
<h5
*
ngIf=
"data.deliveryAddress"
>
<h5
*
ngIf=
"data.deliveryAddress"
>
{{data.deliveryAddress.addressType}},
<br
/>
{{data.deliveryAddress.address}},
{{data.deliveryAddress.addressType}},
<br
/>
{{data.deliveryAddress.address}},
<br
/>
<br
/>
...
...
src/app/orderplaced/orderplaced.page.ts
View file @
d54622a7
...
@@ -41,6 +41,10 @@ export class OrderplacedPage implements OnInit {
...
@@ -41,6 +41,10 @@ export class OrderplacedPage implements OnInit {
});
});
}
}
unEscape
(
text
:
string
)
{
return
unescape
(
text
);
}
getDeliveryTime
(
timeStamp
)
{
getDeliveryTime
(
timeStamp
)
{
// console.log(timeStamp);
// console.log(timeStamp);
const
endDate
=
new
Date
(
timeStamp
*
1000
);
const
endDate
=
new
Date
(
timeStamp
*
1000
);
...
...
src/app/productdetail/productdetail.page.ts
View file @
d54622a7
...
@@ -97,6 +97,8 @@ export class ProductdetailPage implements OnInit {
...
@@ -97,6 +97,8 @@ export class ProductdetailPage implements OnInit {
color
:
params
.
color
,
color
:
params
.
color
,
discount
:
params
.
discount
,
discount
:
params
.
discount
,
featured
:
params
.
featured
,
featured
:
params
.
featured
,
centerId
:
params
.
centerId
,
centerRef
:
params
.
center
,
image
:
params
.
image
,
image
:
params
.
image
,
price
:
params
.
price
,
price
:
params
.
price
,
qty
:
params
.
qty
,
qty
:
params
.
qty
,
...
...
src/config/address.service.ts
View file @
d54622a7
...
@@ -3,6 +3,7 @@ import {
...
@@ -3,6 +3,7 @@ import {
AngularFirestore
,
AngularFirestore
,
AngularFirestoreCollection
AngularFirestoreCollection
}
from
'@angular/fire/firestore'
;
}
from
'@angular/fire/firestore'
;
import
*
as
firebase
from
'firebase'
;
import
{
take
}
from
'rxjs/operators'
;
import
{
take
}
from
'rxjs/operators'
;
import
{
Address
,
AddressList
}
from
'./services/address'
;
import
{
Address
,
AddressList
}
from
'./services/address'
;
...
@@ -11,6 +12,8 @@ import { Address, AddressList } from './services/address';
...
@@ -11,6 +12,8 @@ import { Address, AddressList } from './services/address';
})
})
export
class
AddressService
{
export
class
AddressService
{
addressList
:
AddressList
[]
=
[];
addressList
:
AddressList
[]
=
[];
nearestList
:
AddressList
[]
=
[];
defaultAdd
:
AddressList
;
constructor
(
public
afs
:
AngularFirestore
)
{
}
constructor
(
public
afs
:
AngularFirestore
)
{
}
public
async
addList
(
userId
:
string
)
{
public
async
addList
(
userId
:
string
)
{
...
@@ -44,6 +47,36 @@ export class AddressService {
...
@@ -44,6 +47,36 @@ export class AddressService {
});
});
}
}
public
async
defaultAddress
(
userId
:
string
)
{
const
This
=
this
;
const
state
=
true
;
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
'address'
,
ref
=>
ref
.
where
(
'status'
,
'=='
,
state
).
where
(
'uid'
,
'=='
,
userId
).
where
(
'defaultVal'
,
'=='
,
1
)
);
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
addressList
=
[];
const
res
=
value
;
if
(
res
.
length
>
0
)
{
const
item
=
res
[
0
];
// console.log(item);
const
address
:
AddressList
=
{
address
:
item
.
address
,
addressType
:
item
.
addressType
,
latLng
:
item
.
latLng
,
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
};
this
.
defaultAdd
=
address
;
console
.
log
(
this
.
defaultAdd
);
}
else
{
// alert('No Orders Found');
}
});
}
addressCreate
(
data
:
Address
)
{
addressCreate
(
data
:
Address
)
{
console
.
log
(
data
);
console
.
log
(
data
);
this
.
afs
this
.
afs
...
@@ -99,4 +132,70 @@ export class AddressService {
...
@@ -99,4 +132,70 @@ export class AddressService {
.
doc
(
addId
)
.
doc
(
addId
)
.
delete
();
.
delete
();
}
}
public
async
getNearBy
(
centerId
,
userId
)
{
// latitude, longitude, distance, userId
console
.
log
(
centerId
);
if
(
centerId
)
{
this
.
afs
.
collection
(
'centers'
).
doc
(
centerId
).
ref
.
get
().
then
((
doc
)
=>
{
if
(
doc
.
exists
)
{
console
.
log
(
'Document data:'
,
doc
.
data
());
const
center
=
doc
.
data
();
const
This
=
this
;
const
state
=
true
;
const
latitude
=
center
.
latLng
.
_lat
;
const
longitude
=
center
.
latLng
.
_long
;
const
lat
=
0.0144927536231884
;
const
lon
=
0.0181818181818182
;
const
distance
=
10
;
const
lowerLat
=
latitude
-
lat
*
distance
;
const
lowerLon
=
longitude
-
lon
*
distance
;
const
greaterLat
=
latitude
+
lat
*
distance
;
const
greaterLon
=
longitude
+
lon
*
distance
;
const
lesserGeopoint
=
new
firebase
.
firestore
.
GeoPoint
(
lowerLat
,
lowerLon
);
const
greaterGeopoint
=
new
firebase
.
firestore
.
GeoPoint
(
greaterLat
,
greaterLon
);
const
addressRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
'address'
,
ref
=>
ref
.
where
(
'latLng'
,
'>'
,
lesserGeopoint
)
.
where
(
'latLng'
,
'<'
,
greaterGeopoint
)
.
where
(
'status'
,
'=='
,
state
)
.
where
(
'uid'
,
'=='
,
userId
)
);
addressRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
nearestList
=
[];
const
res
=
value
;
if
(
res
.
length
>
0
)
{
res
.
forEach
(
item
=>
{
// console.log(item);
const
address
:
AddressList
=
{
address
:
item
.
address
,
addressType
:
item
.
addressType
,
latLng
:
item
.
latLng
,
defaultVal
:
item
.
defaultVal
,
building
:
item
.
building
,
landmark
:
item
.
landmark
,
addressId
:
item
.
addressId
};
this
.
nearestList
.
push
(
address
);
});
console
.
log
(
this
.
nearestList
);
}
else
{
// alert('No Orders Found');
}
});
}
else
{
console
.
log
(
'No such document!'
);
}
});
}
}
}
}
src/config/auth.service.ts
View file @
d54622a7
...
@@ -149,9 +149,17 @@ export class AuthService {
...
@@ -149,9 +149,17 @@ export class AuthService {
this
.
afAuth
.
auth
this
.
afAuth
.
auth
.
signInWithPopup
(
new
auth
.
FacebookAuthProvider
())
.
signInWithPopup
(
new
auth
.
FacebookAuthProvider
())
.
then
(
result
=>
{
.
then
(
result
=>
{
this
.
loader
=
false
;
/* this.loader = false;
console.log('success');
console.log(result); */
console
.
log
(
'success'
);
console
.
log
(
'success'
);
console
.
log
(
result
);
console
.
log
(
result
.
additionalUserInfo
.
isNewUser
);
if
(
result
.
additionalUserInfo
&&
result
.
additionalUserInfo
.
isNewUser
===
true
)
{
this
.
socialSignUp
(
result
);
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
this
.
service
.
showToast
(
err
.
message
,
'bottom'
,
'my-error'
,
1000
);
this
.
service
.
showToast
(
err
.
message
,
'bottom'
,
'my-error'
,
1000
);
...
@@ -327,4 +335,18 @@ export class AuthService {
...
@@ -327,4 +335,18 @@ export class AuthService {
});
});
return
false
;
return
false
;
}
}
resetPassword
(
email
:
string
)
{
this
.
loader
=
true
;
this
.
afAuth
.
auth
.
sendPasswordResetEmail
(
email
)
.
then
(()
=>
{
this
.
service
.
showToast
(
'Password reset mail has been sent your mail Id'
,
'top'
,
'my-toast'
,
2000
);
this
.
loader
=
false
;
this
.
router
.
navigateByUrl
(
'login'
);
})
.
catch
((
error
)
=>
{
this
.
service
.
showToast
(
error
,
'top'
,
'my-error'
,
1000
);
this
.
loader
=
false
;
});
}
}
}
src/config/cart.service.ts
View file @
d54622a7
...
@@ -51,7 +51,10 @@ export class CartsService {
...
@@ -51,7 +51,10 @@ export class CartsService {
this
.
size
=
this
.
size
===
undefined
?
product
.
size
[
0
]
:
this
.
size
;
this
.
size
=
this
.
size
===
undefined
?
product
.
size
[
0
]
:
this
.
size
;
this
.
color
=
this
.
color
===
undefined
?
product
.
color
[
0
]
:
this
.
color
;
this
.
color
=
this
.
color
===
undefined
?
product
.
color
[
0
]
:
this
.
color
;
this
.
service
.
get
(
'cartCenter'
).
then
((
centerData
)
=>
{
console
.
log
(
centerData
);
if
(
centerData
===
null
||
(
centerData
===
product
.
centerId
))
{
this
.
service
.
set
(
'cartCenter'
,
product
.
centerId
);
const
cartRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
cartRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
'carts'
,
'carts'
,
ref
=>
ref
=>
...
@@ -66,6 +69,7 @@ export class CartsService {
...
@@ -66,6 +69,7 @@ export class CartsService {
.
pipe
(
take
(
1
))
.
pipe
(
take
(
1
))
.
subscribe
(
value
=>
{
.
subscribe
(
value
=>
{
// console.log(value);
// console.log(value);
if
(
value
.
length
===
0
)
{
if
(
value
.
length
===
0
)
{
product
.
image
=
product
.
image
=
product
.
image
===
undefined
product
.
image
===
undefined
...
@@ -117,6 +121,12 @@ export class CartsService {
...
@@ -117,6 +121,12 @@ export class CartsService {
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
});
});
}
}
});
}
else
{
this
.
service
.
showToast
(
'Your cart is not empty'
,
'top'
,
'my-error'
,
2000
);
}
});
});
}
}
...
@@ -160,6 +170,7 @@ export class CartsService {
...
@@ -160,6 +170,7 @@ export class CartsService {
this
.
carts
.
push
(
cartItem
);
this
.
carts
.
push
(
cartItem
);
});
});
}
else
{
}
else
{
this
.
service
.
remove
(
'cartCenter'
);
// alert('No Products Found');
// alert('No Products Found');
}
}
});
});
...
...
src/config/myorder.service.ts
View file @
d54622a7
...
@@ -120,6 +120,7 @@ export class MyordersService {
...
@@ -120,6 +120,7 @@ export class MyordersService {
deliveryLocation
:
item
.
deliveryLocation
,
deliveryLocation
:
item
.
deliveryLocation
,
pickupLocation
:
item
.
pickupLocation
,
pickupLocation
:
item
.
pickupLocation
,
deliveryAddress
:
item
.
deliveryAddress
,
deliveryAddress
:
item
.
deliveryAddress
,
paymentMode
:
item
.
paymentMethod
,
riderName
:
'John'
,
riderName
:
'John'
,
orderId
:
item
.
orderId
,
orderId
:
item
.
orderId
,
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
...
@@ -225,6 +226,46 @@ export class MyordersService {
...
@@ -225,6 +226,46 @@ export class MyordersService {
return of(this.orders);
return of(this.orders);
}
}
*/
*/
public
async
getNearBy
(
latitude
,
longitude
,
orderId
)
{
const
promise
=
new
Promise
(
resolve
=>
{
const
This
=
this
;
const
lat
=
0.0144927536231884
;
const
lon
=
0.0181818181818182
;
const
distance
=
10
;
const
lowerLat
=
latitude
-
lat
*
distance
;
const
lowerLon
=
longitude
-
lon
*
distance
;
const
greaterLat
=
latitude
+
lat
*
distance
;
const
greaterLon
=
longitude
+
lon
*
distance
;
const
lesserGeopoint
=
new
firebase
.
firestore
.
GeoPoint
(
lowerLat
,
lowerLon
);
const
greaterGeopoint
=
new
firebase
.
firestore
.
GeoPoint
(
greaterLat
,
greaterLon
);
const
addressRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
'orders'
,
ref
=>
ref
.
where
(
'pickupLocation'
,
'>'
,
lesserGeopoint
)
.
where
(
'pickupLocation'
,
'<'
,
greaterGeopoint
)
.
where
(
'orderId'
,
'=='
,
orderId
)
);
addressRef
.
valueChanges
().
subscribe
(
value
=>
{
const
res
=
value
;
if
(
res
.
length
>
0
)
{
resolve
(
true
);
}
else
{
resolve
(
false
);
}
});
});
return
promise
;
}
public
async
trackOrder
(
order
)
{
public
async
trackOrder
(
order
)
{
this
.
selItem
=
order
;
this
.
selItem
=
order
;
}
}
...
...
src/config/order.service.ts
View file @
d54622a7
...
@@ -189,6 +189,7 @@ export class OrdersService {
...
@@ -189,6 +189,7 @@ export class OrdersService {
custName
:
'Customer'
,
custName
:
'Customer'
,
riderName
:
'John'
,
riderName
:
'John'
,
shopperState
:
0
,
shopperState
:
0
,
paymentMethod
:
otherCharge
.
paymentMethod
,
shopperName
:
''
,
shopperName
:
''
,
product
:
products
,
product
:
products
,
discount
:
'A$ '
+
otherCharge
.
discount
,
discount
:
'A$ '
+
otherCharge
.
discount
,
...
@@ -204,6 +205,7 @@ export class OrdersService {
...
@@ -204,6 +205,7 @@ export class OrdersService {
.
then
(()
=>
{
.
then
(()
=>
{
// console.log('Booking Successfully');
// console.log('Booking Successfully');
// this.router.navigateByUrl('cart');
// this.router.navigateByUrl('cart');
this
.
service
.
remove
(
'cartCenter'
);
resolve
(
'Cart to Order Successfully'
);
resolve
(
'Cart to Order Successfully'
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
});
});
...
...
src/config/products.service.ts
View file @
d54622a7
...
@@ -91,6 +91,8 @@ export class ProductsService {
...
@@ -91,6 +91,8 @@ export class ProductsService {
skuCode
:
item
.
skuCode
,
skuCode
:
item
.
skuCode
,
status
:
item
.
status
,
status
:
item
.
status
,
rating
:
item
.
rating
,
rating
:
item
.
rating
,
centerId
:
item
.
centerId
,
centerRef
:
item
.
center
,
size
:
this
.
service
.
splitSep
(
item
.
size
),
size
:
this
.
service
.
splitSep
(
item
.
size
),
subCate
:
item
.
subCate
,
subCate
:
item
.
subCate
,
tag
:
this
.
service
.
splitSep
(
item
.
tag
)
tag
:
this
.
service
.
splitSep
(
item
.
tag
)
...
@@ -163,6 +165,8 @@ export class ProductsService {
...
@@ -163,6 +165,8 @@ export class ProductsService {
rating
:
item
.
rating
,
rating
:
item
.
rating
,
shopper
:
item
.
shopper
,
shopper
:
item
.
shopper
,
skuCode
:
item
.
skuCode
,
skuCode
:
item
.
skuCode
,
centerId
:
item
.
centerId
,
centerRef
:
item
.
center
,
status
:
item
.
status
,
status
:
item
.
status
,
size
:
this
.
service
.
splitSep
(
item
.
size
),
size
:
this
.
service
.
splitSep
(
item
.
size
),
subCate
:
item
.
subCate
,
subCate
:
item
.
subCate
,
...
@@ -216,6 +220,8 @@ export class ProductsService {
...
@@ -216,6 +220,8 @@ export class ProductsService {
shopper
:
item
.
shopper
,
shopper
:
item
.
shopper
,
rating
:
item
.
rating
,
rating
:
item
.
rating
,
skuCode
:
item
.
skuCode
,
skuCode
:
item
.
skuCode
,
centerId
:
item
.
centerId
,
centerRef
:
item
.
center
,
status
:
item
.
status
,
status
:
item
.
status
,
size
:
this
.
service
.
splitSep
(
item
.
size
),
size
:
this
.
service
.
splitSep
(
item
.
size
),
subCate
:
item
.
subCate
,
subCate
:
item
.
subCate
,
...
...
src/config/services/myorder.ts
View file @
d54622a7
...
@@ -12,4 +12,5 @@ export interface Myorder {
...
@@ -12,4 +12,5 @@ export interface Myorder {
time
:
string
;
time
:
string
;
product
:
any
;
product
:
any
;
orderCode
:
string
;
orderCode
:
string
;
paymentMode
:
string
;
}
}
src/config/services/order.ts
View file @
d54622a7
...
@@ -52,6 +52,7 @@ export interface Order {
...
@@ -52,6 +52,7 @@ export interface Order {
orderStatus
:
number
;
orderStatus
:
number
;
pickupAddress
:
string
;
pickupAddress
:
string
;
pickupLocation
:
object
;
pickupLocation
:
object
;
paymentMethod
:
any
;
bookDate
:
any
;
bookDate
:
any
;
orderDate
:
any
;
orderDate
:
any
;
custId
:
string
;
custId
:
string
;
...
...
src/config/services/product.ts
View file @
d54622a7
...
@@ -14,6 +14,8 @@ export interface Products {
...
@@ -14,6 +14,8 @@ export interface Products {
shopperId
:
string
;
shopperId
:
string
;
qty
:
number
;
qty
:
number
;
shopper
:
string
;
shopper
:
string
;
centerId
:
string
;
centerRef
:
any
;
size
:
string
[];
size
:
string
[];
skuCode
:
string
;
skuCode
:
string
;
status
:
boolean
;
status
:
boolean
;
...
...
src/config/wish.service.ts
View file @
d54622a7
...
@@ -69,6 +69,8 @@ export class WishService {
...
@@ -69,6 +69,8 @@ export class WishService {
prodCode
:
item
.
prodCode
,
prodCode
:
item
.
prodCode
,
prodDesc
:
item
.
prodDesc
,
prodDesc
:
item
.
prodDesc
,
prodStatus
:
item
.
prodStatus
,
prodStatus
:
item
.
prodStatus
,
centerId
:
item
.
centerId
,
centerRef
:
item
.
center
,
rating
:
item
.
rating
,
rating
:
item
.
rating
,
skuCode
:
item
.
skuCode
,
skuCode
:
item
.
skuCode
,
status
:
item
.
status
,
status
:
item
.
status
,
...
...
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