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
b8ed8334
Commit
b8ed8334
authored
Mar 09, 2020
by
Arjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into arjunlatest
parents
31d49272
ccfca2f5
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
107 additions
and
29 deletions
+107
-29
app.component.ts
src/app/app.component.ts
+5
-1
cart.page.html
src/app/cart/cart.page.html
+3
-2
cart.page.scss
src/app/cart/cart.page.scss
+8
-1
cart.page.ts
src/app/cart/cart.page.ts
+23
-5
myorder.page.ts
src/app/myorder/myorder.page.ts
+3
-2
nearby.page.html
src/app/nearby/nearby.page.html
+21
-9
nearby.page.ts
src/app/nearby/nearby.page.ts
+20
-1
productdetail.page.ts
src/app/productdetail/productdetail.page.ts
+1
-1
wishlist.page.ts
src/app/wishlist/wishlist.page.ts
+1
-0
address.service.ts
src/config/address.service.ts
+7
-4
auth.service.ts
src/config/auth.service.ts
+13
-0
myorder.service.ts
src/config/myorder.service.ts
+1
-1
order.service.ts
src/config/order.service.ts
+1
-2
No files found.
src/app/app.component.ts
View file @
b8ed8334
...
...
@@ -94,7 +94,8 @@ export class AppComponent {
});
}
ionViewDidEnter
()
{}
ionViewWillEnter
()
{
}
initializeApp
()
{
this
.
platform
.
ready
().
then
(()
=>
{
...
...
@@ -241,6 +242,9 @@ export class AppComponent {
}
else
{
this
.
orderId
=
data
.
orderCode
;
this
.
isShow
=
true
;
setTimeout
(()
=>
{
this
.
isShow
=
false
;
},
3000
);
}
}
});
...
...
src/app/cart/cart.page.html
View file @
b8ed8334
...
...
@@ -106,7 +106,7 @@
<hr
/>
<h5>
<span
class=
"floatLeft"
>
DELIVERY
</span>
<span
class=
"floatRight"
(
click
)="
istoggle
()"
>
EDIT
</span>
<span
class=
"floatRight"
(
click
)="
istoggle
()"
>
CHANGE
</span>
<div
class=
"clear"
></div>
</h5>
<ion-grid
class=
"p0"
*
ngIf=
"addressService.custAddress"
>
...
...
@@ -182,8 +182,9 @@
APPLY
</button>
</div>
<span
*
ngIf=
"discountApplied"
class=
"promo-success"
>
Promocode applied successfully
<span
*
ngIf=
"discountApplied
== 1
"
class=
"promo-success"
>
Promocode applied successfully
</span>
<span
*
ngIf=
"discountApplied == 2"
class=
"promo-error"
>
Invalid Promocode
</span>
</div>
<br
/>
...
...
src/app/cart/cart.page.scss
View file @
b8ed8334
...
...
@@ -242,9 +242,16 @@
}
}
.promo-success
{
color
:
#00f
;
font-size
:
16px
;
text-align
:
center
;
display
:
block
;
margin-top
:
5px
;
}
.promo-error
{
color
:
#31b131
;
font-size
:
16px
;
text-align
:
left
;
text-align
:
center
;
display
:
block
;
margin-top
:
5px
;
}
...
...
src/app/cart/cart.page.ts
View file @
b8ed8334
...
...
@@ -46,12 +46,14 @@ export class CartPage implements OnInit {
};
deliveryCharge
:
number
;
taxAmount
:
number
;
discountApplied
:
boolean
;
discountApplied
:
number
;
discount
:
number
;
totalAmt
:
number
;
bookDate
:
any
;
timeinterval
:
any
;
paymentMethod
:
any
;
lat
:
number
;
lng
:
number
;
constructor
(
private
router
:
Router
,
...
...
@@ -71,7 +73,7 @@ export class CartPage implements OnInit {
this
.
gateway
=
1
;
this
.
deliveryCharge
=
0
;
this
.
taxAmount
=
0
;
this
.
discountApplied
=
false
;
this
.
discountApplied
=
0
;
this
.
discount
=
0
;
this
.
paymentMethod
=
'PayPal'
;
// this.cartService.cartList();
...
...
@@ -89,6 +91,7 @@ export class CartPage implements OnInit {
setTimeout
(()
=>
{
this
.
loader
=
false
;
},
1000
);
this
.
setCurrentLocation
();
}
ngOnInit
()
{
...
...
@@ -99,6 +102,16 @@ export class CartPage implements OnInit {
}, 1000); */
}
private
setCurrentLocation
()
{
const
This
=
this
;
if
(
'geolocation'
in
navigator
)
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
this
.
lat
=
position
.
coords
.
latitude
;
this
.
lng
=
position
.
coords
.
longitude
;
});
}
}
ionViewWillEnter
()
{
const
users
=
this
.
service
.
get
(
'user'
).
then
(
data
=>
{
if
(
data
)
{
...
...
@@ -155,6 +168,9 @@ export class CartPage implements OnInit {
}
goToPage
(
path
,
data
=
null
)
{
if
(
path
===
'nearby'
)
{
this
.
addressService
.
addressState
=
1
;
}
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
,
replaceUrl
:
true
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
...
...
@@ -188,7 +204,7 @@ export class CartPage implements OnInit {
deliveryCharge
:
this
.
deliveryCharge
,
taxAmount
:
this
.
taxAmount
,
discount
:
this
.
discount
,
discountApplied
:
this
.
discountApplied
,
discountApplied
:
this
.
discountApplied
===
1
?
true
:
false
,
totalAmt
:
this
.
totalAmt
,
custAddress
:
this
.
addressService
.
custAddress
,
paymentMethod
:
this
.
paymentMethod
...
...
@@ -211,7 +227,7 @@ export class CartPage implements OnInit {
this
.
slides
.
slideNext
();
});
}
else
{
alert
(
'Please choose delivery location'
);
this
.
istoggle
(
);
}
}
else
{
this
.
slides
.
slideNext
();
...
...
@@ -292,7 +308,7 @@ export class CartPage implements OnInit {
this
.
cartService
.
checkPromo
(
code
).
subscribe
(
value
=>
{
if
(
value
.
length
>
0
)
{
const
promo
=
value
[
0
];
this
.
discountApplied
=
true
;
this
.
discountApplied
=
1
;
if
(
value
[
0
].
type
===
1
)
{
const
rate
=
value
[
0
].
amount
;
const
upto
=
value
[
0
].
amount
;
...
...
@@ -304,6 +320,8 @@ export class CartPage implements OnInit {
this
.
discount
=
value
[
0
].
amount
;
}
this
.
discount
.
toFixed
(
2
);
}
else
{
this
.
discountApplied
=
2
;
}
});
}
...
...
src/app/myorder/myorder.page.ts
View file @
b8ed8334
...
...
@@ -123,8 +123,9 @@ export class MyorderPage implements OnInit {
getProductTotal
(
products
)
{
let
amtPrice
=
0
;
products
.
forEach
(
element
=>
{
amtPrice
+=
element
.
price
*
element
.
qty
;
amtPrice
+=
(
element
.
price
*
element
.
qty
)
;
});
return
'A$'
+
this
.
service
.
formatNumber
(
amtPrice
);
const
totalAmt
:
number
=
parseFloat
(
amtPrice
.
toFixed
(
2
));
return
'A$'
+
(
this
.
service
.
formatNumber
(
totalAmt
));
}
}
src/app/nearby/nearby.page.html
View file @
b8ed8334
...
...
@@ -19,8 +19,10 @@
</ion-header>
<ion-content>
<div
class=
"nearby_map"
>
<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
)"
[
iconUrl
]="
<agm-map
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
zoom
]="
8
"
[
backgroundColor
]="'
rgba
(
29
,
27
,
130
,
0
.
2
)'"
(
mapReady
)="
mapReady
($
event
)"
(
centerChange
)="
centerChange
($
event
)"
>
<agm-marker
[
latitude
]="
latitude
"
[
longitude
]="
longitude
"
[
markerDraggable
]="
true
"
(
dragEnd
)="
markerDragEnd
($
event
)"
[
iconUrl
]="
{
url:
'./
assets
/
pin
.
svg
',
scaledSize:
{
...
...
@@ -28,15 +30,18 @@
height:
40
}}"
></agm-marker>
</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"
>
<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>
...
...
@@ -44,24 +49,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/nearby/nearby.page.ts
View file @
b8ed8334
...
...
@@ -35,6 +35,9 @@ export class NearbyPage implements OnInit {
loader
:
boolean
;
public
searchElementRef
:
ElementRef
;
newCenterLat
:
number
;
newCenterLng
:
number
;
constructor
(
private
router
:
Router
,
private
route
:
ActivatedRoute
,
...
...
@@ -114,6 +117,17 @@ export class NearbyPage implements OnInit {
);
}
mapReady
(
map
)
{
map
.
addListener
(
'dragend'
,
()
=>
{
console
.
log
(
this
.
newCenterLat
,
this
.
newCenterLng
);
});
}
centerChange
(
e
)
{
console
.
log
(
e
);
this
.
newCenterLat
=
e
.
lat
;
this
.
newCenterLng
=
e
.
lng
;
}
goToPage
(
path
,
data
=
null
)
{
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
...
...
@@ -145,7 +159,12 @@ export class NearbyPage implements OnInit {
if
(
this
.
authService
.
regState
===
false
)
{
this
.
router
.
navigateByUrl
(
'preference'
,
{
queryParams
:
null
});
}
else
{
this
.
goBack
();
if
(
this
.
addressService
.
addressState
===
1
)
{
this
.
addressService
.
addressState
=
0
;
this
.
router
.
navigateByUrl
(
'cart'
,
{
replaceUrl
:
true
});
}
else
{
this
.
goBack
();
}
}
},
3000
);
}
...
...
src/app/productdetail/productdetail.page.ts
View file @
b8ed8334
...
...
@@ -153,7 +153,7 @@ export class ProductdetailPage implements OnInit {
this
.
cartService
.
buyNow
(
product
).
then
((
data
)
=>
{
if
(
data
===
true
)
{
if
(
type
===
1
)
{
this
.
router
.
navigateByUrl
(
'cart'
,
{
replaceUrl
:
true
}
);
this
.
router
.
navigateByUrl
(
'cart'
);
}
else
{
this
.
service
.
showToast
(
'Added into cart'
,
'top'
,
'my-toast'
,
2000
);
}
...
...
src/app/wishlist/wishlist.page.ts
View file @
b8ed8334
...
...
@@ -81,6 +81,7 @@ export class WishlistPage implements OnInit {
.
then
(
datas
=>
{
this
.
loader
=
false
;
this
.
service
.
showToast
(
'Added to cart'
,
'top'
,
'my-toast'
,
2000
);
this
.
router
.
navigateByUrl
(
'cart'
,
{
replaceUrl
:
true
,
queryParams
:
data
});
})
.
catch
(
err
=>
{
this
.
loader
=
false
;
...
...
src/config/address.service.ts
View file @
b8ed8334
...
...
@@ -17,7 +17,10 @@ export class AddressService {
defaultAdd
:
AddressList
;
custAddress
:
AddressList
;
centerLoc
:
CenterData
;
constructor
(
public
afs
:
AngularFirestore
)
{
}
addressState
:
number
;
constructor
(
public
afs
:
AngularFirestore
)
{
this
.
addressState
=
0
;
}
public
async
addList
(
userId
:
string
)
{
const
This
=
this
;
...
...
@@ -220,13 +223,13 @@ export class AddressService {
setAddress
()
{
console
.
log
(
this
.
nearestList
);
if
(
this
.
nearestList
.
length
>
0
)
{
let
a
ddress
=
this
.
nearestList
.
find
(
this
.
custA
ddress
=
this
.
nearestList
.
find
(
x
=>
x
.
defaultVal
===
1
);
if
(
!
address
)
{
/*
if (!address) {
address = this.nearestList[0];
}
this
.
custAddress
=
address
;
this.custAddress = address;
*/
}
}
}
src/config/auth.service.ts
View file @
b8ed8334
...
...
@@ -261,6 +261,10 @@ export class AuthService {
this
.
afAuth
.
auth
.
createUserWithEmailAndPassword
(
userData
.
emailId
,
userData
.
password
)
.
then
(
result
=>
{
result
.
user
.
updateProfile
({
displayName
:
userData
.
name
,
photoURL
:
''
});
console
.
log
(
result
.
user
);
this
.
afAuth
.
auth
.
currentUser
.
sendEmailVerification
();
const
currencyData
=
{
...
...
@@ -367,4 +371,13 @@ export class AuthService {
this
.
loader
=
false
;
});
}
resend
()
{
this
.
service
.
showToast
(
'OTP sent successfully'
,
'top'
,
'my-toast'
,
1000
);
}
}
src/config/myorder.service.ts
View file @
b8ed8334
...
...
@@ -103,7 +103,7 @@ export class MyordersService {
ref
=>
ref
.
where
(
'custId'
,
'=='
,
custId
).
orderBy
(
'orderDate'
,
'desc'
)
);
orderRef
.
stateChanges
().
subscribe
(
value
=>
{
//
console.log(value);
console
.
log
(
value
);
const
res
=
value
;
// console.log(res);
if
(
res
.
length
>
0
)
{
...
...
src/config/order.service.ts
View file @
b8ed8334
...
...
@@ -141,8 +141,7 @@ export class OrdersService {
// console.log(cartCount);
const
promise
=
new
Promise
(
resolve
=>
{
distinctShops
.
forEach
(
item
=>
{
console
.
log
(
item
);
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
centerLoc
.
latLng
.
longitude
,
centerLoc
.
latLng
.
longitude
);
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
centerLoc
.
latLng
.
latitude
,
centerLoc
.
latLng
.
longitude
);
const
products
=
{};
const
cartItem
=
cartGroup
[
item
];
let
prodPrice
=
0
;
...
...
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