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
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
e806b8016f81cea8519ff652226dfb2c7eeb2d7b
1 parent
0d10d59d
guang loading
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
12 deletions
static/js/guang/home.js
static/js/guang/info.js
static/sass/_loading.scss
template/m.yohobuy.com/actions/guang/index/index.phtml
static/js/guang/home.js
View file @
e806b80
...
...
@@ -73,26 +73,36 @@ navHammer.on('tap', function(e) {
$this
.
addClass
(
'focus'
);
$curNav
.
removeClass
(
'focus'
);
$infos
.
not
(
'.hide'
).
addClass
(
'hide'
);
$content
=
$infos
.
eq
(
index
);
$content
.
removeClass
(
'hide'
);
$curNav
=
$this
;
curType
=
$this
.
data
(
'type'
);
//当未加载数据时去请求数据
if
(
state
[
curType
].
page
===
1
)
{
loadMore
(
$content
,
state
[
curType
]);
}
//重置当前Tab的load-more
if
(
state
[
curType
].
end
)
{
//无数据时隐藏正在加载和没有更多字样
$loading
.
addClass
(
'hide'
);
$noMore
.
removeClass
(
'hide'
);
}
else
{
$loading
.
removeClass
(
'hide'
);
$noMore
.
addClass
(
'hide'
);
loadMore
(
$content
,
state
[
curType
]);
}
else
{
//重置当前Tab的load-more
if
(
state
[
curType
].
end
)
{
$loading
.
addClass
(
'hide'
);
$noMore
.
removeClass
(
'hide'
);
}
else
{
$loading
.
removeClass
(
'hide'
);
$noMore
.
addClass
(
'hide'
);
}
}
$infos
.
not
(
'.hide'
).
addClass
(
'hide'
);
$content
.
removeClass
(
'hide'
);
if
(
state
[
curType
].
page
===
1
)
{
window
.
rePosFooter
();
//进入空内容时重新定位footer位置
}
});
...
...
static/js/guang/info.js
View file @
e806b80
...
...
@@ -128,6 +128,7 @@ function loadMore($container, opt) {
return
;
}
$container
.
append
(
data
);
if
(
num
>
0
)
{
...
...
@@ -140,6 +141,10 @@ function loadMore($container, opt) {
if
(
opt
.
page
===
1
)
{
loading
.
hideLoadingMask
();
$loading
.
removeClass
(
'hide'
);
//显示空屏加载时hide的隐藏
window
.
rePosFooter
();
//插入内容后重新计算底部位置
}
opt
.
page
++
;
...
...
static/sass/_loading.scss
View file @
e806b80
.loading-mask
{
position
:
absolute
;
position
:
fixed
;
background
:
rgba
(
0
,
0
,
0
,.
1
);
top
:
0
;
bottom
:
0
;
...
...
template/m.yohobuy.com/actions/guang/index/index.phtml
View file @
e806b80
...
...
@@ -37,7 +37,7 @@
<div
id=
"info-list"
class=
"info-list-container"
>
{
{#
infos
}
}
<div
class=
"info-list
{{^show}}
hide{{/show}}"
>
<div
class=
"info-list
{{^show}}
hide{{/show}}"
>
{
{#
info
}
}
{
{>
guang/info
}
}
{
{/
info
}
}
...
...
Please
register
or
login
to post a comment