Authored by uedxwg

'hotrank'

framework @ 75bbc3b0
Subproject commit 4216b36673d37eecf297c5cc8b7634a32c09dc51
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
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);
... ...
<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>
... ...
... ... @@ -184,6 +184,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);
... ...
... ... @@ -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 {
... ...