Merge branch 'develop' into test
Showing
12 changed files
with
70 additions
and
40 deletions
@@ -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 |
static/img/lazy-failure/order-good.jpg
0 → 100644
2.37 KB
@@ -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 | }, |
static/sass/_lazy-failure.scss
0 → 100644
@@ -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"; |
@@ -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; |
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}} |
-
Please register or login to post a comment