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
5899d00a24df27ea2814386d457ede9e66414b75
2 parents
4c25a2b3
0c3510a7
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/web-list
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
119 deletions
library/Plugin/HelperSearch.php
template/m.yohobuy.com/partials/product/feedback-tab.phtml
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/Sale.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
library/Plugin/HelperSearch.php
View file @
5899d00
...
...
@@ -131,7 +131,7 @@ class HelperSearch
if
(
isset
(
$options
[
'controller'
])
&&
$options
[
'controller'
]
==
'Search'
)
{
self
::
setSearchNav
(
$data
[
'product'
][
'total'
]);
}
$result
[
'pathNav'
]
=
self
::
$listnav
;
$result
[
'pathNav'
]
=
isset
(
$options
[
'controller'
])
&&
$options
[
'controller'
]
==
'Sale'
?
array
()
:
self
::
$listnav
;
return
$result
;
}
...
...
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
5899d00
...
...
@@ -21,7 +21,7 @@
</span>
{{/ comments}}
</div>
<a class="comment-content-footer tap-hightlight" href="{{commentsUrl}}">
<a class="comment-content-footer tap-hightlight" href="{{commentsUrl}}">
查看更多
<span class="iconfont"></span>
</a>
...
...
@@ -37,7 +37,7 @@
<div class="consult-content-main content-main">
{{# consults}}
<div class="question">
<span class="iconfont">æ
39
;</span>
<span class="iconfont">æ
44
;</span>
<p>
{{question}}<br>
<span class="time">{{time}}</span>
...
...
@@ -45,7 +45,7 @@
</div>
<div class="answer">
<span class="iconfont">æ
3f
;</span>
<span class="iconfont">æ
42
;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
...
...
web-static/js/product/filter.js
View file @
5899d00
...
...
@@ -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 @
5899d00
...
...
@@ -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 @
5899d00
...
...
@@ -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 @
5899d00
...
...
@@ -6,7 +6,7 @@
.sort-type
,
.checks
{
color
:
#
ccc
;
color
:
#
999
;
font-size
:
12px
;
padding
:
0
10px
;
...
...
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
View file @
5899d00
...
...
@@ -2,8 +2,7 @@
namespace
Product
;
use
LibModels\Wap\Product\SearchData
;
use
LibModels\Web\Product\SearchData
as
WebProduct
;
use
Api\Yohobuy
;
use
Plugin\HelperSearch
;
use
Plugin\Images
;
/**
...
...
@@ -13,33 +12,27 @@ use Plugin\Images;
class
SaleModel
{
public
static
function
getSaleSearchData
(
$
params
,
$o
ptions
,
$specialInfo
)
public
static
function
getSaleSearchData
(
$
customCondition
,
$customO
ptions
,
$specialInfo
)
{
$
data
=
SearchData
::
searchElasticByCondition
(
$params
);
$
urlList
=
array
(
);
if
(
isset
(
$data
[
'code'
])
&&
$data
[
'code'
]
===
200
)
{
//获取分类列表数据
$classes
=
WebProduct
::
getClassesData
();
if
(
isset
(
$classes
[
'code'
])
&&
$classes
[
'code'
]
===
200
)
{
$data
[
'data'
][
'filter'
][
'group_sort'
]
=
$classes
[
'data'
][
'sort'
];
}
//用户浏览记录
// 组织模板数据
$list
=
HelperSearch
::
getList
(
$data
,
$options
);
//删除面包屑导航数据
unset
(
$list
[
'pathNav'
]);
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'newSale'
=>
$list
);
}
else
{
$data
=
array
();
}
//获取$condition和$option 筛选条件和排序条件
$searchCondition
=
SearchModel
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
//组合用户浏览记录url
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
//组织模板数据格式
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
//组织sale数据
if
(
isset
(
$specialInfo
[
'data'
])
&&
!
empty
(
$specialInfo
[
'data'
][
'banner_img'
]))
{
...
...
@@ -52,15 +45,14 @@ class SaleModel
}
//Sale首页 banner数据
$data
[
'newSale'
][
'saleBanner'
][
'bannerHeight'
]
=
$special
[
'banner'
][
0
][
'height'
];
$data
[
'newSale'
][
'saleBanner'
][
'img'
]
=
$special
[
'banner'
][
0
][
'img'
];
$data
[
'newSale'
][
'saleTitle'
][
'name'
]
=
'全部商品'
;
$data
[
'newSale'
][
'saleTitle'
][
'count'
]
=
$data
[
'newSale'
][
'totalCount'
];
$data
[
'saleBanner'
][
'bannerHeight'
]
=
$special
[
'banner'
][
0
][
'height'
];
$data
[
'saleBanner'
][
'img'
]
=
$special
[
'banner'
][
0
][
'img'
];
$data
[
'saleTitle'
][
'name'
]
=
'全部商品'
;
$data
[
'saleTitle'
][
'count'
]
=
$data
[
'totalCount'
];
//获取广告位数据
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$special
[
'left_ad_code'
]);
$data
[
'
newSale'
][
'
leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
$data
[
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
return
$data
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
View file @
5899d00
...
...
@@ -27,39 +27,11 @@ class SaleController extends WebAction
$this
->
go
(
SITE_MAIN
);
}
/* 过滤请求参数 */
$condition
=
array
();
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
//'query' => FILTER_SANITIZE_STRING,
'sort'
=>
FILTER_VALIDATE_INT
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_VALIDATE_INT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,
'shelve_time'
=>
FILTER_DEFAULT
,
'isNew'
=>
FILTER_DEFAULT
,
'specialoffer'
=>
FILTER_DEFAULT
,
'limited'
=>
FILTER_DEFAULT
,
'order'
=>
FILTER_DEFAULT
,
'viewNum'
=>
FILTER_VALIDATE_INT
,
'rowNum'
=>
FILTER_VALIDATE_INT
,
'page'
=>
FILTER_VALIDATE_INT
,),
false
);
//字符转码
if
(
!
empty
(
$condition
))
{
foreach
(
$condition
as
&
$value
)
{
$value
=
rawurldecode
(
$value
);
}
}
//传品牌ID参数
if
(
!
empty
(
$special
[
'brand_id'
])){
$condition
[
'brand'
]
=
$special
[
'brand_id'
];
}
//传促销id
if
(
!
empty
(
$special
[
'ispromotion'
])){
$condition
[
'promotion'
]
=
$special
[
'ispromotion'
];
...
...
@@ -67,52 +39,18 @@ class SaleController extends WebAction
$condition
[
'promotion'
]
=
$promotion
;
}
//获取性别数据
$gender
=
$this
->
get
(
'gender'
)
?
(
$this
->
get
(
'gender'
)
==
'2,3'
?
2
:
1
)
:
(
!
isset
(
$_COOKIE
[
'_Gender'
])
?
'3'
:
(
$_COOKIE
[
'_Gender'
]
==
'2,3'
?
2
:
1
));
$condition
[
'gender'
]
=
$gender
;
//每页显示商品数
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
]))
{
$condition
[
'viewNum'
]
=
60
;
}
$view_num_arr
=
array
(
60
,
100
,
200
);
if
(
!
in_array
(
$condition
[
'viewNum'
],
$view_num_arr
))
{
$condition
[
'viewNum'
]
=
60
;
}
//每行显示的商品数量
if
(
!
isset
(
$condition
[
'rowNum'
])
||
empty
(
$condition
[
'rowNum'
]))
{
$condition
[
'rowNum'
]
=
5
;
}
if
(
$condition
[
'rowNum'
]
==
6
)
{
$imgSize
=
array
(
195
,
260
);
$minImgSize
=
array
(
50
,
67
);
}
else
{
$condition
[
'rowNum'
]
=
5
;
$imgSize
=
array
(
235
,
314
);
$minImgSize
=
array
(
60
,
80
);
}
//搜索词
//$query = $this->get('query');
$condition
[
'needFilter'
]
=
1
;
$options
=
array
(
'imgSize'
=>
$imgSize
,
'minImgSize'
=>
$minImgSize
,
'gender'
=>
$gender
,
'needPd'
=>
'Y'
,
'rowNum'
=>
$condition
[
'rowNum'
],
'viewNum'
=>
$condition
[
'viewNum'
],
'specialsale_id'
=>
'Y'
'specialsale_id'
=>
'Y'
,
'controller'
=>
$this
->
_request
->
controller
);
$params
=
$condition
+
$_GET
;
$params
[
'attribute_not'
]
=
2
;
$params
=
array_filter
(
$params
);
//每页记录数减1,下一页占位
$params
[
'viewNum'
]
=
$params
[
'viewNum'
]
-
1
;
$data
=
Product\SaleModel
::
getSaleSearchData
(
$params
,
$options
,
$specialInfo
);
$cate
=
array
(
'boys'
,
'girls'
,
'kids'
,
'lifestyle'
);
$this
->
setWebNavHeader
(
$cate
[
$gender
-
1
]);
$saleData
=
Product\SaleModel
::
getSaleSearchData
(
$condition
,
$options
,
$specialInfo
);
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'newSale'
=>
$saleData
);
$this
->
setWebNavHeader
();
//渲染模板
$this
->
_view
->
display
(
'new-sale'
,
$data
);
}
...
...
Please
register
or
login
to post a comment