Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
054dc3e9a72dc2cfa055aaa077e5696ddb48062b
2 parents
0b5a591f
fbb159a7
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
53 deletions
library/LibModels/Web/Product/SearchData.php
library/Plugin/HelperSearch.php
web-static/js/product/filter.js
web-static/sass/product/_filter-box.scss
web-static/sass/product/_index.scss
web-static/sass/product/_sort-pager.scss
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
library/LibModels/Web/Product/SearchData.php
View file @
054dc3e
...
...
@@ -19,12 +19,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData
case
'release'
:
if
(
$type
==
'sort'
){
return
'http://100.98.132.63/yohosearch/sortgroup.json'
;
}
elseif
(
$type
==
'discount'
){
return
'http://100.98.132.63/yohosearch/discount.json'
;
}
elseif
(
$type
==
'recent'
){
return
'http://100.98.132.63/yohosearch/recent.json'
;
}
elseif
(
$type
==
'review'
){
}
elseif
(
$type
==
'suggest'
){
return
'http://100.98.132.63/yohosearch/suggest.json'
;
}
return
'http://100.98.132.63/yohosearch/search.json'
;
case
'test'
:
...
...
@@ -34,14 +31,10 @@ class SearchData extends \LibModels\Wap\Product\SearchData
if
(
$type
==
'sort'
){
return
'http://101.200.31.165/yohosearch/sortgroup.json'
;
}
elseif
(
$type
==
'discount'
){
return
'http://101.200.31.165/yohosearch/discount.json'
;
}
elseif
(
$type
==
'recent'
){
return
'http://101.200.31.165/yohosearch/recent.json'
;
}
elseif
(
$type
==
'review'
){
return
'http://itemapi.yohobuy.com/item/item/recentreview'
;
elseif
(
$type
==
'suggest'
){
return
'http://101.200.31.165/yohosearch/suggest.json'
;
}
return
'http://101.200.31.165/yohosearch/search.json'
;
}
}
...
...
@@ -116,36 +109,19 @@ class SearchData extends \LibModels\Wap\Product\SearchData
}
/**
* 获取折扣区间
*/
public
static
function
getDiscount
(){
return
Yohobuy
::
get
(
self
::
getUrl
(
'discount'
));
}
/**
* 获取最新上架
*/
public
static
function
recentShelve
(){
return
Yohobuy
::
get
(
self
::
getUrl
(
'recent'
));
}
/**
* 搜索品牌店铺信息
* @param array $params 参数
* 获取搜索提示
* @param $param
* @param $cache
* @return array
*/
public
static
function
getShop
(
array
$params
)
{
return
Yohobuy
::
get
(
self
::
$shopsUrl
,
$params
);
}
/**
* 获取最近浏览记录
* @param int $limit
* @return json
*/
public
static
function
getRecentReview
(
$limit
=
0
)
public
static
function
getSuggest
(
$param
,
$cache
=
false
)
{
if
(
empty
(
$param
[
'query'
]))
{
return
array
();
}
if
(
empty
(
$param
[
'size'
]))
{
$param
[
'size'
]
=
10
;
}
return
Yohobuy
::
get
(
self
::
getUrl
(
'suggest'
),
$param
,
$cache
);
}
}
\ No newline at end of file
...
...
library/Plugin/HelperSearch.php
View file @
054dc3e
...
...
@@ -121,7 +121,7 @@ class HelperSearch
//品牌店铺信息
$result
[
'shopEntry'
]
=
isset
(
$data
[
'shop'
])
&&
!
empty
(
$data
[
'shop'
])
?
self
::
shop
(
$data
[
'shop'
],
$data
[
'sort'
][
'sort'
])
:
array
();
//分页
$result
[
'pager'
]
=
self
::
pager
(
$result
[
'totalCount'
],
$options
[
'viewNum'
]);
$result
[
'pager'
]
=
self
::
pager
(
$result
[
'totalCount'
],
$options
[
'viewNum'
]
-
1
);
//选中条件
if
(
self
::
getSelected
())
{
$result
[
'filters'
][
'checkedConditions'
][
'conditions'
]
=
self
::
getSelected
();
...
...
web-static/js/product/filter.js
View file @
054dc3e
...
...
@@ -18,7 +18,7 @@ moreUnicode = {
//品牌相关变量
var
$brandDefault
=
$
(
'.brand .default'
),
$brandPanel
=
$
(
'.brand .brand-panel'
),
$brandAttrs
=
$
(
'.brand
.attr'
),
$brandAttrs
=
$
brandPanel
.
find
(
'
.attr'
),
$brandMore
=
$
(
'#brand-more'
),
$brandMulti
=
$
(
'#brand-multi'
);
...
...
web-static/sass/product/_filter-box.scss
View file @
054dc3e
...
...
@@ -55,6 +55,10 @@
-moz-user-select
:
none
;
}
.color
.attr
{
margin-right
:
0
;
}
.checked-conditions
{
line-height
:
30px
;
...
...
@@ -85,6 +89,10 @@
color
:
#999
;
float
:
right
;
}
.close
{
font-size
:
14px
;
}
}
.sort-pre
.active
.attr
{
...
...
@@ -163,7 +171,7 @@
margin-right
:
5px
;
span
{
margin
:
0
2
px
;
margin
:
0
3
px
;
cursor
:
pointer
;
-moz-user-select
:
none
;
...
...
@@ -190,9 +198,12 @@
}
.btn
{
position
:
relative
;
display
:
inline-block
;
top
:
-1px
;
width
:
55px
;
height
:
18px
;
height
:
20px
;
line-height
:
20px
;
background
:
#3a3a3a
;
color
:
#fff
;
text-align
:
center
;
...
...
@@ -230,8 +241,8 @@
border
:
none
;
background
:
#000
;
color
:
#fff
;
font-size
:
15px
;
margin-right
:
15px
;
font-size
:
14px
;
margin-right
:
20px
;
cursor
:
pointer
;
&
.dis
{
...
...
@@ -335,9 +346,19 @@
.checkbox
{
display
:
none
;
float
:
left
;
}
.multi
.checkbox
{
display
:
inline
;
display
:
block
;
color
:
#ccc
;
font-size
:
12px
;
margin-right
:
3px
;
}
}
@media
(
max-width
:
1180px
)
{
.filter-box
.brand
.attr
{
width
:
25%
;
}
}
\ No newline at end of file
...
...
web-static/sass/product/_index.scss
View file @
054dc3e
...
...
@@ -45,10 +45,6 @@
}
}
.panel-body
.attr
{
width
:
25%
;
}
.filter-box
.brand
.attr-content
{
max-width
:
730px
;
}
...
...
web-static/sass/product/_sort-pager.scss
View file @
054dc3e
...
...
@@ -6,7 +6,7 @@
.sort-type
,
.checks
{
color
:
#
ccc
;
color
:
#
999
;
font-size
:
12px
;
padding
:
0
10px
;
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
054dc3e
...
...
@@ -197,4 +197,14 @@ class SearchModel
}
echo
json_encode
(
$data
);
}
/**
* 查询搜索提示
* @param $query
*/
public
static
function
getSuggest
(
$query
)
{
$result
=
SearchData
::
getSuggest
();
return
$result
;
}
}
\ No newline at end of file
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
054dc3e
...
...
@@ -27,6 +27,7 @@ class ListController extends WebAction
'productListPage'
=>
true
,
'list'
=>
$list
);
$this
->
setWebNavHeader
();
$this
->
_view
->
display
(
'list'
,
$data
);
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
View file @
054dc3e
...
...
@@ -15,4 +15,13 @@ class SearchController extends WebAction
$this
->
setWebNavHeader
();
$this
->
_view
->
display
(
'search'
,
$data
);
}
public
function
suggest
()
{
$query
=
rawurldecode
(
$this
->
get
(
'query'
));
if
(
$query
)
{
$param
[
'query'
]
=
$query
;
$result
=
SearchModel
::
getSuggest
(
$param
);
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment