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
ccbikai
9 years ago
Commit
0e6deda010b04f21220890a1a286743503025289
2 parents
8b880520
583f47e8
合并冲突
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
21 deletions
script/nginx/logs/nginx.pid
static/js/category/brand.js
static/js/home/home.js
static/js/home/maybe-like.js
static/js/index/footer.js
static/js/product/newsale/discount.js
static/js/product/newsale/newarrival.js
template/m.yohobuy.com/partials/home/maybe_like.phtml
script/nginx/logs/nginx.pid
View file @
0e6deda
329
36
42
36
...
...
static/js/category/brand.js
View file @
0e6deda
...
...
@@ -5,6 +5,7 @@
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'hammer'
),
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
...
...
@@ -15,6 +16,8 @@ var searchH = $('.newbrand-search').height(),
headerH
=
$
(
'.yoho-header'
).
height
(),
brandSwipe
=
parseInt
(
searchH
)
+
parseInt
(
headerH
);
var
myHammer
;
swiper
=
new
Swiper
(
'.swiper-container'
,
{
lazyLoading
:
true
,
loop
:
true
,
...
...
@@ -49,11 +52,19 @@ if ($brandList.length > 0) {
});
}
$
(
'#right-bar .con'
).
find
(
'b'
).
unbind
().
on
(
'tap'
,
function
()
{
// $('#right-bar .con').find('b').unbind().on('tap', function() {
// var index = $(this).index();
// if ($('.bar-' + index).size() > 0) {
// document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
// }
// });
myHammer
=
new
Hammer
(
$
(
'#right-bar .con'
).
find
(
'b'
).
unbind
()[
0
]);
myHammer
.
on
(
'tap'
,
function
(
e
)
{
var
index
=
$
(
this
).
index
();
if
(
$
(
'.bar-'
+
index
).
size
()
>
0
)
{
document
.
body
.
scrollTop
=
parseInt
(
$
(
'.bar-'
+
index
)[
0
].
offsetTop
)
-
parseInt
(
brandSwipe
-
1
);
}
});
...
...
static/js/home/home.js
View file @
0e6deda
...
...
@@ -4,6 +4,7 @@
* @date: 2015/10/12
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'hammer'
),
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
bannerSwiper
,
...
...
@@ -21,6 +22,8 @@ var requestFrame,
$logotrans
=
$
(
'.home-header .logo'
),
isen
=
true
;
var
navHammer
,
mobileWrapHammer
;
require
(
'./maybe-like'
);
lazyLoad
(
$
(
'img.lazy'
));
...
...
@@ -28,7 +31,24 @@ lazyLoad($('img.lazy'));
//$('img:in-viewport').trigger('appear');
//点击首页汉堡menu图标,滑出侧栏导航
$
(
'.nav-btn'
).
on
(
'tap'
,
function
(
event
)
{
// $('.nav-btn').on('tap', function (event) {
// if (!$(this).hasClass('menu-open')) {
// $('.mobile-wrap').addClass('menu-open');
// $('.overlay').show().css('opacity', 0.3);
// $('.side-nav').addClass('on');
// //设置boy高宽,页面不能上下滑动
// $('body').css({
// height: $(window).height(),
// width: '100%',
// overflow: 'hidden'
// });
// }
// event.stopPropagation();
// });
navHammer
=
new
Hammer
(
$
(
'.nav-btn'
)[
0
]);
navHammer
.
on
(
'tap'
,
function
(
event
)
{
if
(
!
$
(
this
).
hasClass
(
'menu-open'
))
{
$
(
'.mobile-wrap'
).
addClass
(
'menu-open'
);
$
(
'.overlay'
).
show
().
css
(
'opacity'
,
0.3
);
...
...
@@ -45,7 +65,24 @@ $('.nav-btn').on('tap', function (event) {
});
//点击页面主体,收起侧栏导航及二级导航
$
(
'.mobile-wrap'
).
on
(
'tap'
,
function
()
{
// $('.mobile-wrap').on('tap', function () {
// if ($(this).hasClass('menu-open')) {
// $('.mobile-wrap').removeClass('menu-open');
// $('.overlay').css('opacity', 0);
// $('.sub-nav').removeClass('show');
// $('.side-nav').removeClass('on');
// $('body').css({
// height: 'auto',
// overflow: 'auto'
// });
// setTimeout(function() {
// $('.overlay').hide();
// }, 300);
// }
// });
mobileWrapHammer
=
new
Hammer
(
$
(
'.mobile-wrap'
)[
0
]);
mobileWrapHammer
.
on
(
'tap'
,
function
(
event
)
{
if
(
$
(
this
).
hasClass
(
'menu-open'
))
{
$
(
'.mobile-wrap'
).
removeClass
(
'menu-open'
);
$
(
'.overlay'
).
css
(
'opacity'
,
0
);
...
...
@@ -62,7 +99,7 @@ $('.mobile-wrap').on('tap', function () {
});
//点击一级导航,弹出二级导航
$
(
'.side-nav'
).
on
(
't
ap
'
,
'li'
,
function
()
{
$
(
'.side-nav'
).
on
(
't
ouchstart
'
,
'li'
,
function
()
{
if
(
$
(
this
).
find
(
'.sub-nav'
).
size
()
>
0
)
{
$
(
'.sub-nav'
).
removeClass
(
'show'
);
$
(
this
).
find
(
'.sub-nav'
).
addClass
(
'show'
);
...
...
@@ -71,7 +108,7 @@ $('.side-nav').on('tap', 'li', function () {
//返回一级导航,收起二级导航
$
(
'.sub-nav'
).
each
(
function
()
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
't
ap
'
,
function
(
e
)
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
't
ouchstart
'
,
function
(
e
)
{
$
(
'.sub-nav'
).
removeClass
(
'show'
);
e
.
stopPropagation
();
});
...
...
static/js/home/maybe-like.js
View file @
0e6deda
...
...
@@ -86,9 +86,11 @@ $(window).scroll(function () {
type
:
'GET'
,
url
:
url
,
success
:
function
(
data
)
{
$
(
'#load-more-img'
).
show
();
$
(
'#load-more-img a'
).
attr
(
'url'
,
data
[
0
].
banner
[
0
].
url
);
$
(
'#load-more-img a > img'
).
attr
(
'src'
,
data
[
0
].
banner
[
0
].
img
);
if
(
data
&&
data
[
0
]
&&
data
[
0
].
banner
[
0
])
{
$
(
'#load-more-img'
).
show
();
$
(
'#load-more-img a'
).
attr
(
'url'
,
data
[
0
].
banner
[
0
].
url
);
$
(
'#load-more-img a > img'
).
attr
(
'src'
,
data
[
0
].
banner
[
0
].
img
);
}
},
error
:
function
()
{
}
...
...
static/js/index/footer.js
View file @
0e6deda
...
...
@@ -4,12 +4,15 @@
* @date: 2015/10/26
*/
var
$
=
require
(
'jquery'
);
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'hammer'
);
var
$searchBox
=
$
(
'.search-box'
),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
var
floatLayerCloseHammer
,
floatLayerBtnHammer
;
function
downLoadApp
()
{
var
appUrl
=
'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'
;
var
clickedAt
=
new
Date
();
...
...
@@ -21,7 +24,21 @@ function downLoadApp() {
},
500
);
}
$
(
'#float-layer-close'
).
bind
(
'tap'
,
function
()
{
// $('#float-layer-close').bind('tap', function () {
// $('#float-layer-app').hide();
// window.setCookie('_float-layer-app', 'id490655927',
// {
// domain: '.yohobuy.com'
// });
// window.setCookie('_float-layer-app-close', 1,
// {
// domain: '.yohobuy.com',
// expires: 1
// });
// });
floatLayerCloseHammer
=
new
Hammer
(
$
(
'#float-layer-close'
)[
0
]);
floatLayerCloseHammer
.
on
(
'tap'
,
function
(
e
)
{
$
(
'#float-layer-app'
).
hide
();
window
.
setCookie
(
'_float-layer-app'
,
'id490655927'
,
{
...
...
@@ -34,7 +51,12 @@ $('#float-layer-close').bind('tap', function () {
});
});
$
(
'#float-layer-btn'
).
bind
(
'tap'
,
function
()
{
// $('#float-layer-btn').tap(function () {
// downLoadApp('bottom');
// });
floatLayerBtnHammer
=
new
Hammer
(
$
(
'#float-layer-btn'
)[
0
]);
floatLayerBtnHammer
.
on
(
'tap'
,
function
(
e
)
{
downLoadApp
(
'bottom'
);
});
...
...
@@ -76,10 +98,20 @@ $searchBox.find('input').on('focus', function () {
$
(
'.clear-text, .no-search'
).
hide
();
});
$searchBox
.
find
(
'.clear-text'
).
bind
(
'tap'
,
function
()
{
$searchBox
.
find
(
'.clear-text'
).
click
(
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
).
trigger
(
'focus'
);
});
$searchBox
.
find
(
'.search-icon'
).
bind
(
'tap'
,
function
()
{
// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);
// clearTextHammer.on('tap', function(e) {
// $searchBox.find('input').val('').trigger('focus');
// });
$searchBox
.
find
(
'.search-icon'
).
click
(
function
()
{
$indexSearch
.
submit
();
});
\ No newline at end of file
});
// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
// searchIconHammer.on('tap', function(e) {
// $indexSearch.submit();
// });
\ No newline at end of file
...
...
static/js/product/newsale/discount.js
View file @
0e6deda
...
...
@@ -225,7 +225,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav
.
delegate
(
'li'
,
't
ap
'
,
function
()
{
$listNav
.
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
var
$this
=
$
(
this
),
nav
,
navType
,
...
...
static/js/product/newsale/newarrival.js
View file @
0e6deda
...
...
@@ -252,7 +252,7 @@ filter.registerCbFn(search);
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav
.
delegate
(
'li'
,
't
ap
'
,
function
()
{
$listNav
.
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
var
$this
=
$
(
this
),
nav
,
navType
,
...
...
template/m.yohobuy.com/partials/home/maybe_like.phtml
View file @
0e6deda
...
...
@@ -8,7 +8,7 @@
</div>
<div class="load-more-img hide" id="load-more-img">
<a href="">
<img src="">
</a>
<a href="">
<img src="">
</a>
</div>
...
...
Please
register
or
login
to post a comment