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
d9635d89
Commit
d9635d89
authored
Nov 28, 2019
by
amalk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into amal
parents
412e6436
0ef467a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
27 deletions
+55
-27
productlist.page.html
src/app/productlist/productlist.page.html
+4
-6
productlist.page.ts
src/app/productlist/productlist.page.ts
+51
-21
No files found.
src/app/productlist/productlist.page.html
View file @
d9635d89
...
@@ -75,10 +75,8 @@
...
@@ -75,10 +75,8 @@
</div>
</div>
</ion-content>
</ion-content>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<div
class=
"search_item_list"
*
ngIf=
"searchShow"
[@
slideInOut
]
>
<ul
>
<ul
*
ngIf=
"searchService.searchList"
>
<li>
sample
</li>
<li
*
ngFor=
"let search of searchService.searchList"
(
click
)="
viewPage
(
search
)"
>
{{search.text}}
</li>
</ul>
</ul>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
src/app/productlist/productlist.page.ts
View file @
d9635d89
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'
;
import
{
SearchService
}
from
'./../../config/search.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%)'
}))
])
])
])
])
]
]
...
@@ -33,9 +34,10 @@ export class ProductlistPage implements OnInit {
...
@@ -33,9 +34,10 @@ export class ProductlistPage implements OnInit {
private
route
:
ActivatedRoute
,
private
route
:
ActivatedRoute
,
private
location
:
Location
,
private
location
:
Location
,
public
prodService
:
ProductsService
,
public
prodService
:
ProductsService
,
public
service
:
ServiceService
public
service
:
ServiceService
,
public
searchService
:
SearchService
)
{
)
{
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
);
...
@@ -72,7 +74,7 @@ export class ProductlistPage implements OnInit {
...
@@ -72,7 +74,7 @@ export class ProductlistPage implements OnInit {
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
;
}
}
...
@@ -82,10 +84,10 @@ export class ProductlistPage implements OnInit {
...
@@ -82,10 +84,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
);
...
@@ -103,6 +105,34 @@ export class ProductlistPage implements OnInit {
...
@@ -103,6 +105,34 @@ 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'
;
}
searchFun
(
data
:
string
)
{
this
.
searchService
.
search
(
data
);
}
viewPage
(
datas
:
any
)
{
console
.
log
(
datas
);
let
data
;
let
url
;
if
(
datas
.
type
===
'shopper'
)
{
data
=
datas
.
data
;
this
.
service
.
set
(
'params'
,
data
);
url
=
'productlist'
;
}
else
if
(
datas
.
type
===
'category'
)
{
data
=
datas
.
data
;
this
.
service
.
set
(
'params'
,
data
);
url
=
'catstorelist'
;
}
else
{
data
=
datas
.
data
;
data
.
size
=
this
.
service
.
splitSep
(
data
.
size
);
data
.
tag
=
this
.
service
.
splitSep
(
data
.
tag
);
(
data
.
color
=
this
.
service
.
splitSep
(
data
.
color
)),
(
url
=
'productdetail'
);
this
.
prodService
.
setProd
(
data
);
}
this
.
searchClose
();
this
.
router
.
navigateByUrl
(
url
,
{
queryParams
:
data
});
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
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