Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -10,28 +10,51 @@ var Swiper = require('yoho.iswiper'),
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
preferenceUrl = $('#preferenceUrl').val();
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
if (html.length < 5) {
$recommendForYou.css('display', 'none');
} else {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
preferenceUrl = $('#preferenceUrl').val(),
winH = $(window).height(),
end = false,
requesting = false;
function request() {
if (requesting || end) {
return;
}
requesting = true;
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
if (html.length < 5) {
$recommendForYou.css('display', 'none');
} else {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
}
window.rePosFooter();
requesting = false;
end = true;
}).fail(function() {
$recommendForYou.hide();
});
}).fail(function() {
$recommendForYou.hide();
});
}
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
request();
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...
... ... @@ -59,7 +59,7 @@ class BindController extends AbstractAction
$phoneNum=$this->get('phoneNum');
$data = array(
'bindIndex'=>true,//js标识
'bindCode'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
... ... @@ -87,7 +87,7 @@ class BindController extends AbstractAction
$nickname = $this->get('nickname');
$areaCode = $this->get('areaCode', '86');
$data = array(
'bindIndex'=>true,//js标识
'bindPwd'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
... ... @@ -138,7 +138,7 @@ class BindController extends AbstractAction
}
else
{
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => $res['data']);
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => isset($res['data'])?$res['data']:'');
}
}
while (false);
... ...