Authored by Rock Zhang

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

... ... @@ -53,7 +53,6 @@ class Call extends Factory
$keys['redirect_uri'] = $this->apiConfig['appCallbackUrl'];
$token = $this->oauth->getAccessToken('code', $keys);
// try
// {
// $token = $this->oauth->getAccessToken('code', $keys);
... ...
... ... @@ -2213,24 +2213,12 @@ var $searchBox = $('.search-box'),
$box = $('.box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo'),
$channelLink = $('.index-channel a'),
$win = $(window),
$doc = $(document),
$appFloatLayer = $('#float-layer-app');
$channelLink = $('.index-channel a');
var $search = $searchBox.children('input[type="text"]'),
$cancelSearch = $box.children('.no-search'),
$searchIcon = $searchBox.children('.search-icon');
// variables for calculate the app download layer position
var layerInit = false,
windowViewHeight = 0,
layerContentHeight = $appFloatLayer.height(),
layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),
layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),
layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,
layerNewPos;
require("js/common");
$search.on('focus', function() {
... ... @@ -2262,6 +2250,15 @@ $searchBox.children('.search-icon').on('touchstart', function() {
$indexSearch.submit();
});
$searchBox.keyup(function(e) {
if (e.keyCode === 13) {
if (security.hasDangerInput()) {
return false;
}
$indexSearch.submit();
}
});
$('.index-channel img').on('load error', function() {
window.rePosFooter && window.rePosFooter();
});
... ... @@ -2285,43 +2282,6 @@ $channelLink.on('touchstart', function() {
});
});
function updateLayerPosition() {
var winHeight = window.innerHeight,
bodyHeight = $doc.height(),
scrollTopPosition = $win.scrollTop();
if (layerInit) {
//keyboard is shown
if (windowViewHeight - winHeight > 200) {
if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {
layerNewPos = 0;
} else {
layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;
}
} else {
layerNewPos = bodyHeight - winHeight - scrollTopPosition;
}
} else {
windowViewHeight = winHeight;
layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;
layerInit = true;
}
$appFloatLayer.css({
position: 'relative',
bottom: layerNewPos + 'px'
});
}
$(window).scroll(function() {
window.requestAnimationFrame(updateLayerPosition);
});
$doc.on('ready', updateLayerPosition);
});
define("js/passport/entry", ["jquery"], function(require, exports, module){
/**
... ... @@ -4879,6 +4839,8 @@ function search() {
$productDesc = $('#productDesc');
$productDesc.append(data);
window.rePosFooter();
lazyLoad($productDesc.find('img.lazy'));
//尺码信息左右滑动
... ... @@ -5034,6 +4996,9 @@ if (preferenceUrl) {
watchSlidesVisibility: true
});
}
window.rePosFooter();
}).fail(function() {
$recommendForYou.hide();
});
... ... @@ -5719,7 +5684,6 @@ var diaLog = require("js/me/dialog");
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content > .fav-type'),
$swiperList = '',
swiperObj = {},
favTabHammer,
favContentHammer,
... ... @@ -5744,22 +5708,30 @@ function showFavTab(index) {
}
//初始化swiper
function initSwiper() {
function initSwiper(data) {
var i,
id;
idStrReg = /container-(\d+)['"]{1}/gi,
idReg = /\d+/,
idArr = data.match(idStrReg),
idArrLen = idArr.length,
containerId;
$swiperList = $('.swiper-container');
for (i = 0; i < $swiperList.length; i++) {
id = $swiperList.eq(i).attr('data-id');
//$swiperList = $('.swiper-container');
for (i = 0; i < idArrLen; i++) {
/*id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
}
swiperObj[id] = new Swiper('#swiper-container-' + id, {
}*/
containerId = idArr[i].match(idReg)[0];
swiperObj[containerId] = new Swiper('#swiper-container-' + containerId, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + id,
wrapperClass: 'swiper-wrapper-' + containerId,
lazyLoading: true,
watchSlidesVisibility: true
});
... ... @@ -5800,7 +5772,7 @@ function loadData($parent, url, page) {
$parent.append(data);
$parent.closest('.fav-type').find('.fav-content-loading').remove();
if (url === 'favBrand') {
initSwiper();//如果是收藏品牌需要初始化swiper
initSwiper(data);//如果是收藏品牌需要初始化swiper
brandLockId = false;//请求成功后解锁品牌收藏page++
} else {
... ... @@ -5990,7 +5962,7 @@ $('#upload-img').uploadifive({
fileType: 'image*/*',
uploadScript: '/home/suggestimgUpload',
fileObjName: 'fileData',
fileSizeLimit: 1024,
fileSizeLimit: 300,
height: '100%',
width: '100%',
multi: false,
... ... @@ -7664,7 +7636,7 @@ function callpay(orderCode) {
function isWXOpen() {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i).toString() === 'micromessenger') {
if (ua.indexOf('micromessenger') > 0) {
return true;
} else {
return false;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -112,7 +112,6 @@ function loadData($parent, url, page) {
} else {
return;
}
window.rePosFooter();
//},1000);
}
... ...
... ... @@ -18,6 +18,8 @@ var introUrl = $('#introUrl').val(),
var sizeSwiper,
refSwiper;
var UA = navigator.userAgent.toLowerCase().toString();
//判断是否要显示向左滑动提示
function hiddenTips($ele) {
var offsetContainer,
... ... @@ -69,7 +71,9 @@ function search() {
hiddenTips($('#size-swiper-container'));
hiddenTips($('#reference-swiper-container'));
if (UA.indexOf('mqqbrowser') > 0) {
$('.detail > div').removeClass('column').addClass('oldbox');
}
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -16,7 +16,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
var $cart = $('.cart-bar');
var UA = navigator.userAgent.toLowerCase().toString();
require('./desc');
require('./comments-consults');
... ... @@ -82,7 +82,6 @@ $.ajax({
}
});
if (UA.indexOf('mqqbrowser') > -1) {
$('.detail > div').removeClass('column').addClass('oldbox');
}
require('./like');
... ...
... ... @@ -188,6 +188,7 @@ class LoginController extends AbstractAction
}
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
$this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -217,6 +218,7 @@ class LoginController extends AbstractAction
}
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
$this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -246,6 +248,7 @@ class LoginController extends AbstractAction
}
if ($result['code'] == 200 && !empty($result['data']['uid'])) {
$this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ...
... ... @@ -33,12 +33,12 @@ application.debug = False
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = True
application.dispatcher.throwException = False
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象
application.dispatcher.catchException = True
application.dispatcher.catchException = False
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
... ...
... ... @@ -33,12 +33,12 @@ application.debug = True
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = True
application.dispatcher.throwException = False
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象 False
application.dispatcher.catchException = True
application.dispatcher.catchException = False
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
... ...