Authored by hf

Merge branch 'develop' into test

@@ -100,6 +100,18 @@ class AbstractAction extends Controller_Abstract @@ -100,6 +100,18 @@ class AbstractAction extends Controller_Abstract
100 { 100 {
101 return $this->_request->getParam($key, $default); 101 return $this->_request->getParam($key, $default);
102 } 102 }
  103 +
  104 + /**
  105 + * 封装一下获取服务器的参数
  106 + *
  107 + * @param String $key
  108 + * @param mixed $default
  109 + * @return mixed
  110 + */
  111 + protected function server($key, $default = null)
  112 + {
  113 + return $this->_request->getServer($key, $default);
  114 + }
103 115
104 /** 116 /**
105 * 关闭模板自动渲染 117 * 关闭模板自动渲染
1 <?php 1 <?php
  2 +
2 namespace LibModels\Wap\Category; 3 namespace LibModels\Wap\Category;
3 4
4 use Api\Yohobuy; 5 use Api\Yohobuy;
@@ -15,26 +16,28 @@ use Api\Sign; @@ -15,26 +16,28 @@ use Api\Sign;
15 */ 16 */
16 class FocusData 17 class FocusData
17 { 18 {
18 - /**  
19 - * 获取关注数据  
20 - *  
21 - * @param integ $uid 用户ID  
22 - * @param string $gender 性别  
23 - * @param integer $limit 读取数目限制,默认为10  
24 - * @param integer $page 读取分页限制,默认为1  
25 - * @return array 关注数据  
26 - */ 19 +
  20 + /**
  21 + * 获取关注数据
  22 + *
  23 + * @param integ $uid 用户ID
  24 + * @param string $gender 性别
  25 + * @param integer $limit 读取数目限制,默认为10
  26 + * @param integer $page 读取分页限制,默认为1
  27 + * @return array 关注数据
  28 + */
27 public static function getFocusData($uid, $gender, $limit = 10, $page = 1) 29 public static function getFocusData($uid, $gender, $limit = 10, $page = 1)
28 { 30 {
29 - // 构建必传参数  
30 - $param = Yohobuy::param();  
31 - $param['uid'] = $uid;  
32 - $param['gender'] = $gender;  
33 - $param['limit'] = $limit;  
34 - $param['page'] = $page; 31 + // 构建必传参数
  32 + $param = Yohobuy::param();
  33 + $param['uid'] = $uid;
  34 + $param['gender'] = $gender;
  35 + $param['limit'] = $limit;
  36 + $param['page'] = $page;
35 37
36 $param['client_secret'] = Sign::getSign($param); 38 $param['client_secret'] = Sign::getSign($param);
37 -  
38 - return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/attention/getlist', $param); 39 +
  40 + return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v1/attention/getlist', $param);
39 } 41 }
  42 +
40 } 43 }
@@ -58,7 +58,7 @@ class PlusstarData @@ -58,7 +58,7 @@ class PlusstarData
58 $build['client_secret'] = Sign::getSign($build); 58 $build['client_secret'] = Sign::getSign($build);
59 $urlList['all'] = Yohobuy::httpBuildQuery($url, $build); 59 $urlList['all'] = Yohobuy::httpBuildQuery($url, $build);
60 60
61 - return Yohobuy::getMulti($urlList); 61 + return Yohobuy::getMulti($urlList, array(), 1800); // 缓存30分钟
62 } 62 }
63 63
64 /** 64 /**
@@ -96,7 +96,7 @@ class PlusstarData @@ -96,7 +96,7 @@ class PlusstarData
96 $original['client_secret'] = Sign::getSign($original); 96 $original['client_secret'] = Sign::getSign($original);
97 $urlList['original'] = Yohobuy::httpBuildQuery($url, $original); 97 $urlList['original'] = Yohobuy::httpBuildQuery($url, $original);
98 98
99 - return Yohobuy::getMulti($urlList); 99 + return Yohobuy::getMulti($urlList, array(), 1800); // 缓存30分钟
100 } 100 }
101 101
102 /** 102 /**
@@ -33,7 +33,7 @@ class BrandData @@ -33,7 +33,7 @@ class BrandData
33 $param['type'] = 'brand'; 33 $param['type'] = 'brand';
34 $param['client_secret'] = Sign::getSign($param); 34 $param['client_secret'] = Sign::getSign($param);
35 35
36 - return Yohobuy::post(Yohobuy::API_URL, $param, true); 36 + return Yohobuy::post(Yohobuy::API_URL, $param);
37 } 37 }
38 38
39 /** 39 /**
@@ -52,7 +52,7 @@ class BrandData @@ -52,7 +52,7 @@ class BrandData
52 $param['type'] = 'brand'; 52 $param['type'] = 'brand';
53 $param['client_secret'] = Sign::getSign($param); 53 $param['client_secret'] = Sign::getSign($param);
54 54
55 - return Yohobuy::post(Yohobuy::API_URL, $param, true); 55 + return Yohobuy::post(Yohobuy::API_URL, $param);
56 } 56 }
57 57
58 } 58 }
1 <?php 1 <?php
2 2
3 namespace Plugin\DataProcess; 3 namespace Plugin\DataProcess;
  4 +
4 use Plugin\Helpers; 5 use Plugin\Helpers;
5 6
6 /** 7 /**
@@ -19,8 +20,7 @@ class ListProcess @@ -19,8 +20,7 @@ class ListProcess
19 { 20 {
20 $result = array(); 21 $result = array();
21 22
22 - if(isset($data['product_list']))  
23 - { 23 + if (isset($data['product_list'])) {
24 $result['new'] = self::getProductData($data['product_list']); 24 $result['new'] = self::getProductData($data['product_list']);
25 } 25 }
26 if ($returnFilter && isset($data['filter'])) { 26 if ($returnFilter && isset($data['filter'])) {
@@ -28,7 +28,6 @@ class ListProcess @@ -28,7 +28,6 @@ class ListProcess
28 } 28 }
29 29
30 return $result; 30 return $result;
31 -  
32 } 31 }
33 32
34 /** 33 /**
@@ -47,7 +46,6 @@ class ListProcess @@ -47,7 +46,6 @@ class ListProcess
47 } 46 }
48 47
49 return $products; 48 return $products;
50 -  
51 } 49 }
52 50
53 /** 51 /**
@@ -60,23 +58,21 @@ class ListProcess @@ -60,23 +58,21 @@ class ListProcess
60 public static function getFilterData($data, $gender = '1,2,3') 58 public static function getFilterData($data, $gender = '1,2,3')
61 { 59 {
62 // 过滤条件数据 60 // 过滤条件数据
63 - $filters = array('classify'=>array()); 61 + $filters = array('classify' => array());
64 62
65 // 返回数据中有没有gender时要添加gender 63 // 返回数据中有没有gender时要添加gender
66 // $data['gender'] = array('2,3'=>'GIRLS','1,3'=>'BOYS'); 64 // $data['gender'] = array('2,3'=>'GIRLS','1,3'=>'BOYS');
67 65
68 $num = 1; 66 $num = 1;
69 foreach ($data as $key => $val) { 67 foreach ($data as $key => $val) {
70 - if(empty($val))  
71 - { 68 + if (empty($val)) {
72 continue; 69 continue;
73 } 70 }
74 if (!is_callable("self::$key")) { 71 if (!is_callable("self::$key")) {
75 continue; 72 continue;
76 } 73 }
77 $build = self::$key($val, $gender); 74 $build = self::$key($val, $gender);
78 - if($num === 1)  
79 - { 75 + if ($num === 1) {
80 $build['active'] = true; 76 $build['active'] = true;
81 } 77 }
82 78
@@ -88,7 +84,6 @@ class ListProcess @@ -88,7 +84,6 @@ class ListProcess
88 self::sortArrByField($filters['classify'], 'sort_col'); 84 self::sortArrByField($filters['classify'], 'sort_col');
89 85
90 return $filters; 86 return $filters;
91 -  
92 } 87 }
93 88
94 private static function brand($data) 89 private static function brand($data)
@@ -167,7 +162,7 @@ class ListProcess @@ -167,7 +162,7 @@ class ListProcess
167 foreach ($data as $key => $one) { 162 foreach ($data as $key => $one) {
168 $discount = array(); 163 $discount = array();
169 $discount['dataId'] = $key; 164 $discount['dataId'] = $key;
170 - $discount['name'] = $one['name'] .'折商品'; 165 + $discount['name'] = $one['name'] . '折商品';
171 166
172 $result['subs'][] = $discount; 167 $result['subs'][] = $discount;
173 } 168 }
@@ -200,7 +195,9 @@ class ListProcess @@ -200,7 +195,9 @@ class ListProcess
200 195
201 // 处理选中状态 196 // 处理选中状态
202 foreach ($result['subs'] as &$val) { 197 foreach ($result['subs'] as &$val) {
203 - $val['dataId'] === $gender && $val['chosed'] = true; 198 + if ($val['dataId'] === $gender) {
  199 + $val['chosed'] = true;
  200 + }
204 } 201 }
205 202
206 return $result; 203 return $result;
@@ -222,23 +219,24 @@ class ListProcess @@ -222,23 +219,24 @@ class ListProcess
222 ) 219 )
223 ); 220 );
224 221
  222 + $category = array();
225 foreach ($data as $one) { 223 foreach ($data as $one) {
226 - $category = array(); 224 +
227 $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0; 225 $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0;
228 $category['name'] = $one['category_name']; 226 $category['name'] = $one['category_name'];
229 227
230 - /*// 子品类(目前h5不支持二级)  
231 - if(isset($one['sub']))  
232 - {  
233 - $category['subs'] = array();  
234 - foreach ($one['sub'] as $single) {  
235 - $subitem = array();  
236 - $subitem['dataId'] = $single['category_id'];  
237 - $subitem['name'] = $single['category_name']; 228 + /* // 子品类(目前h5不支持二级)
  229 + if(isset($one['sub']))
  230 + {
  231 + $category['subs'] = array();
  232 + foreach ($one['sub'] as $single) {
  233 + $subitem = array();
  234 + $subitem['dataId'] = $single['category_id'];
  235 + $subitem['name'] = $single['category_name'];
238 236
239 - $category['subs'][] = $subitem;  
240 - }  
241 - }*/ 237 + $category['subs'][] = $subitem;
  238 + }
  239 + } */
