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
b4b964e589b88c0821e1138e46d56dca3f139bcd
2 parents
6f680827
7a6895eb
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
30 deletions
static/js/product/newsale/hot-rank.js
template/m.yohobuy.com/actions/product/newsale/hotlist.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
static/js/product/newsale/hot-rank.js
View file @
b4b964e
var
$
=
require
(
'jquery'
),
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
Hammer
=
require
(
'yoho.hammer'
);
var
navSwiper
;
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
function
hotrank
(){
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/newsale/selectHotrank'
,
dataType
:
'html'
,
data
:
{
page
:
1
},
success
:
function
(
data
)
{
$
(
'#hotRank'
).
append
(
data
);
lazyLoad
(
$
(
'img.lazy'
));
$
(
'#yoho-footer'
).
css
(
'position'
,
'static'
);
navSwiper
=
new
Swiper
(
'.s-goods-nav'
,
{
grabCursor
:
true
,
slidesPerView
:
'auto'
,
slideElement
:
'li'
});
var
page
=
1
,
winH
,
hotnav
,
sort
=
''
,
id
=
''
;
}
});
function
hotrank
(
page
,
sort
,
tab_id
)
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/newsale/selectHotrank'
,
dataType
:
'html'
,
data
:
{
page
:
page
,
sort
:
sort
,
tab_id
:
tab_id
},
success
:
function
(
data
)
{
if
(
page
===
1
)
{
$
(
'#hotRank'
).
html
(
''
);
}
$
(
'#hotRank'
).
append
(
data
);
lazyLoad
(
$
(
'img.lazy'
));
$
(
'#yoho-footer'
).
css
(
'position'
,
'static'
);
navSwiper
=
new
Swiper
(
'.s-goods-nav'
,
{
grabCursor
:
true
,
slidesPerView
:
'auto'
,
slideElement
:
'li'
});
winH
=
$
(
window
).
height
();
listTop
=
$
(
'.rank-main'
).
find
(
'ul'
).
offset
().
top
;
$
(
'.s-goods-nav .nav-item'
).
each
(
function
(
index
)
{
hotnav
=
new
Hammer
(
$
(
'.s-goods-nav .nav-item'
)[
index
]);
hotnav
.
on
(
'tap'
,
function
(
e
)
{
id
=
$
(
'.s-goods-nav .nav-item'
).
eq
(
index
).
data
(
'id'
),
sort
=
parseInt
(
$
(
'.s-goods-nav .nav-item'
).
eq
(
index
).
data
(
'sort'
).
split
(
'='
)[
1
]);
hotrank
(
page
,
sort
,
id
);
});
});
}
});
}
hotrank
();
$
(
window
).
scroll
(
function
()
{
if
(
page
===
2
)
{
return
;
}
if
(
$
(
window
).
scrollTop
()
+
winH
<
listTop
+
$
(
'#hotRank'
).
height
()
-
100
)
{
return
;
}
page
=
2
;
hotrank
(
page
,
sort
,
id
);
});
hotrank
(
page
,
sort
,
id
);
...
...
template/m.yohobuy.com/actions/product/newsale/hotlist.phtml
View file @
b4b964e
<div class="s-goods-nav goods-nav">
<ul class="swiper-wrapper clearfix">
{{# tabs}}
<li class="swiper-slide nav-item" data-sort="{{sort}}">
{{# title}}
<span>{{name}}</span>
{{/ title}}
</li>
{{# title}}
<li class="swiper-slide nav-item" data-sort="{{ params}}" data-id="{{ id}}">
<span>{{ name}}</span>
</li>
{{/ title}}
{{/ tabs}}
</ul>
</div>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
b4b964e
...
...
@@ -130,6 +130,9 @@ class HomeController extends AbstractAction
*/
public
function
personalDetailsAction
()
{
$this
->
setTitle
(
'个人信息'
);
$this
->
setNavHeader
(
'个人信息'
,
true
,
SITE_MAIN
);
// $uid = $this->getUid();
$uid
=
967016
;
$data
=
\Index\UserModel
::
getUserProfileData
(
$uid
);
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
b4b964e
...
...
@@ -104,7 +104,7 @@ class NewsaleController extends AbstractAction
if
(
$this
->
isAjax
())
{
$sort
=
$this
->
get
(
'sort'
,
null
);
$tab_id
=
$this
->
get
(
'tab_id'
,
null
);
$limit
=
$this
->
get
(
'limit'
,
34
);
$limit
=
$this
->
get
(
'limit'
,
50
);
$page
=
$this
->
get
(
'page'
,
1
);
// 获取性别
...
...
@@ -155,7 +155,6 @@ class NewsaleController extends AbstractAction
);
$result
=
\Product\NewsaleModel
::
selectData
(
$data
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
...
...
Please
register
or
login
to post a comment