Authored by Lynnic

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

Conflicts:
	static/js/product/detail/detail.js
	static/sass/product/_detail.scss
Showing 47 changed files with 306 additions and 366 deletions
@@ -1096,13 +1096,13 @@ @@ -1096,13 +1096,13 @@
1096 'vipLevel' : { 1096 'vipLevel' : {
1097 'list' : [ 1097 'list' : [
1098 { 1098 {
1099 - 'text' : '¥284.00' 1099 + 'text' : '¥284.00',
  1100 + 'currentLevel':true
1100 }, 1101 },
1101 ... 1102 ...
1102 ] 1103 ]
1103 }, 1104 },
1104 'goodsDiscount' : { 1105 'goodsDiscount' : {
1105 - 'listLength' : 2,  
1106 'list' : [ 1106 'list' : [
1107 { 1107 {
1108 'text' : '【BACK TO SCHOOL】满¥499赠送Paul Franke帽子一个,多买多送!' 1108 'text' : '【BACK TO SCHOOL】满¥499赠送Paul Franke帽子一个,多买多送!'
@@ -1234,12 +1234,29 @@ @@ -1234,12 +1234,29 @@
1234 }, 1234 },
1235 1235
1236 'cartInfo' : { 1236 'cartInfo' : {
1237 - 'numInCart' : 3,  
1238 - 'goodsInstore' : 0,  
1239 - 'isCollect':true// 1237 + 'cartUrl':'购物车url',
  1238 + 'addToCartUrl':'添加购物车url',
  1239 + 'soldOut':'已售罄',
  1240 + 'notForSale':'非卖品'
  1241 + },
  1242 + 'introUrl' : '',
  1243 + 'id' : '',
  1244 + 'preferenceUrl' :''
  1245 + }
  1246 +### 咨询列表页面
  1247 + {
  1248 + 'link' : '咨询表单跳转url',
  1249 + 'consults':{
  1250 + 'list' : [
  1251 + {
  1252 + 'question':'',
  1253 + 'time':'',
  1254 + 'answer':''
  1255 + }
  1256 + ...
  1257 + ]
1240 } 1258 }
1241 } 1259 }
1242 -  
1243 ### 支付中心 1260 ### 支付中心
1244 1261
1245 { 1262 {
@@ -34,6 +34,7 @@ class AbstractAction extends Controller_Abstract @@ -34,6 +34,7 @@ class AbstractAction extends Controller_Abstract
34 protected $_uid = 0; 34 protected $_uid = 0;
35 protected $_uname = ''; 35 protected $_uname = '';
36 protected $_vip; 36 protected $_vip;
  37 + protected $_useSession = true;
37 38
38 /** 39 /**
39 * 存放模板数据 40 * 存放模板数据
@@ -53,16 +54,20 @@ class AbstractAction extends Controller_Abstract @@ -53,16 +54,20 @@ class AbstractAction extends Controller_Abstract
53 switch (APPLICATION_ENV) { 54 switch (APPLICATION_ENV) {
54 case 'production': // 生产 55 case 'production': // 生产
55 $this->_view->assign('rlsEnv', true); 56 $this->_view->assign('rlsEnv', true);
  57 + $this->_useSession = true;
56 break; 58 break;
57 case 'preview': // 预览 59 case 'preview': // 预览
58 $this->_view->assign('preEnv', true); 60 $this->_view->assign('preEnv', true);
  61 + $this->_useSession = true;
59 break; 62 break;
60 case 'testing': // 测试 63 case 'testing': // 测试
61 $this->_view->assign('testEnv', true); 64 $this->_view->assign('testEnv', true);
  65 + $this->_useSession = true;
62 break; 66 break;
63 case 'develop': // 开发 67 case 'develop': // 开发
64 default: 68 default:
65 $this->_view->assign('devEnv', true); 69 $this->_view->assign('devEnv', true);
  70 + $this->_useSession = false;
66 break; 71 break;
67 } 72 }
68 } 73 }
@@ -261,7 +266,9 @@ class AbstractAction extends Controller_Abstract @@ -261,7 +266,9 @@ class AbstractAction extends Controller_Abstract
261 */ 266 */
262 public function setSession($name, $value) 267 public function setSession($name, $value)
263 { 268 {
264 - Session::start('yohobuy_session', null, 'yohobuy.com')->__set($name, $value); 269 + if ($this->_useSession) {
  270 + Session::start('yohobuy_session', null, 'yohobuy.com')->__set($name, $value);
  271 + }
265 } 272 }
266 273
267 /** 274 /**
@@ -272,7 +279,11 @@ class AbstractAction extends Controller_Abstract @@ -272,7 +279,11 @@ class AbstractAction extends Controller_Abstract
272 */ 279 */
273 public function getSession($name) 280 public function getSession($name)
274 { 281 {
275 - return Session::start('yohobuy_session', null, 'yohobuy.com')->__get($name); 282 + if ($this->_useSession) {
  283 + return Session::start('yohobuy_session', null, 'yohobuy.com')->__get($name);
  284 + } else {
  285 + return '';
  286 + }
276 } 287 }
277 288
278 /** 289 /**
@@ -283,26 +294,27 @@ class AbstractAction extends Controller_Abstract @@ -283,26 +294,27 @@ class AbstractAction extends Controller_Abstract
283 */ 294 */
284 protected function getUid($useSession = false) 295 protected function getUid($useSession = false)
285 { 296 {
286 - // @todo  
287 - $useSession = false;  
288 - 297 + // 控制是否启用SESSION
  298 + if (!$this->_useSession) {
  299 + $useSession = false;
  300 + }
  301 +
289 if (!$this->_uid) { 302 if (!$this->_uid) {
290 $cookie = $this->getCookie('_UID'); 303 $cookie = $this->getCookie('_UID');
291 if (!empty($cookie)) { 304 if (!empty($cookie)) {
292 - $uid = 0;  
293 $cookieList = explode('::', $cookie); 305 $cookieList = explode('::', $cookie);
294 if (isset($cookieList[1]) && is_numeric($cookieList[1])) { 306 if (isset($cookieList[1]) && is_numeric($cookieList[1])) {
295 - $uid = $cookieList[1]; 307 + if ($useSession) {
  308 + $token = $this->getSession('_TOKEN');
  309 + if ($token === Helpers::makeToken($cookieList[1])) {
  310 + $this->_uid = $cookieList[1];
  311 + }
  312 + } else {
  313 + $this->_uid = $cookieList[1];
  314 + }
296 $this->_uname = $cookieList[0]; 315 $this->_uname = $cookieList[0];
297 $this->_vip = $cookieList[2]; 316 $this->_vip = $cookieList[2];
298 } 317 }
299 - // 服务端比较  
300 - if ($useSession && $uid) {  
301 - $token = $this->getSession('_TOKEN');  
302 - if ($token === Helpers::makeToken($uid)) {  
303 - $this->_uid = $uid;  
304 - }  
305 - }  
306 } 318 }
307 } 319 }
308 return $this->_uid; 320 return $this->_uid;
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 /** 3 /**
4 * 有货相关接口类 4 * 有货相关接口类
5 - * 5 + *
6 * @name Yohobuy 6 * @name Yohobuy
7 * @package library/Api 7 * @package library/Api
8 * @copyright yoho.inc 8 * @copyright yoho.inc
@@ -35,8 +35,8 @@ class Yohobuy @@ -35,8 +35,8 @@ class Yohobuy
35 35
36 /** 36 /**
37 * 私钥列表 37 * 私钥列表
38 - *  
39 - * @var array 38 + *
  39 + * @var array
40 */ 40 */
41 private static $privateKeyList = array( 41 private static $privateKeyList = array(
42 'android' => 'fd4ad5fcfa0de589ef238c0e7331b585', 42 'android' => 'fd4ad5fcfa0de589ef238c0e7331b585',
@@ -84,7 +84,7 @@ class Yohobuy @@ -84,7 +84,7 @@ class Yohobuy
84 84
85 /** 85 /**
86 * 取得公共的参数 86 * 取得公共的参数
87 - * 87 + *
88 * @return array 88 * @return array
89 */ 89 */
90 public static function param() 90 public static function param()
@@ -103,7 +103,7 @@ class Yohobuy @@ -103,7 +103,7 @@ class Yohobuy
103 103
104 /** 104 /**
105 * 构建URL 105 * 构建URL
106 - * 106 + *
107 * @param string $url 107 * @param string $url
108 * @param array $data 108 * @param array $data
109 * @return string 109 * @return string
@@ -179,7 +179,7 @@ class Yohobuy @@ -179,7 +179,7 @@ class Yohobuy
179 179
180 /** 180 /**
181 * post提交数据 181 * post提交数据
182 - * 182 + *
183 * @param string $url 接口URL 183 * @param string $url 接口URL
184 * @param array $data 参数列表 184 * @param array $data 参数列表
185 * @param bool $returnJson 控制是否返回json格式数据 185 * @param bool $returnJson 控制是否返回json格式数据
@@ -231,7 +231,7 @@ class Yohobuy @@ -231,7 +231,7 @@ class Yohobuy
231 231
232 /** 232 /**
233 * 批量调用接口 233 * 批量调用接口
234 - * 234 + *
235 * @param array $urlList 接口列表 235 * @param array $urlList 接口列表
236 * @param array $options CURL设置项 236 * @param array $options CURL设置项
237 * @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存 237 * @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存
@@ -335,7 +335,7 @@ class Yohobuy @@ -335,7 +335,7 @@ class Yohobuy
335 335
336 /** 336 /**
337 * rpc调用远程服务(YAR) 337 * rpc调用远程服务(YAR)
338 - * 338 + *
339 * @see http://php.net/manual/zh/yar-client.setopt.php 339 * @see http://php.net/manual/zh/yar-client.setopt.php
340 * @param string $uri 340 * @param string $uri
341 * @param string $method 341 * @param string $method
@@ -384,7 +384,7 @@ class Yohobuy @@ -384,7 +384,7 @@ class Yohobuy
384 384
385 /** 385 /**
386 * 并行(异步)调用远程服务 386 * 并行(异步)调用远程服务
387 - * 387 + *
388 * @see http://php.net/manual/zh/class.yar-concurrent-client.php 388 * @see http://php.net/manual/zh/class.yar-concurrent-client.php
389 * @param string $uri 389 * @param string $uri
390 * @param string $method 390 * @param string $method
@@ -76,15 +76,4 @@ class LoginData @@ -76,15 +76,4 @@ class LoginData
76 return Yohobuy::get(Yohobuy::API_URL, $param); 76 return Yohobuy::get(Yohobuy::API_URL, $param);
77 } 77 }
78 78
79 - /**  
80 - * 登出SESSION会话  
81 - *  
82 - * @param string $token 会话  
83 - * @return array  
84 - */  
85 - public static function signoutSession($token)  
86 - {  
87 - return Yohobuy::get( Helpers::logoutSession($token) );  
88 - }  
89 -  
90 } 79 }
@@ -42,7 +42,7 @@ class ListProcess @@ -42,7 +42,7 @@ class ListProcess
42 $products = array(); 42 $products = array();
43 43
44 foreach ($data as $value) { 44 foreach ($data as $value) {
45 - $products[] = Helpers::formatProduct($value, true, true, true); 45 + $products[] = Helpers::formatProduct($value, true, true, true, 235, 314);
46 } 46 }
47 47
48 return $products; 48 return $products;
@@ -247,6 +247,9 @@ class ListProcess @@ -247,6 +247,9 @@ class ListProcess
247 247
248 private static function priceRange($data) 248 private static function priceRange($data)
249 { 249 {
  250 + // 首先对价格进行排序
  251 + ksort($data, SORT_NUMERIC);
  252 +
250 $result = array( 253 $result = array(
251 'title' => '价格', 254 'title' => '价格',
252 'name' => '所有价格', 255 'name' => '所有价格',
@@ -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
@@ -607,7 +607,7 @@ class Helpers @@ -607,7 +607,7 @@ class Helpers
607 public static function syncUserSession($uid, $refer = '', $callback = 'call') 607 public static function syncUserSession($uid, $refer = '', $callback = 'call')
608 { 608 {
609 return 'http://mapi.yohobuy.com/Passport/session/index?callback=' . $callback 609 return 'http://mapi.yohobuy.com/Passport/session/index?callback=' . $callback
610 - . '&sign=' . md5($uid . 'Js8Yn0!EwPM45-ws') . '&uid=' . $uid . '&go=' . $refer; 610 + . '&sign=' . md5(md5($uid . 'Js8Yn0!EwPM45-ws')) . '&uid=' . $uid . '&go=' . $refer;
611 } 611 }
612 612
613 /** 613 /**
@@ -620,10 +620,10 @@ class Helpers @@ -620,10 +620,10 @@ class Helpers
620 * @param string $callback 回调方法名 620 * @param string $callback 回调方法名
621 * @return string 621 * @return string
622 */ 622 */
623 - public static function logoutSession($token, $callback = 'call') 623 + public static function logoutSession($token, $refer = '', $callback = 'call')
624 { 624 {
625 return 'http://mapi.yohobuy.com/Passport/session/logout?callback=' . $callback 625 return 'http://mapi.yohobuy.com/Passport/session/logout?callback=' . $callback
626 - . '&sign=' . md5('Js8Yn0!EwPM45-ws') . '&token=' . $token; 626 + . '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
627 } 627 }
628 628
629 } 629 }
@@ -52,14 +52,15 @@ class Call extends Factory @@ -52,14 +52,15 @@ class Call extends Factory
52 $keys['code'] = $_REQUEST['code']; 52 $keys['code'] = $_REQUEST['code'];
53 $keys['redirect_uri'] = $this->apiConfig['appCallbackUrl']; 53 $keys['redirect_uri'] = $this->apiConfig['appCallbackUrl'];
54 54
55 - try  
56 - {  
57 - $token = $this->oauth->getAccessToken('code', $keys);  
58 - }  
59 - catch (Exception $e)  
60 - {  
61 - // do nothing  
62 - } 55 + $token = $this->oauth->getAccessToken('code', $keys);
  56 +// try
  57 +// {
  58 +// $token = $this->oauth->getAccessToken('code', $keys);
  59 +// }
  60 +// catch (Exception $e)
  61 +// {
  62 +// // do nothing
  63 +// }
63 } 64 }
64 65
65 return $token; 66 return $token;
@@ -990,7 +990,11 @@ var $loading, @@ -990,7 +990,11 @@ var $loading,
990 990
991 // 初始化 991 // 初始化
992 function init($container) { 992 function init($container) {
993 - var html = '<div class="loading-mask hide"><div class="loading"></div></div>'; 993 + var html = '<div class="loading-mask hide">' +
  994 + '<div class="loading">' +
  995 + '<div></div><div></div><div></div>' +
  996 + '</div>' +
  997 + '</div>';
994 998
995 hasInit = true; 999 hasInit = true;
996 if ($container === undefined) { 1000 if ($container === undefined) {
@@ -1970,6 +1974,7 @@ var $icon = $('.search-icon'); @@ -1970,6 +1974,7 @@ var $icon = $('.search-icon');
1970 var $form = $('#search-form'); 1974 var $form = $('#search-form');
1971 1975
1972 var $history = $('.history'); 1976 var $history = $('.history');
  1977 +var $historySearch = $('.history-search');
1973 1978
1974 var $clearHistory = $('#clear-history'); 1979 var $clearHistory = $('#clear-history');
1975 1980
@@ -1984,6 +1989,8 @@ chHammer.on('tap', function() { @@ -1984,6 +1989,8 @@ chHammer.on('tap', function() {
1984 localStorage.removeItem('historys'); 1989 localStorage.removeItem('historys');
1985 1990
1986 $history.html(''); 1991 $history.html('');
  1992 + $historySearch.hide();
  1993 + $clearHistory.hide();
1987 1994
1988 window.rePosFooter(); 1995 window.rePosFooter();
1989 }); 1996 });
@@ -2033,7 +2040,7 @@ $('#search').on('touchend', function() { @@ -2033,7 +2040,7 @@ $('#search').on('touchend', function() {
2033 2040
2034 $history.html(html); 2041 $history.html(html);
2035 $clearHistory.removeClass('hide'); 2042 $clearHistory.removeClass('hide');
2036 - 2043 + $historySearch.removeClass('hide');
2037 window.rePosFooter(); 2044 window.rePosFooter();
2038 } 2045 }
2039 } 2046 }
@@ -2206,24 +2213,12 @@ var $searchBox = $('.search-box'), @@ -2206,24 +2213,12 @@ var $searchBox = $('.search-box'),
2206 $box = $('.box'), 2213 $box = $('.box'),
2207 $indexSearch = $('.index-search'), 2214 $indexSearch = $('.index-search'),
2208 $indexLogo = $('.index-logo'), 2215 $indexLogo = $('.index-logo'),
2209 - $channelLink = $('.index-channel a'),  
2210 - $win = $(window),  
2211 - $doc = $(document),  
2212 - $appFloatLayer = $('#float-layer-app'); 2216 + $channelLink = $('.index-channel a');
2213 2217
2214 var $search = $searchBox.children('input[type="text"]'), 2218 var $search = $searchBox.children('input[type="text"]'),
2215 $cancelSearch = $box.children('.no-search'), 2219 $cancelSearch = $box.children('.no-search'),
2216 $searchIcon = $searchBox.children('.search-icon'); 2220 $searchIcon = $searchBox.children('.search-icon');
2217 2221
2218 -// variables for calculate the app download layer position  
2219 -var layerInit = false,  
2220 - windowViewHeight = 0,  
2221 - layerContentHeight = $appFloatLayer.height(),  
2222 - layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),  
2223 - layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),  
2224 - layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,  
2225 - layerNewPos;  
2226 -  
2227 require("js/common"); 2222 require("js/common");
2228 2223
2229 $search.on('focus', function() { 2224 $search.on('focus', function() {
@@ -2255,6 +2250,15 @@ $searchBox.children('.search-icon').on('touchstart', function() { @@ -2255,6 +2250,15 @@ $searchBox.children('.search-icon').on('touchstart', function() {
2255 $indexSearch.submit(); 2250 $indexSearch.submit();
2256 }); 2251 });
2257 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 +
2258 $('.index-channel img').on('load error', function() { 2262 $('.index-channel img').on('load error', function() {
2259 window.rePosFooter && window.rePosFooter(); 2263 window.rePosFooter && window.rePosFooter();
2260 }); 2264 });
@@ -2278,43 +2282,6 @@ $channelLink.on('touchstart', function() { @@ -2278,43 +2282,6 @@ $channelLink.on('touchstart', function() {
2278 }); 2282 });
2279 }); 2283 });
2280 2284
2281 -  
2282 -function updateLayerPosition() {  
2283 - var winHeight = window.innerHeight,  
2284 - bodyHeight = $doc.height(),  
2285 - scrollTopPosition = $win.scrollTop();  
2286 -  
2287 - if (layerInit) {  
2288 -  
2289 - //keyboard is shown  
2290 - if (windowViewHeight - winHeight > 200) {  
2291 - if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {  
2292 - layerNewPos = 0;  
2293 - } else {  
2294 - layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;  
2295 - }  
2296 - } else {  
2297 - layerNewPos = bodyHeight - winHeight - scrollTopPosition;  
2298 - }  
2299 -  
2300 - } else {  
2301 - windowViewHeight = winHeight;  
2302 - layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;  
2303 - layerInit = true;  
2304 - }  
2305 -  
2306 - $appFloatLayer.css({  
2307 - position: 'relative',  
2308 - bottom: layerNewPos + 'px'  
2309 - });  
2310 -}  
2311 -  
2312 -$(window).scroll(function() {  
2313 - window.requestAnimationFrame(updateLayerPosition);  
2314 -});  
2315 -  
2316 -$doc.on('ready', updateLayerPosition);  
2317 -  
2318 }); 2285 });
2319 define("js/passport/entry", ["jquery"], function(require, exports, module){ 2286 define("js/passport/entry", ["jquery"], function(require, exports, module){
2320 /** 2287 /**
@@ -3299,7 +3266,7 @@ var winH = $(window).height(), @@ -3299,7 +3266,7 @@ var winH = $(window).height(),
3299 noResult = '<p class="no-result">未找到相关搜索结果</p>'; 3266 noResult = '<p class="no-result">未找到相关搜索结果</p>';
3300 3267
3301 //默认筛选条件 3268 //默认筛选条件
3302 -var defaultOpt = require("js/product/extract-url"); 3269 +var defaultOpt = require("js/product/query-param");
3303 3270
3304 var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 3271 var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置
3305 3272
@@ -3844,49 +3811,21 @@ exports.hideFilter = hideFilter; @@ -3844,49 +3811,21 @@ exports.hideFilter = hideFilter;
3844 exports.resetFilter = resetFilter; 3811 exports.resetFilter = resetFilter;
3845 3812
3846 }); 3813 });
3847 -define("js/product/extract-url", [], function(require, exports, module){ 3814 +define("js/product/query-param", ["jquery"], function(require, exports, module){
3848 /** 3815 /**
3849 - * 提取URL中的参数 3816 + * 提取查询参数
3850 * @author: xuqi<qi.xu@yoho.cn> 3817 * @author: xuqi<qi.xu@yoho.cn>
3851 * @date: 2015/11/19 3818 * @date: 2015/11/19
3852 */ 3819 */
3853 3820
3854 -var opt = {};  
3855 -  
3856 -var paramStr = window.location.search.split('?')[1];  
3857 -  
3858 -var keyVal = paramStr ? paramStr.split('&') : [];  
3859 -  
3860 -var i, key, val;  
3861 -  
3862 -for (i = keyVal.length; i > 0; i--) {  
3863 - key = keyVal[i - 1].split('=');  
3864 -  
3865 - val = key[1];  
3866 - key = key[0]; 3821 +var $ = require("jquery"),
  3822 + opt = {};
3867 3823
3868 - //初始化默认参数  
3869 - opt[key] = val; 3824 +$('.query-param').each(function() {
  3825 + var $this = $(this);
3870 3826
3871 - //discount = p_d,同时需要两个参数  
3872 - if (key === 'discount' || key === 'p_d') {  
3873 - opt.discount = val;  
3874 - opt.p_d = val;  
3875 - }  
3876 -}  
3877 -  
3878 -if (typeof opt.gender === 'undefined') {  
3879 - switch (window.cookie('_Channel')) {  
3880 - case 'boys':  
3881 - opt.gender = '1,3';  
3882 - break;  
3883 - case 'girls':  
3884 - opt.gender = '2,3';  
3885 - break;  
3886 - default:  
3887 - opt.gender = '1,2,3';  
3888 - }  
3889 -} 3827 + opt[$this.data('attr')] = $this.val();
  3828 +});
3890 3829
3891 module.exports = opt; 3830 module.exports = opt;
3892 }); 3831 });
@@ -3938,7 +3877,7 @@ var winH = $(window).height(), @@ -3938,7 +3877,7 @@ var winH = $(window).height(),
3938 noResult = '<p class="no-result">未找到相关搜索结果</p>'; 3877 noResult = '<p class="no-result">未找到相关搜索结果</p>';
3939 3878
3940 //默认筛选条件 3879 //默认筛选条件
3941 -var defaultOpt = require("js/product/extract-url"); 3880 +var defaultOpt = require("js/product/query-param");
3942 3881
3943 var $listNav = $('#list-nav'), 3882 var $listNav = $('#list-nav'),
3944 3883
@@ -4324,7 +4263,7 @@ var $input = $('#search-input input'), @@ -4324,7 +4263,7 @@ var $input = $('#search-input input'),
4324 $clear = $('#search-input .clear-input'); 4263 $clear = $('#search-input .clear-input');
4325 4264
4326 //默认筛选条件 4265 //默认筛选条件
4327 -var defaultOpt = require("js/product/extract-url"); 4266 +var defaultOpt = require("js/product/query-param");
4328 4267
4329 var $listNav = $('#list-nav'), 4268 var $listNav = $('#list-nav'),
4330 4269
@@ -4771,10 +4710,8 @@ var goodsSwiper, @@ -4771,10 +4710,8 @@ var goodsSwiper,
4771 var goodsDiscountEl = document.getElementById('goodsDiscount'), 4710 var goodsDiscountEl = document.getElementById('goodsDiscount'),
4772 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); 4711 goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
4773 4712
4774 -var $cart = $('.cart-bar'),  
4775 - $goodsSubtitle = $('.goodsSubtitle'),  
4776 - divH,  
4777 - $goodsSubtitleSpan; 4713 +var $cart = $('.cart-bar');
  4714 +var UA = navigator.userAgent.toLowerCase().toString();
4778 4715
4779 require("js/product/detail/desc"); 4716 require("js/product/detail/desc");
4780 require("js/product/detail/comments-consults"); 4717 require("js/product/detail/comments-consults");
@@ -4811,13 +4748,13 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -4811,13 +4748,13 @@ goodsSwiper = new Swiper('.banner-swiper', {
4811 4748
4812 4749
4813 //初始化goods-discount 4750 //初始化goods-discount
4814 -if (0 === $('.goodsDiscount .discount-folder').children().length) { 4751 +if (0 === $discountFolder.children().length) {
4815 $discountFolder.css('display', 'none'); 4752 $discountFolder.css('display', 'none');
4816 $discountArrow.html(''); 4753 $discountArrow.html('');
4817 } 4754 }
4818 4755
4819 //goods-discount下拉按钮点击事件 4756 //goods-discount下拉按钮点击事件
4820 -if (goodsDiscountHammer) { 4757 +if (goodsDiscountHammer && $discountFolder.children().length > 0) {
4821 goodsDiscountHammer.on('tap', function(e) { 4758 goodsDiscountHammer.on('tap', function(e) {
4822 if ($discountFolder.is(':hidden')) { 4759 if ($discountFolder.is(':hidden')) {
4823 $discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;'); 4760 $discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');
@@ -4826,7 +4763,6 @@ if (goodsDiscountHammer) { @@ -4826,7 +4763,6 @@ if (goodsDiscountHammer) {
4826 $discountArrow.removeClass('icon-up').addClass('icon-down').html('&#xe609;'); 4763 $discountArrow.removeClass('icon-up').addClass('icon-down').html('&#xe609;');
4827 $discountFolder.slideUp(); 4764 $discountFolder.slideUp();
4828 } 4765 }
4829 - return false;  
4830 }); 4766 });
4831 } 4767 }
4832 4768
@@ -4841,13 +4777,8 @@ $.ajax({ @@ -4841,13 +4777,8 @@ $.ajax({
4841 } 4777 }
4842 }); 4778 });
4843 4779
4844 -//限制goodsSubtitle为两行  
4845 -if ($goodsSubtitle[0]) {  
4846 - divH = $goodsSubtitle.height();  
4847 - $goodsSubtitleSpan = $goodsSubtitle.find('span');  
4848 - while ($goodsSubtitleSpan.outerHeight() > divH) {  
4849 - $goodsSubtitleSpan.text($goodsSubtitleSpan.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, '...'));  
4850 - } 4780 +if (UA.indexOf('mqqbrowser') > -1) {
  4781 + $('.detail > div').removeClass('column').addClass('oldbox');
4851 } 4782 }
4852 require("js/product/detail/like"); 4783 require("js/product/detail/like");
4853 4784
@@ -4908,6 +4839,8 @@ function search() { @@ -4908,6 +4839,8 @@ function search() {
4908 $productDesc = $('#productDesc'); 4839 $productDesc = $('#productDesc');
4909 $productDesc.append(data); 4840 $productDesc.append(data);
4910 4841
  4842 + window.rePosFooter();
  4843 +
4911 lazyLoad($productDesc.find('img.lazy')); 4844 lazyLoad($productDesc.find('img.lazy'));
4912 4845
4913 //尺码信息左右滑动 4846 //尺码信息左右滑动
@@ -4960,17 +4893,14 @@ var $ = require("jquery"), @@ -4960,17 +4893,14 @@ var $ = require("jquery"),
4960 4893
4961 var commentsNum,consultsNum; 4894 var commentsNum,consultsNum;
4962 4895
4963 -var consultFooterEle = document.getElementById('consult-content-footer'), 4896 +var consultFooterEle = $('.consult-content-footer')[0],
4964 consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), 4897 consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
4965 4898
4966 navtabEle = document.getElementById('nav-tab'), 4899 navtabEle = document.getElementById('nav-tab'),
4967 navtabHammer = navtabEle && new Hammer(navtabEle), 4900 navtabHammer = navtabEle && new Hammer(navtabEle),
4968 4901
4969 gotoConsultEle = document.getElementById('goto-consult'), 4902 gotoConsultEle = document.getElementById('goto-consult'),
4970 - gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),  
4971 -  
4972 - $gotoConsult = $('#goto-consult');  
4973 - 4903 + gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle);
4974 4904
4975 4905
4976 (function() { 4906 (function() {
@@ -5022,33 +4952,21 @@ if (navtabHammer) { @@ -5022,33 +4952,21 @@ if (navtabHammer) {
5022 4952
5023 if (consultFooterHammer) { 4953 if (consultFooterHammer) {
5024 consultFooterHammer.on('tap', function() { 4954 consultFooterHammer.on('tap', function() {
5025 - location.href = $(consultFooterEle).find('a').attr('href'); 4955 + location.href = $(consultFooterEle).data('href');
5026 }); 4956 });
5027 } 4957 }
5028 4958
5029 if (gotoConsultHammer) { 4959 if (gotoConsultHammer) {
5030 gotoConsultHammer.on('tap', function() { 4960 gotoConsultHammer.on('tap', function() {
5031 - location.href = $(gotoConsultEle).find('a').attr('href'); 4961 + location.href = $(gotoConsultEle).data('href');
5032 }); 4962 });
5033 } 4963 }
5034 4964
5035 -function fixConsultBar() {  
5036 - if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {  
5037 - $gotoConsult.css('position', 'fixed');  
5038 - $gotoConsult.css('top', '0');  
5039 - } else {  
5040 - $gotoConsult.css('position', 'static');  
5041 - } 4965 +//咨询页面固定header
  4966 +if ($('.goods-consults-page').length > 0) {
  4967 + $('#yoho-header').css('position', 'fixed').css('top', '0');
5042 } 4968 }
5043 4969
5044 -//滚动时顶部固定 我要咨询  
5045 -function scrollHandler() {  
5046 - fixConsultBar();  
5047 -}  
5048 -  
5049 -$(window).scroll(function() {  
5050 - window.requestAnimationFrame(scrollHandler);  
5051 -});  
5052 4970
5053 }); 4971 });
5054 define("js/product/recommend-for-you-product-desc", ["swiper","jquery","index"], function(require, exports, module){ 4972 define("js/product/recommend-for-you-product-desc", ["swiper","jquery","index"], function(require, exports, module){
@@ -5078,6 +4996,9 @@ if (preferenceUrl) { @@ -5078,6 +4996,9 @@ if (preferenceUrl) {
5078 watchSlidesVisibility: true 4996 watchSlidesVisibility: true
5079 }); 4997 });
5080 } 4998 }
  4999 +
  5000 + window.rePosFooter();
  5001 +
5081 }).fail(function() { 5002 }).fail(function() {
5082 $recommendForYou.hide(); 5003 $recommendForYou.hide();
5083 }); 5004 });
@@ -5450,13 +5371,17 @@ function getOrders(option) { @@ -5450,13 +5371,17 @@ function getOrders(option) {
5450 5371
5451 if (opt.page === 1) { 5372 if (opt.page === 1) {
5452 $curContainer.html(data); 5373 $curContainer.html(data);
5453 - lazyLoad($curContainer.find('.lazy')); 5374 + lazyLoad($curContainer.find('.lazy'), {
  5375 + try_again_css: 'order-failure'
  5376 + });
5454 } else { 5377 } else {
5455 num = $curContainer.children('.order').length; 5378 num = $curContainer.children('.order').length;
5456 $curContainer.append(data); 5379 $curContainer.append(data);
5457 5380
5458 //lazyload 5381 //lazyload
5459 - lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ')').find('.lazy')); 5382 + lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ')').find('.lazy'), {
  5383 + try_again_css: 'order-failure'
  5384 + });
