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
youfu
9 years ago
Commit
bd525b986d990508977de19aaa99435a1c9aed0d
2 parents
128985c4
515278ca
Merge branch 'develop/wap' of
http://git.dev.yoho.cn/web/yohobuy
into develop/wap
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
2 deletions
static/js/me/index.js
static/js/plugin/notice-scroll.js
template/m.yohobuy.com/actions/index/home/index.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
static/js/me/index.js
View file @
bd525b9
...
...
@@ -3,7 +3,9 @@
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/12
*/
var
$
=
require
(
'jquery'
);
var
$
=
require
(
'jquery'
),
noticeScroll
=
require
(
'../plugin/notice-scroll'
);
var
$userAvatar
=
$
(
'.user-avatar'
),
$listItem
=
$
(
'.list-item'
);
var
myImage
=
new
Image
(),
...
...
@@ -19,6 +21,8 @@ myImage.onload = function() {
$userAvatar
.
css
(
'background-image'
,
'url('
+
avatar
+
')'
);
};
noticeScroll
(
'.notice'
,
$
(
'.notice'
).
data
(
'time'
)
*
1000
);
$
(
'.yoho-page'
).
on
(
'touchstart'
,
'.list-item, .type-item, .order-title'
,
function
()
{
$listItem
.
removeClass
(
'highlight'
);
$
(
this
).
addClass
(
'highlight'
);
...
...
static/js/plugin/notice-scroll.js
0 → 100644
View file @
bd525b9
/**
* 公告栏目滚动
* bikai kai.bi@yoho.cn
*/
var
$
=
require
(
'jquery'
);
function
noticeScroll
(
selecter
,
time
)
{
var
$notice
=
$
(
selecter
),
$noticeItem
=
$notice
.
find
(
'.notice-item'
),
count
=
$noticeItem
.
length
,
i
=
1
;
selecter
=
selecter
||
'.notice'
;
time
=
time
||
3000
;
if
(
count
>
1
)
{
setInterval
(
function
()
{
if
(
i
>=
count
)
{
i
=
0
;
}
$noticeItem
.
fadeOut
();
$notice
.
find
(
'.item-'
+
i
).
fadeIn
();
i
++
;
},
time
);
}
}
module
.
exports
=
noticeScroll
;
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
bd525b9
...
...
@@ -33,6 +33,16 @@
<p>浏览记录</p>
</a>
</div>
{
{#if
notice.open
}
}
<div
class=
"notice"
data-time=
"{{notice.time}}"
>
{
{#notice.list
}
}
<a
class=
"notice-item item-{{@index}}"
href=
"{{url}}"
>
<span
class=
"notice-icon"
></span>
{
{title
}
}
</a>
{
{/notice.list
}
}
</div>
{
{/if
}
}
<div
class=
"my-order"
>
<a
class=
"order-title"
href=
"/home/orders"
>
我的订单
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
bd525b9
...
...
@@ -51,7 +51,7 @@ class HomeController extends AbstractAction
'myIndexPage'
=>
true
,
'showDownloadApp'
=>
true
,
'navHome'
=>
true
,
//
'notice' => UserModel::getNoticeData(),
'notice'
=>
UserModel
::
getNoticeData
(),
'pageFooter'
=>
true
,
'cartUrl'
=>
Helpers
::
url
(
'/cart/index/index'
,
null
),
'signinUrl'
=>
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/home'
))),
...
...
Please
register
or
login
to post a comment