Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
f0e4af94ed3ed69719f3e5028e4b7e0f7e3cc0d7
2 parents
34ee9166
98511717
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
25 deletions
static/js/product/newsale/newarrival.js
static/sass/_filter.scss
static/sass/product/_discount.scss
static/sass/product/_new-arrival.scss
template/m.yohobuy.com/actions/index/search/filter.phtml
template/m.yohobuy.com/actions/product/newsale/new.phtml
yohobuy/m.yohobuy.com/application/controllers/Search.php
static/js/product/newsale/newarrival.js
View file @
f0e4af9
...
...
@@ -272,7 +272,6 @@ $listNav.delegate('li', 'tap', function() {
$pre
.
removeClass
(
'active'
);
$this
.
addClass
(
'active'
);
filter
.
showFilter
();
}
}
else
{
...
...
static/sass/_filter.scss
View file @
f0e4af9
...
...
@@ -40,6 +40,7 @@
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
color
:
#333
;
}
.default
{
...
...
static/sass/product/_discount.scss
View file @
f0e4af9
...
...
@@ -23,7 +23,7 @@
.banner-top-single
{
width
:
100%
;
height
:
2
4
0rem
/
$pxConvertRem
;
height
:
2
0
0rem
/
$pxConvertRem
;
img
{
display
:
block
;
height
:
100%
;
...
...
static/sass/product/_new-arrival.scss
View file @
f0e4af9
.newarrival-page
{
background-color
:
#f
0f0f0
;
background-color
:
#f
ff
;
.swiper-container
{
width
:
100%
;
height
:
20
0rem
/
$pxConvertRem
;
height
:
31
0rem
/
$pxConvertRem
;
img
{
height
:
100%
;
...
...
@@ -32,6 +32,7 @@
}
.list-nav
{
border
:
1px
solid
#e6e6e6
;
>
li
{
float
:
left
;
width
:
25%
;
...
...
@@ -39,12 +40,13 @@
line-height
:
33px
;
text-align
:
center
;
font-size
:
14px
;
color
:
#999
;
}
a
{
display
:
block
;
display
:
inline-
block
;
box-sizing
:
border-box
;
width
:
100%
;
width
:
auto
;
height
:
100%
;
color
:
#999
;
}
...
...
@@ -52,15 +54,14 @@
.active
>
a
{
border-bottom
:
2px
solid
#000
;
color
:
#000
;
.iconfont
{
color
:
#999
;
box-sizing
:border-box
;
}
.active
>
.iconfont
{
color
:
#000
;
&
.cur
{
color
:
#000
;
}
}
}
.filter
.iconfont
{
font-size
:
12px
;
...
...
template/m.yohobuy.com/actions/index/search/filter.phtml
0 → 100644
View file @
f0e4af9
{
{>
filter
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/newsale/new.phtml
View file @
f0e4af9
...
...
@@ -22,8 +22,8 @@
<li
class=
"filter"
>
<a
href=
"javascript:void(0);"
>
筛选
<span
class=
"iconfont"
>
613
;</span>
</a>
<span
class=
"iconfont"
>
613
;</span>
</li>
</ul>
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
f0e4af9
...
...
@@ -203,20 +203,9 @@ class SearchController extends AbstractAction
// 转换排序方式
$page
=
$this
->
get
(
'page'
,
1
);
$order
=
$this
->
get
(
'order'
,
0
);
$order
Val
=
$this
->
get
(
'order'
,
0
);
$type
=
$this
->
get
(
'type'
,
''
);
switch
(
$type
)
{
case
'price'
:
$order
=
(
$order
==
0
)
?
's_p_desc'
:
's_p_asc'
;
break
;
case
'discount'
:
$order
=
(
$order
==
0
)
?
'p_d_desc'
:
'p_d_asc'
;
break
;
case
'newest'
:
default
:
$order
=
(
$order
==
0
)
?
's_t_desc'
:
's_t_asc'
;
break
;
}
$order
=
Helpers
::
transOrder
(
$orderVal
,
$type
);
$data
=
array
();
// 查询品类或品牌数据
...
...
@@ -258,6 +247,56 @@ class SearchController extends AbstractAction
}
/**
* Ajax异步获取筛选数据
* @return array 筛选数据
*/
public
function
filterAction
()
{
if
(
$this
->
isAjax
())
{
// 过滤请求参数
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'query'
=>
FILTER_DEFAULT
,
'brand'
=>
FILTER_VALIDATE_INT
,
'sort'
=>
FILTER_DEFAULT
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_VALIDATE_INT
,
'price'
=>
FILTER_VALIDATE_INT
,
'discount'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
if
(
isset
(
$condition
[
'sort'
]))
{
$condition
[
'sort'
]
=
rawurldecode
(
$condition
[
'sort'
]);
}
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
unset
(
$condition
[
'discount'
]);
}
if
(
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
$data
=
array
();
$listData
=
SearchData
::
searchByCondition
(
$condition
);
// 处理返回的数据
if
(
isset
(
$listData
[
'data'
])
&&
isset
(
$listData
[
'data'
][
'filter'
]))
{
$data
[
'filter'
]
=
ListProcess
::
getFilterData
(
$listData
[
'data'
][
'filter'
]);
}
$listData
=
array
();
if
(
empty
(
$data
))
{
echo
' '
;
}
else
{
$this
->
_view
->
display
(
'filter'
,
$data
);
}
}
else
{
echo
' '
;
}
}
/**
* 模糊搜索指定字符
*
* @return array 模糊搜索的结果
...
...
Please
register
or
login
to post a comment