242 240
243 $result['subs'][] = $category; 241 $result['subs'][] = $category;
244 } 242 }
@@ -262,8 +260,9 @@ class ListProcess @@ -262,8 +260,9 @@ class ListProcess
262 ) 260 )
263 ); 261 );
264 262
  263 + $price = array();
265 foreach ($data as $key => $one) { 264 foreach ($data as $key => $one) {
266 - $price = array(); 265 +
267 $price['dataId'] = $key; 266 $price['dataId'] = $key;
268 $price['name'] = $one; 267 $price['name'] = $one;
269 268
@@ -289,9 +288,10 @@ class ListProcess @@ -289,9 +288,10 @@ class ListProcess
289 ) 288 )
290 ); 289 );
291 290
  291 + $size = array();
292 foreach ($data as $one) { 292 foreach ($data as $one) {
293 - $size = array();  
294 - $size['dataId'] = $one['size_id']; 293 +
  294 + $size['dataId'] = $one['size_id'];
295 $size['name'] = $one['size_name']; 295 $size['name'] = $one['size_name'];
296 296
297 $result['subs'][] = $size; 297 $result['subs'][] = $size;
@@ -307,7 +307,8 @@ class ListProcess @@ -307,7 +307,8 @@ class ListProcess
307 * @param string $field 字段名称 307 * @param string $field 字段名称
308 * @param boolean $desc 时候降序排列,默认为false 308 * @param boolean $desc 时候降序排列,默认为false
309 */ 309 */
310 - private static function sortArrByField(&$array, $field, $desc = false){ 310 + private static function sortArrByField(&$array, $field, $desc = false)
  311 + {
311 $fieldArr = array(); 312 $fieldArr = array();
312 foreach ($array as $k => $v) { 313 foreach ($array as $k => $v) {
313 $fieldArr[$k] = $v[$field]; 314 $fieldArr[$k] = $v[$field];
@@ -315,4 +316,5 @@ class ListProcess @@ -315,4 +316,5 @@ class ListProcess
315 $sort = $desc == false ? SORT_ASC : SORT_DESC; 316 $sort = $desc == false ? SORT_ASC : SORT_DESC;
316 array_multisort($fieldArr, $sort, $array); 317 array_multisort($fieldArr, $sort, $array);
317 } 318 }
  319 +
318 } 320 }
@@ -33,7 +33,7 @@ class Helpers @@ -33,7 +33,7 @@ class Helpers
33 $url = 'http://search' . SUB_DOMAIN; 33 $url = 'http://search' . SUB_DOMAIN;
34 break; 34 break;
35 case 'index': // 默认 35 case 'index': // 默认
36 - $url = ''; 36 + $url = SITE_MAIN;
37 break; 37 break;
38 default: // 其它子域名 38 default: // 其它子域名
39 $url = 'http://' . $module . SUB_DOMAIN; 39 $url = 'http://' . $module . SUB_DOMAIN;
@@ -201,7 +201,7 @@ class Helpers @@ -201,7 +201,7 @@ class Helpers
201 $result['product_id'] = $productData['product_id']; 201 $result['product_id'] = $productData['product_id'];
202 $result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height); 202 $result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height);
203 $result['name'] = $productData['product_name']; 203 $result['name'] = $productData['product_name'];
204 - $result['price'] = $productData['market_price'] . '.00'; 204 + $result['price'] = empty($productData['market_price']) ? false : $productData['market_price'] . '.00';
205 $result['salePrice'] = $productData['sales_price'] . '.00'; 205 $result['salePrice'] = $productData['sales_price'] . '.00';
206 $result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y'); 206 $result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
207 $result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_' 207 $result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_'
@@ -7,8 +7,6 @@ var $ = require('jquery'); @@ -7,8 +7,6 @@ var $ = require('jquery');
7 7
8 var $footer = $('#yoho-footer'); 8 var $footer = $('#yoho-footer');
9 9
10 -var FOOTERHEIGHT = 120; //footer height  
11 -  
12 function cookie(name) { 10 function cookie(name) {
13 var cookies = document.cookie, 11 var cookies = document.cookie,
14 cookieVal, 12 cookieVal,
@@ -100,7 +98,7 @@ function rePosFooter() { @@ -100,7 +98,7 @@ function rePosFooter() {
100 return; 98 return;
101 } 99 }
102 100
103 - if ($('body').height() < $(window).height() - FOOTERHEIGHT) { 101 + if ($('body').height() <= $(window).height()) {
104 $footer.addClass('bottom'); 102 $footer.addClass('bottom');
105 } else { 103 } else {
106 $footer.removeClass('bottom'); 104 $footer.removeClass('bottom');
@@ -113,7 +111,7 @@ function rePosFooter() { @@ -113,7 +111,7 @@ function rePosFooter() {
113 111
114 var user = getUser(); 112 var user = getUser();
115 113
116 - if ($('body').height() < $(window).height() - FOOTERHEIGHT) { 114 + if ($('body').height() <= $(window).height()) {
117 $footer.addClass('bottom'); 115 $footer.addClass('bottom');
118 } 116 }
119 117
@@ -8,7 +8,7 @@ var $searchBox = $('.search-box'), @@ -8,7 +8,7 @@ var $searchBox = $('.search-box'),
8 $indexSearch = $('.index-search'), 8 $indexSearch = $('.index-search'),
9 $indexLogo = $('.index-logo'); 9 $indexLogo = $('.index-logo');
10 10
11 -$searchBox.find('input').on('focus', function() { 11 +function showBigSearch() {
12 $indexLogo.css({ 12 $indexLogo.css({
13 width: 0 13 width: 0
14 }); 14 });
@@ -19,7 +19,9 @@ $searchBox.find('input').on('focus', function() { @@ -19,7 +19,9 @@ $searchBox.find('input').on('focus', function() {
19 width: '15.5rem' 19 width: '15.5rem'
20 }); 20 });
21 $('.clear-text, .no-search').show(); 21 $('.clear-text, .no-search').show();
22 -}).on('blur', function() { 22 +}
  23 +
  24 +function hideBigSearch() {
23 $indexLogo.css({ 25 $indexLogo.css({
24 width: '5.4rem' 26 width: '5.4rem'
25 }); 27 });
@@ -30,12 +32,22 @@ $searchBox.find('input').on('focus', function() { @@ -30,12 +32,22 @@ $searchBox.find('input').on('focus', function() {
30 width: '9.6rem' 32 width: '9.6rem'
31 }); 33 });
32 $('.clear-text, .no-search').hide(); 34 $('.clear-text, .no-search').hide();
  35 +}
  36 +
  37 +$searchBox.find('input').on('focus', function() {
  38 + showBigSearch();
33 }); 39 });
34 -$searchBox.find('.clear-text').click(function() {  
35 - $searchBox.find('input').val('').trigger('focus'); 40 +
  41 +$searchBox.find('.clear-text').on('touchend', function() {
  42 + $searchBox.find('input').val('');
36 }); 43 });
37 -$searchBox.find('.search-icon').click(function() { 44 +$searchBox.find('.search-icon').on('touchend', function() {
38 $indexSearch.submit(); 45 $indexSearch.submit();
39 }); 46 });
40 47
  48 +$('.no-search').on('touchend', function() {
  49 + $searchBox.find('input').val('');
  50 + hideBigSearch();
  51 +});
  52 +
41 window.rePosFooter(); 53 window.rePosFooter();
@@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
108 padding: 0 20rem / $pxConvertRem; 108 padding: 0 20rem / $pxConvertRem;
109 a { 109 a {
110 display: block; 110 display: block;
111 - padding-top: 10rem / $pxConvertRem; 111 + // padding-top: 10rem / $pxConvertRem;
112 height: 76rem / $pxConvertRem; 112 height: 76rem / $pxConvertRem;
113 line-height: 76rem / $pxConvertRem; 113 line-height: 76rem / $pxConvertRem;
114 font-size: 28rem / $pxConvertRem; 114 font-size: 28rem / $pxConvertRem;
@@ -116,13 +116,14 @@ @@ -116,13 +116,14 @@
116 border-top: 1px solid #f9f9f9; 116 border-top: 1px solid #f9f9f9;
117 i { 117 i {
118 display: inline-block; 118 display: inline-block;
  119 + margin-top: -4rem / $pxConvertRem;
119 margin-left: 24rem / $pxConvertRem; 120 margin-left: 24rem / $pxConvertRem;
120 width: 58rem / $pxConvertRem; 121 width: 58rem / $pxConvertRem;
121 height: 38rem / $pxConvertRem; 122 height: 38rem / $pxConvertRem;
122 text-align: center; 123 text-align: center;
123 vertical-align: middle; 124 vertical-align: middle;
124 font-size: 18rem / $pxConvertRem; 125 font-size: 18rem / $pxConvertRem;
125 - line-height: 39rem / $pxConvertRem; 126 + line-height: 38rem / $pxConvertRem;
126 color: #fff; 127 color: #fff;
127 border-radius: 50rem / $pxConvertRem;; 128 border-radius: 50rem / $pxConvertRem;;
128 } 129 }
@@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
4 position: fixed; 4 position: fixed;
5 top: 0; 5 top: 0;
6 bottom: 0; 6 bottom: 0;
7 - // left: 0; 7 + left: -540rem / $pxConvertRem;
8 right: 640rem / $pxConvertRem; 8 right: 640rem / $pxConvertRem;
9 width: 540rem / $pxConvertRem; 9 width: 540rem / $pxConvertRem;
10 z-index: -1; 10 z-index: -1;
11 overflow: hidden; 11 overflow: hidden;
12 - @include transition(right .3s); 12 + @include transition(all .3s);
13 13
14 ul { 14 ul {
15 background: #f0f0f0; 15 background: #f0f0f0;
@@ -107,6 +107,7 @@ @@ -107,6 +107,7 @@
107 } 107 }
108 108
109 .side-nav.on { 109 .side-nav.on {
  110 + left: 0;
110 right: 100rem / $pxConvertRem; 111 right: 100rem / $pxConvertRem;
111 z-index: 3; 112 z-index: 3;
112 } 113 }
@@ -24,7 +24,8 @@ @@ -24,7 +24,8 @@
24 width: 384rem / $pxConvertRem; 24 width: 384rem / $pxConvertRem;
25 height: 112rem / $pxConvertRem; 25 height: 112rem / $pxConvertRem;
26 overflow: hidden; 26 overflow: hidden;
27 - transition: width 400ms; 27 + z-index: 3;
  28 + @include transition(width .4s);
28 .search-box { 29 .search-box {
29 float: left; 30 float: left;
30 position: relative; 31 position: relative;
@@ -96,10 +97,10 @@ @@ -96,10 +97,10 @@
96 min-height: 800rem / $pxConvertRem; 97 min-height: 800rem / $pxConvertRem;
97 98
98 .index-channel-list { 99 .index-channel-list {
99 - padding-top: 50%; 100 + margin-top: -50%;
100 width: 100%; 101 width: 100%;
101 position: absolute; 102 position: absolute;
102 - top: -180rem / $pxConvertRem; 103 + top: 50%;
103 104
104 .list-item { 105 .list-item {
105 display: block; 106 display: block;
@@ -114,6 +115,9 @@ @@ -114,6 +115,9 @@
114 background: #000; 115 background: #000;
115 border: 4px solid #fff; 116 border: 4px solid #fff;
116 font-weight: bold; 117 font-weight: bold;
  118 + &:last-child {
  119 + margin-bottom: 0;
  120 + }
117 } 121 }
118 .lighter { 122 .lighter {
119 font-weight: lighter; 123 font-weight: lighter;
@@ -19,7 +19,7 @@ class HomeController extends AbstractAction @@ -19,7 +19,7 @@ class HomeController extends AbstractAction
19 public function indexAction() 19 public function indexAction()
20 { 20 {
21 // 目前跳到老站 21 // 目前跳到老站
22 - $this->go(OLD_MAIN . '/home'); 22 + // $this->go(OLD_MAIN . '/home');
23 } 23 }
24 24
25 } 25 }
@@ -123,7 +123,9 @@ class BrandModel @@ -123,7 +123,9 @@ class BrandModel
123 $list = array(); 123 $list = array();
124 $build = array(); 124 $build = array();
125 foreach ($brand['data']['brands'] as $char => $value) { 125 foreach ($brand['data']['brands'] as $char => $value) {
  126 + $build = array();
126 foreach ($value as $row) { 127 foreach ($value as $row) {
  128 + $list = array();
127 $list['name'] = $row['brand_name']; 129 $list['name'] = $row['brand_name'];
128 $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; 130 $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false;
129 $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; 131 $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false;
@@ -160,7 +160,7 @@ class HomeModel @@ -160,7 +160,7 @@ class HomeModel
160 } 160 }
161 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 161 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
162 else { 162 else {
163 - Cache::set($cache, $result); 163 + Cache::set($cache, $result);
164 } 164 }
165 } 165 }
166 166
@@ -59,7 +59,7 @@ class SideModel @@ -59,7 +59,7 @@ class SideModel
59 } 59 }
60 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 60 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
61 else { 61 else {
62 - Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV, $result, 3600); // 缓存1小时 62 + Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV, $result);
63 } 63 }
64 } 64 }
65 65
@@ -57,7 +57,7 @@ class ListModel @@ -57,7 +57,7 @@ class ListModel
57 } 57 }
58 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 58 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
59 else { 59 else {
60 - Cache::set($key, $result, 600); // 缓存10分钟 60 + Cache::set($key, $result, 1800); // 缓存30分钟
61 } 61 }
62 } 62 }
63 63
@@ -140,7 +140,7 @@ class ListModel @@ -140,7 +140,7 @@ class ListModel
140 } 140 }
141 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 141 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
142 else { 142 else {
143 - Cache::set($key, $result, 600); // 缓存10分钟 143 + Cache::set($key, $result, 1800); // 缓存30分钟
144 } 144 }
145 } 145 }
146 146
@@ -186,7 +186,7 @@ class ListModel @@ -186,7 +186,7 @@ class ListModel
186 } 186 }
187 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 187 // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
188 else { 188 else {
189 - Cache::set($key, $result, 10800); // 缓存3小时 189 + Cache::set($key, $result); // 缓存1小时
190 } 190 }
191 } 191 }
192 192
@@ -16,6 +16,6 @@ class IndexController extends AbstractAction @@ -16,6 +16,6 @@ class IndexController extends AbstractAction
16 public function indexAction() 16 public function indexAction()
17 { 17 {
18 // 跳转到老版 18 // 跳转到老版
19 - $this->go(OLD_MAIN . '/cart/index/index'); 19 + // $this->go(OLD_MAIN . '/cart/index/index');
20 } 20 }
21 } 21 }
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use LibModels\Wap\Product\BrandData; 4 use LibModels\Wap\Product\BrandData;
  5 +use Plugin\Helpers;