5460 } 5385 }
5461 5386
5462 window.rePosFooter(); //重新计算底部位置 5387 window.rePosFooter(); //重新计算底部位置
@@ -5470,7 +5395,9 @@ function getOrders(option) { @@ -5470,7 +5395,9 @@ function getOrders(option) {
5470 }); 5395 });
5471 } 5396 }
5472 5397
5473 -lazyLoad(); 5398 +lazyLoad({
  5399 + try_again_css: 'order-failure'
  5400 +});
5474 5401
5475 //初始化导航 5402 //初始化导航
5476 (function() { 5403 (function() {
@@ -5706,7 +5633,9 @@ var orderId = $('#order-detail').data('id'); @@ -5706,7 +5633,9 @@ var orderId = $('#order-detail').data('id');
5706 5633
5707 var optHammer; 5634 var optHammer;
5708 5635
5709 -lazyLoad(); 5636 +lazyLoad({
  5637 + try_again_css: 'order-failure'
  5638 +});
5710 5639
5711 //订单删除 5640 //订单删除
5712 optHammer = new Hammer(document.getElementsByClassName('opt')[0]); 5641 optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
@@ -5755,7 +5684,6 @@ var diaLog = require("js/me/dialog"); @@ -5755,7 +5684,6 @@ var diaLog = require("js/me/dialog");
5755 5684
5756 var $navLi = $('#fav-tab > li'), 5685 var $navLi = $('#fav-tab > li'),
5757 $favContainer = $('.fav-content > .fav-type'), 5686 $favContainer = $('.fav-content > .fav-type'),
5758 - $swiperList = '',  
5759 swiperObj = {}, 5687 swiperObj = {},
5760 favTabHammer, 5688 favTabHammer,
5761 favContentHammer, 5689 favContentHammer,
@@ -5780,22 +5708,30 @@ function showFavTab(index) { @@ -5780,22 +5708,30 @@ function showFavTab(index) {
5780 } 5708 }
5781 5709
5782 //初始化swiper 5710 //初始化swiper
5783 -function initSwiper() { 5711 +function initSwiper(data) {
5784 var i, 5712 var i,
5785 - id; 5713 + idStrReg = /container-(\d+)['"]{1}/gi,
  5714 + idReg = /\d+/,
  5715 + idArr = data.match(idStrReg),
  5716 + idArrLen = idArr.length,
  5717 + containerId;
5786 5718
5787 - $swiperList = $('.swiper-container');  
5788 - for (i = 0; i < $swiperList.length; i++) {  
5789 - 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');
5790 5723
5791 if (!!swiperObj[id]) { 5724 if (!!swiperObj[id]) {
5792 swiperObj[id].destroy(true, true); 5725 swiperObj[id].destroy(true, true);
5793 - }  
5794 - 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, {
5795 slidesPerView: 'auto', 5731 slidesPerView: 'auto',
5796 grabCursor: true, 5732 grabCursor: true,
5797 slideElement: 'li', 5733 slideElement: 'li',
5798 - wrapperClass: 'swiper-wrapper-' + id, 5734 + wrapperClass: 'swiper-wrapper-' + containerId,
5799 lazyLoading: true, 5735 lazyLoading: true,
5800 watchSlidesVisibility: true 5736 watchSlidesVisibility: true
5801 }); 5737 });
@@ -5836,7 +5772,7 @@ function loadData($parent, url, page) { @@ -5836,7 +5772,7 @@ function loadData($parent, url, page) {
5836 $parent.append(data); 5772 $parent.append(data);
5837 $parent.closest('.fav-type').find('.fav-content-loading').remove(); 5773 $parent.closest('.fav-type').find('.fav-content-loading').remove();
5838 if (url === 'favBrand') { 5774 if (url === 'favBrand') {
5839 - initSwiper();//如果是收藏品牌需要初始化swiper 5775 + initSwiper(data);//如果是收藏品牌需要初始化swiper
5840 5776
5841 brandLockId = false;//请求成功后解锁品牌收藏page++ 5777 brandLockId = false;//请求成功后解锁品牌收藏page++
5842 } else { 5778 } else {
@@ -6026,7 +5962,7 @@ $('#upload-img').uploadifive({ @@ -6026,7 +5962,7 @@ $('#upload-img').uploadifive({
6026 fileType: 'image*/*', 5962 fileType: 'image*/*',
6027 uploadScript: '/home/suggestimgUpload', 5963 uploadScript: '/home/suggestimgUpload',
6028 fileObjName: 'fileData', 5964 fileObjName: 'fileData',
6029 - fileSizeLimit: 1024, 5965 + fileSizeLimit: 300,
6030 height: '100%', 5966 height: '100%',
6031 width: '100%', 5967 width: '100%',
6032 multi: false, 5968 multi: false,
@@ -7700,7 +7636,7 @@ function callpay(orderCode) { @@ -7700,7 +7636,7 @@ function callpay(orderCode) {
7700 function isWXOpen() { 7636 function isWXOpen() {
7701 var ua = window.navigator.userAgent.toLowerCase(); 7637 var ua = window.navigator.userAgent.toLowerCase();
7702 7638
7703 - if (ua.match(/MicroMessenger/i) === 'micromessenger') { 7639 + if (ua.indexOf('micromessenger') > 0) {
7704 return true; 7640 return true;
7705 } else { 7641 } else {
7706 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.
This diff could not be displayed because it is too large.
@@ -10,24 +10,12 @@ var $searchBox = $('.search-box'), @@ -10,24 +10,12 @@ var $searchBox = $('.search-box'),
10 $box = $('.box'), 10 $box = $('.box'),
11 $indexSearch = $('.index-search'), 11 $indexSearch = $('.index-search'),
12 $indexLogo = $('.index-logo'), 12 $indexLogo = $('.index-logo'),
13 - $channelLink = $('.index-channel a'),  
14 - $win = $(window),  
15 - $doc = $(document),  
16 - $appFloatLayer = $('#float-layer-app'); 13 + $channelLink = $('.index-channel a');
17 14
18 var $search = $searchBox.children('input[type="text"]'), 15 var $search = $searchBox.children('input[type="text"]'),
19 $cancelSearch = $box.children('.no-search'), 16 $cancelSearch = $box.children('.no-search'),
20 $searchIcon = $searchBox.children('.search-icon'); 17 $searchIcon = $searchBox.children('.search-icon');
21 18
22 -// variables for calculate the app download layer position  
23 -var layerInit = false,  
24 - windowViewHeight = 0,  
25 - layerContentHeight = $appFloatLayer.height(),  
26 - layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),  
27 - layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),  
28 - layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,  
29 - layerNewPos;  
30 -  
31 require('../common'); 19 require('../common');
32 20
33 $search.on('focus', function() { 21 $search.on('focus', function() {
@@ -59,6 +47,15 @@ $searchBox.children('.search-icon').on('touchstart', function() { @@ -59,6 +47,15 @@ $searchBox.children('.search-icon').on('touchstart', function() {
59 $indexSearch.submit(); 47 $indexSearch.submit();
60 }); 48 });
61 49
  50 +$searchBox.keyup(function(e) {
  51 + if (e.keyCode === 13) {
  52 + if (security.hasDangerInput()) {
  53 + return false;
  54 + }
  55 + $indexSearch.submit();
  56 + }
  57 +});
  58 +
62 $('.index-channel img').on('load error', function() { 59 $('.index-channel img').on('load error', function() {
63 window.rePosFooter && window.rePosFooter(); 60 window.rePosFooter && window.rePosFooter();
64 }); 61 });
@@ -81,40 +78,3 @@ $channelLink.on('touchstart', function() { @@ -81,40 +78,3 @@ $channelLink.on('touchstart', function() {
81 borderColor: '#fff' 78 borderColor: '#fff'
82 }); 79 });
83 }); 80 });
84 -  
85 -  
86 -function updateLayerPosition() {  
87 - var winHeight = window.innerHeight,  
88 - bodyHeight = $doc.height(),  
89 - scrollTopPosition = $win.scrollTop();  
90 -  
91 - if (layerInit) {  
92 -  
93 - //keyboard is shown  
94 - if (windowViewHeight - winHeight > 200) {  
95 - if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {  
96 - layerNewPos = 0;  
97 - } else {  
98 - layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;  
99 - }  
100 - } else {  
101 - layerNewPos = bodyHeight - winHeight - scrollTopPosition;  
102 - }  
103 -  
104 - } else {  
105 - windowViewHeight = winHeight;  
106 - layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;  
107 - layerInit = true;  
108 - }  
109 -  
110 - $appFloatLayer.css({  
111 - position: 'relative',  
112 - bottom: layerNewPos + 'px'  
113 - });  
114 -}  
115 -  
116 -$(window).scroll(function() {  
117 - window.requestAnimationFrame(updateLayerPosition);  
118 -});  
119 -  
120 -$doc.on('ready', updateLayerPosition);  
@@ -12,7 +12,6 @@ var diaLog = require('./dialog'); @@ -12,7 +12,6 @@ var diaLog = require('./dialog');
12 12
13 var $navLi = $('#fav-tab > li'), 13 var $navLi = $('#fav-tab > li'),
14 $favContainer = $('.fav-content > .fav-type'), 14 $favContainer = $('.fav-content > .fav-type'),
15 - $swiperList = '',  
16 swiperObj = {}, 15 swiperObj = {},
17 favTabHammer, 16 favTabHammer,
18 favContentHammer, 17 favContentHammer,
@@ -37,22 +36,30 @@ function showFavTab(index) { @@ -37,22 +36,30 @@ function showFavTab(index) {
37 } 36 }
38 37
39 //初始化swiper 38 //初始化swiper
40 -function initSwiper() { 39 +function initSwiper(data) {
41 var i, 40 var i,
42 - id; 41 + idStrReg = /container-(\d+)['"]{1}/gi,
  42 + idReg = /\d+/,
  43 + idArr = data.match(idStrReg),
  44 + idArrLen = idArr.length,
  45 + containerId;
43 46
44 - $swiperList = $('.swiper-container');  
45 - for (i = 0; i < $swiperList.length; i++) {  
46 - id = $swiperList.eq(i).attr('data-id'); 47 + //$swiperList = $('.swiper-container');
  48 + for (i = 0; i < idArrLen; i++) {
  49 +
  50 + /*id = $swiperList.eq(i).attr('data-id');
47 51
48 if (!!swiperObj[id]) { 52 if (!!swiperObj[id]) {
49 swiperObj[id].destroy(true, true); 53 swiperObj[id].destroy(true, true);
50 - }  
51 - swiperObj[id] = new Swiper('#swiper-container-' + id, { 54 + }*/
  55 +
  56 + containerId = idArr[i].match(idReg)[0];
  57 +
  58 + swiperObj[containerId] = new Swiper('#swiper-container-' + containerId, {
52 slidesPerView: 'auto', 59 slidesPerView: 'auto',
53 grabCursor: true, 60 grabCursor: true,
54 slideElement: 'li', 61 slideElement: 'li',
55 - wrapperClass: 'swiper-wrapper-' + id, 62 + wrapperClass: 'swiper-wrapper-' + containerId,
56 lazyLoading: true, 63 lazyLoading: true,
57 watchSlidesVisibility: true 64 watchSlidesVisibility: true
58 }); 65 });
@@ -93,7 +100,7 @@ function loadData($parent, url, page) { @@ -93,7 +100,7 @@ function loadData($parent, url, page) {
93 $parent.append(data); 100 $parent.append(data);
94 $parent.closest('.fav-type').find('.fav-content-loading').remove(); 101 $parent.closest('.fav-type').find('.fav-content-loading').remove();
95 if (url === 'favBrand') { 102 if (url === 'favBrand') {
96 - initSwiper();//如果是收藏品牌需要初始化swiper 103 + initSwiper(data);//如果是收藏品牌需要初始化swiper
97 104
98 brandLockId = false;//请求成功后解锁品牌收藏page++ 105 brandLockId = false;//请求成功后解锁品牌收藏page++
99 } else { 106 } else {
@@ -105,7 +112,6 @@ function loadData($parent, url, page) { @@ -105,7 +112,6 @@ function loadData($parent, url, page) {
105 } else { 112 } else {
106 return; 113 return;
107 } 114 }
108 - window.rePosFooter();  
109 115
110 //},1000); 116 //},1000);
111 } 117 }
@@ -12,7 +12,9 @@ var orderId = $('#order-detail').data('id'); @@ -12,7 +12,9 @@ var orderId = $('#order-detail').data('id');
12 12
13 var optHammer; 13 var optHammer;
14 14
15 -lazyLoad(); 15 +lazyLoad({
  16 + try_again_css: 'order-failure'
  17 +});
16 18
17 //订单删除 19 //订单删除
18 optHammer = new Hammer(document.getElementsByClassName('opt')[0]); 20 optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
@@ -58,13 +58,17 @@ function getOrders(option) { @@ -58,13 +58,17 @@ function getOrders(option) {
58 58
59 if (opt.page === 1) { 59 if (opt.page === 1) {
60 $curContainer.html(data); 60 $curContainer.html(data);
61 - lazyLoad($curContainer.find('.lazy')); 61 + lazyLoad($curContainer.find('.lazy'), {
  62 + try_again_css: 'order-failure'
  63 + });
62 } else { 64 } else {
63 num = $curContainer.children('.order').length; 65 num = $curContainer.children('.order').length;
64 $curContainer.append(data); 66 $curContainer.append(data);
65 67
66 //lazyload 68 //lazyload
67 - lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ')').find('.lazy')); 69 + lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ')').find('.lazy'), {
  70 + try_again_css: 'order-failure'
  71 + });
68 } 72 }
69 73
70 window.rePosFooter(); //重新计算底部位置 74 window.rePosFooter(); //重新计算底部位置
@@ -78,7 +82,9 @@ function getOrders(option) { @@ -78,7 +82,9 @@ function getOrders(option) {
78 }); 82 });
79 } 83 }
80 84
81 -lazyLoad(); 85 +lazyLoad({
  86 + try_again_css: 'order-failure'
  87 +});
82 88
83 //初始化导航 89 //初始化导航
84 (function() { 90 (function() {
@@ -92,7 +92,7 @@ function callpay(orderCode) { @@ -92,7 +92,7 @@ function callpay(orderCode) {
92 function isWXOpen() { 92 function isWXOpen() {
93 var ua = window.navigator.userAgent.toLowerCase(); 93 var ua = window.navigator.userAgent.toLowerCase();
94 94
95 - if (ua.match(/MicroMessenger/i) === 'micromessenger') { 95 + if (ua.indexOf('micromessenger') > 0) {
96 return true; 96 return true;
97 } else { 97 } else {
98 return false; 98 return false;
@@ -39,7 +39,7 @@ $('#upload-img').uploadifive({ @@ -39,7 +39,7 @@ $('#upload-img').uploadifive({
39 fileType: 'image*/*', 39 fileType: 'image*/*',
40 uploadScript: '/home/suggestimgUpload', 40 uploadScript: '/home/suggestimgUpload',
41 fileObjName: 'fileData', 41 fileObjName: 'fileData',
42 - fileSizeLimit: 1024, 42 + fileSizeLimit: 300,
43 height: '100%', 43 height: '100%',
44 width: '100%', 44 width: '100%',
45 multi: false, 45 multi: false,
@@ -18,6 +18,8 @@ var introUrl = $('#introUrl').val(), @@ -18,6 +18,8 @@ var introUrl = $('#introUrl').val(),
18 var sizeSwiper, 18 var sizeSwiper,
19 refSwiper; 19 refSwiper;
20 20
  21 +var UA = navigator.userAgent.toLowerCase().toString();
  22 +
21 //判断是否要显示向左滑动提示 23 //判断是否要显示向左滑动提示
22 function hiddenTips($ele) { 24 function hiddenTips($ele) {
23 var offsetContainer, 25 var offsetContainer,
@@ -53,6 +55,8 @@ function search() { @@ -53,6 +55,8 @@ function search() {
53 $productDesc = $('#productDesc'); 55 $productDesc = $('#productDesc');
54 $productDesc.append(data); 56 $productDesc.append(data);
55 57
  58 + window.rePosFooter();
  59 +
56 lazyLoad($productDesc.find('img.lazy')); 60 lazyLoad($productDesc.find('img.lazy'));
57 61
58 //尺码信息左右滑动 62 //尺码信息左右滑动
@@ -67,7 +71,9 @@ function search() { @@ -67,7 +71,9 @@ function search() {
67 71
68 hiddenTips($('#size-swiper-container')); 72 hiddenTips($('#size-swiper-container'));
69 hiddenTips($('#reference-swiper-container')); 73 hiddenTips($('#reference-swiper-container'));
70 - 74 + if (UA.indexOf('mqqbrowser') > 0) {
  75 + $('.detail > div').removeClass('column').addClass('oldbox');
  76 + }
71 searching = false; 77 searching = false;
72 end = true; 78 end = true;
73 loading.hideLoadingMask(); 79 loading.hideLoadingMask();
@@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), @@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
17 17
18 var $cart = $('.cart-bar'); 18 var $cart = $('.cart-bar');
19 19
  20 +
20 require('./desc'); 21 require('./desc');
21 require('./comments-consults'); 22 require('./comments-consults');
22 require('../recommend-for-you-product-desc'); 23 require('../recommend-for-you-product-desc');
@@ -28,6 +28,9 @@ if (preferenceUrl) { @@ -28,6 +28,9 @@ if (preferenceUrl) {
28 }); 28 });
29 } 29 }
30 } 30 }
  31 +
  32 + window.rePosFooter();
  33 +
31 }).fail(function() { 34 }).fail(function() {
32 $recommendForYou.hide(); 35 $recommendForYou.hide();
33 }); 36 });
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 "yoho.iswiper": "3.0.1", 21 "yoho.iswiper": "3.0.1",
22 "iscroll": "5.1.2", 22 "iscroll": "5.1.2",
23 "import-style": "1.0.0", 23 "import-style": "1.0.0",
24 - "yoho.lazyload": "1.1.2", 24 + "yoho.lazyload": "1.1.3",
25 "yoho.handlebars": "3.0.3", 25 "yoho.handlebars": "3.0.3",
26 "yoho.hammer": "2.0.4" 26 "yoho.hammer": "2.0.4"
27 }, 27 },
  1 +.order-failure {
  2 + background-image: image-url('lazy-failure/order-good.jpg');
  3 + background-size: 100%;
  4 +}
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 background-color: #FFF; 16 background-color: #FFF;
17 border-radius: 30rem / $pxConvertRem; 17 border-radius: 30rem / $pxConvertRem;
18 padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem; 18 padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem;
19 - 19 +
20 a { 20 a {
21 width: 100%; 21 width: 100%;
22 height: 60rem / $pxConvertRem; 22 height: 60rem / $pxConvertRem;
@@ -77,6 +77,14 @@ @@ -77,6 +77,14 @@
77 77
78 .hot-brands { 78 .hot-brands {
79 padding-top: 178rem / $pxConvertRem; 79 padding-top: 178rem / $pxConvertRem;
  80 +
  81 + .floor-header {
  82 + padding: 0;
  83 + }
  84 +
  85 + .brands-swiper {
  86 + border-top: 0;
  87 + }
80 } 88 }
81 89
82 .hot-brand { 90 .hot-brand {
@@ -194,7 +202,7 @@ @@ -194,7 +202,7 @@
194 .con { 202 .con {
195 padding-top: 10rem / $pxConvertRem; 203 padding-top: 10rem / $pxConvertRem;
196 } 204 }
197 - 205 +
198 .search-result { 206 .search-result {
199 padding-top: 176rem / $pxConvertRem; 207 padding-top: 176rem / $pxConvertRem;
200 } 208 }
@@ -61,14 +61,14 @@ @@ -61,14 +61,14 @@
61 .brand:nth-child(5n) { 61 .brand:nth-child(5n) {
62 border-right: none; 62 border-right: none;
63 } 63 }
64 - 64 +
65 .more { 65 .more {
66 float: left; 66 float: left;
67 width: 317rem / $pxConvertRem; 67 width: 317rem / $pxConvertRem;
68 height: 174rem / $pxConvertRem; 68 height: 174rem / $pxConvertRem;
69 border-top: 1px solid #e0e0e0; 69 border-top: 1px solid #e0e0e0;
70 70
71 - 71 +
72 a { 72 a {
73 display: block; 73 display: block;
74 width: 100%; 74 width: 100%;
@@ -109,6 +109,7 @@ @@ -109,6 +109,7 @@
109 } 109 }
110 110
111 img { 111 img {
  112 + display: inline-block;
112 max-width: 100%; 113 max-width: 100%;
113 max-height: 100%; 114 max-height: 100%;
114 vertical-align: middle; 115 vertical-align: middle;
@@ -132,4 +133,4 @@ @@ -132,4 +133,4 @@
132 } 133 }
133 } 134 }
134 } 135 }
135 -}  
  136 +}
@@ -143,6 +143,7 @@ a { @@ -143,6 +143,7 @@ a {
143 @import "layout/footer"; 143 @import "layout/footer";
144 @import "layout/footer_tab"; 144 @import "layout/footer_tab";
145 @import "good"; 145 @import "good";
  146 +@import "lazy-failure";
146 @import "filter"; 147 @import "filter";
147 @import "loading"; 148 @import "loading";
148 @import "passport/index"; 149 @import "passport/index";
@@ -280,7 +280,7 @@ @@ -280,7 +280,7 @@
280 } 280 }
281 } 281 }
282 } 282 }
283 - 283 +
284 .comment-content-footer, 284 .comment-content-footer,
285 .consult-content-footer { 285 .consult-content-footer {
286 min-height: pxToRem(88px); 286 min-height: pxToRem(88px);
@@ -290,7 +290,7 @@ @@ -290,7 +290,7 @@
290 line-height: pxToRem(88px); 290 line-height: pxToRem(88px);
291 font-size: pxToRem(28px); 291 font-size: pxToRem(28px);
292 a { 292 a {
293 - color: #e0e0e0; 293 + color: #b0b0b0;
294 .iconfont { 294 .iconfont {
295 font-size: inherit; 295 font-size: inherit;
296 } 296 }
@@ -48,8 +48,7 @@ $basicBtnC:#eb0313; @@ -48,8 +48,7 @@ $basicBtnC:#eb0313;
48 //padding: pxToRem(20px) pxToRem(12px); 48 //padding: pxToRem(20px) pxToRem(12px);
49 padding: pxToRem(6px) 3%; 49 padding: pxToRem(6px) 3%;
50 width: 49.9%; 50 width: 49.9%;
51 - border-bottom: pxToRem(4px) solid #fff;  
52 - border-right: pxToRem(4px) solid #fff; 51 + border: 1px solid #fff;
53 font-size: pxToRem(24px); 52 font-size: pxToRem(24px);
54 background-color: $tableCellC; 53 background-color: $tableCellC;
55 word-wrap: break-word; 54 word-wrap: break-word;
@@ -69,8 +68,7 @@ $basicBtnC:#eb0313; @@ -69,8 +68,7 @@ $basicBtnC:#eb0313;
69 width: 49.9%; 68 width: 49.9%;
70 background-color: $tableCellC; 69 background-color: $tableCellC;
71 box-sizing: border-box; 70 box-sizing: border-box;
72 - border-bottom: 1px solid #fff;  
73 - border-right: 1px solid #fff; 71 + border: 1px solid #fff;
74 width: 49.9%; 72 width: 49.9%;
75 height: 100%; 73 height: 100%;
76 float: left; 74 float: left;
@@ -11,10 +11,6 @@ @@ -11,10 +11,6 @@
11 background-size: cover; 11 background-size: cover;
12 } 12 }
13 .detail{ 13 .detail{
14 - // background-color: $tableCellC;  
15 - // &.table .inner-container{  
16 - // background-color: $tableCellC;  
17 - // }  
18 margin-bottom: 1px; 14 margin-bottom: 1px;
19 } 15 }
20 .desc-text { 16 .desc-text {
@@ -42,30 +38,21 @@ @@ -42,30 +38,21 @@
42 .detail { 38 .detail {
43 .material-item{ 39 .material-item{
44 margin: pxToRem(10px) 0; 40 margin: pxToRem(10px) 0;
45 - @include flexbox((  
46 - display: box,  
47 - box-align: center  
48 - ), $version: 1);  
49 - @include flexbox((  
50 - display: flex,  
51 - align-items: center  
52 - )); 41 + width: 100%;
  42 + height: auto;
  43 + overflow: hidden;
  44 + display: block;
  45 + position: relative;
53 46
54 img { 47 img {
55 margin: 0; 48 margin: 0;
56 } 49 }
57 .material-image { 50 .material-image {
58 width: 23%; 51 width: 23%;
59 - @include flexbox((  
60 - box-flex: 1.0,  
61 - display: box,  
62 - box-pack: center  
63 - ), $version: 1);  
64 - @include flexbox((  
65 - display: flex,  
66 - flex-basis: 23%,  
67 - justify-content: center  
68 - )); 52 + position: absolute;
  53 + left: 0;
  54 + top: 50%;
  55 + @include transform(translateY(-50%))
69 } 56 }
70 .material-desc { 57 .material-desc {
71 font-size: pxToRem(24px); 58 font-size: pxToRem(24px);
@@ -76,15 +63,8 @@ @@ -76,15 +63,8 @@
76 line-height: pxToRem(38px); 63 line-height: pxToRem(38px);
77 color: #4b4b4b; 64 color: #4b4b4b;
78 word-wrap: break-word; 65 word-wrap: break-word;
79 - width: 76.9;  
80 - @include flexbox((  
81 - box-flex: 1.0,  
82 - display: box  
83 - ), $version: 1);  
84 - @include flexbox((  
85 - display: flex,  
86 - flex-basis: 76.9%  
87 - )); 66 + width: 76.9%;
  67 + float: right;
88 } 68 }
89 &:last-child{ 69 &:last-child{
90 border-bottom: none; 70 border-bottom: none;
@@ -129,6 +109,13 @@ @@ -129,6 +109,13 @@
129 width: pxToRem(581px); 109 width: pxToRem(581px);
130 height:auto; 110 height:auto;
131 } 111 }
  112 +
  113 + a {
  114 + color: #2f91f6;
  115 + text-decoration: underline;
  116 +
  117 + }
  118 +
132 } 119 }
133 margin-top: pxToRem(30px); 120 margin-top: pxToRem(30px);
134 margin-bottom: pxToRem(30px); 121 margin-bottom: pxToRem(30px);
@@ -10,6 +10,12 @@ @@ -10,6 +10,12 @@
10 bottom: 70px; 10 bottom: 70px;
11 z-index: 10; 11 z-index: 10;
12 12
  13 + a {
  14 + display: block;
  15 + width: 100%;
  16 + height: 100%;
  17 + }
  18 +
13 .iconfont { 19 .iconfont {
14 color: #fff; 20 color: #fff;
15 font-size: 18px; 21 font-size: 18px;
@@ -26,4 +32,4 @@ @@ -26,4 +32,4 @@
26 right: 0; 32 right: 0;
27 color: #fff; 33 color: #fff;
28 } 34 }
29 -}  
  35 +}
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 {{/isLogin}} 13 {{/isLogin}}
14 {{^isLogin}} 14 {{^isLogin}}
15 <div class="user-info"> 15 <div class="user-info">
16 - <a class="login-btn" href="/signin.html?refer=/home"> 16 + <a class="login-btn" href="{{signinUrl}}">
17 登录/注册 17 登录/注册
18 </a> 18 </a>
19 </div> 19 </div>
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <span class="icon iconfont icon-tel">&#xe63e;</span> 36 <span class="icon iconfont icon-tel">&#xe63e;</span>
37 电话客服 37 电话客服
38 <p> 38 <p>
39 - 400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日) 39 + 400-889-9646 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
40 </p> 40 </p>
41 </a> 41 </a>
42 42
@@ -22,13 +22,9 @@ @@ -22,13 +22,9 @@
22 <p>{{answer}}</p> 22 <p>{{answer}}</p>
23 </div> 23 </div>
24 </div> 24 </div>
25 -  
26 {{/list}} 25 {{/list}}
27 </div> 26 </div>
28 {{/ consults}} 27 {{/ consults}}
29 28
30 - {{#if loadmore}}  
31 - <input id="loadMoreUrl" type="hidden" value="{{loadMoreUrl}}">  
32 - {{/if}}  
33 </div> 29 </div>
34 {{> layout/footer}} 30 {{> layout/footer}}
1 <div class="hot-brands"> 1 <div class="hot-brands">
2 - {{^ brandPage}}  
3 - {{> home/floor_header}}  
4 - {{/ brandPage}} 2 + {{> home/floor_header}}
5 <div class="brands-swiper"> 3 <div class="brands-swiper">
6 <ul class="brands-list swiper-wrapper clearfix"> 4 <ul class="brands-list swiper-wrapper clearfix">
7 {{# list}} 5 {{# list}}
@@ -48,6 +48,7 @@ class HomeController extends AbstractAction @@ -48,6 +48,7 @@ class HomeController extends AbstractAction
48 'showDownloadApp' => true, 48 'showDownloadApp' => true,
49 'pageFooter' => true, 49 'pageFooter' => true,
50 'cartUrl' => Helpers::url('/cart/index/index', null), 50 'cartUrl' => Helpers::url('/cart/index/index', null),
  51 + 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ),
51 ); 52 );
52 $uid = $this->getUid(true); 53 $uid = $this->getUid(true);
53 if ($uid) { 54 if ($uid) {
@@ -201,7 +201,7 @@ class UserModel @@ -201,7 +201,7 @@ class UserModel
201 $datas[] = $product; 201 $datas[] = $product;
202 } 202 }
203 !empty($datas) && $result['hasFavProduct'] = $datas; 203 !empty($datas) && $result['hasFavProduct'] = $datas;
204 - } else if ($page > 1 && isset($favProduct['code']) && $favProduct['code'] === 500) { 204 + } else if ($page > 1 && (!$favProduct || (isset($favProduct['code']) && $favProduct['code'] === 500))) {
205 $result['end'] = true; 205 $result['end'] = true;
206 } 206 }
207 207
@@ -259,7 +259,7 @@ class UserModel @@ -259,7 +259,7 @@ class UserModel
259 $datas[] = $brand; 259 $datas[] = $brand;
260 } 260 }
261 !empty($datas) && $result['hasFavBrand'] = $datas; 261 !empty($datas) && $result['hasFavBrand'] = $datas;
262 - } else if ($page > 1 && isset($favBrand['code']) && $favBrand['code'] === 500) { 262 + } else if ($page > 1 && (!$favBrand || (isset($favBrand['code']) && $favBrand['code'] === 500))) {
263 $result['end'] = true; 263 $result['end'] = true;
264 } 264 }
265 265
@@ -157,8 +157,8 @@ class DetailModel @@ -157,8 +157,8 @@ class DetailModel
157 157
158 // 商品信息 158 // 商品信息
159 if (!empty($baseInfo['goodsList'])) { 159 if (!empty($baseInfo['goodsList'])) {
160 - $colorGroup = array();  
161 - $sizeGroup = array(); 160 +// $colorGroup = array();
  161 +// $sizeGroup = array();
162 $goodsList = array(); 162 $goodsList = array();
163 $goodsGroup = array(); 163 $goodsGroup = array();
164 $colorId = 0; 164 $colorId = 0;
@@ -168,49 +168,44 @@ class DetailModel @@ -168,49 +168,44 @@ class DetailModel
168 if (isset($value['goodsImagesList'])) { 168 if (isset($value['goodsImagesList'])) {
169 foreach ($value['goodsImagesList'] as $goods) { 169 foreach ($value['goodsImagesList'] as $goods) {
170 $goodsList[$goods['goodsId']] = $colorId; 170 $goodsList[$goods['goodsId']] = $colorId;
171 - $goodsGroup[$colorId][] = array( 171 + $goodsGroup[] = array(
172 'goodsId' => $goods['goodsId'], 172 'goodsId' => $goods['goodsId'],
173 'img' => $goods['imageUrl'], 173 'img' => $goods['imageUrl'],
174 ); 174 );
175 - $colorGroup[$colorId] = array(  
176 - 'colorId' => $colorId,  
177 - 'colorName' => $value['colorName'],  
178 - 'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),  
179 - ); 175 +// $colorGroup[$colorId] = array(
  176 +// 'colorId' => $colorId,
  177 +// 'colorName' => $value['colorName'],
  178 +// 'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
  179 +// );
180 } 180 }
181 } 181 }
182 182
183 - // 商品的尺码列表  
184 - if (isset($value['goodsSizeBoList'])) {  
185 - foreach ($value['goodsSizeBoList'] as $size) {  
186 - $sizeGroup[$colorId] = array(  
187 - 'sizeName' => $size['sizeName'],  
188 - 'sizeSku' => $size['goodsSizeSkuId'],  
189 - 'sizeStorage' => $size['goodsSizeStorageNum'],  
190 - );  
191 - }  
192 - } 183 +// // 商品的尺码列表
  184 +// if (isset($value['goodsSizeBoList'])) {
  185 +// foreach ($value['goodsSizeBoList'] as $size) {
  186 +// $sizeGroup[$colorId] = array(
  187 +// 'sizeName' => $size['sizeName'],
  188 +// 'sizeSku' => $size['goodsSizeSkuId'],
  189 +// 'sizeStorage' => $size['goodsSizeStorageNum'],
  190 +// );
  191 +// }
  192 +// }
193 } 193 }
194 -  
195 - // 商品图  
196 - $goodsId = intval($goodsId);  
197 - if (isset($goodsList[$goodsId])) {  
198 - $colorId = $goodsList[$goodsId];  
199 - // 多个  
200 - if (isset($goodsGroup[$colorId][1])) {  
201 - foreach ($goodsGroup[$colorId] as $value) {  
202 - $result['bannerTop']['list'][] = array(  
203 - 'img' => Helpers::getImageUrl($value['img'], 450, 600)  
204 - );  
205 - }  
206 - }  
207 - // 单个  
208 - elseif (isset($goodsGroup[$colorId][0])) {  
209 - $result['bannerTop'] = array(  
210 - 'img' => Helpers::getImageUrl($goodsGroup[$colorId][0]['img'], 450, 600) 194 +
  195 + // 商品图: 多个
  196 + if (isset($goodsGroup[1])) {
  197 + foreach ($goodsGroup as $value) {
  198 + $result['bannerTop']['list'][] = array(
  199 + 'img' => Helpers::getImageUrl($value['img'], 450, 600)
211 ); 200 );
212 } 201 }
213 } 202 }
  203 + // 商品图: 单个
  204 + elseif (isset($goodsGroup[0])) {
  205 + $result['bannerTop'] = array(
  206 + 'img' => Helpers::getImageUrl($goodsGroup[0]['img'], 450, 600)
  207 + );
  208 + }
214 } 209 }
215 210
216 // 悬浮的购物车信息 211 // 悬浮的购物车信息
@@ -213,7 +213,7 @@ class ListModel @@ -213,7 +213,7 @@ class ListModel
213 } 213 }
214 214
215 // 调用接口查询数据 215 // 调用接口查询数据
216 - $brandLogo = BrandData::getBrandLogoByDomain($domain); 216 + $brandLogo = BrandData::getBrandLogoByDomain($domain);
217 // 处理返回的数据 217 // 处理返回的数据
218 if (isset($brandLogo['data'])) { 218 if (isset($brandLogo['data'])) {
219 $result = array( 219 $result = array(
@@ -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
@@ -78,7 +78,7 @@ class LoginController extends AbstractAction @@ -78,7 +78,7 @@ class LoginController extends AbstractAction
78 $refer = $this->server('HTTP_REFERER', SITE_MAIN); 78 $refer = $this->server('HTTP_REFERER', SITE_MAIN);
79 $token = $this->get('token'); 79 $token = $this->get('token');
80 if (!empty($token)) { 80 if (!empty($token)) {
81 - LoginData::signoutSession($token); 81 + $this->go( Helpers::logoutSession($token, $refer) );
82 } 82 }
83 83
84 $this->go($refer); 84 $this->go($refer);
@@ -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);
@@ -203,7 +204,7 @@ class LoginController extends AbstractAction @@ -203,7 +204,7 @@ class LoginController extends AbstractAction
203 $access = $qqconnect->getAccessToken(); 204 $access = $qqconnect->getAccessToken();
204 /* 获取QQ腾讯用户的详细信息 */ 205 /* 获取QQ腾讯用户的详细信息 */
205 $partnerInfo = $qqconnect->getUserInfo($access); 206 $partnerInfo = $qqconnect->getUserInfo($access);
206 - 207 +
207 $result = array(); 208 $result = array();
208 if ($partnerInfo && is_array($partnerInfo)) { 209 if ($partnerInfo && is_array($partnerInfo)) {
209 $result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq'); 210 $result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq');
@@ -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);
@@ -229,9 +231,9 @@ class LoginController extends AbstractAction @@ -229,9 +231,9 @@ class LoginController extends AbstractAction
229 public function sinacallbackAction() 231 public function sinacallbackAction()
230 { 232 {
231 $sina = Factory::create('sinaweibo'); 233 $sina = Factory::create('sinaweibo');
232 - $access = $sina->getAccessToken(); 234 + $access = $sina->getAccessToken();
233 /* 获取用户的详细信息 */ 235 /* 获取用户的详细信息 */
234 - $partnerInfo = $sina->getUserInfo($access); 236 + $partnerInfo = $sina->getUserInfo($access);
235 237
236 $result = array(); 238 $result = array();
237 if ($partnerInfo && is_array($partnerInfo)) { 239 if ($partnerInfo && is_array($partnerInfo)) {
@@ -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);
@@ -217,7 +217,7 @@ class IndexController extends AbstractAction @@ -217,7 +217,7 @@ class IndexController extends AbstractAction
217 217
218 // 右下角的购物车链接 218 // 右下角的购物车链接
219 $data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null); 219 $data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null);
220 - //$data['goodList'] += $condition; 220 + $data['goodList'] += $condition;
221 $data['pageFooter'] = true; 221 $data['pageFooter'] = true;
222 222
223 if ($title === '') { 223 if ($title === '') {
@@ -177,7 +177,7 @@ class NewsaleController extends AbstractAction @@ -177,7 +177,7 @@ class NewsaleController extends AbstractAction
177 $color = $this->get('color', null); 177 $color = $this->get('color', null);
178 $size = $this->get('size', null); 178 $size = $this->get('size', null);
179 $price = $this->get('price', null); 179 $price = $this->get('price', null);
180 - $p_d = $this->get('discount', null); 180 + $p_d = '0.1,0.3';
181 $dayLimit = $this->get('dayLimit', null); 181 $dayLimit = $this->get('dayLimit', null);
182 $limit = $this->get('limit', 60); 182 $limit = $this->get('limit', 60);
183 $page = $this->get('page', 1); 183 $page = $this->get('page', 1);
@@ -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"