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
4d6515bd
Commit
4d6515bd
authored
Nov 22, 2019
by
amalk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
22-11-2019
parent
9de87a4e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
254 additions
and
153 deletions
+254
-153
app-routing.module.ts
src/app/app-routing.module.ts
+95
-34
catstorelist.page.html
src/app/catstorelist/catstorelist.page.html
+9
-1
catstorelist.page.ts
src/app/catstorelist/catstorelist.page.ts
+33
-14
home.page.scss
src/app/home/home.page.scss
+2
-34
home.page.ts
src/app/home/home.page.ts
+41
-48
productlist.page.html
src/app/productlist/productlist.page.html
+10
-1
productlist.page.ts
src/app/productlist/productlist.page.ts
+29
-21
searchmodal.page.html
src/app/searchmodal/searchmodal.page.html
+2
-0
global.scss
src/global.scss
+33
-0
No files found.
src/app/app-routing.module.ts
View file @
4d6515bd
import
{
NgModule
}
from
'@angular/core'
;
import
{
NgModule
}
from
"@angular/core"
;
import
{
PreloadAllModules
,
RouterModule
,
Routes
}
from
'@angular/router'
;
import
{
PreloadAllModules
,
RouterModule
,
Routes
}
from
"@angular/router"
;
const
routes
:
Routes
=
[
const
routes
:
Routes
=
[
{
{
path
:
''
,
loadChildren
:
'./landing/landing.module#LandingPageModule'
path
:
""
,
},
loadChildren
:
"./landing/landing.module#LandingPageModule"
{
path
:
'tabs'
,
loadChildren
:
'./tabs/tabs.module#TabsPageModule'
},
},
{
path
:
'login'
,
loadChildren
:
'./login/login.module#LoginPageModule'
},
{
path
:
"tabs"
,
loadChildren
:
"./tabs/tabs.module#TabsPageModule"
},
{
path
:
'signup'
,
loadChildren
:
'./signup/signup.module#SignupPageModule'
},
{
path
:
"login"
,
loadChildren
:
"./login/login.module#LoginPageModule"
},
{
path
:
'verification'
,
loadChildren
:
'./verification/verification.module#VerificationPageModule'
},
{
path
:
"signup"
,
loadChildren
:
"./signup/signup.module#SignupPageModule"
},
{
path
:
'forgot'
,
loadChildren
:
'./forgot/forgot.module#ForgotPageModule'
},
{
{
path
:
'changepass'
,
loadChildren
:
'./changepass/changepass.module#ChangepassPageModule'
},
path
:
"verification"
,
{
path
:
'orderdelivered'
,
loadChildren
:
'./orderdelivered/orderdelivered.module#OrderdeliveredPageModule'
},
loadChildren
:
"./verification/verification.module#VerificationPageModule"
{
path
:
'orderplaced'
,
loadChildren
:
'./orderplaced/orderplaced.module#OrderplacedPageModule'
},
},
{
path
:
'ordercancelled'
,
loadChildren
:
'./ordercancelled/ordercancelled.module#OrdercancelledPageModule'
},
{
path
:
"forgot"
,
loadChildren
:
"./forgot/forgot.module#ForgotPageModule"
},
{
path
:
'myorder'
,
loadChildren
:
'./myorder/myorder.module#MyorderPageModule'
},
{
{
path
:
'cart'
,
loadChildren
:
'./cart/cart.module#CartPageModule'
},
path
:
"changepass"
,
{
path
:
'changedetails'
,
loadChildren
:
'./changedetails/changedetails.module#ChangedetailsPageModule'
},
loadChildren
:
"./changepass/changepass.module#ChangepassPageModule"
{
path
:
'wishlist'
,
loadChildren
:
'./wishlist/wishlist.module#WishlistPageModule'
},
},
{
path
:
'addaddresss'
,
loadChildren
:
'./addaddresss/addaddresss.module#AddaddresssPageModule'
},
{
{
path
:
'profile'
,
loadChildren
:
'./profile/profile.module#ProfilePageModule'
},
path
:
"orderdelivered"
,
{
path
:
'home'
,
loadChildren
:
'./home/home.module#HomePageModule'
},
loadChildren
:
{
path
:
'productlist'
,
loadChildren
:
'./productlist/productlist.module#ProductlistPageModule'
},
"./orderdelivered/orderdelivered.module#OrderdeliveredPageModule"
{
path
:
'productdetail'
,
loadChildren
:
'./productdetail/productdetail.module#ProductdetailPageModule'
},
},
{
path
:
'reviewlist'
,
loadChildren
:
'./reviewlist/reviewlist.module#ReviewlistPageModule'
},
{
{
path
:
'catagory'
,
loadChildren
:
'./catagory/catagory.module#CatagoryPageModule'
},
path
:
"orderplaced"
,
{
path
:
'trackorder'
,
loadChildren
:
'./trackorder/trackorder.module#TrackorderPageModule'
},
loadChildren
:
"./orderplaced/orderplaced.module#OrderplacedPageModule"
{
path
:
'storelist'
,
loadChildren
:
'./storelist/storelist.module#StorelistPageModule'
},
},
{
path
:
'catstorelist'
,
loadChildren
:
'./catstorelist/catstorelist.module#CatStorelistPageModule'
},
{
{
path
:
'nearby'
,
loadChildren
:
'./nearby/nearby.module#NearbyPageModule'
},
path
:
"ordercancelled"
,
{
path
:
'review'
,
loadChildren
:
'./review/review.module#ReviewPageModule'
},
loadChildren
:
{
path
:
'delivery'
,
loadChildren
:
'./delivery/delivery.module#DeliveryPageModule'
},
"./ordercancelled/ordercancelled.module#OrdercancelledPageModule"
{
path
:
'addcard'
,
loadChildren
:
'./addcard/addcard.module#AddcardPageModule'
},
{
path
:
'searchmodal'
,
loadChildren
:
'./searchmodal/searchmodal.module#SearchmodalPageModule'
}
},
{
path
:
"myorder"
,
loadChildren
:
"./myorder/myorder.module#MyorderPageModule"
},
{
path
:
"cart"
,
loadChildren
:
"./cart/cart.module#CartPageModule"
},
{
path
:
"changedetails"
,
loadChildren
:
"./changedetails/changedetails.module#ChangedetailsPageModule"
},
{
path
:
"wishlist"
,
loadChildren
:
"./wishlist/wishlist.module#WishlistPageModule"
},
{
path
:
"addaddresss"
,
loadChildren
:
"./addaddresss/addaddresss.module#AddaddresssPageModule"
},
{
path
:
"profile"
,
loadChildren
:
"./profile/profile.module#ProfilePageModule"
},
{
path
:
"home"
,
loadChildren
:
"./home/home.module#HomePageModule"
},
{
path
:
"productlist"
,
loadChildren
:
"./productlist/productlist.module#ProductlistPageModule"
},
{
path
:
"productdetail"
,
loadChildren
:
"./productdetail/productdetail.module#ProductdetailPageModule"
},
{
path
:
"reviewlist"
,
loadChildren
:
"./reviewlist/reviewlist.module#ReviewlistPageModule"
},
{
path
:
"catagory"
,
loadChildren
:
"./catagory/catagory.module#CatagoryPageModule"
},
{
path
:
"trackorder"
,
loadChildren
:
"./trackorder/trackorder.module#TrackorderPageModule"
},
{
path
:
"storelist"
,
loadChildren
:
"./storelist/storelist.module#StorelistPageModule"
},
{
path
:
"catstorelist"
,
loadChildren
:
"./catstorelist/catstorelist.module#CatStorelistPageModule"
},
{
path
:
"nearby"
,
loadChildren
:
"./nearby/nearby.module#NearbyPageModule"
},
{
path
:
"review"
,
loadChildren
:
"./review/review.module#ReviewPageModule"
},
{
path
:
"delivery"
,
loadChildren
:
"./delivery/delivery.module#DeliveryPageModule"
},
{
path
:
"addcard"
,
loadChildren
:
"./addcard/addcard.module#AddcardPageModule"
},
{
path
:
"searchmodal"
,
loadChildren
:
"./searchmodal/searchmodal.module#SearchmodalPageModule"
}
];
];
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
...
src/app/catstorelist/catstorelist.page.html
View file @
4d6515bd
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<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
class=
"search_bar"
placeholder=
"Search here.. eg:shirts, retailers etc..."
>
</div>
<input
class=
"search_bar"
placeholder=
"Search here.. eg:shirts, retailers etc..."
(
click
)="
clickSearch
()"
>
</div>
<button
class=
"nav_btn nav_search floatRight"
>
<button
class=
"nav_btn nav_search floatRight"
>
</button>
</button>
<div
class=
"clear"
></div>
<div
class=
"clear"
></div>
...
@@ -51,3 +52,9 @@
...
@@ -51,3 +52,9 @@
</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.ts
View file @
4d6515bd
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
"@angular/core"
;
import
{
Router
}
from
'@angular/router'
;
import
{
Router
}
from
"@angular/router"
;
import
{
Location
}
from
'@angular/common'
;
import
{
Location
}
from
"@angular/common"
;
import
{
ServiceService
}
from
'./../../config/service.service'
;
import
{
ServiceService
}
from
"./../../config/service.service"
;
import
{
ShoppersService
}
from
'./../../config/shopper.service'
;
import
{
ShoppersService
}
from
"./../../config/shopper.service"
;
import
{
trigger
,
transition
,
animate
,
style
}
from
"@angular/animations"
;
@
Component
({
@
Component
({
selector
:
'app-catstorelist'
,
selector
:
"app-catstorelist"
,
templateUrl
:
'./catstorelist.page.html'
,
templateUrl
:
"./catstorelist.page.html"
,
styleUrls
:
[
'./catstorelist.page.scss'
],
styleUrls
:
[
"./catstorelist.page.scss"
],
animations
:
[
trigger
(
"slideInOut"
,
[
transition
(
":enter"
,
[
style
({
transform
:
"translateY(100%)"
}),
animate
(
"200ms ease-in"
,
style
({
transform
:
"translateY(0%)"
}))
]),
transition
(
":leave"
,
[
animate
(
"200ms ease-out"
,
style
({
transform
:
"translateY(100%)"
}))
])
])
]
})
})
export
class
CatStorelistPage
implements
OnInit
{
export
class
CatStorelistPage
implements
OnInit
{
searchShow
=
false
;
slideOpts
=
{
slideOpts
=
{
slidesPerView
:
1.5
slidesPerView
:
1.5
};
};
data
:
any
;
data
:
any
;
clickSearch
()
{
this
.
searchShow
=
true
;
}
searchClose
()
{
this
.
searchShow
=
false
;
}
constructor
(
constructor
(
public
router
:
Router
,
public
router
:
Router
,
public
location
:
Location
,
public
location
:
Location
,
public
service
:
ServiceService
,
public
service
:
ServiceService
,
public
shopperService
:
ShoppersService
,
public
shopperService
:
ShoppersService
)
{
)
{
this
.
service
.
get
(
'params'
).
then
((
val
)
=>
{
this
.
service
.
get
(
"params"
).
then
(
val
=>
{
this
.
data
=
val
;
this
.
data
=
val
;
this
.
shopperService
.
shopperList
(
this
.
data
.
catId
,
'catId'
);
this
.
shopperService
.
shopperList
(
this
.
data
.
catId
,
"catId"
);
});
});
}
}
ngOnInit
()
{}
ngOnInit
()
{}
goToPage
(
path
,
data
=
null
)
{
goToPage
(
path
,
data
=
null
)
{
this
.
service
.
set
(
'params'
,
data
);
this
.
service
.
set
(
"params"
,
data
);
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
...
@@ -39,5 +59,4 @@ export class CatStorelistPage implements OnInit {
...
@@ -39,5 +59,4 @@ export class CatStorelistPage implements OnInit {
goBack
()
{
goBack
()
{
this
.
location
.
back
();
this
.
location
.
back
();
}
}
}
}
src/app/home/home.page.scss
View file @
4d6515bd
...
@@ -267,7 +267,7 @@
...
@@ -267,7 +267,7 @@
margin
:
0px
;
margin
:
0px
;
padding
:
0px
;
padding
:
0px
;
color
:
rgba
(
176
,
174
,
199
,
1
);
color
:
rgba
(
176
,
174
,
199
,
1
);
padding-top
:
5px
;
padding-top
:
5px
;
padding-bottom
:
5px
;
padding-bottom
:
5px
;
}
}
.styled-checkbox
{
.styled-checkbox
{
...
@@ -321,35 +321,3 @@
...
@@ -321,35 +321,3 @@
}
}
}
}
}
}
\ No newline at end of file
.search_item_list
{
position
:
absolute
;
background-color
:
#fff
;
left
:
0px
;
right
:
0px
;
width
:
100%
;
margin
:
0px
;
top
:
50px
;
bottom
:
0px
;
z-index
:
99
;
ul
{
margin
:
0px
;
padding
:
0px
;
li
{
list-style
:
none
;
color
:
rgba
(
59
,
57
,
77
,
1
);
text-align
:
left
;
list-style
:
none
;
padding
:
10px
;
border-bottom
:
1px
solid
#ddd
;
&
:hover
{
background-color
:
rgba
(
59
,
57
,
77
,
1
);
color
:
#fff
;
}
&
:focus
{
background-color
:
rgba
(
59
,
57
,
77
,
1
);
color
:
#fff
;
}
}
}
}
\ No newline at end of file
src/app/home/home.page.ts
View file @
4d6515bd
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
"@angular/core"
;
import
{
Location
}
from
'@angular/common'
;
import
{
Location
}
from
"@angular/common"
;
import
{
trigger
,
transition
,
animate
,
style
}
from
'@angular/animations'
;
import
{
trigger
,
transition
,
animate
,
style
}
from
"@angular/animations"
;
import
{
MapsAPILoader
,
MouseEvent
}
from
'@agm/core'
;
import
{
MapsAPILoader
,
MouseEvent
}
from
"@agm/core"
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
Router
,
ActivatedRoute
}
from
"@angular/router"
;
import
{
MenuController
}
from
'@ionic/angular'
;
import
{
MenuController
}
from
"@ionic/angular"
;
import
{
CenterService
}
from
'./../../config/center.service'
;
import
{
CenterService
}
from
"./../../config/center.service"
;
import
{
ShoppersService
}
from
'./../../config/shopper.service'
;
import
{
ShoppersService
}
from
"./../../config/shopper.service"
;
import
{
CategoriesService
}
from
'./../../config/category.service'
;
import
{
CategoriesService
}
from
"./../../config/category.service"
;
import
{
ServiceService
}
from
'./../../config/service.service'
;
import
{
ServiceService
}
from
"./../../config/service.service"
;
import
{
AddressService
}
from
'./../../config/address.service'
;
import
{
AddressService
}
from
"./../../config/address.service"
;
import
{
SearchService
}
from
'./../../config/search.service'
;
import
{
SearchService
}
from
"./../../config/search.service"
;
import
{
ProductsService
}
from
'./../../config/products.service'
;
import
{
ProductsService
}
from
"./../../config/products.service"
;
import
{
from
}
from
'rxjs'
;
import
{
from
}
from
"rxjs"
;
import
{
ModalController
}
from
'@ionic/angular'
;
import
{
ModalController
}
from
"@ionic/angular"
;
@
Component
({
@
Component
({
selector
:
'app-home'
,
selector
:
"app-home"
,
templateUrl
:
'./home.page.html'
,
templateUrl
:
"./home.page.html"
,
styleUrls
:
[
'./home.page.scss'
],
styleUrls
:
[
"./home.page.scss"
],
animations
:
[
animations
:
[
trigger
(
'slideInOut'
,
[
trigger
(
"slideInOut"
,
[
transition
(
':enter'
,
[
transition
(
":enter"
,
[
style
({
transform
:
'translateY(100%)'
}),
style
({
transform
:
"translateY(100%)"
}),
animate
(
'200ms ease-in'
,
style
({
transform
:
'translateY(0%)'
}))
animate
(
"200ms ease-in"
,
style
({
transform
:
"translateY(0%)"
}))
]),
]),
transition
(
':leave'
,
[
transition
(
":leave"
,
[
animate
(
'200ms ease-out'
,
style
({
transform
:
'translateY(100%)'
}))
animate
(
"200ms ease-out"
,
style
({
transform
:
"translateY(100%)"
}))
])
])
])
])
]
]
})
})
export
class
HomePage
implements
OnInit
{
export
class
HomePage
implements
OnInit
{
isShow
=
false
;
isShow
=
false
;
searchShow
=
false
;
searchShow
=
false
;
...
@@ -58,8 +56,7 @@ export class HomePage implements OnInit {
...
@@ -58,8 +56,7 @@ export class HomePage implements OnInit {
private
mapsAPILoader
:
MapsAPILoader
,
private
mapsAPILoader
:
MapsAPILoader
,
private
searchService
:
SearchService
,
private
searchService
:
SearchService
,
private
productsService
:
ProductsService
private
productsService
:
ProductsService
)
{
)
{}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
mapsAPILoader
.
load
().
then
(()
=>
{
this
.
mapsAPILoader
.
load
().
then
(()
=>
{
...
@@ -67,7 +64,7 @@ export class HomePage implements OnInit {
...
@@ -67,7 +64,7 @@ export class HomePage implements OnInit {
this
.
geoCoder
=
new
google
.
maps
.
Geocoder
();
this
.
geoCoder
=
new
google
.
maps
.
Geocoder
();
});
});
this
.
menuCtrl
.
enable
(
true
);
this
.
menuCtrl
.
enable
(
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
;
...
@@ -77,7 +74,7 @@ export class HomePage implements OnInit {
...
@@ -77,7 +74,7 @@ export class HomePage implements OnInit {
}
}
private
setCurrentLocation
()
{
private
setCurrentLocation
()
{
if
(
'geolocation'
in
navigator
)
{
if
(
"geolocation"
in
navigator
)
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
navigator
.
geolocation
.
getCurrentPosition
(
position
=>
{
this
.
lat
=
position
.
coords
.
latitude
;
this
.
lat
=
position
.
coords
.
latitude
;
this
.
lng
=
position
.
coords
.
longitude
;
this
.
lng
=
position
.
coords
.
longitude
;
...
@@ -92,16 +89,16 @@ export class HomePage implements OnInit {
...
@@ -92,16 +89,16 @@ export class HomePage implements OnInit {
(
results
,
status
)
=>
{
(
results
,
status
)
=>
{
console
.
log
(
results
);
console
.
log
(
results
);
console
.
log
(
status
);
console
.
log
(
status
);
if
(
status
===
'OK'
)
{
if
(
status
===
"OK"
)
{
if
(
results
[
0
])
{
if
(
results
[
0
])
{
const
addressData
=
results
[
0
].
formatted_address
.
split
(
', '
);
const
addressData
=
results
[
0
].
formatted_address
.
split
(
", "
);
this
.
address
=
addressData
[
0
]
+
', '
+
addressData
[
1
];
this
.
address
=
addressData
[
0
]
+
", "
+
addressData
[
1
];
console
.
log
(
this
.
address
);
console
.
log
(
this
.
address
);
}
else
{
}
else
{
window
.
alert
(
'No results found'
);
window
.
alert
(
"No results found"
);
}
}
}
else
{
}
else
{
window
.
alert
(
'Geocoder failed due to: '
+
status
);
window
.
alert
(
"Geocoder failed due to: "
+
status
);
}
}
}
}
);
);
...
@@ -120,15 +117,13 @@ export class HomePage implements OnInit {
...
@@ -120,15 +117,13 @@ export class HomePage implements OnInit {
this
.
searchShow
=
false
;
this
.
searchShow
=
false
;
}
}
ionViewWillEnter
()
{
ionViewWillEnter
()
{
this
.
menuCtrl
.
enable
(
true
);
this
.
menuCtrl
.
enable
(
true
);
}
}
goToPage
(
path
,
data
=
null
)
{
goToPage
(
path
,
data
=
null
)
{
console
.
log
(
data
);
console
.
log
(
data
);
this
.
service
.
set
(
'params'
,
data
);
this
.
service
.
set
(
"params"
,
data
);
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
this
.
router
.
navigateByUrl
(
path
,
{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
...
@@ -145,24 +140,23 @@ export class HomePage implements OnInit {
...
@@ -145,24 +140,23 @@ export class HomePage implements OnInit {
console
.
log
(
datas
);
console
.
log
(
datas
);
let
data
;
let
data
;
let
url
;
let
url
;
if
(
datas
.
type
===
'shopper'
)
{
if
(
datas
.
type
===
"shopper"
)
{
data
=
datas
.
data
;
data
=
datas
.
data
;
this
.
service
.
set
(
'params'
,
data
);
this
.
service
.
set
(
"params"
,
data
);
url
=
'productlist'
;
url
=
"productlist"
;
}
else
if
(
datas
.
type
===
'category'
)
{
}
else
if
(
datas
.
type
===
"category"
)
{
data
=
datas
.
data
;
data
=
datas
.
data
;
this
.
service
.
set
(
'params'
,
data
);
this
.
service
.
set
(
"params"
,
data
);
url
=
'catstorelist'
;
url
=
"catstorelist"
;
}
else
{
}
else
{
data
=
datas
.
data
;
data
=
datas
.
data
;
data
.
size
=
this
.
service
.
splitSep
(
data
.
size
);
data
.
size
=
this
.
service
.
splitSep
(
data
.
size
);
data
.
tag
=
this
.
service
.
splitSep
(
data
.
tag
);
data
.
tag
=
this
.
service
.
splitSep
(
data
.
tag
);
data
.
color
=
this
.
service
.
splitSep
(
data
.
color
),
(
data
.
color
=
this
.
service
.
splitSep
(
data
.
color
)),
(
url
=
"productdetail"
);
url
=
'productdetail'
;
this
.
productsService
.
setProd
(
data
);
this
.
productsService
.
setProd
(
data
);
}
}
this
.
searchClose
();
this
.
searchClose
();
this
.
router
.
navigateByUrl
(
url
,
{
queryParams
:
data
});
this
.
router
.
navigateByUrl
(
url
,
{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
...
@@ -170,4 +164,3 @@ export class HomePage implements OnInit {
...
@@ -170,4 +164,3 @@ export class HomePage implements OnInit {
this
.
searchService
.
search
(
data
);
this
.
searchService
.
search
(
data
);
}
}
}
}
src/app/productlist/productlist.page.html
View file @
4d6515bd
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
<img
src=
"../assets/Group17_2.png"
>
<img
src=
"../assets/Group17_2.png"
>
</button>
</button>
<div
class=
"nav_title floatLeft"
>
<div
class=
"nav_title floatLeft"
>
<input
class=
"search_bar"
placeholder=
"Search here.. eg:shirts, retailers etc..."
>
</div>
<input
class=
"search_bar"
placeholder=
"Search here.. eg:shirts, retailers etc..."
(
click
)="
clickSearch
()"
>
</div>
<button
class=
"nav_btn nav_search floatRight"
>
<button
class=
"nav_btn nav_search floatRight"
>
<img
src=
"../assets/search_2.png"
>
<img
src=
"../assets/search_2.png"
>
</button>
</button>
...
@@ -73,3 +74,10 @@
...
@@ -73,3 +74,10 @@
</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/productlist/productlist.page.ts
View file @
4d6515bd
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
"@angular/core"
;
import
{
Location
}
from
'@angular/common'
;
import
{
Location
}
from
"@angular/common"
;
import
{
trigger
,
transition
,
animate
,
style
}
from
'@angular/animations'
;
import
{
trigger
,
transition
,
animate
,
style
}
from
"@angular/animations"
;
import
{
Router
,
ActivatedRoute
,
NavigationExtras
}
from
'@angular/router'
;
import
{
Router
,
ActivatedRoute
,
NavigationExtras
}
from
"@angular/router"
;
import
{
ProductsService
}
from
'./../../config/products.service'
;
import
{
ProductsService
}
from
"./../../config/products.service"
;
import
{
ServiceService
}
from
'./../../config/service.service'
;
import
{
ServiceService
}
from
"./../../config/service.service"
;
@
Component
({
@
Component
({
selector
:
'app-productlist'
,
selector
:
"app-productlist"
,
templateUrl
:
'./productlist.page.html'
,
templateUrl
:
"./productlist.page.html"
,
styleUrls
:
[
'./productlist.page.scss'
],
styleUrls
:
[
"./productlist.page.scss"
],
animations
:
[
animations
:
[
trigger
(
'slideInOut'
,
[
trigger
(
"slideInOut"
,
[
transition
(
':enter'
,
[
transition
(
":enter"
,
[
style
({
transform
:
'translateY(100%)'
}),
style
({
transform
:
"translateY(100%)"
}),
animate
(
'200ms ease-in'
,
style
({
transform
:
'translateY(0%)'
}))
animate
(
"200ms ease-in"
,
style
({
transform
:
"translateY(0%)"
}))
]),
]),
transition
(
':leave'
,
[
transition
(
":leave"
,
[
animate
(
'200ms ease-out'
,
style
({
transform
:
'translateY(100%)'
}))
animate
(
"200ms ease-out"
,
style
({
transform
:
"translateY(100%)"
}))
])
])
])
])
]
]
})
})
export
class
ProductlistPage
implements
OnInit
{
export
class
ProductlistPage
implements
OnInit
{
onGrid
=
false
;
onGrid
=
false
;
isShow
=
false
;
isShow
=
false
;
data
:
any
;
data
:
any
;
searchShow
=
false
;
sortValue
:
string
;
sortValue
:
string
;
constructor
(
constructor
(
...
@@ -35,7 +35,7 @@ export class ProductlistPage implements OnInit {
...
@@ -35,7 +35,7 @@ export class ProductlistPage implements OnInit {
public
prodService
:
ProductsService
,
public
prodService
:
ProductsService
,
public
service
:
ServiceService
public
service
:
ServiceService
)
{
)
{
this
.
service
.
get
(
'params'
).
then
((
val
)
=>
{
this
.
service
.
get
(
"params"
).
then
(
val
=>
{
this
.
data
=
val
;
this
.
data
=
val
;
console
.
log
(
this
.
data
);
console
.
log
(
this
.
data
);
this
.
prodService
.
prodList
(
this
.
data
.
uid
);
this
.
prodService
.
prodList
(
this
.
data
.
uid
);
...
@@ -62,9 +62,17 @@ export class ProductlistPage implements OnInit {
...
@@ -62,9 +62,17 @@ export class ProductlistPage implements OnInit {
this
.
onGrid
=
!
this
.
onGrid
;
this
.
onGrid
=
!
this
.
onGrid
;
}
}
clickSearch
()
{
this
.
searchShow
=
true
;
}
searchClose
()
{
this
.
searchShow
=
false
;
}
prodDetails
(
index
:
number
)
{
prodDetails
(
index
:
number
)
{
this
.
prodService
.
setProd
(
this
.
prodService
.
product
[
index
]);
this
.
prodService
.
setProd
(
this
.
prodService
.
product
[
index
]);
this
.
router
.
navigateByUrl
(
'productdetail'
);
this
.
router
.
navigateByUrl
(
"productdetail"
);
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
}
}
...
@@ -74,10 +82,10 @@ export class ProductlistPage implements OnInit {
...
@@ -74,10 +82,10 @@ export class ProductlistPage implements OnInit {
console
.
log
(
this
.
prodService
.
fav
);
console
.
log
(
this
.
prodService
.
fav
);
if
(
state
>
-
1
)
{
if
(
state
>
-
1
)
{
this
.
prodService
.
fav
.
splice
(
state
,
1
);
this
.
prodService
.
fav
.
splice
(
state
,
1
);
this
.
prodService
.
changeFav
(
index
,
'yes'
);
this
.
prodService
.
changeFav
(
index
,
"yes"
);
}
else
{
}
else
{
this
.
prodService
.
fav
.
push
(
index
);
this
.
prodService
.
fav
.
push
(
index
);
this
.
prodService
.
changeFav
(
index
,
'no'
);
this
.
prodService
.
changeFav
(
index
,
"no"
);
}
}
return
;
return
;
console
.
log
(
this
.
prodService
.
fav
);
console
.
log
(
this
.
prodService
.
fav
);
...
@@ -95,6 +103,6 @@ export class ProductlistPage implements OnInit {
...
@@ -95,6 +103,6 @@ export class ProductlistPage implements OnInit {
checkFavStatus
(
index
)
{
checkFavStatus
(
index
)
{
const
state
=
this
.
prodService
.
fav
.
findIndex
(
x
=>
x
===
index
);
const
state
=
this
.
prodService
.
fav
.
findIndex
(
x
=>
x
===
index
);
return
state
>
-
1
?
'fav_fill'
:
'fav_icon'
;
return
state
>
-
1
?
"fav_fill"
:
"fav_icon"
;
}
}
}
}
src/app/searchmodal/searchmodal.page.html
View file @
4d6515bd
<h1>
Search modal
</h1>
\ No newline at end of file
src/global.scss
View file @
4d6515bd
...
@@ -622,3 +622,35 @@ ion-header {
...
@@ -622,3 +622,35 @@ ion-header {
}
}
}
}
}
}
.search_item_list
{
position
:
absolute
;
background-color
:
#fff
;
left
:
0px
;
right
:
0px
;
width
:
100%
;
margin
:
0px
;
top
:
50px
;
bottom
:
0px
;
z-index
:
99
;
ul
{
margin
:
0px
;
padding
:
0px
;
li
{
list-style
:
none
;
color
:
rgba
(
59
,
57
,
77
,
1
);
text-align
:
left
;
list-style
:
none
;
padding
:
10px
;
border-bottom
:
1px
solid
#ddd
;
&
:hover
{
background-color
:
rgba
(
59
,
57
,
77
,
1
);
color
:
#fff
;
}
&
:focus
{
background-color
:
rgba
(
59
,
57
,
77
,
1
);
color
:
#fff
;
}
}
}
}
\ No newline at end of file
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