Authored by 毕凯

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

@@ -284,7 +284,7 @@ class AbstractAction extends Controller_Abstract @@ -284,7 +284,7 @@ class AbstractAction extends Controller_Abstract
284 protected function getUid($useSession = false) 284 protected function getUid($useSession = false)
285 { 285 {
286 // @todo 286 // @todo
287 - $useSession = false; 287 + // $useSession = false;
288 288
289 if (!$this->_uid) { 289 if (!$this->_uid) {
290 $cookie = $this->getCookie('_UID'); 290 $cookie = $this->getCookie('_UID');
@@ -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;
@@ -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 }
@@ -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() {
@@ -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 +}
@@ -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";
@@ -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;
@@ -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
@@ -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(
@@ -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);
@@ -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 === '') {