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
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
72 deletions
+78
-72
app.component.html
src/app/app.component.html
+2
-1
contact.page.ts
src/app/contact/contact.page.ts
+6
-2
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
+60
-63
No files found.
src/app/app.component.html
View file @
c51e9b66
...
...
@@ -28,7 +28,8 @@
<div
class=
"sub_menu"
>
<ul
*
ngIf=
"categoryService.activecategories"
>
<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 }}
</li>
</ion-menu-toggle>
...
...
src/app/contact/contact.page.ts
View file @
c51e9b66
...
...
@@ -51,8 +51,12 @@ export class ContactPage implements OnInit {
this
.
submitted
=
true
;
console
.
log
(
form
.
value
);
if
(
form
.
valid
&&
form
.
value
.
message
!==
''
)
{
const
contData
=
{
...
this
.
contactData
,
from
:
this
.
userData
.
emailId
};
this
.
contactService
.
contactCreate
(
contData
);
this
.
service
.
get
(
'orderId'
).
then
((
orderId
)
=>
{
const
newOrder
=
orderId
;
const
contData
=
{
...
this
.
contactData
,
from
:
this
.
userData
.
emailId
,
orderId
:
newOrder
};
this
.
contactService
.
contactCreate
(
contData
);
});
}
else
{
console
.
log
(
'form not valid'
);
this
.
submitted
=
false
;
...
...
src/app/orderplaced/orderplaced.page.html
View file @
c51e9b66
...
...
@@ -106,7 +106,7 @@
{{data.deliveryAddress.building}},
<br
/>
{{data.deliveryAddress.landmark}}
</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"
>
CANCEL THIS ORDER
</button>
...
...
src/app/orderplaced/orderplaced.page.ts
View file @
c51e9b66
...
...
@@ -78,6 +78,11 @@ export class OrderplacedPage implements OnInit {
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
cancelOrder
(
orderId
)
{
this
.
service
.
set
(
'orderId'
,
orderId
);
this
.
router
.
navigateByUrl
(
'contact'
);
}
changeAddress
(
orderId
)
{
this
.
service
.
set
(
'orderId'
,
orderId
);
this
.
router
.
navigateByUrl
(
'changeaddress'
);
...
...
src/app/preference/preference.page.ts
View file @
c51e9b66
...
...
@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit {
});
}
ngOnInit
()
{}
ngOnInit
()
{
}
selectPrefernce
(
preferenceId
)
{
console
.
log
(
this
.
userPrefence
);
...
...
@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit {
setTimeout
(()
=>
{
this
.
loader
=
false
;
this
.
successState
=
false
;
this
.
service
.
set
(
'type'
,
0
);
if
(
this
.
type
===
1
)
{
this
.
service
.
set
(
'type'
,
0
);
this
.
router
.
navigateByUrl
(
'home'
,
{
queryParams
:
null
});
}
else
{
this
.
goBack
();
...
...
src/config/address.service.ts
View file @
c51e9b66
...
...
@@ -55,7 +55,6 @@ export class AddressService {
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
];
...
...
src/config/contact.service.ts
View file @
c51e9b66
...
...
@@ -25,13 +25,13 @@ export class ContactService {
this
.
loader
=
true
;
this
.
afs
.
collection
(
'contacts'
)
.
add
(
{}
)
.
add
(
data
)
.
then
(
docRef
=>
{
data
.
contactId
=
docRef
.
id
;
this
.
afs
.
collection
(
'contacts'
)
.
doc
(
data
.
contactId
)
.
set
(
data
)
.
update
({
contactId
:
data
.
contactId
}
)
.
then
(()
=>
{
this
.
service
.
showToast
(
'Thank you for your feedback!'
,
'top'
,
'my-toast'
,
500
)
...
...
src/config/order.service.ts
View file @
c51e9b66
...
...
@@ -134,74 +134,72 @@ export class OrdersService {
const
promise
=
new
Promise
(
resolve
=>
{
distinctShops
.
forEach
(
item
=>
{
console
.
log
(
item
);
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
10.7231
,
76.1234
);
const
products
=
{};
const
cartItem
=
cartGroup
[
item
];
let
prodPrice
=
0
;
cartItem
.
forEach
(
prodItem
=>
{
prodPrice
+=
prodItem
.
price
;
products
[
prodItem
.
prodId
]
=
{
prodId
:
prodItem
.
prodId
,
prodName
:
prodItem
.
prodName
,
image
:
prodItem
.
image
,
price
:
prodItem
.
price
,
color
:
prodItem
.
color
,
size
:
prodItem
.
size
,
qty
:
prodItem
.
qty
,
discount
:
''
};
this
.
afs
.
doc
(
`carts/
${
prodItem
.
cartId
}
`
).
delete
();
});
// console.log(cartItem);
// console.log(products);
const
product
=
cartItem
[
0
];
this
.
custId
=
this
.
custId
.
trim
();
const
orderItem
:
Order
=
{
amount
:
'A$ '
+
otherCharge
.
totalAmt
,
customer
:
firebase
.
firestore
().
doc
(
'/customer/'
+
this
.
custId
),
shopper
:
product
.
shopper
,
deliveryAddress
:
otherCharge
.
custAddress
,
deliveryCharge
:
'A$ '
+
otherCharge
.
deliveryCharge
,
deliveryLocation
:
otherCharge
.
custAddress
.
latLng
,
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
(),
orderDate
:
Math
.
floor
(
Date
.
now
()
/
1000
),
orderCode
:
this
.
orderCode
(),
orderId
:
''
,
orderStatus
:
1
,
pickupAddress
:
''
,
pickupLocation
:
pickup
,
promoId
:
null
,
rider
:
firebase
.
firestore
()
.
doc
(
'/riders/qbTKza18mWVzYG9NLIbmjMbrYjG2'
),
status
:
1
,
custId
:
this
.
custId
,
riderId
:
'qbTKza18mWVzYG9NLIbmjMbrYjG2'
,
shopperId
:
product
.
shopperId
,
custName
:
'Customer'
,
riderName
:
'John'
,
shopperState
:
0
,
paymentMethod
:
otherCharge
.
paymentMethod
,
shopperName
:
''
,
product
:
products
,
discount
:
'A$ '
+
otherCharge
.
discount
,
promoApplied
:
otherCharge
.
discountApplied
,
tax
:
'A$ '
+
otherCharge
.
taxAmount
};
// console.log(orderItem);
this
.
afs
.
collection
(
'orders'
)
.
add
({
shopper
:
firebase
.
firestore
().
doc
(
'/shoppers/'
+
item
),
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
()
})
.
add
(
orderItem
)
.
then
(
docRef
=>
{
const
neworderId
=
docRef
.
id
;
const
pickup
=
new
firebase
.
firestore
.
GeoPoint
(
10.7231
,
76.1234
);
const
products
=
{};
const
cartItem
=
cartGroup
[
item
];
let
prodPrice
=
0
;
cartItem
.
forEach
(
prodItem
=>
{
prodPrice
+=
prodItem
.
price
;
products
[
prodItem
.
prodId
]
=
{
prodId
:
prodItem
.
prodId
,
prodName
:
prodItem
.
prodName
,
image
:
prodItem
.
image
,
price
:
prodItem
.
price
,
color
:
prodItem
.
color
,
size
:
prodItem
.
size
,
qty
:
prodItem
.
qty
,
discount
:
''
};
this
.
afs
.
doc
(
`carts/
${
prodItem
.
cartId
}
`
).
delete
();
});
// console.log(cartItem);
// console.log(products);
const
product
=
cartItem
[
0
];
this
.
custId
=
this
.
custId
.
trim
();
const
orderItem
:
Order
=
{
amount
:
'A$ '
+
otherCharge
.
totalAmt
,
customer
:
firebase
.
firestore
().
doc
(
'/customer/'
+
this
.
custId
),
shopper
:
product
.
shopper
,
deliveryAddress
:
otherCharge
.
custAddress
,
deliveryCharge
:
'A$ '
+
otherCharge
.
deliveryCharge
,
deliveryLocation
:
otherCharge
.
custAddress
.
latLng
,
bookDate
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
(),
orderDate
:
Math
.
floor
(
Date
.
now
()
/
1000
),
orderCode
:
this
.
orderCode
(),
orderId
:
neworderId
,
orderStatus
:
1
,
pickupAddress
:
''
,
pickupLocation
:
pickup
,
promoId
:
null
,
rider
:
firebase
.
firestore
()
.
doc
(
'/riders/qbTKza18mWVzYG9NLIbmjMbrYjG2'
),
status
:
1
,
custId
:
this
.
custId
,
riderId
:
'qbTKza18mWVzYG9NLIbmjMbrYjG2'
,
shopperId
:
product
.
shopperId
,
custName
:
'Customer'
,
riderName
:
'John'
,
shopperState
:
0
,
paymentMethod
:
otherCharge
.
paymentMethod
,
shopperName
:
''
,
product
:
products
,
discount
:
'A$ '
+
otherCharge
.
discount
,
promoApplied
:
otherCharge
.
discountApplied
,
tax
:
'A$ '
+
otherCharge
.
taxAmount
};
// console.log(orderItem);
this
.
afs
.
collection
(
'orders'
)
.
doc
(
neworderId
)
.
set
(
orderItem
)
.
update
({
orderId
:
neworderId
}
)
.
then
(()
=>
{
// console.log('Booking Successfully');
// this.router.navigateByUrl('cart');
...
...
@@ -209,8 +207,7 @@ export class OrdersService {
resolve
(
'Cart to Order Successfully'
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
});
})
.
catch
(
error
=>
{
}).
catch
(
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