5 6
6 /** 7 /**
7 * 商品操作相关的控制器 8 * 商品操作相关的控制器
@@ -56,6 +57,11 @@ class OptController extends AbstractAction @@ -56,6 +57,11 @@ class OptController extends AbstractAction
56 } 57 }
57 while (false); 58 while (false);
58 59
  60 + if (isset($result['code']) && $result['code'] == 412) {
  61 + $referer = $this->server('HTTP_REFERER', SITE_MAIN);
  62 + $result['data'] = Helpers::url('/signin.html', array('refer' => $referer));
  63 + }
  64 +
59 $this->echoJson($result); 65 $this->echoJson($result);
60 } 66 }
61 67
@@ -36,11 +36,11 @@ class RecomController extends AbstractAction @@ -36,11 +36,11 @@ class RecomController extends AbstractAction
36 $gender = $this->get('gender', '1,3'); 36 $gender = $this->get('gender', '1,3');
37 // 女 37 // 女
38 if ($gender === '2,3') { 38 if ($gender === '2,3') {
39 - $recom = RecomData::mayLike('2,3', 2); 39 + $recom = RecomData::mayLike('2,3', 2, $page);
40 } 40 }
41 // 男 41 // 男
42 else { 42 else {
43 - $recom = RecomData::mayLike('1,3', 1); 43 + $recom = RecomData::mayLike('1,3', 1, $page);
44 } 44 }
45 45
46 /* 判断是否有内容返回 */ 46 /* 判断是否有内容返回 */
@@ -58,10 +58,13 @@ class RecomController extends AbstractAction @@ -58,10 +58,13 @@ class RecomController extends AbstractAction
58 foreach ($recom['data']['product_list'] as $value) { 58 foreach ($recom['data']['product_list'] as $value) {
59 $data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366); 59 $data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366);
60 } 60 }
61 - $this->_view->display('maylike', $data);  
62 } while (false); 61 } while (false);
63 62
64 - echo ' '; 63 + if (isset($data)) {
  64 + $this->_view->display('maylike', $data);
  65 + } else {
  66 + echo ' ';
  67 + }
