Authored by xuqi

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

Showing 35 changed files with 327 additions and 333 deletions
@@ -3,9 +3,11 @@ nbproject @@ -3,9 +3,11 @@ nbproject
3 .idea 3 .idea
4 .gitignore 4 .gitignore
5 .gitmodules 5 .gitmodules
6 -compile/  
7 -assets/ 6 +compile
  7 +assets
8 script/nginx/logs 8 script/nginx/logs
9 npm-debug.log 9 npm-debug.log
10 composer.lock 10 composer.lock
11 vendor/ 11 vendor/
  12 +.jscsrc
  13 +.jshintrc
1 -<!DOCTYPE html>  
2 -<html>  
3 -<head>  
4 -<meta charset="utf-8">  
5 -<title>国际账号登录 | YOHO!有货</title>  
6 -<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">  
7 -<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">  
8 -<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">  
9 -<meta http-equiv="cleartype" content="on">  
10 -<meta name="apple-mobile-web-app-status-bar-style" content="black" />  
11 -<meta content="telephone=no" name="format-detection" />  
12 -<meta content="email=no" name="format-detection" />  
13 -<script type="text/javascript">  
14 - (function(doc, win) {  
15 - var docEl = doc.documentElement;  
16 - (function() {  
17 - var clientWidth = docEl.clientWidth;  
18 - if (!clientWidth) {  
19 - return;  
20 - }  
21 - docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';  
22 - }());  
23 - })(document, window);  
24 -</script>  
25 -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css">  
26 -</head>  
27 -<body class=passport-body>  
28 - <div class="login-international-page passport-page yoho-page">  
29 - <div class="header">  
30 - <a class="go-back" href=/></a>  
31 - <p class="title">登录</p>  
32 - </div> <div class="content">  
33 - <div class="select-container row">  
34 - <span class="select-title">国家和地区</span>  
35 - <select id="country-select" class="country-select select in-android-uc">  
36 - <option value=+61 >澳大利亚</option>  
37 - <option value=+82 >韩国</option>  
38 - <option value=+1 >加拿大</option>  
39 - <option value=+60 >马来西亚</option>  
40 - <option value=+1 >美国</option>  
41 - <option value=+81 >日本</option>  
42 - <option value=+65 >新加坡</option>  
43 - <option value=+44 >英国</option>  
44 - <option value=+86 selected>中国</option>  
45 - <option value=+853 >中国澳门</option>  
46 - <option value=+886 >中国台湾</option>  
47 - <option value=+852 >中国香港</option>  
48 - </select>  
49 - <div class="arrow-right"></div>  
50 - </div> <div class="input-container phone-container row has-clear">  
51 - <span id="area-code" class="area-code">+86</span>  
52 - <input id="phone-num" class="input phone-num" type="text" placeholder="手机号" value=>  
53 - </div>  
54 - <div class="input-container row has-eye">  
55 - <input id="pwd" class="pwd input" type="password" placeholder="密码">  
56 - </div>  
57 - <span id="btn-login" class="btn btn-login disble row">登录</span>  
58 - </div>  
59 -</div>  
60 -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script>  
61 -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script>  
62 -<script>  
63 - seajs.use('js/common');  
64 -</script>  
65 - <script>  
66 - seajs.use('js/passport/login/international');  
67 - </script>  
68 -</body>  
69 -</html>  
1 -<!DOCTYPE html>  
2 -<html>  
3 -<head>  
4 -<meta charset="utf-8">  
5 -<title>登录 | YOHO!有货</title>  
6 -<meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款">  
7 -<meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。">  
8 -<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">  
9 -<meta http-equiv="cleartype" content="on">  
10 -<meta name="apple-mobile-web-app-status-bar-style" content="black" />  
11 -<meta content="telephone=no" name="format-detection" />  
12 -<meta content="email=no" name="format-detection" />  
13 -<script type="text/javascript">  
14 - (function(doc, win) {  
15 - var docEl = doc.documentElement;  
16 - (function() {  
17 - var clientWidth = docEl.clientWidth;  
18 - if (!clientWidth) {  
19 - return;  
20 - }  
21 - docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';  
22 - }());  
23 - })(document, window);  
24 -</script>  
25 -<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.css">  
26 -</head>  
27 -<body class=passport-body>  
28 - <div class="login-page passport-page yoho-page">  
29 - <div class="header">  
30 - <a class="go-back" href=/></a>  
31 - <div class="img-header"></div>  
32 - </div> <div class="content">  
33 - <div class="acc-container input-container row has-clear">  
34 - <div class="yoho-logo"></div>  
35 - <input id="account" class="input account" type="text" placeholder="手机号/邮箱" autocomplete="off" value=>  
36 - </div>  
37 - <div class="input-container row has-eye">  
38 - <input id="pwd" class="pwd input" type="password" placeholder="密码">  
39 - </div>  
40 - <span id="btn-login" class="btn btn-login disable">登录</span>  
41 - <p class="op-container">  
42 - <a class="go-register" href=/reg.html>免费注册</a>  
43 - <span id="forget-pwd" class="forget-pwd">忘记密码</span>  
44 - </p>  
45 - <div class="third-party-login">  
46 - <span>其他登录方式</span>  
47 - <div class="tp-link">  
48 - <a class="alipay" href=/passport/login/alipay></a>  
49 - <a class="weibo" href=/passport/login/sina></a>  
50 - <a class="qq" href=/passport/login/qq></a>  
51 - </div>  
52 - </div>  
53 - <a class="international" href=/login.html>International Customer</a>  
54 - <div class="login-tip">  
55 - <div class="info-icon"></div>  
56 - Yoho!Family账号可登录YOHO!有货  
57 - </div>  
58 - <div id="retrive-pwd-mask" class="mask"></div>  
59 - <ul id="retrive-pwd-ways" class="retrive-pwd-ways">  
60 - <li>  
61 - <a href=/passport/back/mobile>通过手机找回密码</a>  
62 - </li>  
63 - <li>  
64 - <a href=/passport/back/email>通过邮箱找回密码</a>  
65 - </li>  
66 - <li id="cancel-retrive">  
67 - 取消  
68 - </li>  
69 - </ul>  
70 - </div>  
71 -</div>  
72 -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/lib.js"></script>  
73 -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/0.0.6/index.js"></script>  
74 -<script>  
75 - seajs.use('js/common');  
76 -</script>  
77 -<script>  
78 - seajs.use('js/passport/login/login');  
79 -</script>  
80 -</body>  
81 -</html>  
@@ -210,7 +210,7 @@ class Yohobuy @@ -210,7 +210,7 @@ class Yohobuy
210 * @param int $timeout 超时时间,单位是秒 210 * @param int $timeout 超时时间,单位是秒
211 * @return array 211 * @return array
212 */ 212 */
213 - public static function getMulti($urlList = array(), $options = array(), $cache = false, $timeout = 3) 213 + public static function getMulti($urlList = array(), $options = array(), $cache = false, $timeout = 5)
214 { 214 {
215 /* 开启缓存的情况 */ 215 /* 开启缓存的情况 */
216 if ($cache && USE_CACHE) { 216 if ($cache && USE_CACHE) {
@@ -40,6 +40,7 @@ class CacheConfig @@ -40,6 +40,7 @@ class CacheConfig
40 const KEY_ACTION_PRODUCT_BRAND_NAMES = 'key_action_product_brand_names'; // 所有品牌名称列表 40 const KEY_ACTION_PRODUCT_BRAND_NAMES = 'key_action_product_brand_names'; // 所有品牌名称列表
41 const KEY_ACTION_PRODUCT_BRAND_LOGO = 'key_action_product_brand_logo'; // 品牌信息 41 const KEY_ACTION_PRODUCT_BRAND_LOGO = 'key_action_product_brand_logo'; // 品牌信息
42 42
43 - const KEY_ACTION_INDEX_SEARCH = 'key_action_search_search'; // 搜索的数据 43 + const KEY_ACTION_SEARCH_SEARCH = 'key_action_search_search'; // 搜索的数据
  44 + const KEY_ACTION_SEARCH_FILTER = 'key_action_search_filter'; // 搜索的过滤条件
44 45
45 } 46 }
@@ -143,7 +143,8 @@ class SearchData @@ -143,7 +143,8 @@ class SearchData
143 143
144 $param = array(); 144 $param = array();
145 $param['status'] = 1; // 是否上架,1表示在架,2表示不在 145 $param['status'] = 1; // 是否上架,1表示在架,2表示不在
146 - if (!isset($orderMaps[ $condition['order'] ] )) { 146 + // $param['needFilter'] = 1; // 是否需要返回筛选条件
  147 + if (!isset($condition['order'])) {
147 $param['order'] = $orderMaps['s_t_desc']; 148 $param['order'] = $orderMaps['s_t_desc'];
148 } else { 149 } else {
149 $param['order'] = $orderMaps[ $condition['order'] ]; 150 $param['order'] = $orderMaps[ $condition['order'] ];
@@ -59,12 +59,9 @@ class FloorProcess @@ -59,12 +59,9 @@ class FloorProcess
59 { 59 {
60 $result = array(); 60 $result = array();
61 61
62 - foreach ($data as &$one) {  
63 - $one['url'] = Helpers::getFilterUrl($one['url']);  
64 - $one['img'] = Helpers::getImageUrl($one['src'], 640, 310);  
65 - unset($one['src']); 62 + foreach ($data as $one) {
  63 + $result['bannerTop']['list'][] = Helpers::formatBanner($one, 640, 240);
66 } 64 }
67 - $result['bannerTop']['list'] = $data;  
68 65
69 return $result; 66 return $result;
70 } 67 }
@@ -197,6 +197,8 @@ class ListProcess @@ -197,6 +197,8 @@ class ListProcess
197 foreach ($result['subs'] as &$val) { 197 foreach ($result['subs'] as &$val) {
198 if ($val['dataId'] === $gender) { 198 if ($val['dataId'] === $gender) {
199 $val['chosed'] = true; 199 $val['chosed'] = true;
  200 +
  201 + $result['name'] = $val['name'];
200 } 202 }
201 } 203 }
202 204
@@ -154,11 +154,11 @@ class TemplateLayout implements View_Interface @@ -154,11 +154,11 @@ class TemplateLayout implements View_Interface
154 else { 154 else {
155 $template = file_get_contents($viewName, false, null); 155 $template = file_get_contents($viewName, false, null);
156 $phpStr = LightnCandy::compile($template, array( 156 $phpStr = LightnCandy::compile($template, array(
157 - // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION  
158 - 'flags' => LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式  
159 - 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录  
160 - 'fileext' => array($tplExt), // 允许查找文件的后缀  
161 - 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime 157 + // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
  158 + 'flags' => LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
  159 + 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
  160 + 'fileext' => array($tplExt), // 允许查找文件的后缀
  161 + 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
162 )); 162 ));
163 // 文件流方式读取PHP方法 163 // 文件流方式读取PHP方法
164 $renderer = LightnCandy::prepare($phpStr); 164 $renderer = LightnCandy::prepare($phpStr);
@@ -14,12 +14,15 @@ var swiper, @@ -14,12 +14,15 @@ var swiper,
14 14
15 var searchH = $('.newbrand-search').outerHeight(), 15 var searchH = $('.newbrand-search').outerHeight(),
16 headerH = $('.yoho-header').outerHeight(), 16 headerH = $('.yoho-header').outerHeight(),
17 - brandSwipe = parseInt(searchH) + parseInt(headerH) - 1; 17 + brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
  18 + searchArray = [];
18 19
19 var brandsData, 20 var brandsData,
20 $keyword, 21 $keyword,
21 - searchBtnHammer,  
22 - clearTextHammer; 22 + clearTextHammer,
  23 + removeHistory,
  24 + searchList,
  25 + yohoHistory;
23 26
24 swiper = new Swiper('.swiper-container', { 27 swiper = new Swiper('.swiper-container', {
25 lazyLoading: true, 28 lazyLoading: true,
@@ -31,7 +34,8 @@ swiper = new Swiper('.swiper-container', { @@ -31,7 +34,8 @@ swiper = new Swiper('.swiper-container', {
31 lazyLoad($('img.lazy')); 34 lazyLoad($('img.lazy'));
32 $('.yoho-header').css({ 35 $('.yoho-header').css({
33 'z-index': 2, 36 'z-index': 2,
34 - position: 'fixed' 37 + position: 'fixed',
  38 + top: 0
35 }); 39 });
36 40
37 $(window).scroll(function() { 41 $(window).scroll(function() {
@@ -96,12 +100,15 @@ function searchResult() { @@ -96,12 +100,15 @@ function searchResult() {
96 brandHtml.push(k); 100 brandHtml.push(k);
97 brandHtml.push('</h2></div>'); 101 brandHtml.push('</h2></div>');
98 $.each(v, function(i, brand) { 102 $.each(v, function(i, brand) {
  103 +
99 brandHtml.push('<p><a href="' + brand.url + '">' + brand.name); 104 brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
  105 +
  106 + // brandHtml.push('<p><span>' + brand.name);
100 if (brand.isNew) { 107 if (brand.isNew) {
101 - brandHtml.push('<i class="icon-hot">Hot</i>'); 108 + brandHtml.push('<i class="icon-hot">HOT</i>');
102 } 109 }
103 if (brand.isHot) { 110 if (brand.isHot) {
104 - brandHtml.push('<i class="icon-new">New</i>'); 111 + brandHtml.push('<i class="icon-new">NEW</i>');
105 } 112 }
106 brandHtml.push('</a></p>'); 113 brandHtml.push('</a></p>');
107 }); 114 });
@@ -127,6 +134,20 @@ function searchResult() { @@ -127,6 +134,20 @@ function searchResult() {
127 if (Object.keys(result).length > 0) { 134 if (Object.keys(result).length > 0) {
128 rightBarBindClick(); 135 rightBarBindClick();
129 } 136 }
  137 + $('.search-result .brand-list p').each(function (index) {
  138 + searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]);
  139 + searchList.on('tap', function() {
  140 + if (localStorage.getItem('yohoHistory')) {
  141 + yohoHistory = localStorage.getItem('yohoHistory');
  142 + searchArray.push(yohoHistory);
  143 + }
  144 + searchArray.push('{"searchName":"' +
  145 + $('.search-result .brand-list p').eq(index).find('a').html() +
  146 + '","searchHref":"' + $('.search-result .brand-list p')
  147 + .eq(index).find('a').attr('href') + '"}');
  148 + localStorage.setItem('yohoHistory', searchArray);
  149 + });
  150 + });
130 } 151 }
131 152
132 if ($('.brand-search-page').length) { 153 if ($('.brand-search-page').length) {
@@ -134,6 +155,7 @@ if ($('.brand-search-page').length) { @@ -134,6 +155,7 @@ if ($('.brand-search-page').length) {
134 $keyword = $('#keyword'); 155 $keyword = $('#keyword');
135 156
136 $keyword.on('input', function() { 157 $keyword.on('input', function() {
  158 + $('.history').css('display', 'none');
137 if ($keyword.val().length) { 159 if ($keyword.val().length) {
138 searchResult(); 160 searchResult();
139 $(this).closest('.search-box').css('width', '11.25rem'); 161 $(this).closest('.search-box').css('width', '11.25rem');
@@ -142,14 +164,7 @@ if ($('.brand-search-page').length) { @@ -142,14 +164,7 @@ if ($('.brand-search-page').length) {
142 $(this).closest('.search-box').css('width', '12.5rem'); 164 $(this).closest('.search-box').css('width', '12.5rem');
143 $('.search-action').hide(); 165 $('.search-action').hide();
144 } 166 }
145 - });  
146 -  
147 -  
148 - searchBtnHammer = new Hammer($('.search-btn')[0]);  
149 - searchBtnHammer.on('tap', function(e) {  
150 - searchResult();  
151 - e.srcEvent.stopPropagation();  
152 - }); 167 + }).focus();
153 168
154 clearTextHammer = new Hammer($('.clear-text')[0]); 169 clearTextHammer = new Hammer($('.clear-text')[0]);
155 clearTextHammer.on('tap', function(e) { 170 clearTextHammer.on('tap', function(e) {
@@ -160,16 +175,18 @@ if ($('.brand-search-page').length) { @@ -160,16 +175,18 @@ if ($('.brand-search-page').length) {
160 $('form.search-box').on('submit', function() { 175 $('form.search-box').on('submit', function() {
161 return false; 176 return false;
162 }); 177 });
  178 + if (localStorage && localStorage.getItem('yohoHistory')) {
  179 + yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']');
  180 + if (yohoHistory) {
  181 + $.each(yohoHistory, function(index, content) {
  182 + $('<a href="' + content.searchHref + '">' + content.searchName + '</a>').appendTo('.historyList');
  183 + });
  184 + }
  185 + }
163 186
164 - // clearHistoryHammer = new Hammer($('#clear-text')[0]);  
165 - // clearHistoryHammer.on('tap', function() {  
166 -  
167 - // // setcookie('h_brands', '', {  
168 - // // expire: -1,  
169 - // // path: '/',  
170 - // // domain: '.m.yohobuy.com'  
171 - // // });  
172 - // $('#history-keyword').remove();  
173 - // $(this).hide();  
174 - // }); 187 + removeHistory = new Hammer($('.removeHistory')[0]);
  188 + removeHistory.on('tap', function(e) {
  189 + $('.historyList').html(' ');
  190 + localStorage.clear();
  191 + });
175 } 192 }
@@ -10,7 +10,7 @@ var $searchBox = $('.search-box'), @@ -10,7 +10,7 @@ var $searchBox = $('.search-box'),
10 10
11 function showBigSearch() { 11 function showBigSearch() {
12 $indexLogo.css({ 12 $indexLogo.css({
13 - width: 0 13 + opacity: 0
14 }); 14 });
15 $searchBox.css({ 15 $searchBox.css({
16 width: '12.8rem' 16 width: '12.8rem'
@@ -23,7 +23,7 @@ function showBigSearch() { @@ -23,7 +23,7 @@ function showBigSearch() {
23 23
24 function hideBigSearch() { 24 function hideBigSearch() {
25 $indexLogo.css({ 25 $indexLogo.css({
26 - width: '5.4rem' 26 + opacity: 1
27 }); 27 });
28 $searchBox.css({ 28 $searchBox.css({
29 width: '8.8rem' 29 width: '8.8rem'
@@ -290,6 +290,7 @@ navHammer.on('tap', function(e) { @@ -290,6 +290,7 @@ navHammer.on('tap', function(e) {
290 navType, 290 navType,
291 $active; 291 $active;
292 292
  293 + e.preventDefault();
293 if ($this.hasClass('filter')) { 294 if ($this.hasClass('filter')) {
294 295
295 //筛选面板切换状态 296 //筛选面板切换状态
1 { 1 {
2 "name": "yohobuy", 2 "name": "yohobuy",
3 - "version": "0.0.6", 3 + "version": "0.0.9",
4 "description": "yohobuy statics", 4 "description": "yohobuy statics",
5 "keywords": [], 5 "keywords": [],
6 "homepage": "", 6 "homepage": "",
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 color: #fff; 47 color: #fff;
48 } 48 }
49 .limit-tag { 49 .limit-tag {
50 - width: 90rem / $pxConvertRem; 50 + width: 100rem / $pxConvertRem;
51 border: 1px solid #000; 51 border: 1px solid #000;
52 color: #000; 52 color: #000;
53 } 53 }
1 .brand-page { 1 .brand-page {
2 -  
3 - .newbrand-search { 2 +
  3 + .newbrand-search {
4 width: 93.75%; 4 width: 93.75%;
5 height: 60rem / $pxConvertRem; 5 height: 60rem / $pxConvertRem;
6 padding: 14rem / $pxConvertRem 3.125%; 6 padding: 14rem / $pxConvertRem 3.125%;
@@ -9,27 +9,28 @@ @@ -9,27 +9,28 @@
9 top: 88rem / $pxConvertRem; 9 top: 88rem / $pxConvertRem;
10 position: fixed; 10 position: fixed;
11 z-index: 2; 11 z-index: 2;
  12 +
12 .search-box { 13 .search-box {
13 position: relative; 14 position: relative;
14 - width: 500rem / $pxConvertRem;//450 15 + width: 500rem / $pxConvertRem; //450
15 height: 60rem / $pxConvertRem; 16 height: 60rem / $pxConvertRem;
16 background-color: #FFF; 17 background-color: #FFF;
17 border-radius: 30rem / $pxConvertRem; 18 border-radius: 30rem / $pxConvertRem;
18 padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem; 19 padding: 0 32rem / $pxConvertRem 0 52rem / $pxConvertRem;
19 -  
20 - a {  
21 - width: 100%;  
22 - height: 60rem / $pxConvertRem;  
23 - border: 0;  
24 - display: block;  
25 - span{ 20 +
  21 + a {
  22 + width: 100%;
  23 + height: 60rem / $pxConvertRem;
  24 + border: 0;
  25 + display: block;
  26 + span {
26 line-height: 60rem / $pxConvertRem; 27 line-height: 60rem / $pxConvertRem;
27 color: #bdbdbd; 28 color: #bdbdbd;
28 font-size: 1.2em; 29 font-size: 1.2em;
29 padding-left: 18rem / $pxConvertRem; 30 padding-left: 18rem / $pxConvertRem;
30 - }  
31 - }  
32 - 31 + }
  32 + }
  33 +
33 .search-icon { 34 .search-icon {
34 position: absolute; 35 position: absolute;
35 font-size: 24rem / $pxConvertRem; 36 font-size: 24rem / $pxConvertRem;
@@ -38,6 +39,7 @@ @@ -38,6 +39,7 @@
38 line-height: 60rem / $pxConvertRem; 39 line-height: 60rem / $pxConvertRem;
39 color: #bdbdbd; 40 color: #bdbdbd;
40 } 41 }
  42 +
41 .search-input { 43 .search-input {
42 border: none; 44 border: none;
43 width: 95%; 45 width: 95%;
@@ -45,6 +47,7 @@ @@ -45,6 +47,7 @@
45 line-height: 1; 47 line-height: 1;
46 padding: 0 10rem / $pxConvertRem; 48 padding: 0 10rem / $pxConvertRem;
47 } 49 }
  50 +
48 .search-action { 51 .search-action {
49 display: none; 52 display: none;
50 position: absolute; 53 position: absolute;
@@ -54,11 +57,15 @@ @@ -54,11 +57,15 @@
54 line-height: 60rem / $pxConvertRem; 57 line-height: 60rem / $pxConvertRem;
55 color: #666; 58 color: #666;
56 } 59 }
  60 +
  61 + .cancel-btn {
  62 + display: inline;
  63 + }
  64 +
57 .clear-text { 65 .clear-text {
58 margin-right: 20rem / $pxConvertRem; 66 margin-right: 20rem / $pxConvertRem;
59 } 67 }
60 } 68 }
61 -  
62 } 69 }
63 70
64 .banner-top { 71 .banner-top {
@@ -67,14 +74,15 @@ @@ -67,14 +74,15 @@
67 74
68 .hot-brand { 75 .hot-brand {
69 margin: (30rem / $pxConvertRem) 0 0; 76 margin: (30rem / $pxConvertRem) 0 0;
70 - 77 +
71 .hot-brand-list { 78 .hot-brand-list {
72 - background: #fff; 79 + background: #fff;
  80 +
73 li { 81 li {
74 float: left; 82 float: left;
75 width: 158rem / $pxConvertRem; 83 width: 158rem / $pxConvertRem;
76 height: 158rem / $pxConvertRem; 84 height: 158rem / $pxConvertRem;
77 - 85 +
78 .img-box { 86 .img-box {
79 display: table-cell; 87 display: table-cell;
80 vertical-align: middle; 88 vertical-align: middle;
@@ -91,11 +99,11 @@ @@ -91,11 +99,11 @@
91 .title-bar { 99 .title-bar {
92 width: 100%; 100 width: 100%;
93 background: #eeeeee; 101 background: #eeeeee;
94 -  
95 color: #999999; 102 color: #999999;
96 // font-weight: bold; 103 // font-weight: bold;
97 position: relative; 104 position: relative;
98 - h2 { 105 +
  106 + h2 {
99 // width: 100%; 107 // width: 100%;
100 padding: 0 20rem / $pxConvertRem; 108 padding: 0 20rem / $pxConvertRem;
101 height: 50rem / $pxConvertRem; 109 height: 50rem / $pxConvertRem;
@@ -105,11 +113,12 @@ @@ -105,11 +113,12 @@
105 background-color: #f4f4f4; 113 background-color: #f4f4f4;
106 } 114 }
107 } 115 }
108 - 116 +
109 p { 117 p {
110 cursor: pointer; 118 cursor: pointer;
111 // height: 50rem / $pxConvertRem; 119 // height: 50rem / $pxConvertRem;
112 padding: 0 20rem / $pxConvertRem; 120 padding: 0 20rem / $pxConvertRem;
  121 +
113 a { 122 a {
114 display: block; 123 display: block;
115 // padding-top: 10rem / $pxConvertRem; 124 // padding-top: 10rem / $pxConvertRem;
@@ -117,7 +126,8 @@ @@ -117,7 +126,8 @@
117 line-height: 76rem / $pxConvertRem; 126 line-height: 76rem / $pxConvertRem;
118 font-size: 28rem / $pxConvertRem; 127 font-size: 28rem / $pxConvertRem;
119 border-bottom: 1px solid #f3f3f3; 128 border-bottom: 1px solid #f3f3f3;
120 - border-top: 1px solid #f9f9f9; 129 + border-top: 1px solid #f9f9f9;
  130 +
121 i { 131 i {
122 display: inline-block; 132 display: inline-block;
123 margin-top: -4rem / $pxConvertRem; 133 margin-top: -4rem / $pxConvertRem;
@@ -129,11 +139,14 @@ @@ -129,11 +139,14 @@
129 font-size: 18rem / $pxConvertRem; 139 font-size: 18rem / $pxConvertRem;
130 line-height: 38rem / $pxConvertRem; 140 line-height: 38rem / $pxConvertRem;
131 color: #fff; 141 color: #fff;
132 - border-radius: 50rem / $pxConvertRem;; 142 + border-radius: 50rem / $pxConvertRem;
  143 + ;
133 } 144 }
  145 +
134 .icon-hot { 146 .icon-hot {
135 background: #ff0000; 147 background: #ff0000;
136 } 148 }
  149 +
137 .icon-new { 150 .icon-new {
138 background: #86c048; 151 background: #86c048;
139 } 152 }
@@ -141,32 +154,82 @@ @@ -141,32 +154,82 @@
141 } 154 }
142 } 155 }
143 156
144 - .right-bar {  
145 -  
146 - width: 60rem / $pxConvertRem;  
147 - height: 75%;  
148 - top: 20%;  
149 - overflow: auto;  
150 - position: fixed;  
151 - right: 2rem / $pxConvertRem;  
152 - border-radius: 12rem / $pxConvertRem;  
153 - background: rgba(0,0,0,.8);  
154 - z-index: 2;  
155 - b {  
156 - height: 36rem / $pxConvertRem;  
157 -  
158 - line-height: 36rem / $pxConvertRem;  
159 - text-align: center;  
160 - display: block;  
161 - color: #999999;  
162 - font-weight: bold;  
163 - }  
164 - }  
165 -  
166 - .con {  
167 - padding-top: 10rem / $pxConvertRem; 157 + .right-bar {
  158 + width: 60rem / $pxConvertRem;
  159 + height: 75%;
  160 + top: 20%;
  161 + overflow: auto;
  162 + position: fixed;
  163 + right: 2rem / $pxConvertRem;
  164 + border-radius: 12rem / $pxConvertRem;
  165 + background: rgba(0, 0, 0, .8);
  166 + z-index: 2;
  167 +
  168 + b {
  169 + height: 36rem / $pxConvertRem;
  170 + line-height: 36rem / $pxConvertRem;
  171 + text-align: center;
  172 + display: block;
  173 + color: #999999;
  174 + font-weight: bold;
168 } 175 }
  176 + }
  177 + .right-bar::-webkit-scrollbar {
  178 + display: none;
  179 + }
  180 +
  181 + .con {
  182 + padding-top: 10rem / $pxConvertRem;
  183 + }
  184 +
169 .search-result { 185 .search-result {
170 padding-top: 176rem / $pxConvertRem; 186 padding-top: 176rem / $pxConvertRem;
171 } 187 }
172 -}  
  188 +}
  189 +
  190 +.history{
  191 + width: 100%;
  192 + height: auto;
  193 + overflow: hidden;
  194 + position: absolute;
  195 + left: 0;
  196 + top: 176rem / $pxConvertRem;
  197 + > h6{
  198 + width: 100%;
  199 + height: 88rem / $pxConvertRem;
  200 + line-height: 88rem / $pxConvertRem;
  201 + color: #999;
  202 + text-indent: .6rem;
  203 + font-size: 36em / $pxConvertRem;
  204 + }
  205 + .historyList{
  206 + width: 100%;
  207 + height: auto;
  208 + overflow: hidden;
  209 + display: block;
  210 + > a{
  211 + width: auto;
  212 + height: 58rem / $pxConvertRem;
  213 + overflow: hidden;
  214 + line-height: 58rem / $pxConvertRem;
  215 + margin: 0 0 20rem / $pxConvertRem .6rem;
  216 + padding: 0 20rem / $pxConvertRem;
  217 + float: left;
  218 + background-color:#f8f8f8;
  219 + color: #444;
  220 + }
  221 + }
  222 + > span{
  223 + width: auto;
  224 + height: 68rem / $pxConvertRem;
  225 + overflow: hidden;
  226 + display: inline-block;
  227 + line-height: 68rem / $pxConvertRem;
  228 + border:1px solid #e6e6e6;
  229 + padding: 0 28rem / $pxConvertRem;
  230 + font-size: 48em / $pxConvertRem;
  231 + margin-left: .6rem;
  232 + color: #000;
  233 + }
  234 +}
  235 +
@@ -50,7 +50,6 @@ @@ -50,7 +50,6 @@
50 width: 191rem / $pxConvertRem; 50 width: 191rem / $pxConvertRem;
51 height: 191rem / $pxConvertRem; 51 height: 191rem / $pxConvertRem;
52 border-left: 1px solid #e0e0e0; 52 border-left: 1px solid #e0e0e0;
53 - border-bottom: 1px solid #e0e0e0;  
54 .first-show { 53 .first-show {
55 display: none; 54 display: none;
56 } 55 }
@@ -85,7 +84,7 @@ @@ -85,7 +84,7 @@
85 font-size: 22rem / $pxConvertRem; 84 font-size: 22rem / $pxConvertRem;
86 } 85 }
87 } 86 }
88 - // li:nth-child(4), li:nth-child(5) {  
89 - // border-top: 1px solid #e0e0e0;  
90 - // } 87 + li:nth-child(4), li:nth-child(5) {
  88 + border-top: 1px solid #e0e0e0;
  89 + }
91 } 90 }
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 font-size: 50rem / $pxConvertRem; 13 font-size: 50rem / $pxConvertRem;
14 width: 216rem / $pxConvertRem; 14 width: 216rem / $pxConvertRem;
15 color: #343434; 15 color: #343434;
16 - overflow: hidden;  
17 - transition: width 400ms; 16 + opacity: 1;
  17 + transition: all 400ms;
18 } 18 }
19 19
20 .index-search { 20 .index-search {
@@ -22,7 +22,8 @@ @@ -22,7 +22,8 @@
22 top: 0; 22 top: 0;
23 right: 0; 23 right: 0;
24 width: 384rem / $pxConvertRem; 24 width: 384rem / $pxConvertRem;
25 - height: 112rem / $pxConvertRem; 25 + height: 96rem / $pxConvertRem;
  26 + background: #fff;
26 overflow: hidden; 27 overflow: hidden;
27 z-index: 3; 28 z-index: 3;
28 @include transition(width .4s); 29 @include transition(width .4s);
@@ -39,10 +39,10 @@ @@ -39,10 +39,10 @@
39 <p> 39 <p>
40 <a href="{{url}}">{{name}} 40 <a href="{{url}}">{{name}}
41 {{# isHot}} 41 {{# isHot}}
42 - <i class="icon-hot">Hot</i> 42 + <i class="icon-hot">HOT</i>
43 {{/ isHot}} 43 {{/ isHot}}
44 {{# isNew}} 44 {{# isNew}}
45 - <i class="icon-new">New</i> 45 + <i class="icon-new">NEW</i>
46 {{/ isNew}} 46 {{/ isNew}}
47 </a> 47 </a>
48 </p> 48 </p>
@@ -6,14 +6,20 @@ @@ -6,14 +6,20 @@
6 <i class="search-icon iconfont">&#xe60f;</i> 6 <i class="search-icon iconfont">&#xe60f;</i>
7 <div class="search-action"> 7 <div class="search-action">
8 <span class="iconfont clear-text">&#xe623;</span> 8 <span class="iconfont clear-text">&#xe623;</span>
9 - <span class="search-btn">搜索</span> 9 + <a class="cancel-btn" href="javascript: history.go(-1);">取消</span>
10 </div> 10 </div>
11 </form> 11 </form>
12 </div> 12 </div>
13 - 13 + <div class="history">
  14 + <h6>历史纪录</h6>
  15 + <div class="historyList">
  16 + </div>
  17 + <span class='removeHistory'>清空搜索历史</span>
  18 + </div>
14 <div class="search-result"> 19 <div class="search-result">
15 </div> 20 </div>
16 </div> 21 </div>
  22 +
17 <script id="brands-data" type="text/tmpl"> 23 <script id="brands-data" type="text/tmpl">
18 {{{brandList}}} 24 {{{brandList}}}
19 </script> 25 </script>
@@ -20,7 +20,7 @@ class KidsController extends AbstractAction @@ -20,7 +20,7 @@ class KidsController extends AbstractAction
20 // 设置网站标题 20 // 设置网站标题
21 $this->setTitle('潮童首页'); 21 $this->setTitle('潮童首页');
22 // 显示侧边栏 22 // 显示侧边栏
23 - $this->setNavSide(); 23 + $this->setNavSide('kids');
24 // 显示底部TAB 24 // 显示底部TAB
25 $this->setNavFooterTab(); 25 $this->setNavFooterTab();
26 26
@@ -20,7 +20,7 @@ class LifestyleController extends AbstractAction @@ -20,7 +20,7 @@ class LifestyleController extends AbstractAction
20 // 设置网站标题 20 // 设置网站标题
21 $this->setTitle('创意生活首页'); 21 $this->setTitle('创意生活首页');
22 // 显示侧边栏 22 // 显示侧边栏
23 - $this->setNavSide(); 23 + $this->setNavSide('lifestyle');
24 // 显示底部TAB 24 // 显示底部TAB
25 $this->setNavFooterTab(); 25 $this->setNavFooterTab();
26 26
@@ -291,7 +291,7 @@ class SearchController extends AbstractAction @@ -291,7 +291,7 @@ class SearchController extends AbstractAction
291 } 291 }
292 292
293 // 区别各种列表页面的筛选数据 293 // 区别各种列表页面的筛选数据
294 - $data = Product\FilterModel::getFilterData($condition); 294 + $data = Product\SearchModel::getFilterData($condition);
295 } 295 }
296 296
297 if (empty($data)) { 297 if (empty($data)) {
@@ -60,8 +60,18 @@ class BrandModel @@ -60,8 +60,18 @@ class BrandModel
60 // 搜索链接地址 60 // 搜索链接地址
61 $result['searchUrl'] = Helpers::url('/brands/search', null); 61 $result['searchUrl'] = Helpers::url('/brands/search', null);
62 62
63 - /* 顶部的轮翻广告列表 */  
64 - if (!empty($brand['brandTop'][0]['data'])) { 63 + /* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */
  64 + if (!empty($brand['brandTop'][0]['data']['list'])) {
  65 + $build = array();
  66 + foreach ($brand['brandTop'][0]['data']['list'] as $value) {
  67 + $build['url'] = Helpers::getFilterUrl($value['url']);
  68 + $build['img'] = Helpers::getImageUrl($value['src'], 144, 144);
  69 + $build['name'] = $value['name'];
  70 + $result['hotBrand']['list'][] = $build;
  71 + }
  72 + }
  73 + // 顶部的轮翻广告列表
  74 + elseif (!empty($brand['brandTop'][0]['data'])) {
65 $build = array(); 75 $build = array();
66 foreach ($brand['brandTop'][0]['data'] as $value) { 76 foreach ($brand['brandTop'][0]['data'] as $value) {
67 $build['url'] = Helpers::getFilterUrl($value['url']); 77 $build['url'] = Helpers::getFilterUrl($value['url']);
@@ -71,7 +81,7 @@ class BrandModel @@ -71,7 +81,7 @@ class BrandModel
71 } 81 }
72 } 82 }
73 83
74 - /* 顶部的热门品牌列表 */ 84 + /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
75 if (!empty($brand['brandTop'][1]['data']['list'])) { 85 if (!empty($brand['brandTop'][1]['data']['list'])) {
76 $build = array(); 86 $build = array();
77 foreach ($brand['brandTop'][1]['data']['list'] as $value) { 87 foreach ($brand['brandTop'][1]['data']['list'] as $value) {
@@ -52,6 +52,17 @@ class ClassModel @@ -52,6 +52,17 @@ class ClassModel
52 $item = array(); 52 $item = array();
53 $item['name'] = $val['category_name']; 53 $item['name'] = $val['category_name'];
54 $item['id'] = $val['relation_parameter']['sort']; 54 $item['id'] = $val['relation_parameter']['sort'];
  55 +
  56 + // 首先添加一级分类
  57 + $item['sub'][] = array(
  58 + 'name' => '全部'.$item['name'],
  59 + 'id' => $item['id'],
  60 + 'url' => Helpers::url('/', array(
  61 + 'sort' => $item['id'],
  62 + 'sort_name' => $item['name']), 'list')
  63 + );
  64 +
  65 + $subitem = array();
55 foreach ($val['sub'] as $value) { 66 foreach ($val['sub'] as $value) {
56 $subitem = array(); 67 $subitem = array();
57 $subitem['name'] = $value['category_name']; 68 $subitem['name'] = $value['category_name'];
@@ -77,6 +77,16 @@ class SideModel @@ -77,6 +77,16 @@ class SideModel
77 */ 77 */
78 private static function genLeftNavGuang($guangChoosed = 'all') 78 private static function genLeftNavGuang($guangChoosed = 'all')
79 { 79 {
  80 + // 判断逛的背景色
  81 + $color = false;
  82 + if($guangChoosed === 'girls') {
  83 + $color = '#FF88AE';
  84 + } else if($guangChoosed === 'kids') {
  85 + $color = '#7ad9f9';
  86 + } else if($guangChoosed === 'lifestyle') {
  87 + $color = '#4f4138';
  88 + }
  89 +
80 return array( 90 return array(
81 'textCn' => '逛', 91 'textCn' => '逛',
82 'textEn' => 'TRENDFINDER', 92 'textEn' => 'TRENDFINDER',
@@ -88,7 +98,7 @@ class SideModel @@ -88,7 +98,7 @@ class SideModel
88 'textEn' => 'TrendFinder', 98 'textEn' => 'TrendFinder',
89 'back' => true, 99 'back' => true,
90 'isSelect' => false, 100 'isSelect' => false,
91 - 'bgColor' => ($guangChoosed === 'girls') ? '#FF88AE' : false, 101 + 'bgColor' => $color,
92 ), 102 ),
93 1 => array( 103 1 => array(
94 'textCn' => '查看全部', 104 'textCn' => '查看全部',
1 -<?php  
2 -  
3 -namespace Product;  
4 -  
5 -use Configs\CacheConfig;  
6 -use LibModels\Wap\Product\SearchData;  
7 -use LibModels\Wap\Category\BrandData;  
8 -use LibModels\Wap\Category\ClassData;  
9 -use Plugin\DataProcess\ListProcess;  
10 -  
11 -/**  
12 - * 搜索相关的模板数据模型  
13 - *  
14 - * @name Filter  
15 - * @package Product  
16 - * @copyright yoho.inc  
17 - * @version 1.0 (2015-11-1 17:35:52)  
18 - */  
19 -class FilterModel  
20 -{  
21 -  
22 - /**  
23 - * 获取筛选的数据  
24 - *  
25 - * @param array $condition 查询条件  
26 - * @return array  
27 - */  
28 - public static function getFilterData($condition)  
29 - {  
30 - $result = array();  
31 -  
32 - // 区别各种列表页面的筛选数据  
33 - if (isset($condition['brand'])) {  
34 - $listData = BrandData::filterBrandData($condition);  
35 - } else if(isset($condition['sort'])) {  
36 - $listData = ClassData::filterClassData($condition);  
37 - } else {  
38 - $listData = SearchData::searchByCondition($condition);  
39 - }  
40 -  
41 - if (isset($listData['data']) && isset($listData['data']['filter'])) {  
42 - $result['filter'] = ListProcess::getFilterData($listData['data']['filter']);  
43 - }  
44 -  
45 - return $result;  
46 - }  
47 -  
48 -}  
@@ -183,8 +183,14 @@ class NewsaleModel @@ -183,8 +183,14 @@ class NewsaleModel
183 $newsale = NewsaleData::getNewsaleFocus($codeKey); 183 $newsale = NewsaleData::getNewsaleFocus($codeKey);
184 184
185 // 调用接口获取数据并封装 185 // 调用接口获取数据并封装
186 - if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {  
187 - $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240); 186 + if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
  187 + if(count($newsale['data'][0]['data']) === 1) {
  188 + $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
  189 + } else {
  190 + foreach ($newsale['data'][0]['data'] as $one) {
  191 + $result['list'][] = Helpers::formatBanner($one, 640, 240);
  192 + }
  193 + }
188 } 194 }
189 195
190 if (USE_CACHE) { 196 if (USE_CACHE) {
@@ -4,7 +4,10 @@ namespace Product; @@ -4,7 +4,10 @@ namespace Product;
4 4
5 use Configs\CacheConfig; 5 use Configs\CacheConfig;
6 use LibModels\Wap\Product\SearchData; 6 use LibModels\Wap\Product\SearchData;
  7 +use LibModels\Wap\Category\BrandData;
  8 +use LibModels\Wap\Category\ClassData;
7 use Plugin\DataProcess\ListProcess; 9 use Plugin\DataProcess\ListProcess;
  10 +use Plugin\Cache;
8 11
9 /** 12 /**
10 * 搜索相关的模板数据模型 13 * 搜索相关的模板数据模型
@@ -28,7 +31,7 @@ class SearchModel @@ -28,7 +31,7 @@ class SearchModel
28 $result = array(); 31 $result = array();
29 32
30 if (USE_CACHE) { 33 if (USE_CACHE) {
31 - $key = CacheConfig::KEY_ACTION_INDEX_SEARCH; 34 + $key = CacheConfig::KEY_ACTION_SEARCH_SEARCH;
32 if (!empty($condition)) { 35 if (!empty($condition)) {
33 $key .= http_build_query($condition, null, '&'); 36 $key .= http_build_query($condition, null, '&');
34 } 37 }
@@ -40,7 +43,7 @@ class SearchModel @@ -40,7 +43,7 @@ class SearchModel
40 } 43 }
41 44
42 // 调用接口查询数据 (使用新的 Elastic Engine) 45 // 调用接口查询数据 (使用新的 Elastic Engine)
43 - $listData = SearchData::searchElasticByCondition($condition); 46 + $listData = SearchData::searchElasticByCondition($condition);
44 // 调用接口查询数据 (使用老的 Sphinx Engine) 47 // 调用接口查询数据 (使用老的 Sphinx Engine)
45 // $listData = SearchData::searchByCondition($condition); 48 // $listData = SearchData::searchByCondition($condition);
46 // 处理返回的数据 49 // 处理返回的数据
@@ -62,4 +65,53 @@ class SearchModel @@ -62,4 +65,53 @@ class SearchModel
62 return $result; 65 return $result;
63 } 66 }
64 67
  68 + /**
  69 + * 获取筛选的数据
  70 + *
  71 + * @param array $condition 查询条件
  72 + * @return array
  73 + */
  74 + public static function getFilterData($condition)
  75 + {
  76 + $result = array();
  77 +
  78 + if (USE_CACHE) {
  79 + $key = CacheConfig::KEY_ACTION_SEARCH_FILTER;
  80 + if (!empty($condition)) {
  81 + $key .= http_build_query($condition, null, '&');
  82 + }
  83 + // 先尝试获取一级缓存(master), 有数据则直接返回.
  84 + $result = Cache::get($key, 'master');
  85 + if (!empty($result)) {
  86 + return $result;
  87 + }
  88 + }
  89 +
  90 + // 区别各种列表页面的筛选数据
  91 + if (isset($condition['brand'])) {
  92 + $listData = BrandData::filterBrandData($condition);
  93 + } else if (isset($condition['sort'])) {
  94 + $listData = ClassData::filterClassData($condition);
  95 + } else {
  96 + $listData = SearchData::searchByCondition($condition);
  97 + }
  98 +
  99 + if (isset($listData['data']['filter'])) {
  100 + $result['filter'] = ListProcess::getFilterData($listData['data']['filter']);
  101 + }
  102 +
  103 + if (USE_CACHE) {
  104 + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
  105 + if (empty($result)) {
  106 + $result = Cache::get($key, 'slave');
  107 + }
  108 + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
  109 + else {
  110 + Cache::set($key, $result, 1800); // 缓存30分钟
  111 + }
  112 + }
  113 +
  114 + return $result;
  115 + }
  116 +
65 } 117 }
@@ -209,7 +209,7 @@ class BackController extends AbstractAction @@ -209,7 +209,7 @@ class BackController extends AbstractAction
209 'phoneNum' => $phoneNum 209 'phoneNum' => $phoneNum
210 ); 210 );
211 211
212 - $this->_view->assign('title', 'YOHO!有货'); 212 + $this->setTitle('找回密码-通过手机号');
213 $this->_view->display('mobile-code', $data); 213 $this->_view->display('mobile-code', $data);
214 } 214 }
215 215
@@ -246,6 +246,11 @@ class BackController extends AbstractAction @@ -246,6 +246,11 @@ class BackController extends AbstractAction
246 246
247 // 邮箱验证码 247 // 邮箱验证码
248 $code = $this->get('code', ''); 248 $code = $this->get('code', '');
  249 +
  250 + // 判断是否允许访问, 不允许则跳转到错误页面
  251 + if ((!$token || !Helpers::verifyMobile($phoneNum)) && !$code) {
  252 + $this->error();
  253 + }
249 254
250 $data = array( 255 $data = array(
251 'backUrl' => '/signin.html', 256 'backUrl' => '/signin.html',
@@ -258,7 +263,7 @@ class BackController extends AbstractAction @@ -258,7 +263,7 @@ class BackController extends AbstractAction
258 'code' => $code 263 'code' => $code
259 ); 264 );
260 265
261 - $this->_view->assign('title', 'YOHO!有货'); 266 + $this->setTitle('找回密码-输入新密码');
262 $this->_view->display('new-password', $data); 267 $this->_view->display('new-password', $data);
263 } 268 }
264 269
@@ -249,6 +249,11 @@ class RegController extends AbstractAction @@ -249,6 +249,11 @@ class RegController extends AbstractAction
249 if (!Helpers::verifyToken($mobile, $token)) { 249 if (!Helpers::verifyToken($mobile, $token)) {
250 break; 250 break;
251 } 251 }
  252 +
  253 + /* 判断密码是否符合规则 */
  254 + if (!Helpers::verifyPassword($password)) {
  255 + break;
  256 + }
252 257
253 /* 验证注册的标识码是否有效 */ 258 /* 验证注册的标识码是否有效 */
254 $data = RegData::regMobile($area, $mobile, $password); 259 $data = RegData::regMobile($area, $mobile, $password);
@@ -15,7 +15,7 @@ use Plugin\Helpers; @@ -15,7 +15,7 @@ use Plugin\Helpers;
15 */ 15 */
16 class OptController extends AbstractAction 16 class OptController extends AbstractAction
17 { 17 {
18 - 18 +
19 /** 19 /**
20 * 品牌[店铺]收藏/取消收藏 20 * 品牌[店铺]收藏/取消收藏
21 * 21 *
@@ -25,44 +25,47 @@ class OptController extends AbstractAction @@ -25,44 +25,47 @@ class OptController extends AbstractAction
25 */ 25 */
26 public function favoriteBrandAction() 26 public function favoriteBrandAction()
27 { 27 {
28 - $result = array('code' => 400, 'message' => '未登录', 'data' => false);  
29 - 28 + $result = array('code' => 401, 'message' => '未登录', 'data' => false);
  29 +
30 do { 30 do {
31 /* 判断是否是AJAX请求 */ 31 /* 判断是否是AJAX请求 */
32 if (!$this->isAjax()) { 32 if (!$this->isAjax()) {
33 break; 33 break;
34 } 34 }
35 - 35 +
36 /* 判断品牌ID是否有效 */ 36 /* 判断品牌ID是否有效 */
37 $id = $this->post('id'); 37 $id = $this->post('id');
38 if (!is_numeric($id)) { 38 if (!is_numeric($id)) {
39 break; 39 break;
40 } 40 }
41 - 41 +
42 /* 判断用户是否登录 */ 42 /* 判断用户是否登录 */
43 $uid = $this->getUdid(); 43 $uid = $this->getUdid();
44 if (!$uid) { 44 if (!$uid) {
45 break; 45 break;
46 } 46 }
47 - 47 +
48 /* 取消收藏 */ 48 /* 取消收藏 */
49 $opt = $this->post('opt', 'ok'); 49 $opt = $this->post('opt', 'ok');
50 if ($opt !== 'ok') { 50 if ($opt !== 'ok') {
51 $result = BrandData::favoriteCancel($id, $uid); 51 $result = BrandData::favoriteCancel($id, $uid);
52 break; 52 break;
53 } 53 }
54 - 54 +
55 /* 收藏 */ 55 /* 收藏 */
56 $result = BrandData::favorite($id, $uid); 56 $result = BrandData::favorite($id, $uid);
57 - }  
58 - while (false);  
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 - 57 + if (!isset($result['code'])) {
  58 + break;
  59 + }
  60 +
  61 + /* 未登录的情况,加跳转链接 */
  62 + if ($result['code'] == 412 || $result['code'] == 400) {
  63 + $referer = $this->server('HTTP_REFERER', SITE_MAIN);
  64 + $result['data'] = Helpers::url('/signin.html', array('refer' => $referer));
  65 + }
  66 + } while (false);
  67 +
65 $this->echoJson($result); 68 $this->echoJson($result);
66 } 69 }
67 - 70 +
68 } 71 }
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "0.0.6" 53 +application.version = "0.0.9"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "0.0.6" 53 +application.version = "0.0.9"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "0.0.6" 53 +application.version = "0.0.9"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "0.0.6" 53 +application.version = "0.0.9"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"