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
3d105682
Commit
3d105682
authored
Feb 04, 2020
by
muhsin
Browse files
Options
Browse Files
Download
Plain Diff
conflicts
parents
147a761f
d0836db7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
268 additions
and
181 deletions
+268
-181
app.component.html
src/app/app.component.html
+1
-1
app.component.ts
src/app/app.component.ts
+6
-2
catstorelist.page.html
src/app/catstorelist/catstorelist.page.html
+80
-58
catstorelist.page.scss
src/app/catstorelist/catstorelist.page.scss
+0
-0
feedback.page.html
src/app/feedback/feedback.page.html
+12
-1
feedback.page.ts
src/app/feedback/feedback.page.ts
+7
-3
home.page.html
src/app/home/home.page.html
+0
-11
login.page.html
src/app/login/login.page.html
+1
-1
productlist.page.html
src/app/productlist/productlist.page.html
+12
-10
productlist.page.ts
src/app/productlist/productlist.page.ts
+3
-1
storelist.page.html
src/app/storelist/storelist.page.html
+4
-8
storelist.page.ts
src/app/storelist/storelist.page.ts
+6
-0
auth.service.ts
src/config/auth.service.ts
+8
-3
feedback.service.ts
src/config/feedback.service.ts
+20
-15
products.service.ts
src/config/products.service.ts
+13
-6
search.service.ts
src/config/search.service.ts
+4
-4
service.service.ts
src/config/service.service.ts
+30
-5
shopper.ts
src/config/services/shopper.ts
+34
-34
shopper.service.ts
src/config/shopper.service.ts
+20
-17
global.scss
src/global.scss
+7
-1
No files found.
src/app/app.component.html
View file @
3d105682
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</ion-menu-toggle>
</ion-menu-toggle>
<div
class=
"sidemenu_list"
>
<div
class=
"sidemenu_list"
>
<ul>
<ul>
<ion-menu-toggle>
<ion-menu-toggle
(
click
)="
hideTab
()"
>
<li
(
click
)="
vieworder
('
home
')"
>
Shop
</li>
<li
(
click
)="
vieworder
('
home
')"
>
Shop
</li>
</ion-menu-toggle>
</ion-menu-toggle>
<!-- <li>About us</li> -->
<!-- <li>About us</li> -->
...
...
src/app/app.component.ts
View file @
3d105682
...
@@ -89,6 +89,10 @@ export class AppComponent {
...
@@ -89,6 +89,10 @@ export class AppComponent {
});
});
}
}
hideTab
()
{
alert
(
'asdasdas'
);
}
async
finishpop
(
data
:
any
)
{
async
finishpop
(
data
:
any
)
{
const
modal
=
await
this
.
modalController
.
create
({
const
modal
=
await
this
.
modalController
.
create
({
component
:
DeliverypopPage
,
component
:
DeliverypopPage
,
...
@@ -109,12 +113,12 @@ export class AppComponent {
...
@@ -109,12 +113,12 @@ export class AppComponent {
'login'
,
'login'
,
'signup'
,
'signup'
,
'address'
,
'address'
,
'forgot'
'forgot'
,
'feedback'
];
];
const
currentUrl
=
this
.
router
.
url
.
split
(
'/'
);
const
currentUrl
=
this
.
router
.
url
.
split
(
'/'
);
const
index
=
restrictedUrl
.
findIndex
(
x
=>
x
===
currentUrl
[
1
]);
const
index
=
restrictedUrl
.
findIndex
(
x
=>
x
===
currentUrl
[
1
]);
// console.log(currentUrl[1], index, this.state);
// console.log(currentUrl[1], index, this.state);
// console.log(this.tabData);
if
(
index
>
-
1
||
this
.
tabData
===
false
)
{
if
(
index
>
-
1
||
this
.
tabData
===
false
)
{
return
true
;
return
true
;
}
else
{
}
else
{
...
...
src/app/catstorelist/catstorelist.page.html
View file @
3d105682
<div
class=
"nav_header"
>
<div
class=
"nav_header"
>
<button
class=
"nav_btn nav_back floatLeft"
(
click
)="
goBack
()"
>
<button
class=
"nav_btn nav_back floatLeft"
(
click
)="
goBack
()"
></button>
</button>
<div
class=
"nav_title floatLeft"
>
<div
class=
"nav_title floatLeft"
>
<input
<input
class=
"search_bar"
placeholder=
"Search here.. eg:shirts, retailers etc..."
(
click
)="
clickSearch
()"
>
class=
"search_bar"
</div>
placeholder=
"Search here.. eg:shirts, retailers etc..."
<button
class=
"nav_btn nav_search floatRight"
*
ngIf=
"!searchShow"
>
(
click
)="
clickSearch
()"
</button>
/>
<button
class=
"nav_btn nav_close floatRight"
*
ngIf=
"searchShow"
(
click
)="
searchClose
()"
>
</div>
</button>
<button
class=
"nav_btn nav_search floatRight"
*
ngIf=
"!searchShow"
></button>
<div
class=
"clear"
></div>
<button
class=
"nav_btn nav_close floatRight"
*
ngIf=
"searchShow"
(
click
)="
searchClose
()"
></button>
<div
class=
"clear"
></div>
</div>
</div>
<ion-content>
<ion-content>
<div
class=
"home_wrapper"
>
<div
class=
"home_wrapper"
>
<div
class=
"home_sub_header"
>
<div
class=
"home_sub_header"
>
Featured Stores
Featured Stores
</div>
</div>
<div
class=
"featured_slider"
>
<div
class=
"featured_slider"
>
<ion-slides
pager=
"false"
[
options
]="
slideOpts
"
*
ngIf=
"shopperService.activeshoppers && shopperService.activeshoppers.length > 0"
>
<ion-slides
<ion-slide
*
ngFor=
"let shopper of shopperService.activeshoppers"
>
pager=
"false"
<div
class=
"feature_product"
(
click
)="
goToPage
('
productlist
',
shopper
)"
>
[
options
]="
slideOpts
"
<img
[
src
]="
shopper
.
featuredImage
"
onerror=
"this.src='./../../assets/getmi_malls/featured/featured1.png'"
>
*
ngIf=
"shopperService.activeshoppers && shopperService.activeshoppers.length > 0"
<div
class=
"feature_overlay"
>
>
<h5>
{{shopper.name}}
</h5>
<ion-slide
*
ngFor=
"let shopper of shopperService.activeshoppers"
>
<p>
{{shopper.caption}}
</p>
<div
</div>
class=
"feature_product"
</div>
(
click
)="
goToPage
('
productlist
',
shopper
)"
</ion-slide>
>
</ion-slides>
<img
</div>
[
src
]="
shopper
.
featuredImage
"
<div
class=
"home_sub_header"
*
ngIf=
"data"
>
onerror=
"this.src='./../../assets/getmi_malls/featured/featured1.png'"
{{data.catName}}
/>
</div>
<div
class=
"feature_overlay"
>
<div
class=
"nearby_shop_list"
>
<h5>
{{shopper.name}}
</h5>
<ul
*
ngIf=
"shopperService.shoppers && shopperService.shoppers.length > 0"
>
<p>
{{shopper.caption}}
</p>
<li
*
ngFor=
"let shopper of shopperService.shoppers"
(
click
)="
goToPage
('
productlist
',
shopper
)"
>
</div>
<div
class=
"nearby_image"
>
</div>
<img
[
src
]="
shopper
.
profilePic
"
onerror=
"this.src='./../../assets/getmi_malls/store298/stores1.png'"
>
</ion-slide>
</div>
</ion-slides>
<div
class=
"nearby_detail"
>
</div>
<h5>
<div
class=
"home_sub_header"
*
ngIf=
"data"
>
<span
class=
"floatLeft"
>
{{shopper.name}}
</span>
{{data.catName}}
<span
class=
"floatRight"
>
0
</div>
<img
src=
"../assets/Path61_2.png"
>
<div
class=
"nearby_shop_list"
>
</span>
<ul
*
ngIf=
"shopperService.shoppers && shopperService.shoppers.length > 0"
>
<div
class=
"clear"
></div>
<li
</h5>
*
ngFor=
"let shopper of shopperService.shoppers"
<p>
{{shopper.caption}}
</p>
(
click
)="
goToPage
('
productlist
',
shopper
)"
</div>
>
<div
class=
"clear"
></div>
<div
class=
"nearby_image"
>
</li>
<img
</ul>
[
src
]="
shopper
.
profilePic
"
</div>
onerror=
"this.src='./../../assets/getmi_malls/store298/stores1.png'"
/>
</div>
<div
class=
"nearby_detail"
>
<h5>
<span
class=
"floatLeft"
>
{{shopper.name}}
</span>
<span
class=
"floatRight"
>
0
<img
src=
"../assets/Path61_2.png"
/>
</span>
<div
class=
"clear"
></div>
</h5>
<p>
{{shopper.caption}}
</p>
</div>
<div
class=
"clear"
></div>
</li>
</ul>
<div
class=
"no-result-wrapper"
*
ngIf=
"shopperService.shoppers.length === 0"
>
<img
src=
"../../assets/basket.png"
/>
<h1>
No result found
</h1>
<button
(
click
)="
goToPage
('
home
')"
>
home
</button>
</div>
</div>
</div>
</div>
</ion-content>
</ion-content>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<ul>
<li>
sample
</li>
</ul>
</div>
\ No newline at end of file
src/app/catstorelist/catstorelist.page.scss
View file @
3d105682
This diff is collapsed.
Click to expand it.
src/app/feedback/feedback.page.html
View file @
3d105682
...
@@ -59,10 +59,21 @@
...
@@ -59,10 +59,21 @@
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<button
(
click
)="
onFeedbackSubmit
(
feedbackForm
)"
class=
"login_btn"
>
<button
(
click
)="
onFeedbackSubmit
(
feedbackForm
)"
class=
"login_btn"
[
disabled
]="
submitted
"
>
SENT
SENT
</button>
</button>
</div>
</div>
</div>
</div>
</form>
</form>
</ion-content>
</ion-content>
<div
class=
"loader"
*
ngIf=
"feedService.loader"
>
<div
class=
"lds-ripple"
>
<div></div>
<div></div>
</div>
</div>
src/app/feedback/feedback.page.ts
View file @
3d105682
...
@@ -4,7 +4,7 @@ import { SubjectService } from '../../config/subject.service';
...
@@ -4,7 +4,7 @@ import { SubjectService } from '../../config/subject.service';
import
{
NgForm
}
from
'@angular/forms'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
FeedbackData
}
from
'../../config/services/feedback'
;
import
{
FeedbackData
}
from
'../../config/services/feedback'
;
import
{
FeedbackService
}
from
'../../config/feedback.service'
;
import
{
FeedbackService
}
from
'../../config/feedback.service'
;
import
{
ToastController
}
from
'@ionic/angular
'
;
import
{
ServiceService
}
from
'../../config/service.service
'
;
@
Component
({
@
Component
({
selector
:
'app-feedback'
,
selector
:
'app-feedback'
,
templateUrl
:
'./feedback.page.html'
,
templateUrl
:
'./feedback.page.html'
,
...
@@ -24,7 +24,7 @@ export class FeedbackPage implements OnInit {
...
@@ -24,7 +24,7 @@ export class FeedbackPage implements OnInit {
private
location
:
Location
,
private
location
:
Location
,
public
subjectService
:
SubjectService
,
public
subjectService
:
SubjectService
,
public
feedService
:
FeedbackService
,
public
feedService
:
FeedbackService
,
public
toastController
:
ToastController
public
service
:
ServiceService
)
{
)
{
// Gets userdata
// Gets userdata
this
.
subjectService
.
getUserData
().
subscribe
(
userData
=>
{
this
.
subjectService
.
getUserData
().
subscribe
(
userData
=>
{
...
@@ -39,8 +39,12 @@ export class FeedbackPage implements OnInit {
...
@@ -39,8 +39,12 @@ export class FeedbackPage implements OnInit {
onFeedbackSubmit
(
form
:
NgForm
)
{
onFeedbackSubmit
(
form
:
NgForm
)
{
this
.
submitted
=
true
;
this
.
submitted
=
true
;
if
(
form
.
valid
)
{
console
.
log
(
form
.
value
);
if
(
form
.
valid
&&
form
.
value
.
message
!==
''
)
{
this
.
feedService
.
feedbackCreate
(
form
.
value
);
this
.
feedService
.
feedbackCreate
(
form
.
value
);
}
else
{
this
.
submitted
=
false
;
this
.
service
.
showToast
(
'Invalid request!'
,
'top'
,
'my-error'
,
1000
);
}
}
}
}
...
...
src/app/home/home.page.html
View file @
3d105682
...
@@ -205,14 +205,3 @@
...
@@ -205,14 +205,3 @@
</div>
</div>
</ion-content>
</ion-content>
</div>
</div>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<ul
*
ngIf=
"searchService.searchList"
>
<li
*
ngFor=
"let search of searchService.searchList"
(
click
)="
viewPage
(
search
)"
>
{{search.text}}
</li>
</ul>
</div>
src/app/login/login.page.html
View file @
3d105682
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<!-- <button (click)="goToPage('addaddresss')">Address</button> -->
<!-- <button (click)="goToPage('addaddresss')">Address</button> -->
</div>
</div>
</div>
</div>
<div
class=
"loader"
*
ngIf=
"loader"
>
<div
class=
"loader"
*
ngIf=
"
authService.
loader"
>
<div
class=
"lds-ripple"
>
<div
class=
"lds-ripple"
>
<div></div>
<div></div>
<div></div>
<div></div>
...
...
src/app/productlist/productlist.page.html
View file @
3d105682
...
@@ -112,6 +112,17 @@
...
@@ -112,6 +112,17 @@
<li>
<li>
<input
<input
class=
"styled-checkbox"
class=
"styled-checkbox"
id=
"styled-checkbox-5"
type=
"radio"
value=
"a-z"
name=
"sort"
(
click
)="
setValue
($
event
.
target
.
value
)"
/>
<label
for=
"styled-checkbox-5"
>
Name A - Z
</label>
</li>
<li>
<input
class=
"styled-checkbox"
id=
"styled-checkbox-3"
id=
"styled-checkbox-3"
type=
"radio"
type=
"radio"
value=
"low"
value=
"low"
...
@@ -131,6 +142,7 @@
...
@@ -131,6 +142,7 @@
/>
/>
<label
for=
"styled-checkbox-4"
>
Price High - Low
</label>
<label
for=
"styled-checkbox-4"
>
Price High - Low
</label>
</li>
</li>
<!-- <li>
<!-- <li>
<input class="styled-checkbox" id="styled-checkbox-5" type="radio" value="rate" name="sort" (click)="setValue($event.target.value)">
<input class="styled-checkbox" id="styled-checkbox-5" type="radio" value="rate" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-5">Rating</label>
<label for="styled-checkbox-5">Rating</label>
...
@@ -152,13 +164,3 @@
...
@@ -152,13 +164,3 @@
</div>
</div>
</div>
</div>
</ion-content>
</ion-content>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<ul
*
ngIf=
"searchService.searchList"
>
<li
*
ngFor=
"let search of searchService.searchList"
(
click
)="
viewPage
(
search
)"
>
{{search.text}}
</li>
</ul>
</div>
src/app/productlist/productlist.page.ts
View file @
3d105682
...
@@ -32,6 +32,7 @@ export class ProductlistPage implements OnInit {
...
@@ -32,6 +32,7 @@ export class ProductlistPage implements OnInit {
searchShow
=
false
;
searchShow
=
false
;
sortValue
:
string
;
sortValue
:
string
;
loader
:
boolean
;
loader
:
boolean
;
shopperId
:
any
;
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
...
@@ -46,6 +47,7 @@ export class ProductlistPage implements OnInit {
...
@@ -46,6 +47,7 @@ export class ProductlistPage implements OnInit {
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
service
.
get
(
'params'
).
then
(
val
=>
{
this
.
service
.
get
(
'params'
).
then
(
val
=>
{
this
.
data
=
val
;
this
.
data
=
val
;
this
.
shopperId
=
this
.
data
.
uid
;
console
.
log
(
this
.
data
);
console
.
log
(
this
.
data
);
this
.
prodService
.
prodList
(
this
.
data
.
uid
);
this
.
prodService
.
prodList
(
this
.
data
.
uid
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -117,7 +119,7 @@ export class ProductlistPage implements OnInit {
...
@@ -117,7 +119,7 @@ export class ProductlistPage implements OnInit {
submit
()
{
submit
()
{
console
.
log
(
this
.
sortValue
);
console
.
log
(
this
.
sortValue
);
this
.
prodService
.
filterSearch
(
this
.
sortValue
);
this
.
prodService
.
filterSearch
(
this
.
sortValue
,
this
.
shopperId
);
}
}
checkFavStatus
(
index
)
{
checkFavStatus
(
index
)
{
...
...
src/app/storelist/storelist.page.html
View file @
3d105682
...
@@ -28,9 +28,11 @@
...
@@ -28,9 +28,11 @@
<ion-slides
<ion-slides
pager=
"false"
pager=
"false"
[
options
]="
slideOpts
"
[
options
]="
slideOpts
"
*
ngIf=
"shopperService.activeshoppers &&
shopperService.activeshoppers
.length > 0"
*
ngIf=
"shopperService.activeshoppers &&
filterFunction(shopperService.activeshoppers)
.length > 0"
>
>
<ion-slide
*
ngFor=
"let shopper of shopperService.activeshoppers"
>
<ion-slide
*
ngFor=
"let shopper of filterFunction(shopperService.activeshoppers)"
>
<div
<div
class=
"feature_product"
class=
"feature_product"
(
click
)="
goToPage
('
productlist
',
shopper
)"
(
click
)="
goToPage
('
productlist
',
shopper
)"
...
@@ -85,9 +87,3 @@
...
@@ -85,9 +87,3 @@
</div>
</div>
</div>
</div>
</ion-content>
</ion-content>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<ul>
<li>
sample
</li>
</ul>
</div>
src/app/storelist/storelist.page.ts
View file @
3d105682
...
@@ -31,6 +31,7 @@ export class StorelistPage implements OnInit {
...
@@ -31,6 +31,7 @@ export class StorelistPage implements OnInit {
};
};
data
:
any
;
data
:
any
;
loader
:
boolean
;
loader
:
boolean
;
centerId
:
any
;
constructor
(
constructor
(
public
router
:
Router
,
public
router
:
Router
,
...
@@ -44,6 +45,7 @@ export class StorelistPage implements OnInit {
...
@@ -44,6 +45,7 @@ export class StorelistPage implements OnInit {
this
.
loader
=
true
;
this
.
loader
=
true
;
this
.
service
.
get
(
'params'
).
then
(
val
=>
{
this
.
service
.
get
(
'params'
).
then
(
val
=>
{
this
.
data
=
val
;
this
.
data
=
val
;
this
.
centerId
=
this
.
data
.
cId
;
this
.
shopperService
.
shopperList
(
this
.
data
.
cId
,
'centerId'
);
this
.
shopperService
.
shopperList
(
this
.
data
.
cId
,
'centerId'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
...
@@ -82,4 +84,8 @@ export class StorelistPage implements OnInit {
...
@@ -82,4 +84,8 @@ export class StorelistPage implements OnInit {
searchClose
()
{
searchClose
()
{
this
.
searchShow
=
false
;
this
.
searchShow
=
false
;
}
}
filterFunction
(
featuredStore
):
any
[]
{
return
featuredStore
.
filter
(
store
=>
store
.
centerId
===
this
.
centerId
);
}
}
}
src/config/auth.service.ts
View file @
3d105682
...
@@ -76,7 +76,7 @@ export class AuthService {
...
@@ -76,7 +76,7 @@ export class AuthService {
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
this
.
loader
=
false
;
this
.
loader
=
false
;
window
.
alert
(
error
.
message
);
this
.
service
.
showToast
(
error
.
message
,
'bottom'
,
'my-error'
,
1000
);
});
});
}
}
...
@@ -100,7 +100,12 @@ export class AuthService {
...
@@ -100,7 +100,12 @@ export class AuthService {
this
.
router
.
navigateByUrl
(
'nearby'
);
this
.
router
.
navigateByUrl
(
'nearby'
);
}
else
{
}
else
{
this
.
loader
=
false
;
this
.
loader
=
false
;
window
.
alert
(
'Please input valid OTP'
);
this
.
service
.
showToast
(
'Please input valid OTP'
,
'bottom'
,
'my-error'
,
1000
);
}
}
});
});
}
}
...
@@ -149,7 +154,7 @@ export class AuthService {
...
@@ -149,7 +154,7 @@ export class AuthService {
console
.
log
(
result
);
console
.
log
(
result
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
alert
(
err
.
message
);
this
.
service
.
showToast
(
err
.
message
,
'bottom'
,
'my-error'
,
1000
);
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
This
.
loader
=
false
;
This
.
loader
=
false
;
...
...
src/config/feedback.service.ts
View file @
3d105682
...
@@ -5,21 +5,24 @@ import {
...
@@ -5,21 +5,24 @@ import {
}
from
'@angular/fire/firestore'
;
}
from
'@angular/fire/firestore'
;
import
{
take
}
from
'rxjs/operators'
;
import
{
take
}
from
'rxjs/operators'
;
import
{
FeedbackData
}
from
'./services/feedback'
;
import
{
FeedbackData
}
from
'./services/feedback'
;
import
{
ToastController
}
from
'@ionic/angular
'
;
import
{
ServiceService
}
from
'./service.service
'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'root'
providedIn
:
'root'
})
})
export
class
FeedbackService
{
export
class
FeedbackService
{
loader
:
boolean
;
constructor
(
constructor
(
public
afs
:
AngularFirestore
,
public
afs
:
AngularFirestore
,
public
toastController
:
ToastController
,
private
router
:
Router
,
private
router
:
Router
private
service
:
ServiceService
)
{}
)
{
this
.
loader
=
false
;
}
feedbackCreate
(
data
:
FeedbackData
)
{
feedbackCreate
(
data
:
FeedbackData
)
{
console
.
log
(
data
)
;
this
.
loader
=
true
;
this
.
afs
this
.
afs
.
collection
(
'feedback'
)
.
collection
(
'feedback'
)
.
add
({})
.
add
({})
...
@@ -30,19 +33,21 @@ export class FeedbackService {
...
@@ -30,19 +33,21 @@ export class FeedbackService {
.
doc
(
data
.
feedbackId
)
.
doc
(
data
.
feedbackId
)
.
set
(
data
)
.
set
(
data
)
.
then
(()
=>
{
.
then
(()
=>
{
// SHows success toast
this
.
service
this
.
toastController
.
showToast
(
.
create
({
'Thank you for your feedback!'
,
message
:
'Thank you for your Feedback!'
,
'top'
,
duration
:
2000
,
'my-toast'
,
position
:
'top'
,
2000
cssClass
:
'my-toast'
)
})
.
then
(()
=>
{
.
then
(
res
=>
{
this
.
loader
=
false
;
res
.
present
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
router
.
navigateByUrl
(
'home'
);
this
.
router
.
navigateByUrl
(
'home'
);
},
2100
);
},
2100
);
})
.
catch
(
err
=>
{
this
.
loader
=
false
;
});
});
});
});
});
});
...
...
src/config/products.service.ts
View file @
3d105682
...
@@ -61,7 +61,10 @@ export class ProductsService {
...
@@ -61,7 +61,10 @@ export class ProductsService {
const
prodRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
prodRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
`products`
,
`products`
,
ref
=>
ref
=>
ref
.
where
(
'shopperId'
,
'=='
,
shopperId
).
where
(
'status'
,
'=='
,
state
)
ref
.
orderBy
(
'category'
,
'asc'
)
.
where
(
'shopperId'
,
'=='
,
shopperId
)
.
where
(
'status'
,
'=='
,
state
)
);
);
prodRef
.
valueChanges
().
subscribe
(
value
=>
{
prodRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
product
=
[];
this
.
product
=
[];
...
@@ -101,7 +104,7 @@ export class ProductsService {
...
@@ -101,7 +104,7 @@ export class ProductsService {
});
});
}
}
public
async
filterSearch
(
sortValue
:
string
)
{
public
async
filterSearch
(
sortValue
:
string
,
shopperId
:
string
)
{
const
This
=
this
;
const
This
=
this
;
const
state
=
true
;
const
state
=
true
;
// console.log(sortValue);
// console.log(sortValue);
...
@@ -117,15 +120,19 @@ export class ProductsService {
...
@@ -117,15 +120,19 @@ export class ProductsService {
order
=
'desc'
;
order
=
'desc'
;
}
}
if
(
sortValue
===
'
rate
'
)
{
if
(
sortValue
===
'
a-z
'
)
{
// field = 'pric
e';
field
=
'prodNam
e'
;
// order = 'de
sc';
order
=
'a
sc'
;
}
}
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
const
prodRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
prodRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
`products`
,
`products`
,
ref
=>
ref
.
where
(
'status'
,
'=='
,
state
).
orderBy
(
field
,
order
)
ref
=>
ref
.
where
(
'status'
,
'=='
,
state
)
.
where
(
'shopperId'
,
'=='
,
shopperId
)
.
orderBy
(
field
,
order
)
);
);
prodRef
.
valueChanges
().
subscribe
(
value
=>
{
prodRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
product
=
[];
this
.
product
=
[];
...
...
src/config/search.service.ts
View file @
3d105682
...
@@ -28,8 +28,8 @@ export class SearchService {
...
@@ -28,8 +28,8 @@ export class SearchService {
ref
=>
ref
=>
ref
ref
.
where
(
'status'
,
'=='
,
state
)
.
where
(
'status'
,
'=='
,
state
)
.
orderBy
(
'
n
ame'
)
.
orderBy
(
'
searchN
ame'
)
.
startAt
(
inputText
.
to
Upp
erCase
())
.
startAt
(
inputText
.
to
Low
erCase
())
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
limit
(
5
)
.
limit
(
5
)
);
);
...
@@ -55,7 +55,7 @@ export class SearchService {
...
@@ -55,7 +55,7 @@ export class SearchService {
ref
ref
.
where
(
'status'
,
'=='
,
state
)
.
where
(
'status'
,
'=='
,
state
)
.
orderBy
(
'prodName'
)
.
orderBy
(
'prodName'
)
.
startAt
(
inputText
.
to
Upp
erCase
())
.
startAt
(
inputText
.
to
Low
erCase
())
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
limit
(
5
)
.
limit
(
5
)
);
);
...
@@ -82,7 +82,7 @@ export class SearchService {
...
@@ -82,7 +82,7 @@ export class SearchService {
ref
ref
.
where
(
'status'
,
'=='
,
state
)
.
where
(
'status'
,
'=='
,
state
)
.
orderBy
(
'catName'
)
.
orderBy
(
'catName'
)
.
startAt
(
inputText
.
to
Upp
erCase
())
.
startAt
(
inputText
.
to
Low
erCase
())
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
endAt
(
inputText
.
toLowerCase
()
+
'
\
uf8ff'
)
.
limit
(
5
)
.
limit
(
5
)
);
);
...
...
src/config/service.service.ts
View file @
3d105682
import
{
Injectable
}
from
"@angular/core"
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Storage
}
from
"@ionic/storage"
;
import
{
Storage
}
from
'@ionic/storage'
;
import
{
ToastController
}
from
'@ionic/angular'
;
@
Injectable
({
@
Injectable
({
providedIn
:
"root"
providedIn
:
'root'
})
})
export
class
ServiceService
{
export
class
ServiceService
{
state
:
boolean
;
state
:
boolean
;
constructor
(
public
storage
:
Storage
)
{
constructor
(
public
storage
:
Storage
,
public
toastController
:
ToastController
)
{
this
.
state
=
true
;
this
.
state
=
true
;
}
}
...
@@ -25,7 +29,7 @@ export class ServiceService {
...
@@ -25,7 +29,7 @@ export class ServiceService {
public
clear
()
{
public
clear
()
{
this
.
storage
.
clear
().
then
(()
=>
{
this
.
storage
.
clear
().
then
(()
=>
{
console
.
log
(
"all keys cleared"
);
console
.
log
(
'all keys cleared'
);
});
});
}
}
...
@@ -48,4 +52,25 @@ export class ServiceService {
...
@@ -48,4 +52,25 @@ export class ServiceService {
}
}
return
response
;
return
response
;
}
}
showToast
(
msg
,
positions
,
className
,
durations
=
2000
)
{
try
{
const
promise1
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
toastController
.
create
({
message
:
msg
,
duration
:
durations
,
position
:
positions
,
cssClass
:
className
})
.
then
(
res
=>
{
res
.
present
();
resolve
(
true
);
});
});
return
promise1
;
}
catch
(
error
)
{
console
.
log
(
'error: '
+
error
);
}
}
}
}
src/config/services/shopper.ts
View file @
3d105682
export
interface
Shopper
{
export
interface
Shopper
{
name
:
string
;
name
:
string
;
emailId
:
string
;
emailId
:
string
;
phone
:
string
;
phone
:
string
;
caption
:
string
;
caption
:
string
;
profilePhoto
:
string
;
profilePhoto
:
string
;
status
:
boolean
;
status
:
boolean
;
uid
:
string
;
uid
:
string
;
shopName
:
string
;
shopName
:
string
;
address
:
string
;
address
:
string
;
featured
:
boolean
;
featured
:
boolean
;
shopStatus
:
boolean
;
shopStatus
:
boolean
;
centre
:
object
;
centre
:
object
;
rate
:
any
;
rate
:
any
;
workingHours
:
string
;
workingHours
:
string
;
featuredImage
:
string
;
featuredImage
:
string
;
centerId
:
string
;
}
}
export
interface
ShopperData
{
export
interface
ShopperData
{
centre
:
object
;
centre
:
object
;
abn
:
string
;
abn
:
string
;
category
:
object
;
category
:
object
;
name
:
string
;
name
:
string
;
address
:
string
;
address
:
string
;
emailId
:
string
;
emailId
:
string
;
phone
:
string
;
phone
:
string
;
caption
:
string
;
caption
:
string
;
featured
:
boolean
;
featured
:
boolean
;
profilePic
:
any
;
profilePic
:
any
;
featuredImage
:
string
;
featuredImage
:
string
;
shopStatus
:
boolean
;
shopStatus
:
boolean
;
centerId
:
string
;
centerId
:
string
;
uid
:
string
;
uid
:
string
;
shopName
:
string
;
shopName
:
string
;
status
:
boolean
;
status
:
boolean
;
rate
:
any
;
rate
:
any
;
workingHours
:
string
;
workingHours
:
string
;
}
}
src/config/shopper.service.ts
View file @
3d105682
import
{
Injectable
}
from
"@angular/core"
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
AngularFireAuth
}
from
"@angular/fire/auth"
;
import
{
AngularFireAuth
}
from
'@angular/fire/auth'
;
import
{
import
{
AngularFirestore
,
AngularFirestore
,
AngularFirestoreDocument
,
AngularFirestoreDocument
,
AngularFirestoreCollection
AngularFirestoreCollection
}
from
"@angular/fire/firestore"
;
}
from
'@angular/fire/firestore'
;
import
{
Shopper
}
from
"./services/shopper"
;
import
{
Shopper
}
from
'./services/shopper'
;
import
*
as
firebase
from
"firebase"
;
import
*
as
firebase
from
'firebase'
;
@
Injectable
({
@
Injectable
({
providedIn
:
"root"
providedIn
:
'root'
})
})
export
class
ShoppersService
{
export
class
ShoppersService
{
shoppers
:
Shopper
[]
=
[];
shoppers
:
Shopper
[]
=
[];
...
@@ -24,8 +24,8 @@ export class ShoppersService {
...
@@ -24,8 +24,8 @@ export class ShoppersService {
const
This
=
this
;
const
This
=
this
;
const
state
=
true
;
const
state
=
true
;
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
"shoppers"
,
'shoppers'
,
ref
=>
ref
.
where
(
type
,
"=="
,
centerId
).
where
(
"status"
,
"=="
,
state
)
ref
=>
ref
.
where
(
type
,
'=='
,
centerId
).
where
(
'status'
,
'=='
,
state
)
);
);
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
shoppers
=
[];
this
.
shoppers
=
[];
...
@@ -48,7 +48,8 @@ export class ShoppersService {
...
@@ -48,7 +48,8 @@ export class ShoppersService {
workingHours
:
item
.
workingHours
,
workingHours
:
item
.
workingHours
,
caption
:
item
.
caption
,
caption
:
item
.
caption
,
centre
:
item
.
centre
,
centre
:
item
.
centre
,
rate
:
item
.
rate
rate
:
item
.
rate
,
centerId
:
item
.
centerId
};
};
this
.
shoppers
.
push
(
shopper
);
this
.
shoppers
.
push
(
shopper
);
});
});
...
@@ -63,8 +64,8 @@ export class ShoppersService {
...
@@ -63,8 +64,8 @@ export class ShoppersService {
const
This
=
this
;
const
This
=
this
;
const
state
=
true
;
const
state
=
true
;
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
"shoppers"
,
'shoppers'
,
ref
=>
ref
.
where
(
"featured"
,
"=="
,
state
).
where
(
"status"
,
"=="
,
state
)
ref
=>
ref
.
where
(
'featured'
,
'=='
,
state
).
where
(
'status'
,
'=='
,
state
)
);
);
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
activeshoppers
=
[];
this
.
activeshoppers
=
[];
...
@@ -87,7 +88,8 @@ export class ShoppersService {
...
@@ -87,7 +88,8 @@ export class ShoppersService {
workingHours
:
item
.
workingHours
,
workingHours
:
item
.
workingHours
,
caption
:
item
.
caption
,
caption
:
item
.
caption
,
centre
:
item
.
centre
,
centre
:
item
.
centre
,
rate
:
item
.
rate
rate
:
item
.
rate
,
centerId
:
item
.
centerId
};
};
this
.
activeshoppers
.
push
(
shopper
);
this
.
activeshoppers
.
push
(
shopper
);
});
});
...
@@ -117,12 +119,12 @@ export class ShoppersService {
...
@@ -117,12 +119,12 @@ export class ShoppersService {
greaterLon
greaterLon
);
);
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
"shoppers"
,
'shoppers'
,
ref
=>
ref
=>
ref
ref
.
where
(
"centre.latLng"
,
">"
,
lesserGeopoint
)
.
where
(
'centre.latLng'
,
'>'
,
lesserGeopoint
)
.
where
(
"centre.latLng"
,
"<"
,
greaterGeopoint
)
.
where
(
'centre.latLng'
,
'<'
,
greaterGeopoint
)
.
where
(
"status"
,
"=="
,
state
)
.
where
(
'status'
,
'=='
,
state
)
);
);
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
this
.
nearshoppers
=
[];
this
.
nearshoppers
=
[];
...
@@ -145,7 +147,8 @@ export class ShoppersService {
...
@@ -145,7 +147,8 @@ export class ShoppersService {
workingHours
:
item
.
workingHours
,
workingHours
:
item
.
workingHours
,
caption
:
item
.
caption
,
caption
:
item
.
caption
,
centre
:
item
.
centre
,
centre
:
item
.
centre
,
rate
:
item
.
rate
rate
:
item
.
rate
,
centerId
:
item
.
centerId
};
};
this
.
nearshoppers
.
push
(
shopper
);
this
.
nearshoppers
.
push
(
shopper
);
});
});
...
...
src/global.scss
View file @
3d105682
...
@@ -417,7 +417,7 @@ app-deliverypop {
...
@@ -417,7 +417,7 @@ app-deliverypop {
}
}
app-success
{
app-success
{
padding
:
0px
!
important
;
padding
:
0px
!
important
;
}
}
.nav_header
{
.nav_header
{
...
@@ -665,3 +665,9 @@ ion-header {
...
@@ -665,3 +665,9 @@ ion-header {
--border-radius
:
4px
;
--border-radius
:
4px
;
--color
:
#fff
;
--color
:
#fff
;
}
}
.my-error
{
--background
:
rgb
(
212
,
43
,
38
);
--border-radius
:
4px
;
--color
:
#fff
;
}
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