Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
hf
9 years ago
Commit
86d3a4df8205d67da74608159f6cedb422ab6b77
2 parents
ac66ad5c
858c776a
merge channel.js
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
94 additions
and
25 deletions
static/js/category/brand.js
static/js/category/index.js
static/js/home/home.js
static/js/index/channel.js
static/js/plugin/filter.js
static/sass/_filter.scss
static/sass/category/_index.scss
static/sass/product/_discount.scss
static/sass/product/_list.scss
static/sass/product/_new-arrival.scss
static/js/category/brand.js
View file @
86d3a4d
...
...
@@ -64,6 +64,18 @@ $(window).scroll(function() {
});
});
function
changeBackground
()
{
var
$brandList
=
$
(
'.brand-list'
).
find
(
'p'
);
$brandList
.
on
(
'touchstart'
,
function
()
{
$brandList
.
css
(
'background'
,
'#fff'
);
$
(
this
).
css
(
'background'
,
'#eee'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
css
(
'background'
,
'#fff'
);
});
}
changeBackground
();
function
searchResult
()
{
var
keyword
=
(
$keyword
.
val
()
+
''
).
toLowerCase
();
var
result
=
{},
...
...
@@ -113,6 +125,7 @@ function searchResult() {
// 插入 dom,绑定事件
$
(
'.search-result'
).
html
(
html
);
changeBackground
();
}
if
(
$
(
'.brand-search-page'
).
length
)
{
...
...
static/js/category/index.js
View file @
86d3a4d
...
...
@@ -9,10 +9,10 @@ var $ = require('jquery'),
var
$nav
=
$
(
'.category-nav'
),
$categoryContainer
=
$
(
'.category-container'
),
$contents
=
$categoryContainer
.
children
(
'.content'
);
$contents
=
$categoryContainer
.
children
(
'.content'
),
$subLevelItem
=
$
(
'.sub-level li'
);
var
$curContent
=
$contents
.
not
(
'.hide'
),
$curClickSubLevel
;
var
$curContent
=
$contents
.
not
(
'.hide'
);
var
navHammer
,
ccHammer
;
...
...
@@ -71,13 +71,9 @@ ccHammer.on('tap', function(e) {
}
});
$
(
'.sub-level'
).
bind
(
'touchend'
,
function
(
e
)
{
var
$cur
=
$
(
e
.
target
);
$cur
.
addClass
(
'a-highlight'
);
if
(
$curClickSubLevel
)
{
$curClickSubLevel
.
removeClass
(
'a-highlight'
);
}
$curClickSubLevel
=
$cur
;
});
\ No newline at end of file
$subLevelItem
.
on
(
'touchstart'
,
function
()
{
$subLevelItem
.
removeClass
(
'highlight'
);
$
(
this
).
addClass
(
'highlight'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
removeClass
(
'highlight'
);
});
...
...
static/js/home/home.js
View file @
86d3a4d
...
...
@@ -94,6 +94,14 @@ $subNav.each(function () {
}
});
// 侧边栏点击背景色变化
$sideNav
.
children
(
'ul'
).
children
(
'li'
).
on
(
'touchstart'
,
function
()
{
$sideNav
.
children
(
'ul'
).
children
(
'li'
).
css
(
'background'
,
'#fff'
);
$
(
this
).
css
(
'background'
,
'#eee'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
css
(
'background'
,
'#fff'
);
});
//头部banner轮播
if
(
$
(
'.banner-swiper'
).
find
(
'li'
).
size
()
>
1
)
{
bannerSwiper
=
new
Swiper
(
'.banner-swiper'
,
{
...
...
static/js/index/channel.js
View file @
86d3a4d
...
...
@@ -8,7 +8,8 @@ var $ = require('jquery');
var
$searchBox
=
$
(
'.search-box'
),
$box
=
$
(
'.box'
),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
$indexLogo
=
$
(
'.index-logo'
),
$channelLink
=
$
(
'.index-channel a'
);
var
$search
=
$searchBox
.
children
(
'input[type="text"]'
),
$cancelSearch
=
$box
.
children
(
'.no-search'
),
...
...
@@ -42,6 +43,26 @@ $searchBox.children('.search-icon').on('touchstart', function() {
$indexSearch
.
submit
();
});
$
(
'.index-channel img'
).
on
(
'load'
,
function
()
{
window
.
rePosFooter
();
$
(
'.index-channel img'
).
on
(
'load error'
,
function
()
{
window
.
rePosFooter
&&
window
.
rePosFooter
();
});
$channelLink
.
on
(
'touchstart'
,
function
()
{
$channelLink
.
css
({
background
:
'#000'
,
color
:
'#fff'
,
borderColor
:
'#fff'
});
$
(
this
).
css
({
background
:
'rgba(255, 255, 255, 0.5)'
,
color
:
'#000'
,
borderColor
:
'#000'
});
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
css
({
background
:
'#000'
,
color
:
'#fff'
,
borderColor
:
'#fff'
});
});
...
...
static/js/plugin/filter.js
View file @
86d3a4d
...
...
@@ -24,6 +24,18 @@ function showFilter() {
$filter
.
removeClass
(
'hide'
);
}
// 子菜单点击时背景高亮
function
highlightSubItem
()
{
var
$subItem
=
$
(
'.filter-body .sub-item'
);
$subItem
.
on
(
'touchstart'
,
function
()
{
$subItem
.
removeClass
(
'highlight'
);
$
(
this
).
addClass
(
'highlight'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
removeClass
(
'highlight'
);
});
}
//主筛选项Tap事件句柄
function
classifyTapEvt
(
$this
)
{
if
(
$this
.
hasClass
(
'active'
))
{
...
...
@@ -95,7 +107,7 @@ function initFilter(opt) {
hCbFn
=
opt
.
hCbFn
;
missStatus
=
opt
.
missStatus
;
highlightSubItem
();
$filter
=
$
(
'.filter-mask'
);
...
...
@@ -131,6 +143,7 @@ function initFilter(opt) {
}
}
});
}
//重置筛选面板
...
...
static/sass/_filter.scss
View file @
86d3a4d
...
...
@@ -59,18 +59,23 @@
display
:
none
;
width
:
50%
;
height
:
440px
;
padding-left
:
15px
;
left
:
50%
;
top
:
0
;
overflow
:
auto
;
-webkit-overflow-scrolling
:
touch
;
>
li
{
height
:
60px
;
line-height
:
60px
;
padding-left
:
15px
;
border-bottom
:
1px
solid
#e6e6e6
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
&
.highlight
{
background
:
#eee
;
}
}
.chosed-icon
{
...
...
static/sass/category/_index.scss
View file @
86d3a4d
...
...
@@ -95,7 +95,6 @@
.sub-level-container
{
float
:
left
;
box-sizing
:
border-box
;
padding-left
:
20rem
/
$pxConvertRem
;
background
:
#fff
;
width
:
60%
;
height
:
100%
;
...
...
@@ -112,6 +111,11 @@
height
:
71rem
/
$pxConvertRem
;
line-height
:
71rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e6e6e6
;
padding-left
:
20rem
/
$pxConvertRem
;
&
.highlight
{
background
:
#eee
;
}
&
:last-child
{
border-bottom
:
none
;
...
...
@@ -126,7 +130,4 @@
}
}
.a-highlight
{
text-decoration
:
underline
;
}
}
\ No newline at end of file
...
...
static/sass/product/_discount.scss
View file @
86d3a4d
...
...
@@ -50,12 +50,16 @@
color
:
#999
;
}
.active
{
background
:
#eee
;
}
.active
>
a
{
color
:
#000
;
.spanTest
{
width
:
auto
;
height
:
100%
;
border-bottom
:
2px
solid
#000
;
//
border-bottom: 2px solid #000;
display
:
inline-block
;
box-sizing
:border-box
;
}
...
...
static/sass/product/_list.scss
View file @
86d3a4d
...
...
@@ -206,11 +206,15 @@
box-sizing
:
border-box
;
}
.active
{
background
:
#eee
;
}
.active
>
a
{
color
:
#000
;
.nav-txt
{
border-bottom
:
2px
solid
#000
;
//
border-bottom: 2px solid #000;
}
.iconfont
{
...
...
static/sass/product/_new-arrival.scss
View file @
86d3a4d
...
...
@@ -51,8 +51,12 @@
color
:
#999
;
}
.active
{
background
:
#eee
;
}
.active
>
a
{
border-bottom
:
2px
solid
#000
;
//
border-bottom: 2px solid #000;
color
:
#000
;
box-sizing
:border-box
;
}
...
...
Please
register
or
login
to post a comment