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
c51e9b66
Commit
c51e9b66
authored
Feb 19, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'adarsh' into 'master'
Adarsh See merge request
!76
parents
b96e3946
0173e664
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
20 deletions
+26
-20
app.component.html
src/app/app.component.html
+2
-1
contact.page.ts
src/app/contact/contact.page.ts
+5
-1
orderplaced.page.html
src/app/orderplaced/orderplaced.page.html
+1
-1
orderplaced.page.ts
src/app/orderplaced/orderplaced.page.ts
+5
-0
preference.page.ts
src/app/preference/preference.page.ts
+2
-2
address.service.ts
src/config/address.service.ts
+0
-1
contact.service.ts
src/config/contact.service.ts
+2
-2
order.service.ts
src/config/order.service.ts
+9
-12
No files found.
src/app/app.component.html
View file @
c51e9b66
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
<div
class=
"sub_menu"
>
<div
class=
"sub_menu"
>
<ul
*
ngIf=
"categoryService.activecategories"
>
<ul
*
ngIf=
"categoryService.activecategories"
>
<ion-menu-toggle>
<ion-menu-toggle>
<li
*
ngFor=
"let category of categoryService.activecategories"
(
click
)="
goToPage
('
catstorelist
',
category
)"
>
<li
*
ngFor=
"let category of categoryService.activecategories"
(
click
)="
goToPage
('
catstorelist
',
category
)"
>
{{ category.catName }}
{{ category.catName }}
</li>
</li>
</ion-menu-toggle>
</ion-menu-toggle>
...
...
src/app/contact/contact.page.ts
View file @
c51e9b66
...
@@ -51,8 +51,12 @@ export class ContactPage implements OnInit {
...
@@ -51,8 +51,12 @@ export class ContactPage implements OnInit {
this
.
submitted
=
true
;
this
.
submitted
=
true
;
console
.
log
(
form
.
value
);
console
.
log
(
form
.
value
);
if
(
form
.
valid
&&
form
.
value
.
message
!==
''
)
{
if
(
form
.
valid
&&
form
.
value
.
message
!==
''
)
{
const
contData
=
{
...
this
.
contactData
,
from
:
this
.
userData
.
emailId
};
this
.
service
.
get
(
'orderId'
).
then
((
orderId
)
=>
{
const
newOrder
=
orderId
;
const
contData
=
{
...
this
.
contactData
,
from
:
this
.
userData
.
emailId
,
orderId
:
newOrder
};
this
.
contactService
.
contactCreate
(
contData
);
this
.
contactService
.
contactCreate
(
contData
);
});
}
else
{
}
else
{
console
.
log
(
'form not valid'
);
console
.
log
(
'form not valid'
);
this
.
submitted
=
false
;
this
.
submitted
=
false
;
...
...
src/app/orderplaced/orderplaced.page.html
View file @
c51e9b66
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
{{data.deliveryAddress.building}},
<br
/>
{{data.deliveryAddress.building}},
<br
/>
{{data.deliveryAddress.landmark}}
{{data.deliveryAddress.landmark}}
</h5>
</h5>
<button
class=
"cancel_btn"
(
click
)="
goToPage
('
contact
'
)"
<button
class=
"cancel_btn"
(
click
)="
cancelOrder
(
data
.
orderId
)"
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
>
*
ngIf=
"cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
>
CANCEL THIS ORDER
CANCEL THIS ORDER
</button>
</button>
...
...
src/app/orderplaced/orderplaced.page.ts
View file @
c51e9b66
...
@@ -78,6 +78,11 @@ export class OrderplacedPage implements OnInit {
...
@@ -78,6 +78,11 @@ export class OrderplacedPage implements OnInit {
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
cancelOrder
(
orderId
)
{
this
.
service
.
set
(
'orderId'
,
orderId
);
this
.
router
.
navigateByUrl
(
'contact'
);
}
changeAddress
(
orderId
)
{
changeAddress
(
orderId
)
{
this
.
service
.
set
(
'orderId'
,
orderId
);
this
.
service
.
set
(
'orderId'
,
orderId
);
this
.
router
.
navigateByUrl
(
'changeaddress'
);
this
.
router
.
navigateByUrl
(
'changeaddress'
);
...
...
src/app/preference/preference.page.ts
View file @
c51e9b66
...
@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit {
...
@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit {
});
});
}
}
ngOnInit
()
{}
ngOnInit
()
{
}
selectPrefernce
(
preferenceId
)
{
selectPrefernce
(
preferenceId
)
{
console
.
log
(
this
.
userPrefence
);
console
.
log
(
this
.
userPrefence
);
...
@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit {
...
@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
this
.
successState
=
false
;
this
.
successState
=
false
;
if
(
this
.
type
===
1
)
{
this
.
service
.
set
(
'type'
,
0
);
this
.
service
.
set
(
'type'
,
0
);
if
(
this
.
type
===
1
)
{
this
.
router
.
navigateByUrl
(
'home'
,
{
queryParams
:
null
});
this
.
router
.
navigateByUrl
(
'home'
,
{
queryParams
:
null
});
}
else
{
}
else
{
this
.
goBack
();
this
.
goBack
();
...
...
src/config/address.service.ts
View file @
c51e9b66
...
@@ -55,7 +55,6 @@ export class AddressService {
...
@@ -55,7 +55,6 @@ export class AddressService {
ref
=>
ref
.
where
(
'status'
,
'=='
,
state
).
where
(
'uid'
,
'=='
,
userId
).
where
(
'defaultVal'
,
'=='
,
1
)
ref
=>
ref
.
where
(
'status'
,
'=='
,
state
).
where
(
'uid'
,
'=='
,
userId
).
where
(
'defaultVal'
,
'=='
,
1
)
);
);
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
addressList
=
[];
const
res
=
value
;
const
res
=
value
;
if
(
res
.
length
>
0
)
{
if
(
res
.
length
>
0
)
{
const
item
=
res
[
0
];
const
item
=
res
[
0
];
...
...
src/config/contact.service.ts
View file @
c51e9b66
...
@@ -25,13 +25,13 @@ export class ContactService {
...
@@ -25,13 +25,13 @@ export class ContactService {
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
afs
this
.
afs
.
collection
(
'contacts'
)
.
collection
(
'contacts'
)
.
add
(
{}
)
.
add
(
data
)
.
then
(
docRef
=>
{
.
then
(
docRef
=>
{
data
.
contactId
=
docRef
.
id
;
data
.
contactId
=
docRef
.
id
;
this
.
afs
this
.
afs
.
collection
(
'contacts'
)
.
collection
(
'contacts'
)
.
doc
(
data
.
contactId
)
.
doc
(
data
.
contactId
)
.
set
(
data
)
.
update
({
contactId
:
data
.
contactId
}
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
service
this
.
service
.
showToast
(
'Thank you for your feedback!'
,
'top'
,
'my-toast'
,
500
)
.
showToast
(
'Thank you for your feedback!'
,
'top'
,
'my-toast'
,
500
)
...
...
src/config/order.service.ts
View file @
c51e9b66
...
@@ -134,14 +134,7 @@ export class OrdersService {
...
@@ -134,14 +134,7 @@ export class OrdersService {
const
promise
=
new
Promise
(
resolve
=>
{
const
promise
=
new
Promise
(
resolve
=>
{
distinctShops
.
forEach
(
item
=>
{
distinctShops
.
forEach
(
item
=>
{
console
.
log
(
item
);
console
.
log
(
item
);
this
.
afs
.
collection
(
'orders'
)
.
add
({
shopper
:
firebase
.
firestore
().
doc
(
'/shoppers/'
+
item
),
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
()
})
.
then
(
docRef
=>
{
const
neworderId
=
docRef
.
id
;
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
10.7231
,
76.1234
);
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
10.7231
,
76.1234
);
const
products
=
{};
const
products
=
{};
const
cartItem
=
cartGroup
[
item
];
const
cartItem
=
cartGroup
[
item
];
...
@@ -174,7 +167,7 @@ export class OrdersService {
...
@@ -174,7 +167,7 @@ export class OrdersService {
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
(),
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
(),
orderDate
:
Math
.
floor
(
Date
.
now
()
/
1000
),
orderDate
:
Math
.
floor
(
Date
.
now
()
/
1000
),
orderCode
:
this
.
orderCode
(),
orderCode
:
this
.
orderCode
(),
orderId
:
neworderId
,
orderId
:
''
,
orderStatus
:
1
,
orderStatus
:
1
,
pickupAddress
:
''
,
pickupAddress
:
''
,
pickupLocation
:
pickup
,
pickupLocation
:
pickup
,
...
@@ -200,8 +193,13 @@ export class OrdersService {
...
@@ -200,8 +193,13 @@ export class OrdersService {
this
.
afs
this
.
afs
.
collection
(
'orders'
)
.
collection
(
'orders'
)
.
add
(
orderItem
)
.
then
(
docRef
=>
{
const
neworderId
=
docRef
.
id
;
this
.
afs
.
collection
(
'orders'
)
.
doc
(
neworderId
)
.
doc
(
neworderId
)
.
set
(
orderItem
)
.
update
({
orderId
:
neworderId
}
)
.
then
(()
=>
{
.
then
(()
=>
{
// console.log('Booking Successfully');
// console.log('Booking Successfully');
// this.router.navigateByUrl('cart');
// this.router.navigateByUrl('cart');
...
@@ -209,8 +207,7 @@ export class OrdersService {
...
@@ -209,8 +207,7 @@ export class OrdersService {
resolve
(
'Cart to Order Successfully'
);
resolve
(
'Cart to Order Successfully'
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
});
});
})
}).
catch
(
error
=>
{
.
catch
(
error
=>
{
console
.
error
(
'Error adding document: '
,
error
);
console
.
error
(
'Error adding document: '
,
error
);
});
});
});
});
...
...
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