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
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
7d904b9131009ac3bc15240c5e8d34992bbbfc62
1 parent
8974915c
品牌一览支持轮播和品牌手滑的样式调整,以及商品详情页的touchend改成hammer手势 code review by zhangzheng
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
6 deletions
static/js/category/brand.js
static/js/product/detail/detail.js
static/sass/category/_brand.scss
template/m.yohobuy.com/actions/product/detail/index.phtml
static/js/category/brand.js
View file @
7d904b9
...
...
@@ -11,8 +11,9 @@ var $ = require('jquery'),
var
swiper
,
$fixTitleBar
,
$brandList
=
$
(
'.brand-list'
);
var
$icon
=
$
(
'.search-icon'
);
$brandList
=
$
(
'.brand-list'
),
$icon
=
$
(
'.search-icon'
),
hotBrandsSwiper
;
var
searchH
=
$
(
'.newbrand-search'
).
outerHeight
(),
headerH
=
$
(
'.yoho-header'
).
outerHeight
(),
...
...
@@ -23,6 +24,14 @@ var brandsData,
$keyword
,
clearTextHammer
;
//热门品牌滑动
hotBrandsSwiper
=
new
Swiper
(
'.brands-swiper'
,
{
grabCursor
:
true
,
slidesPerView
:
'auto'
,
wrapperClass
:
'brands-list'
,
slideElement
:
'li'
});
swiper
=
new
Swiper
(
'.swiper-container'
,
{
lazyLoading
:
true
,
loop
:
true
,
...
...
@@ -37,12 +46,16 @@ $('.yoho-header').css({
top
:
0
});
if
(
$
(
'.banner-top'
).
length
>
0
)
{
$
(
'.hot-brands'
).
css
(
'padding-top'
,
'0'
);
}
$fixTitleBar
=
$
(
'<div class="title-bar fixed-title-bar"><h2></h2></div>'
);
$fixTitleBar
.
css
({
position
:
'fixed'
,
top
:
brandSwipe
}).
hide
();
minBrandListTop
=
brandSwipe
+
$
(
'.hot-brand'
).
outerHeight
()
+
$
(
'.banner-top'
).
outerHeight
();
minBrandListTop
=
brandSwipe
+
$
(
'.hot-brand
s
'
).
outerHeight
()
+
$
(
'.banner-top'
).
outerHeight
();
$brandList
.
last
().
append
(
$fixTitleBar
);
function
scrollHandler
()
{
...
...
static/js/product/detail/detail.js
View file @
7d904b9
...
...
@@ -5,12 +5,14 @@
*/
var
$
=
require
(
'jquery'
),
Swiper
=
require
(
'yoho.iswiper'
),
Hammer
=
require
(
'yoho.hammer'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
goodsSwiper
,
$discountFolder
=
$
(
'.goodsDiscount .discount-folder'
),
$discountArrow
=
$
(
'.goodsDiscount .first-item span'
);
var
goodsDiscountHammer
=
new
Hammer
(
document
.
getElementById
(
'goodsDiscount'
));
require
(
'./desc'
);
require
(
'./comments-consults'
);
...
...
@@ -38,7 +40,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$
(
'.goodsDiscount'
).
on
(
'touchend
'
,
function
(
e
)
{
goodsDiscountHammer
.
on
(
'tap
'
,
function
(
e
)
{
if
(
$discountFolder
.
is
(
':hidden'
))
{
$discountArrow
.
removeClass
(
'icon-down'
).
addClass
(
'icon-up'
).
html
(
''
);
$discountFolder
.
slideDown
();
...
...
@@ -46,7 +48,7 @@ $('.goodsDiscount').on('touchend', function(e) {
$discountArrow
.
removeClass
(
'icon-up'
).
addClass
(
'icon-down'
).
html
(
''
);
$discountFolder
.
slideUp
();
}
return
false
;
});
require
(
'./like'
);
...
...
static/sass/category/_brand.scss
View file @
7d904b9
...
...
@@ -75,6 +75,10 @@
background-color
:
#f8f8f8
;
}
.hot-brands
{
padding-top
:
178rem
/
$pxConvertRem
;
}
.hot-brand
{
margin
:
(
30rem
/
$pxConvertRem
)
0
0
;
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
7d904b9
...
...
@@ -64,7 +64,7 @@
{
{/vipLevel
}
}
{
{#
goodsDiscount
}
}
<div
class=
"goodsDiscount"
>
<div
class=
"goodsDiscount"
id=
"goodsDiscount"
>
{
{#
list
}
}
{
{#if
@first
}
}
{
{#if
text
}
}
...
...
Please
register
or
login
to post a comment