65 } 68 }
66 69
67 /** 70 /**
@@ -100,11 +103,13 @@ class RecomController extends AbstractAction @@ -100,11 +103,13 @@ class RecomController extends AbstractAction
100 foreach ($recom['data']['product_list'] as $value) { 103 foreach ($recom['data']['product_list'] as $value) {
101 $data['goods'][] = Helpers::formatProduct($value, true); 104 $data['goods'][] = Helpers::formatProduct($value, true);
102 } 105 }
103 - $this->_view->display('maylike', $data);  
104 -  
105 } while (false); 106 } while (false);
106 107
107 - echo ' '; 108 + if (isset($data)) {
  109 + $this->_view->display('maylike', $data);
  110 + } else {
  111 + echo ' ';
  112 + }
108 } 113 }
109 114
110 /** 115 /**
@@ -119,23 +124,22 @@ class RecomController extends AbstractAction @@ -119,23 +124,22 @@ class RecomController extends AbstractAction
119 if (!$this->isAjax()) { 124 if (!$this->isAjax()) {
120 break; 125 break;
121 } 126 }
122 - 127 +
123 /* 创意生活只有一页数据 */ 128 /* 创意生活只有一页数据 */
124 $page = $this->get('page', 1); 129 $page = $this->get('page', 1);
125 if (intval($page) > 1) { 130 if (intval($page) > 1) {
126 break; 131 break;
127 - } 132 + }
128 133
129 /* 取可能喜欢的数据 */ 134 /* 取可能喜欢的数据 */
130 $recom = RecomData::mayLikeLifestyle(); 135 $recom = RecomData::mayLikeLifestyle();
131 - 136 +
132 /* 构建人气单品数据 */ 137 /* 构建人气单品数据 */
133 if (empty($recom['top']['data']['product_list'])) { 138 if (empty($recom['top']['data']['product_list'])) {
134 break; 139 break;
135 } 140 }
136 - 141 +
137 $data = array(); 142 $data = array();
138 -  
139 $build = array(); 143 $build = array();
140 $build['show'] = true; 144 $build['show'] = true;
141 foreach ($recom['top']['data']['product_list'] as $value) { 145 foreach ($recom['top']['data']['product_list'] as $value) {
@@ -177,47 +181,13 @@ class RecomController extends AbstractAction @@ -177,47 +181,13 @@ class RecomController extends AbstractAction
177 // } 181 // }
178 // $data['goodsContainer'][] = $build; 182 // $data['goodsContainer'][] = $build;
179 // } 183 // }
180 -  
181 - $this->_view->display('maylikelife', $data);  
182 -  
183 } while (false); 184 } while (false);
184 185
185 - echo ' '; 186 + if (isset($data)) {
  187 + $this->_view->display('maylikelife', $data);
  188 + } else {
  189 + echo ' ';
  190 + }
