Authored by uedxwg

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

@@ -43,7 +43,7 @@ class NewSaleProcess @@ -43,7 +43,7 @@ class NewSaleProcess
43 // 处理商品 43 // 处理商品
44 if (isset($products['product_list'])) { 44 if (isset($products['product_list'])) {
45 foreach ($products['product_list'] as $single) { 45 foreach ($products['product_list'] as $single) {
46 - $result['goods'][] = Helpers::formatProduct($single, true, false, false, 290, 388); 46 + $result['goods'][] = Helpers::formatProduct($single, true, false, false, 235, 314);
47 } 47 }
48 } 48 }
49 49
@@ -53,7 +53,6 @@ class Call extends Factory @@ -53,7 +53,6 @@ class Call extends Factory
53 $keys['redirect_uri'] = $this->apiConfig['appCallbackUrl']; 53 $keys['redirect_uri'] = $this->apiConfig['appCallbackUrl'];
54 54
55 $token = $this->oauth->getAccessToken('code', $keys); 55 $token = $this->oauth->getAccessToken('code', $keys);
56 -  
57 // try 56 // try
58 // { 57 // {
59 // $token = $this->oauth->getAccessToken('code', $keys); 58 // $token = $this->oauth->getAccessToken('code', $keys);
@@ -2213,24 +2213,12 @@ var $searchBox = $('.search-box'), @@ -2213,24 +2213,12 @@ var $searchBox = $('.search-box'),
2213 $box = $('.box'), 2213 $box = $('.box'),
2214 $indexSearch = $('.index-search'), 2214 $indexSearch = $('.index-search'),
2215 $indexLogo = $('.index-logo'), 2215 $indexLogo = $('.index-logo'),
2216 - $channelLink = $('.index-channel a'),  
2217 - $win = $(window),  
2218 - $doc = $(document),  
2219 - $appFloatLayer = $('#float-layer-app'); 2216 + $channelLink = $('.index-channel a');
2220 2217
2221 var $search = $searchBox.children('input[type="text"]'), 2218 var $search = $searchBox.children('input[type="text"]'),
2222 $cancelSearch = $box.children('.no-search'), 2219 $cancelSearch = $box.children('.no-search'),
2223 $searchIcon = $searchBox.children('.search-icon'); 2220 $searchIcon = $searchBox.children('.search-icon');
2224 2221
2225 -// variables for calculate the app download layer position  
2226 -var layerInit = false,  
2227 - windowViewHeight = 0,  
2228 - layerContentHeight = $appFloatLayer.height(),  
2229 - layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),  
2230 - layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),  
2231 - layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,  
2232 - layerNewPos;  
2233 -  
2234 require("js/common"); 2222 require("js/common");
2235 2223
2236 $search.on('focus', function() { 2224 $search.on('focus', function() {
@@ -2262,6 +2250,15 @@ $searchBox.children('.search-icon').on('touchstart', function() { @@ -2262,6 +2250,15 @@ $searchBox.children('.search-icon').on('touchstart', function() {
2262 $indexSearch.submit(); 2250 $indexSearch.submit();
2263 }); 2251 });
2264 2252
  2253 +$searchBox.keyup(function(e) {
  2254 + if (e.keyCode === 13) {
  2255 + if (security.hasDangerInput()) {
  2256 + return false;
  2257 + }
  2258 + $indexSearch.submit();
  2259 + }
  2260 +});
  2261 +
2265 $('.index-channel img').on('load error', function() { 2262 $('.index-channel img').on('load error', function() {
2266 window.rePosFooter && window.rePosFooter(); 2263 window.rePosFooter && window.rePosFooter();
2267 }); 2264 });
@@ -2285,43 +2282,6 @@ $channelLink.on('touchstart', function() { @@ -2285,43 +2282,6 @@ $channelLink.on('touchstart', function() {
2285 }); 2282 });
2286 }); 2283 });
2287 2284
2288 -  
2289 -function updateLayerPosition() {  
2290 - var winHeight = window.innerHeight,  
2291 - bodyHeight = $doc.height(),  
2292 - scrollTopPosition = $win.scrollTop();  
2293 -  
2294 - if (layerInit) {  
2295 -  
2296 - //keyboard is shown  
2297 - if (windowViewHeight - winHeight > 200) {  
2298 - if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {  
2299 - layerNewPos = 0;  
2300 - } else {  
2301 - layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;  
2302 - }  
2303 - } else {  
2304 - layerNewPos = bodyHeight - winHeight - scrollTopPosition;  
2305 - }  
2306 -  
2307 - } else {  
2308 - windowViewHeight = winHeight;  
2309 - layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;  
2310 - layerInit = true;  
2311 - }  
2312 -  
2313 - $appFloatLayer.css({  
2314 - position: 'relative',  
2315 - bottom: layerNewPos + 'px'  
2316 - });  
2317 -}  
2318 -  
2319 -$(window).scroll(function() {  
2320 - window.requestAnimationFrame(updateLayerPosition);  
2321 -});  
2322 -  
2323 -$doc.on('ready', updateLayerPosition);  
2324 -  
2325 }); 2285 });
2326 define("js/passport/entry", ["jquery"], function(require, exports, module){ 2286 define("js/passport/entry", ["jquery"], function(require, exports, module){
2327 /** 2287 /**
@@ -4879,6 +4839,8 @@ function search() { @@ -4879,6 +4839,8 @@ function search() {
4879 $productDesc = $('#productDesc'); 4839 $productDesc = $('#productDesc');
4880 $productDesc.append(data); 4840 $productDesc.append(data);
4881 4841
  4842 + window.rePosFooter();
  4843 +
4882 lazyLoad($productDesc.find('img.lazy')); 4844 lazyLoad($productDesc.find('img.lazy'));
4883 4845
4884 //尺码信息左右滑动 4846 //尺码信息左右滑动
@@ -5034,6 +4996,9 @@ if (preferenceUrl) { @@ -5034,6 +4996,9 @@ if (preferenceUrl) {
5034 watchSlidesVisibility: true 4996 watchSlidesVisibility: true
5035 }); 4997 });
5036 } 4998 }
  4999 +
  5000 + window.rePosFooter();
  5001 +
5037 }).fail(function() { 5002 }).fail(function() {
5038 $recommendForYou.hide(); 5003 $recommendForYou.hide();
5039 }); 5004 });
@@ -5719,7 +5684,6 @@ var diaLog = require("js/me/dialog"); @@ -5719,7 +5684,6 @@ var diaLog = require("js/me/dialog");
5719 5684
5720 var $navLi = $('#fav-tab > li'), 5685 var $navLi = $('#fav-tab > li'),
5721 $favContainer = $('.fav-content > .fav-type'), 5686 $favContainer = $('.fav-content > .fav-type'),
5722 - $swiperList = '',  
5723 swiperObj = {}, 5687 swiperObj = {},
5724 favTabHammer, 5688 favTabHammer,
5725 favContentHammer, 5689 favContentHammer,
@@ -5744,22 +5708,30 @@ function showFavTab(index) { @@ -5744,22 +5708,30 @@ function showFavTab(index) {
5744 } 5708 }
5745 5709
5746 //初始化swiper 5710 //初始化swiper
5747 -function initSwiper() { 5711 +function initSwiper(data) {
5748 var i, 5712 var i,
5749 - id; 5713 + idStrReg = /container-(\d+)['"]{1}/gi,
  5714 + idReg = /\d+/,
  5715 + idArr = data.match(idStrReg),
  5716 + idArrLen = idArr.length,
  5717 + containerId;
5750 5718
5751 - $swiperList = $('.swiper-container');  
5752 - for (i = 0; i < $swiperList.length; i++) {  
5753 - id = $swiperList.eq(i).attr('data-id'); 5719 + //$swiperList = $('.swiper-container');
  5720 + for (i = 0; i < idArrLen; i++) {
  5721 +
  5722 + /*id = $swiperList.eq(i).attr('data-id');
5754 5723
5755 if (!!swiperObj[id]) { 5724 if (!!swiperObj[id]) {
5756 swiperObj[id].destroy(true, true); 5725 swiperObj[id].destroy(true, true);
5757 - }  
5758 - swiperObj[id] = new Swiper('#swiper-container-' + id, { 5726 + }*/
  5727 +
  5728 + containerId = idArr[i].match(idReg)[0];
  5729 +
  5730 + swiperObj[containerId] = new Swiper('#swiper-container-' + containerId, {
5759 slidesPerView: 'auto', 5731 slidesPerView: 'auto',
5760 grabCursor: true, 5732 grabCursor: true,
5761 slideElement: 'li', 5733 slideElement: 'li',
5762 - wrapperClass: 'swiper-wrapper-' + id, 5734 + wrapperClass: 'swiper-wrapper-' + containerId,
5763 lazyLoading: true, 5735 lazyLoading: true,
5764 watchSlidesVisibility: true 5736 watchSlidesVisibility: true
5765 }); 5737 });
@@ -5800,7 +5772,7 @@ function loadData($parent, url, page) { @@ -5800,7 +5772,7 @@ function loadData($parent, url, page) {
5800 $parent.append(data); 5772 $parent.append(data);
5801 $parent.closest('.fav-type').find('.fav-content-loading').remove(); 5773 $parent.closest('.fav-type').find('.fav-content-loading').remove();
5802 if (url === 'favBrand') { 5774 if (url === 'favBrand') {
5803 - initSwiper();//如果是收藏品牌需要初始化swiper 5775 + initSwiper(data);//如果是收藏品牌需要初始化swiper
5804 5776
5805 brandLockId = false;//请求成功后解锁品牌收藏page++ 5777 brandLockId = false;//请求成功后解锁品牌收藏page++
5806 } else { 5778 } else {
@@ -5990,7 +5962,7 @@ $('#upload-img').uploadifive({ @@ -5990,7 +5962,7 @@ $('#upload-img').uploadifive({
5990 fileType: 'image*/*', 5962 fileType: 'image*/*',
5991 uploadScript: '/home/suggestimgUpload', 5963 uploadScript: '/home/suggestimgUpload',
5992 fileObjName: 'fileData', 5964 fileObjName: 'fileData',
5993 - fileSizeLimit: 1024, 5965 + fileSizeLimit: 300,
5994 height: '100%', 5966 height: '100%',
5995 width: '100%', 5967 width: '100%',
5996 multi: false, 5968 multi: false,
@@ -7664,7 +7636,7 @@ function callpay(orderCode) { @@ -7664,7 +7636,7 @@ function callpay(orderCode) {
7664 function isWXOpen() { 7636 function isWXOpen() {
7665 var ua = window.navigator.userAgent.toLowerCase(); 7637 var ua = window.navigator.userAgent.toLowerCase();
7666 7638
7667 - if (ua.match(/MicroMessenger/i).toString() === 'micromessenger') { 7639 + if (ua.indexOf('micromessenger') > 0) {
7668 return true; 7640 return true;
7669 } else { 7641 } else {
7670 return false; 7642 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.
@@ -219,7 +219,7 @@ class NewsaleModel @@ -219,7 +219,7 @@ class NewsaleModel
219 219
220 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { 220 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
221 foreach ($data['data']['product_list'] as $val) { 221 foreach ($data['data']['product_list'] as $val) {
222 - $result['goods'][] = Helpers::formatProduct($val, true, false, false, 299, 388); 222 + $result['goods'][] = Helpers::formatProduct($val, true, false, false, 235, 314);
223 } 223 }
224 } 224 }
225 225
@@ -188,6 +188,7 @@ class LoginController extends AbstractAction @@ -188,6 +188,7 @@ class LoginController extends AbstractAction
188 } 188 }
189 189
190 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 190 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
  191 + $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
191 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 192 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
192 } else { 193 } else {
193 $this->go($refer); 194 $this->go($refer);
@@ -217,6 +218,7 @@ class LoginController extends AbstractAction @@ -217,6 +218,7 @@ class LoginController extends AbstractAction
217 } 218 }
218 219
219 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 220 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
  221 + $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
220 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 222 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
221 } else { 223 } else {
222 $this->go($refer); 224 $this->go($refer);
@@ -246,6 +248,7 @@ class LoginController extends AbstractAction @@ -246,6 +248,7 @@ class LoginController extends AbstractAction
246 } 248 }
247 249
248 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 250 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
  251 + $this->setSession('_TOKEN', Helpers::makeToken($result['data']['uid']));
249 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 252 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
250 } else { 253 } else {
251 $this->go($refer); 254 $this->go($refer);
@@ -33,12 +33,12 @@ application.debug = False @@ -33,12 +33,12 @@ application.debug = False
33 application.servers.config = APPLICATION_PATH "/configs/core" 33 application.servers.config = APPLICATION_PATH "/configs/core"
34 34
35 ;出错的时候是否抛出异常 35 ;出错的时候是否抛出异常
36 -application.dispatcher.throwException = True 36 +application.dispatcher.throwException = False
37 37
38 ;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候, 38 ;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
39 ;控制权会交给ErrorController的errorAction 方法, 39 ;控制权会交给ErrorController的errorAction 方法,
40 ;可以通过$request->getException()获得此异常对象 40 ;可以通过$request->getException()获得此异常对象
41 -application.dispatcher.catchException = True 41 +application.dispatcher.catchException = False
42 42
43 ;模板预编译目录,该目录需要有读写权限 43 ;模板预编译目录,该目录需要有读写权限
44 application.template.compile = ROOT_PATH "/compile/m.yohobuy.com" 44 application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
@@ -33,12 +33,12 @@ application.debug = True @@ -33,12 +33,12 @@ application.debug = True
33 application.servers.config = APPLICATION_PATH "/configs/core" 33 application.servers.config = APPLICATION_PATH "/configs/core"
34 34
35 ;出错的时候是否抛出异常 35 ;出错的时候是否抛出异常
36 -application.dispatcher.throwException = True 36 +application.dispatcher.throwException = False
37 37
38 ;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候, 38 ;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
39 ;控制权会交给ErrorController的errorAction 方法, 39 ;控制权会交给ErrorController的errorAction 方法,
40 ;可以通过$request->getException()获得此异常对象 False 40 ;可以通过$request->getException()获得此异常对象 False
41 -application.dispatcher.catchException = True 41 +application.dispatcher.catchException = False
42 42
43 ;模板预编译目录,该目录需要有读写权限 43 ;模板预编译目录,该目录需要有读写权限
44 application.template.compile = ROOT_PATH "/compile/m.yohobuy.com" 44 application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"