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
whb
9 years ago
Commit
f7be680a4dc44d87e7ec8c6c2a5a701ff6e93291
2 parents
d99d401a
ab1abcad
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
122 additions
and
90 deletions
docs/web-data-structure.md
template/www.yohobuy.com/partials/product/filter-box.phtml
template/www.yohobuy.com/partials/product/latest-walk.phtml
web-static/js/product/filter.js
web-static/js/product/latest-walk.js
web-static/js/product/list.js
web-static/sass/_footer.scss
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php
docs/web-data-structure.md
View file @
f7be680
...
...
@@ -513,6 +513,11 @@
{
attr: 'style', //查找的键值
name: '风格',
//若无子项,传url
url: '',
//若有子项,传sub
showMulti: true, //是否显示多选按钮
sub: [
{
...
...
template/www.yohobuy.com/partials/product/filter-box.phtml
View file @
f7be680
...
...
@@ -196,38 +196,44 @@
<div class="attr-content">
<ul class="clearfix senior-attr-wrap">
{{#each seniorChose}}
<li class="attr">
{{name}}
<span class="iconfont"></span>
<li class="attr{{#unless sub}} no-sub{{/unless}}">
{{#if sub}}
{{name}}
<span class="iconfont"></span>
<div class="senior-up-icon"></div>
<div class="senior-up-icon"></div>
{{^}}
<a href="{{url}}">{{name}}</a>
{{/if}}
</li>
{{/each}}
</ul>
<div class="senior-sub-wrap">
{{#each seniorChose}}
<div class="senior-sub hide" data-attr="{{attr}}">
<div class="senior-content">
{{#if showMulti}}
<span class="multi-select">多选 +</span>
{{/if}}
<ul class="clearfix check-container">
{{#each sub}}
<li class="attr {{#if checked}}checked{{/if}}">
<a href="{{href}}">
<span class="iconfont checkbox" data-id="{{id}}"></span>
<span>{{name}}</span>
</a>
</li>
{{/each}}
</ul>
<div class="btns">
<button class="multi-select-ok dis">确定</button>
<button class="multi-select-cancel">取消</button>
{{#if sub}}
<div class="senior-sub hide" data-attr="{{attr}}">
<div class="senior-content">
{{#if showMulti}}
<span class="multi-select">多选 +</span>
{{/if}}
<ul class="clearfix check-container">
{{#each sub}}
<li class="attr {{#if checked}}checked{{/if}}">
<a href="{{href}}">
<span class="iconfont checkbox" data-id="{{id}}"></span>
<span>{{name}}</span>
</a>
</li>
{{/each}}
</ul>
<div class="btns">
<button class="multi-select-ok dis">确定</button>
<button class="multi-select-cancel">取消</button>
</div>
</div>
</div>
</div>
{{/if}}
{{/each}}
</div>
</div>
...
...
template/www.yohobuy.com/partials/product/latest-walk.phtml
View file @
f7be680
{
{#if
latestWalk
}
}
<input
id=
"latest-walk-count"
type=
"hidden"
value=
"{{latestWalk}}"
>
<div
class=
"latest-walk"
>
<h
2
>最近浏览的商品</h
2
>
<div
class=
"goods clearfix"
>
{
{#
latestWalk
}
}
<div
class=
"good"
>
<a
href=
"{{href}}"
>
<img
class=
"lazy"
data-original=
"{{img}}"
>
</a>
<a
class=
"name"
href=
"{{href}}"
>
{
{name
}
}</a>
<p
class=
"price"
>
{
{#if
salePrice
}
}
<span
class=
"market-price"
>¥
{
{marketPrice
}
}</span>
{
{/if
}
}
<span
class=
"sale-price"
>¥
{
{salePrice
}
}</span>
</p>
</div>
{
{/
latestWalk
}
}
</div>
<div
id=
"latest-walk-goods"
class=
"goods clearfix"
></div>
</div>
<script
id=
"latest-walk-tpl"
type=
"text/html"
>
\
{
{#
latestWalk
}
}
<div
class=
"good"
>
<a
href=
"\{{href}}"
>
<img
class=
"lazy"
data-original=
"\{{img}}"
>
</a>
<a
class=
"name"
href=
"\{{href}}"
>\
{
{name
}
}</a>
<p
class=
"price"
>
<span
class=
"market-price"
>\
{
{marketPrice
}
}</span>
<span
class=
"sale-price"
>\
{
{salePrice
}
}</span>
</p>
</div>
\
{
{/
latestWalk
}
}
</script>
{
{/if
}
}
\ No newline at end of file
...
...
web-static/js/product/filter.js
View file @
f7be680
...
...
@@ -309,6 +309,9 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() {
var
$this
=
$
(
this
);
var
index
=
$this
.
index
();
if
(
$this
.
hasClass
(
'no-sub'
))
{
return
;
}
$this
.
addClass
(
'hover'
).
siblings
().
removeClass
(
'hover'
);
$seniorSubWrap
.
children
(
'.senior-sub:eq('
+
index
+
')'
).
removeClass
(
'hide'
).
siblings
().
addClass
(
'hide'
);
...
...
@@ -316,6 +319,10 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() {
var
$this
=
$
(
this
),
index
=
$this
.
index
();
if
(
$this
.
hasClass
(
'no-sub'
))
{
return
;
}
hoveredIndex
=
index
;
seniorHoverTime
=
setTimeout
(
function
()
{
...
...
web-static/js/product/latest-walk.js
0 → 100644
View file @
f7be680
/**
* 最近浏览取接口渲染模板
* @author: xuqi<qi.xu@yoho.cn>
8 @date: 2016/1/20
*/
var
$
=
require
(
'yoho.jquery'
);
var
Handlebars
=
require
(
'yoho.handlebars'
);
var
lazyLoad
=
require
(
'yoho.lazyload'
);
var
$latestWalkCount
=
$
(
'#latest-walk-count'
);
(
function
()
{
var
tpl
;
if
(
$latestWalkCount
.
lenght
<
0
)
{
return
;
}
tpl
=
Handlebars
.
compile
(
$
(
'#latest-walk-tpl'
).
html
());
$
.
ajax
({
url
:
'http://itemapi.yohobuy.com/item/item/recentreview'
,
dataType
:
'jsonp'
,
data
:
{
limit
:
$latestWalkCount
.
val
()
},
success
:
function
(
data
)
{
var
latestWalk
=
[],
res
,
i
,
cur
;
if
(
data
.
code
===
200
)
{
res
=
data
.
data
;
for
(
i
=
0
;
i
<
res
.
length
;
i
++
)
{
cur
=
res
[
i
];
latestWalk
.
push
({
href
:
cur
.
url
,
img
:
cur
.
pic_url
,
name
:
cur
.
product_name
,
salePrice
:
cur
.
price
,
marketPrice
:
cur
.
market_price
});
}
if
(
latestWalk
.
length
>
0
)
{
$
(
'#latest-walk-goods'
).
html
(
tpl
({
latestWalk
:
latestWalk
}));
lazyLoad
(
$
(
'#latest-walk-goods .lazy'
));
}
}
}
});
}());
\ No newline at end of file
...
...
web-static/js/product/list.js
View file @
f7be680
...
...
@@ -8,4 +8,6 @@ require('./filter');
require
(
'./sort-pager'
);
require
(
'./latest-walk'
);
require
(
'./product'
);
\ No newline at end of file
...
...
web-static/sass/_footer.scss
View file @
f7be680
...
...
@@ -386,6 +386,10 @@
}
}
.promise
.left
{
margin-right
:
45px
;
}
.subscribe
{
width
:
200px
;
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php
View file @
f7be680
...
...
@@ -248,19 +248,7 @@ class Index1Controller extends AbstractAction
array
(
'attr'
=>
'weather'
,
'name'
=>
'适用季节'
,
'sub'
=>
array
(
array
(
'id'
=>
'1'
,
'href'
=>
''
,
'name'
=>
'春天'
,
'checked'
=>
true
),
array
(
'id'
=>
'2'
,
'href'
=>
''
,
'name'
=>
'夏天'
)
)
'url'
=>
''
)
)
),
...
...
@@ -970,44 +958,7 @@ class Index1Controller extends AbstractAction
),
'totalCount'
=>
'2259'
,
'pager'
=>
'<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">></span></a>'
,
'latestWalk'
=>
array
(
array
(
'img'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/08/24/11/018fd5cbe604b37ea35336257fcbff8114.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'Life·After Life 牛角扣夹棉连帽大衣(M51款)【吴亦凡亲身试着】'
,
'marketPrice'
=>
'939'
,
'salePrice'
=>
'679'
),
array
(
'img'
=>
'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'th:字母撞色毛衣'
,
'marketPrice'
=>
'698'
,
'salePrice'
=>
'209'
),
array
(
'img'
=>
'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'th:字母撞色毛衣'
,
'marketPrice'
=>
'698'
,
'salePrice'
=>
'209'
),
array
(
'img'
=>
'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'th:字母撞色毛衣'
,
'marketPrice'
=>
'698'
,
'salePrice'
=>
'209'
),
array
(
'img'
=>
'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'th:字母撞色毛衣'
,
'marketPrice'
=>
'698'
,
'salePrice'
=>
'209'
),
array
(
'img'
=>
'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'th:字母撞色毛衣'
,
'marketPrice'
=>
'698'
,
'salePrice'
=>
'209'
)
)
'latestWalk'
=>
6
)
);
$this
->
_view
->
display
(
'list'
,
$data
);
...
...
Please
register
or
login
to post a comment