186 } 191 }
187 192
188 -// /**  
189 -// * 你可能喜欢的  
190 -// *  
191 -// * 备注:  
192 -// * 调用位于男生(BOYS),女生(GIRLS),潮童(KIDS),创意生活(LifeStyle)页面的底部.  
193 -// * 调用方式为AJAX,需要用JS遍历该数据集,替换图片URL地址中的{width},{height},{mode}.  
194 -// * JS替换示例: str.replace("{width}", 300).replace("{height}", 300).replace("{mode}", 2);  
195 -// *  
196 -// * @param string gender "1,3"表示男, "2,3"表示女, 当channel为3时该参数可不传  
197 -// * @param string channel 1表示男, 2表示女, 3表示潮童  
198 -// * @return json  
199 -// */  
200 -// public function maylikeAction()  
201 -// {  
202 -// if ($this->isAjax()) {  
203 -// $data = '';  
204 -// $gender = $this->get('gender', '1,3');  
205 -// $channel = $this->get('channel', '1');  
206 -//  
207 -// switch (strval($channel)) {  
208 -// case '1': // 男(Boys)  
209 -// case '2': // 女(Girls)  
210 -// $data = RecomData::mayLike($gender, $channel);  
211 -// break;  
212 -// case '3': // 潮童(Kids)  
213 -// $data = RecomData::mayLikeKids();  
214 -// break;  
215 -// case '4': // 创意生活(LifeStyle)  
216 -// $data = RecomData::mayLikeLifestyle();  
217 -// break;  
218 -// }  
219 -//  
220 -// $this->echoJson($data);  
221 -// }  
222 -// }  
223 } 193 }