Authored by yangyang

Merge branch 'feature/web-list' of http://git.dev.yoho.cn/web/yohobuy into feature/web-list

Showing 35 changed files with 649 additions and 736 deletions
@@ -4,7 +4,7 @@ namespace LibModels\Web\Product; @@ -4,7 +4,7 @@ namespace LibModels\Web\Product;
4 use Api\Yohobuy; 4 use Api\Yohobuy;
5 class SearchData extends \LibModels\Wap\Product\SearchData 5 class SearchData extends \LibModels\Wap\Product\SearchData
6 { 6 {
7 - public static $shops_url = 'http://101.200.31.165/yohosearch/shops.json'; 7 + public static $shopsUrl = 'http://101.200.31.165/yohosearch/shops.json';
8 /** 8 /**
9 * 获取搜索的服务地址 9 * 获取搜索的服务地址
10 * 10 *
@@ -136,7 +136,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData @@ -136,7 +136,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
136 */ 136 */
137 public static function getShop(array $params) 137 public static function getShop(array $params)
138 { 138 {
139 - return Yohobuy::get(self::$shops_url,$params); 139 + return Yohobuy::get(self::$shopsUrl,$params);
140 } 140 }
141 141
142 /** 142 /**
@@ -129,7 +129,8 @@ class HelperSearch @@ -129,7 +129,8 @@ class HelperSearch
129 * @author sefon 2015-12-21 17:24:04 129 * @author sefon 2015-12-21 17:24:04
130 * @return array 130 * @return array
131 */ 131 */
132 - public static function getProductList($product,$imgSize){ 132 + public static function getProductList($product,$imgSize)
  133 + {
133 $goods = array(); 134 $goods = array();
134 foreach($product as $key => $val){ 135 foreach($product as $key => $val){
135 //NEW 136 //NEW
@@ -172,7 +173,8 @@ class HelperSearch @@ -172,7 +173,8 @@ class HelperSearch
172 * @param $filter 173 * @param $filter
173 * @return array 174 * @return array
174 */ 175 */
175 - public static function standard($filter) { 176 + public static function standard($filter)
  177 + {
176 $params = self::$params; 178 $params = self::$params;
177 $result = array(); 179 $result = array();
178 foreach ($filter as $key => $val) { 180 foreach ($filter as $key => $val) {
@@ -217,7 +219,8 @@ class HelperSearch @@ -217,7 +219,8 @@ class HelperSearch
217 * 性别 219 * 性别
218 * @return array 220 * @return array
219 */ 221 */
220 - public static function gender($filter) { 222 + public static function gender($filter)
  223 + {
221 if (empty($filter) || !isset($filter['gender']) || empty($filter['gender'])) { 224 if (empty($filter) || !isset($filter['gender']) || empty($filter['gender'])) {
222 return array(); 225 return array();
223 } 226 }
@@ -343,7 +346,8 @@ class HelperSearch @@ -343,7 +346,8 @@ class HelperSearch
343 * @param array $filter 346 * @param array $filter
344 * @return array 347 * @return array
345 */ 348 */
346 - public static function brand($filter) { 349 + public static function brand($filter)
  350 + {
347 $options = self::$options; 351 $options = self::$options;
348 //品牌列表返回空 352 //品牌列表返回空
349 if (isset($options['brandName'])) { 353 if (isset($options['brandName'])) {
@@ -447,7 +451,8 @@ class HelperSearch @@ -447,7 +451,8 @@ class HelperSearch
447 * @param array $filter 451 * @param array $filter
448 * @return array 452 * @return array
449 */ 453 */
450 - public static function size($filter) { 454 + public static function size($filter)
  455 + {
451 $params = self::$params; 456 $params = self::$params;
452 $sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : ''; 457 $sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : '';
453 if (isset($params['size'])) { 458 if (isset($params['size'])) {
@@ -484,7 +489,8 @@ class HelperSearch @@ -484,7 +489,8 @@ class HelperSearch
484 * @param array $filter 489 * @param array $filter
485 * @return array 490 * @return array
486 */ 491 */
487 - public static function color($filter) { 492 + public static function color($filter)
  493 + {
488 $params = self::$params; 494 $params = self::$params;
489 $colorId = isset($params['color']) && !empty(self::$params['color']) ? self::$params['color'] : ''; 495 $colorId = isset($params['color']) && !empty(self::$params['color']) ? self::$params['color'] : '';
490 if (isset($params['color'])) { 496 if (isset($params['color'])) {
@@ -520,7 +526,8 @@ class HelperSearch @@ -520,7 +526,8 @@ class HelperSearch
520 * @param array $filter 526 * @param array $filter
521 * @return array 527 * @return array
522 */ 528 */
523 - public static function price($filter) { 529 + public static function price($filter)
  530 + {
524 $params = self::$params; 531 $params = self::$params;
525 $priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : ''; 532 $priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : '';
526 if (isset($params['price'])) { 533 if (isset($params['price'])) {
@@ -562,7 +569,8 @@ class HelperSearch @@ -562,7 +569,8 @@ class HelperSearch
562 /** 569 /**
563 * 获取自定义价格要提交的地址 570 * 获取自定义价格要提交的地址
564 */ 571 */
565 - public static function customPrice($filter) { 572 + public static function customPrice($filter)
  573 + {
566 $params = self::$params; 574 $params = self::$params;
567 $result = array( 575 $result = array(
568 'min' => '', 576 'min' => '',
@@ -585,7 +593,8 @@ class HelperSearch @@ -585,7 +593,8 @@ class HelperSearch
585 * @param array $filter 593 * @param array $filter
586 * @return array 594 * @return array
587 */ 595 */
588 - public static function style($filter) { 596 + public static function style($filter)
  597 + {
589 $params = self::$params; 598 $params = self::$params;
590 $styleIds = isset($params['style']) && !empty($params['style']) ? explode(',', $params['style']) : array(); 599 $styleIds = isset($params['style']) && !empty($params['style']) ? explode(',', $params['style']) : array();
591 if (isset($params['style'])) { 600 if (isset($params['style'])) {
@@ -976,7 +985,8 @@ class HelperSearch @@ -976,7 +985,8 @@ class HelperSearch
976 /** 985 /**
977 * 当前页地址 986 * 当前页地址
978 */ 987 */
979 - public static function current(){ 988 + public static function current()
  989 + {
980 $url = explode('?', $_SERVER['REQUEST_URI']); 990 $url = explode('?', $_SERVER['REQUEST_URI']);
981 self::$listnav[0]['href'] = $url[0]; 991 self::$listnav[0]['href'] = $url[0];
982 return $url[0]; 992 return $url[0];
@@ -984,7 +994,8 @@ class HelperSearch @@ -984,7 +994,8 @@ class HelperSearch
984 /** 994 /**
985 * 下一页 995 * 下一页
986 */ 996 */
987 - public static function next($total){ 997 + public static function next($total)
  998 + {
988 $param = self::$params; 999 $param = self::$params;
989 $page = self::$page; 1000 $page = self::$page;
990 $next = array(); 1001 $next = array();
@@ -1025,13 +1036,14 @@ class HelperSearch @@ -1025,13 +1036,14 @@ class HelperSearch
1025 * @param $viewNum 1036 * @param $viewNum
1026 * @return mixed 1037 * @return mixed
1027 */ 1038 */
1028 - public static function pager($total,$viewNum){ 1039 + public static function pager($total, $viewNum){
1029 $Paging = new Paging('Yoho'); 1040 $Paging = new Paging('Yoho');
1030 return $Paging->setTotal($total)->setSize($viewNum)->view(0); 1041 return $Paging->setTotal($total)->setSize($viewNum)->view(0);
1031 } 1042 }
1032 1043
1033 //组织静态资源数据格式 1044 //组织静态资源数据格式
1034 - public static function formatNodeContent($code){ 1045 + public static function formatNodeContent($code)
  1046 + {
1035 $nodeContent = BrandData::getByNodeContent($code); 1047 $nodeContent = BrandData::getByNodeContent($code);
1036 if (isset($nodeContent['code']) && $nodeContent['code'] === 200) { 1048 if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
1037 $result = array(); 1049 $result = array();
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015 5 +Created by FontForge 20120731 at Wed Jan 13 13:50:02 2016
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -16,10 +16,10 @@ Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015 @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
16 ascent="896" 16 ascent="896"
17 descent="-128" 17 descent="-128"
18 x-height="792" 18 x-height="792"
19 - bbox="-0.75 -224 3943 893" 19 + bbox="-0.75 -224 3943 896"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E641" 22 + unicode-range="U+0078-E644"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -268,5 +268,15 @@ d="M522 893q-103 0 -197 -40t-162 -108t-108.5 -162t-40.5 -197.5t40.5 -197.5t108.5 @@ -268,5 +268,15 @@ d="M522 893q-103 0 -197 -40t-162 -108t-108.5 -162t-40.5 -197.5t40.5 -197.5t108.5
268 t92.5 138.5t138.5 92.5t169 34.5t168.5 -34.5t138.5 -92.5t93 -138.5t34.5 -169t-34.5 -168.5t-93 -138.5t-138.5 -93t-169 -34.5zM775 268l-105 61q-11 4 -21 6.5t-18 2.5t-15 -0.5t-13 -4t-10 -5.5t-9 -6l-6 -7q-2 -2 -6 -7l-3 -4l-6 -10q-34 -4 -59 21l-51 50 268 t92.5 138.5t138.5 92.5t169 34.5t168.5 -34.5t138.5 -92.5t93 -138.5t34.5 -169t-34.5 -168.5t-93 -138.5t-138.5 -93t-169 -34.5zM775 268l-105 61q-11 4 -21 6.5t-18 2.5t-15 -0.5t-13 -4t-10 -5.5t-9 -6l-6 -7q-2 -2 -6 -7l-3 -4l-6 -10q-34 -4 -59 21l-51 50
269 q-24 25 -20 60l9 4q3 5 16 16t17 18t4 25t-11 43h-1l-60 105q-8 13 -20.5 20t-26 7t-27.5 -7l-62 -36q-3 -1 -6 -4l-6 -6l-6 -6q-3 -3 -5.5 -6t-4.5 -5t-3 -4l-1 -1q-14 -87 24.5 -183.5t121.5 -174.5q72 -68 157 -101.5t165 -29.5q4 1 10.5 2.5t20.5 10t21 20.5l36 62 269 q-24 25 -20 60l9 4q3 5 16 16t17 18t4 25t-11 43h-1l-60 105q-8 13 -20.5 20t-26 7t-27.5 -7l-62 -36q-3 -1 -6 -4l-6 -6l-6 -6q-3 -3 -5.5 -6t-4.5 -5t-3 -4l-1 -1q-14 -87 24.5 -183.5t121.5 -174.5q72 -68 157 -101.5t165 -29.5q4 1 10.5 2.5t20.5 10t21 20.5l36 62
270 q11 20 5.5 41.5t-25.5 32.5z" /> 270 q11 20 5.5 41.5t-25.5 32.5z" />
  271 + <glyph glyph-name="uniE642" unicode="&#xe642;"
  272 +d="M439 324h110l-54 148zM501 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q101 0 192.5 39t158 105.5t105.5 158.5t39 192.5t-39 192.5t-105.5 158t-158 105.5t-192.5 39.5zM656 180l-19 -9q-2 -1 -4 -1.5t-3.5 -1t-3.5 -0.5
  273 +q-5 0 -9 2q-5 2 -8.5 5.5t-5.5 8.5l-27 69h-163l-25 -69q-4 -10 -14.5 -14t-19.5 1l-20 9q-9 4 -12.5 13t-0.5 18l151 401q6 16 23 16t23 -16l151 -401q3 -9 -0.5 -18t-12.5 -13z" />
  274 + <glyph glyph-name="uniE643" unicode="&#xe643;" horiz-adv-x="1124"
  275 +d="M859 896h-595q-109 0 -186.5 -77.5t-77.5 -186.5v-760l200 135q18 14 49.5 24t63.5 14.5t71.5 6.5t66 2t57 -1t34.5 -1h317q109 0 186.5 77.5t77.5 186.5v316q0 109 -77.5 186.5t-186.5 77.5zM477 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70
  276 +q0 -14 -3.5 -27t-10 -23.5t-16 -20t-20.5 -15.5t-24 -10t-27 -4zM848 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70t-29.5 -70.5t-71.5 -29.5z" />
  277 + <glyph glyph-name="uniE644" unicode="&#xe644;"
  278 +d="M523 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q67 0 131.5 18t119 49.5t100 77.5t77.5 100.5t49.5 118.5t17.5 131q0 101 -39 193t-105.5 158t-158 105.5t-192.5 39.5zM739 224q8 -8 7 -19q0 -2 -0.5 -4.5t-1.5 -5t-2.5 -4.5
  279 +t-3.5 -3q-11 -10 -15 -14q-7 -7 -17 -7t-18 7l-34 34q-59 -42 -131 -42q-94 0 -160.5 66.5t-66.5 160.5q0 46 18 88t48.5 72.5t72.5 48.5t88 18t88 -18t72.5 -48.5t48.5 -72.5t18 -88q0 -75 -45 -135zM592 337q8 7 18 6.5t17 -7.5l27 -27q25 39 25 84q0 64 -45.5 109.5
  280 +t-110 45.5t-110 -45.5t-45.5 -109.5t45.5 -109.5t109.5 -45.5q44 0 80 21l-27 28q-8 7 -7.5 18t7.5 18z" />
271 </font> 281 </font>
272 </defs></svg> 282 </defs></svg>
No preview for this file type
No preview for this file type
1 #thumb-row { 1 #thumb-row {
2 - @include flexbox((  
3 - display: box,  
4 - box-pack: justify  
5 - ), $version: 1);  
6 - @include flexbox((  
7 - display: flex,  
8 - justify-content: space-around  
9 - ), $version: 3); 2 + // @include flexbox((
  3 + // display: box,
  4 + // box-pack: justify
  5 + // ), $version: 1);
  6 + // @include flexbox((
  7 + // display: flex,
  8 + // justify-content: space-around
  9 + // ), $version: 3);
10 background-color: #f0f0f0; 10 background-color: #f0f0f0;
11 text-align: center; 11 text-align: center;
12 - padding: 32rem/$pxConvertRem 14rem/$pxConvertRem 0;  
13 - 12 + padding: 32rem/$pxConvertRem 0 0;
14 .thumb-row-box { 13 .thumb-row-box {
15 display: inline-block; 14 display: inline-block;
16 width: 275rem/$pxConvertRem; 15 width: 275rem/$pxConvertRem;
@@ -19,5 +18,6 @@ @@ -19,5 +18,6 @@
19 background-size: 100%; 18 background-size: 100%;
20 background-repeat: no-repeat; 19 background-repeat: no-repeat;
21 background-position: center; 20 background-position: center;
  21 + margin: 0 14.4rem/$pxConvertRem;
22 } 22 }
23 } 23 }
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 right: 0; 47 right: 0;
48 top: 0; 48 top: 0;
49 margin-right: pxToRem(30px); 49 margin-right: pxToRem(30px);
50 - font-size: pxToRem(28px); 50 + font-size: pxToRem(34px);
51 font-weight: bold; 51 font-weight: bold;
52 line-height: pxToRem(100px); 52 line-height: pxToRem(100px);
53 } 53 }
@@ -12,14 +12,12 @@ @@ -12,14 +12,12 @@
12 } 12 }
13 13
14 .info { 14 .info {
  15 + width: auto;
15 color: #b0b0b0; 16 color: #b0b0b0;
16 font-size: pxToRem(24px); 17 font-size: pxToRem(24px);
17 - line-height: 1;  
18 - 18 + line-height: 1rem;
19 .dollar { 19 .dollar {
20 display: inline-block; 20 display: inline-block;
21 - // margin-right: pxToRem(6px);  
22 - vertical-align: middle;  
23 width: pxToRem(24px); 21 width: pxToRem(24px);
24 height: pxToRem(24px); 22 height: pxToRem(24px);
25 background: image-url("me/yoho-coin/dollar.png") center center; 23 background: image-url("me/yoho-coin/dollar.png") center center;
@@ -29,15 +27,15 @@ @@ -29,15 +27,15 @@
29 27
30 .more { 28 .more {
31 display: inline-block; 29 display: inline-block;
32 - margin: pxToRem(30px) 0; 30 + margin: pxToRem(20px) 0 pxToRem(30px);
33 color: #444; 31 color: #444;
34 - font-size: pxToRem(24px);  
35 - line-height: pxToRem(40px);  
36 - width: pxToRem(152px);  
37 - height: pxToRem(36px); 32 + font-size: pxToRem(28px);
  33 + line-height: pxToRem(44px);
  34 + width: pxToRem(168px);
  35 + height: pxToRem(42px);
38 text-align: center; 36 text-align: center;
39 border: 1px solid #444; 37 border: 1px solid #444;
40 - border-radius: pxToRem(36px); 38 + border-radius: pxToRem(22px);
41 } 39 }
42 40
43 .coin-tip { 41 .coin-tip {
@@ -45,7 +43,7 @@ @@ -45,7 +43,7 @@
45 padding: pxToRem(20px) pxToRem(30px); 43 padding: pxToRem(20px) pxToRem(30px);
46 font-size: pxToRem(24px); 44 font-size: pxToRem(24px);
47 line-height: pxToRem(32px); 45 line-height: pxToRem(32px);
48 - color: #dc6870; 46 + color: #d0021b;
49 border-top: 1px solid #e0e0e0; 47 border-top: 1px solid #e0e0e0;
50 border-bottom: 1px solid #e0e0e0; 48 border-bottom: 1px solid #e0e0e0;
51 49
@@ -54,7 +52,7 @@ @@ -54,7 +52,7 @@
54 width: pxToRem(32px); 52 width: pxToRem(32px);
55 height: pxToRem(32px); 53 height: pxToRem(32px);
56 font-weight: bold; 54 font-weight: bold;
57 - border: 2px solid #dc6870; 55 + border: 2px solid #d0021b;
58 border-radius: 50%; 56 border-radius: 50%;
59 } 57 }
60 } 58 }
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 span { 97 span {
98 display: block; 98 display: block;
99 float: left; 99 float: left;
100 - font-size: inherit; 100 + // font-size: inherit;
101 padding-right: pxToRem(15px); 101 padding-right: pxToRem(15px);
102 } 102 }
103 p { 103 p {
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 span { 118 span {
119 display: block; 119 display: block;
120 float: left; 120 float: left;
121 - font-size: inherit; 121 + // font-size: inherit;
122 color: $mainFontC; 122 color: $mainFontC;
123 padding-right: pxToRem(15px); 123 padding-right: pxToRem(15px);
124 } 124 }
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="goods-consults-page yoho-page"> 2 <div class="goods-consults-page yoho-page">
3 <div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}"> 3 <div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}">
4 - <i class="iconfont consult-logo">&#xe639;</i> 4 + <i class="iconfont consult-logo">&#xe643;</i>
5 <span>我要咨询</span> 5 <span>我要咨询</span>
6 <a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a> 6 <a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
7 </div> 7 </div>
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 {{#list}} 10 {{#list}}
11 <div class="consult-item" data-id="{{id}}"> 11 <div class="consult-item" data-id="{{id}}">
12 <div class="question"> 12 <div class="question">
13 - <span class="iconfont">&#xe639;</span> 13 + <span class="iconfont">&#xe644;</span>
14 <p> 14 <p>
15 {{question}}<br> 15 {{question}}<br>
16 <span class="time">{{time}}</span> 16 <span class="time">{{time}}</span>
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 </div> 18 </div>
19 19
20 <div class="answer"> 20 <div class="answer">
21 - <span class="iconfont">&#xe63f;</span> 21 + <span class="iconfont">&#xe642;</span>
22 <p>{{answer}}</p> 22 <p>{{answer}}</p>
23 </div> 23 </div>
24 24
@@ -58,14 +58,14 @@ @@ -58,14 +58,14 @@
58 {{#commonConsults}} 58 {{#commonConsults}}
59 <div class="faq-item"> 59 <div class="faq-item">
60 <div class="question"> 60 <div class="question">
61 - <span class="iconfont">&#xe639;</span> 61 + <span class="iconfont">&#xe644;</span>
62 <p> 62 <p>
63 {{question}} 63 {{question}}
64 </p> 64 </p>
65 </div> 65 </div>
66 66
67 <div class="answer"> 67 <div class="answer">
68 - <span class="iconfont">&#xe63f;</span> 68 + <span class="iconfont">&#xe642;</span>
69 <p>{{answer}}</p> 69 <p>{{answer}}</p>
70 </div> 70 </div>
71 </div> 71 </div>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 </span> 11 </span>
12 <ul id="country-code-list" class="country-code-list"> 12 <ul id="country-code-list" class="country-code-list">
13 {{# countryList}} 13 {{# countryList}}
14 - <li data-cc="+{{code}}">{{name}} +{{code}}</li> 14 + <li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li>
15 {{/ countryList}} 15 {{/ countryList}}
16 </ul> 16 </ul>
17 </div> 17 </div>
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 </li> 28 </li>
29 <li class="input-container-li clearfix"> 29 <li class="input-container-li clearfix">
30 <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4"> 30 <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4">
31 - <img id="captcha-img" class="captcha-img" src="http://web.dev.yohobuy.com/passport/images" alt=""> 31 + <img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
32 <a id="change-captcha" class="link change-captcha">换一张</a> 32 <a id="change-captcha" class="link change-captcha">换一张</a>
33 <span id="captcha-err" class="err-tip captcha-err hide"> 33 <span id="captcha-err" class="err-tip captcha-err hide">
34 <i></i> 34 <i></i>
1 -{{> layout/header}}  
2 -<div class="product-list-page product-page yoho-page">  
3 - {{# list}}  
4 - {{# brandBanner}}  
5 - <div class="brand-banner">  
6 - <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>  
7 - <div class="opt-wrap">  
8 - <p class="opt center-content">  
9 - <a href="{{brandHome}}">  
10 - <i class="iconfont">&#xe617;</i>  
11 - 品牌首页  
12 - </a>  
13 - <a href="{{brandIntro}}">  
14 - <i class="iconfont">&#xe618;</i>  
15 - 品牌介绍  
16 - </a>  
17 - <span id="brand-favor" class="brand-favor">  
18 - <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>  
19 - </span>  
20 - </p>  
21 - </div>  
22 - </div>  
23 - {{/ brandBanner}}  
24 -  
25 - <div class="center-content clearfix">  
26 - {{> layout/path-nav}}  
27 -  
28 - {{# brandAbout}}  
29 - <div class="brand-about">  
30 - {{{brandIntro}}}  
31 - </div>  
32 - {{^}}  
33 - <div class="list-left pull-left">  
34 - {{> product/left-content}}  
35 - </div>  
36 - <div class="list-right pull-right">  
37 - {{# shopEntry}}  
38 - <div class="shop-entry clearfix">  
39 - <a class="pull-left" href="{{home}}">  
40 - <img class="logo" src="{{logo}}">  
41 - </a>  
42 -  
43 - <div class="name pull-left">  
44 - <a class="shop-name" href="{{home}}">{{shopName}}</a>  
45 - <p class="sorts">  
46 - {{#each sort}}  
47 - <a href="{{href}}">{{name}}</a>  
48 -  
49 - {{#unless @last}}  
50 - /  
51 - {{/unless}}  
52 - {{/each}}  
53 - </p>  
54 - </div>  
55 -  
56 - <a class="entry-btn pull-right" href="{{home}}">  
57 - 进入品牌店铺  
58 - <span class="iconfont">&#xe601;</span>  
59 - </a>  
60 - </div>  
61 - {{/ shopEntry}}  
62 -  
63 - {{> product/standard-content}}  
64 -  
65 - {{> product/latest-walk}}  
66 - </div>  
67 - {{/ brandAbout}}  
68 - </div>  
69 - {{/ list}}  
70 -</div>  
71 -{{> layout/footer}}  
  1 +{{> product/list}}
1 -{{> layout/header}}  
2 -<div class="product-list-page product-page yoho-page">  
3 - {{# list}}  
4 - {{# brandBanner}}  
5 - <div class="brand-banner">  
6 - <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>  
7 - <div class="opt-wrap">  
8 - <p class="opt center-content">  
9 - <a href="{{brandHome}}">  
10 - <i class="iconfont">&#xe617;</i>  
11 - 品牌首页  
12 - </a>  
13 - <a href="{{brandIntro}}">  
14 - <i class="iconfont">&#xe618;</i>  
15 - 品牌介绍  
16 - </a>  
17 - <span id="brand-favor" class="brand-favor">  
18 - <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>  
19 - </span>  
20 - </p>  
21 - </div>  
22 - </div>  
23 - {{/ brandBanner}}  
24 -  
25 - <div class="center-content clearfix">  
26 - {{> layout/path-nav}}  
27 -  
28 - {{# brandAbout}}  
29 - <div class="brand-about">  
30 - {{{brandIntro}}}  
31 - </div>  
32 - {{^}}  
33 - <div class="list-left pull-left">  
34 - {{> product/left-content}}  
35 - </div>  
36 - <div class="list-right pull-right">  
37 - {{> product/standard-content}}  
38 -  
39 - {{> product/latest-walk}}  
40 - </div>  
41 - {{/ brandAbout}}  
42 - </div>  
43 - {{/ list}}  
44 -</div>  
45 -{{> layout/footer}}  
  1 +{{> product/list}}
1 -{{> layout/header}}  
2 -<div class="new-sale-page product-page yoho-page">  
3 - {{# newSale}}  
4 - {{# saleBanner}}  
5 - <div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>  
6 - {{/ saleBanner}}  
7 -  
8 - <div class="center-content clearfix">  
9 - {{> layout/path-nav}}  
10 -  
11 - {{# saleTitle}}  
12 - <div class="header-title">  
13 - {{name}}  
14 - <p class="line-through"></p>  
15 - <p class="count-wrap">  
16 - <span class="count">共{{count}}个结果</span>  
17 - </p>  
18 - </div>  
19 - {{/ saleTitle}}  
20 -  
21 - <div class="list-left pull-left">  
22 - {{> product/left-content}}  
23 - </div>  
24 -  
25 - <div class="list-right pull-right">  
26 - {{# newMain}}  
27 - <div class="new-banner">  
28 - <a href="{{bannerHref}}">  
29 - <img src="{{banner}}">  
30 - </a>  
31 - </div>  
32 - <div class="new-brands clearfix">  
33 - <span class="iconfont pre">&#xe607;</span>  
34 - <div class="brands-wrap">  
35 - <ul class="brands">  
36 - {{# brands}}  
37 - <li>  
38 - <a href="{{href}}">  
39 - <img src="{{logo}}">  
40 - </a>  
41 - </li>  
42 - {{/ brands}}  
43 - </ul>  
44 - </div>  
45 - <span class="iconfont next">&#xe608;</span>  
46 - </div>  
47 - <div class="new-floor-title">  
48 - <span class="date">{{date}}</span>  
49 - <span class="title">{{title}}</span>  
50 - </div>  
51 - {{/ newMain}}  
52 -  
53 - {{> product/standard-content}}  
54 - </div>  
55 - </div>  
56 - {{/ newSale}}  
57 -</div>  
58 -{{> layout/footer}}  
  1 +{{> product/new-sale}}
1 -{{> layout/header}}  
2 -<div class="new-sale-page product-page yoho-page">  
3 - {{# newSale}}  
4 - {{# saleBanner}}  
5 - <div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>  
6 - {{/ saleBanner}}  
7 -  
8 - <div class="center-content clearfix">  
9 - {{> layout/path-nav}}  
10 -  
11 - {{# saleTitle}}  
12 - <div class="header-title">  
13 - {{name}}  
14 - <p class="line-through"></p>  
15 - <p class="count-wrap">  
16 - <span class="count">共{{count}}个结果</span>  
17 - </p>  
18 - </div>  
19 - {{/ saleTitle}}  
20 -  
21 - <div class="list-left pull-left">  
22 - {{> product/left-content}}  
23 - </div>  
24 -  
25 - <div class="list-right pull-right">  
26 - {{# newMain}}  
27 - <div class="new-banner">  
28 - <a href="{{bannerHref}}">  
29 - <img src="{{banner}}">  
30 - </a>  
31 - </div>  
32 - <div class="new-brands clearfix">  
33 - <span class="iconfont pre">&#xe607;</span>  
34 - <div class="brands-wrap">  
35 - <ul class="brands">  
36 - {{# brands}}  
37 - <li>  
38 - <a href="{{href}}">  
39 - <img src="{{logo}}">  
40 - </a>  
41 - </li>  
42 - {{/ brands}}  
43 - </ul>  
44 - </div>  
45 - <span class="iconfont next">&#xe608;</span>  
46 - </div>  
47 - <div class="new-floor-title">  
48 - <span class="date">{{date}}</span>  
49 - <span class="title">{{title}}</span>  
50 - </div>  
51 - {{/ newMain}}  
52 -  
53 - {{> product/standard-content}}  
54 - </div>  
55 - </div>  
56 - {{/ newSale}}  
57 -</div>  
58 -{{> layout/footer}}  
  1 +{{> product/new-sale}}
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="product-search-page product-page yoho-page center-content"> 2 <div class="product-search-page product-page yoho-page center-content">
3 {{# search}} 3 {{# search}}
4 - {{> layout/path-nav}} 4 + {{> layout/path-nav}}
5 5
6 - {{> product/shop-entry}} 6 + {{> product/shop-entry}}
7 7
8 - {{> product/standard-content}} 8 + {{> product/standard-content}}
9 9
10 - {{> product/latest-walk}} 10 + {{> product/latest-walk}}
11 {{/ search}} 11 {{/ search}}
12 </div> 12 </div>
13 {{> layout/footer}} 13 {{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="product-list-page product-page yoho-page">
  3 + {{# list}}
  4 + {{# brandBanner}}
  5 + <div class="brand-banner">
  6 + <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
  7 + <div class="opt-wrap">
  8 + <p class="opt center-content">
  9 + <a href="{{brandHome}}">
  10 + <i class="iconfont">&#xe617;</i>
  11 + 品牌首页
  12 + </a>
  13 + <a href="{{brandIntro}}">
  14 + <i class="iconfont">&#xe618;</i>
  15 + 品牌介绍
  16 + </a>
  17 + <span id="brand-favor" class="brand-favor">
  18 + <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
  19 + </span>
  20 + </p>
  21 + </div>
  22 + </div>
  23 + {{/ brandBanner}}
  24 +
  25 + <div class="center-content clearfix">
  26 + {{> layout/path-nav}}
  27 +
  28 + {{# brandAbout}}
  29 + <div class="brand-about">
  30 + {{{brandIntro}}}
  31 + </div>
  32 + {{^}}
  33 + <div class="list-left pull-left">
  34 + {{> product/left-content}}
  35 + </div>
  36 + <div class="list-right pull-right">
  37 + {{> product/standard-content}}
  38 +
  39 + {{> product/latest-walk}}
  40 + </div>
  41 + {{/ brandAbout}}
  42 + </div>
  43 + {{/ list}}
  44 +</div>
  45 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="new-sale-page product-page yoho-page">
  3 + {{# newSale}}
  4 + {{# saleBanner}}
  5 + <div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
  6 + {{/ saleBanner}}
  7 +
  8 + <div class="center-content clearfix">
  9 + {{> layout/path-nav}}
  10 +
  11 + {{# saleTitle}}
  12 + <div class="header-title">
  13 + {{name}}
  14 + <p class="line-through"></p>
  15 + <p class="count-wrap">
  16 + <span class="count">共{{count}}个结果</span>
  17 + </p>
  18 + </div>
  19 + {{/ saleTitle}}
  20 +
  21 + <div class="list-left pull-left">
  22 + {{> product/left-content}}
  23 + </div>
  24 +
  25 + <div class="list-right pull-right">
  26 + {{# newMain}}
  27 + <div class="new-banner">
  28 + <a href="{{bannerHref}}">
  29 + <img src="{{banner}}">
  30 + </a>
  31 + </div>
  32 + <div class="new-brands clearfix">
  33 + <span class="iconfont pre">&#xe607;</span>
  34 + <div class="brands-wrap">
  35 + <ul class="brands">
  36 + {{# brands}}
  37 + <li>
  38 + <a href="{{href}}">
  39 + <img src="{{logo}}">
  40 + </a>
  41 + </li>
  42 + {{/ brands}}
  43 + </ul>
  44 + </div>
  45 + <span class="iconfont next">&#xe608;</span>
  46 + </div>
  47 + <div class="new-floor-title">
  48 + <span class="date">{{date}}</span>
  49 + <span class="title">{{title}}</span>
  50 + </div>
  51 + {{/ newMain}}
  52 +
  53 + {{> product/standard-content}}
  54 + </div>
  55 + </div>
  56 + {{/ newSale}}
  57 +</div>
  58 +{{> layout/footer}}
@@ -84,11 +84,11 @@ @@ -84,11 +84,11 @@
84 {{> product/good}} 84 {{> product/good}}
85 {{/each}} 85 {{/each}}
86 {{# hasNextPage}} 86 {{# hasNextPage}}
87 - <div class="block-next-page">  
88 - <a href="{{href}}">  
89 - <img src="{{src}}" alt=""/>  
90 - </a>  
91 - </div> 87 + <div class="block-next-page">
  88 + <a href="{{href}}">
  89 + <img src="{{src}}" alt=""/>
  90 + </a>
  91 + </div>
92 {{/ hasNextPage}} 92 {{/ hasNextPage}}
93 <div class="good-item-wrapper"> 93 <div class="good-item-wrapper">
94 <div class="good-info-main"></div> 94 <div class="good-info-main"></div>
@@ -1483,305 +1483,309 @@ require("js/product/sort-pager"); @@ -1483,305 +1483,309 @@ require("js/product/sort-pager");
1483 require("js/product/product"); 1483 require("js/product/product");
1484 }); 1484 });
1485 define("js/product/filter", ["jquery"], function(require, exports, module){ 1485 define("js/product/filter", ["jquery"], function(require, exports, module){
1486 -/**  
1487 - * 商品筛选逻辑  
1488 - * @author: xuqi<qi.xu@yoho.cn>  
1489 - * @date: 2015/12/4  
1490 - */  
1491 -  
1492 -var $ = require("jquery");  
1493 -  
1494 -var checkUnicode = {  
1495 - unchecked: '&#xe613;',  
1496 - checked: '&#xe612;'  
1497 -},  
1498 -moreUnicode = {  
1499 - up: '&#xe610;',  
1500 - down: '&#xe600;'  
1501 -};  
1502 -  
1503 -//品牌相关变量  
1504 -var $brandDefault = $('.brand .default'),  
1505 - $brandPanel = $('.brand .brand-panel'),  
1506 - $brandAttrs = $('.brand .attr'),  
1507 - $brandMore = $('#brand-more'),  
1508 - $brandMulti = $('#brand-multi');  
1509 -  
1510 -var $brandMoreTxt, $brandMoreIcon;  
1511 -  
1512 -//价格相关变量  
1513 -var $udPrice = $('.ud-price-range'),  
1514 - interReg = /^\d+$/,  
1515 - $limit, $min, $max, $btn;  
1516 -  
1517 -//分类相关变量  
1518 -var $sortSub = $('.sort-sub-wrap');  
1519 -  
1520 -//高级选项相关变量  
1521 -var $seniorSubWrap = $('.senior-sub-wrap'),  
1522 - $seniorAttrWrap = $('.senior-attr-wrap');  
1523 -  
1524 -var seniorHoverTime, hoveredIndex;  
1525 -  
1526 -//清除checkbox选中状态  
1527 -function clearChecked($checkbox) {  
1528 - $checkbox.removeClass('checked').html(checkUnicode.unchecked);  
1529 -}  
1530 -  
1531 -//显示更多品牌面板  
1532 -function brandShowMore() {  
1533 - $brandDefault.addClass('hide');  
1534 - $brandPanel.removeClass('hide');  
1535 -}  
1536 -  
1537 -//隐藏更多品牌面板  
1538 -function brandHideMore() {  
1539 - $brandPanel.addClass('hide');  
1540 - $brandDefault.removeClass('hide');  
1541 -}  
1542 -  
1543 -//url构造&跳转  
1544 -function uriLoc(attr, val) {  
1545 - var href = decodeURIComponent(window.location.search),  
1546 - query = attr + '=' + val,  
1547 - newHref;  
1548 -  
1549 - if (href === '') {  
1550 - newHref = '?' + query;  
1551 - } else {  
1552 - newHref = href + '&' + query;  
1553 - }  
1554 -  
1555 - window.location.href = newHref;  
1556 -}  
1557 -  
1558 -//隐藏高级选项面板  
1559 -function hideSeniorPanel(index) {  
1560 - $seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide');  
1561 - $seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover');  
1562 - hoveredIndex = -1;  
1563 -}  
1564 -  
1565 -//屏蔽筛选项双击文字选中  
1566 -$('.filter-box').on('selectstart', '.attr, .brands-index span', function() {  
1567 - return false;  
1568 -});  
1569 -  
1570 -//【分类】  
1571 -$('.sort-pre').on('click', 'li', function() {  
1572 - var $this = $(this),  
1573 - index = $this.index();  
1574 -  
1575 - $this.siblings('.active').removeClass('active');  
1576 - $this.addClass('active');  
1577 -  
1578 - $sortSub.children(':not(.hide)').addClass('hide');  
1579 - $sortSub.children(':eq(' + index + ')').removeClass('hide');  
1580 -});  
1581 -  
1582 -//【品牌】  
1583 -if ($brandMore.length > 0) {  
1584 - $brandMoreTxt = $brandMore.children('em');  
1585 - $brandMoreIcon = $brandMore.children('.iconfont');  
1586 -}  
1587 -  
1588 -//【品牌】多选  
1589 -$brandMulti.click(function() {  
1590 - if ($brandPanel.css('display') === 'none') {  
1591 -  
1592 - //显示品牌面板  
1593 - brandShowMore();  
1594 - }  
1595 -  
1596 - $brandPanel.addClass('multi'); //显示出checkbox  
1597 - $(this).addClass('hide');  
1598 -});  
1599 -  
1600 -//【品牌】更多  
1601 -$brandMore.click(function() {  
1602 - var $this = $(this);  
1603 -  
1604 - if ($this.hasClass('more')) {  
1605 - brandHideMore();  
1606 -  
1607 - $brandMoreTxt.text('更多');  
1608 - $brandMoreIcon.html(moreUnicode.down);  
1609 - } else {  
1610 - brandShowMore();  
1611 -  
1612 - $brandMoreTxt.text('收起');  
1613 - $brandMoreIcon.html(moreUnicode.up);  
1614 - }  
1615 -  
1616 - $(this).toggleClass('more');  
1617 -});  
1618 -  
1619 -//【品牌】索引  
1620 -$('.brands-index').on('click', 'span', function() {  
1621 - var $this = $(this),  
1622 - index = $this.data('index');  
1623 -  
1624 - if ($this.index() === 0) {  
1625 -  
1626 - //全部  
1627 - $brandAttrs.removeClass('hide');  
1628 - } else {  
1629 - $brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide');  
1630 - }  
1631 -});  
1632 -  
1633 -//【品牌】搜索  
1634 -$('#brand-search-input').keyup(function() {  
1635 - var val = $(this).val().toLowerCase();  
1636 -  
1637 - if (val === '') {  
1638 - $brandAttrs.removeClass('hide');  
1639 - } else {  
1640 - $brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide');  
1641 - }  
1642 -});  
1643 -  
1644 -//【品牌】多选确定  
1645 -$('#brand-multi-ok').click(function() {  
1646 - var val = '';  
1647 -  
1648 - if ($(this).hasClass('dis')) {  
1649 - return;  
1650 - }  
1651 -  
1652 - $brandPanel.find('.checked').each(function() {  
1653 - var id = $(this).data('id');  
1654 -  
1655 - val += (val === '') ? id : (',' + id);  
1656 - });  
1657 -  
1658 - uriLoc('brand', val);  
1659 -});  
1660 -  
1661 -//【品牌/高级选项】多选取消  
1662 -$('.multi-select-cancel').click(function() {  
1663 - var $panel = $(this).closest('.multi');  
1664 -  
1665 - if ($panel.hasClass('brand-panel')) {  
1666 - brandHideMore();  
1667 -  
1668 - $brandMulti.removeClass('hide'); //显示多选按钮  
1669 - }  
1670 -  
1671 - $panel.removeClass('multi');  
1672 - clearChecked($panel.find('.checkbox.checked')); //清除选中状态  
1673 -});  
1674 -  
1675 -//【品牌/高级选项】checkbox  
1676 -$('.check-container').on('click', '.attr', function() {  
1677 - var $this = $(this),  
1678 - $check = $this.find('.checkbox'),  
1679 - $btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');  
1680 -  
1681 - $check.toggleClass('checked');  
1682 -  
1683 - if ($check.hasClass('checked')) {  
1684 - $check.html(checkUnicode.checked);  
1685 - } else {  
1686 - $check.html(checkUnicode.unchecked);  
1687 - }  
1688 -  
1689 - //更新按钮状态  
1690 - if ($check.hasClass('checked') ||  
1691 - $this.siblings('.attr').find('.checked').length > 0) {  
1692 - $btnOk.removeClass('dis');  
1693 - } else {  
1694 - $btnOk.addClass('dis');  
1695 - }  
1696 -});  
1697 -  
1698 -//【品牌/高级选项】当多选时阻止链接默认跳转  
1699 -$('.brand, .senior').on('click', '.attr > a', function(e) {  
1700 - if ($(this).closest('.multi').length > 0) {  
1701 - e.preventDefault();  
1702 - }  
1703 -});  
1704 -  
1705 -//【价格】用户定义价格处理  
1706 -if ($udPrice.length > 0) {  
1707 - $limit = $udPrice.find('.limit');  
1708 - $min = $limit.filter('.min');  
1709 - $max = $limit.filter('.max');  
1710 - $btn = $udPrice.find('.price-sure');  
1711 -  
1712 - //【价格】输入  
1713 - $limit.keyup(function() {  
1714 - var min = $.trim($min.val()),  
1715 - max = $.trim($max.val()),  
1716 - isMinInt = interReg.test(min),  
1717 - isMaxInt = interReg.test(max);  
1718 -  
1719 - if (isMaxInt && (min === '' || isMinInt) ||  
1720 - isMinInt && (max === '' || isMaxInt)  
1721 - ) {  
1722 - $btn.removeClass('hide');  
1723 - } else {  
1724 - $btn.addClass('hide');  
1725 - }  
1726 - });  
1727 -  
1728 - //【价格】多项查询  
1729 - $btn.click(function() {  
1730 - var min = $.trim($min.val()),  
1731 - max = $.trim($max.val()),  
1732 - tmp;  
1733 -  
1734 - //对于min大于max的情况,交换位置  
1735 - if (min !== '' && max !== '' && +min > +max) {  
1736 - tmp = max;  
1737 - max = min;  
1738 - min = tmp;  
1739 - }  
1740 -  
1741 - uriLoc('price', min + ',' + max);  
1742 - });  
1743 -}  
1744 -  
1745 -//【高级选项】鼠标移入显示子项  
1746 -$seniorAttrWrap.on('mouseenter', '.attr', function() {  
1747 - var index = $(this).addClass('hover').index();  
1748 -  
1749 - $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide');  
1750 -}).on('mouseleave', '.attr', function() {  
1751 - var $this = $(this),  
1752 - index = $this.index();  
1753 -  
1754 - hoveredIndex = index;  
1755 -  
1756 - seniorHoverTime = setTimeout(function() {  
1757 - hideSeniorPanel();  
1758 - }, 100);  
1759 -});  
1760 -  
1761 -//【高级选项】多选  
1762 -$('.senior-sub').on('click', '.multi-select', function() {  
1763 - $(this).closest('.senior-sub').addClass('multi');  
1764 -}).on('click', '.multi-select-ok', function() {  
1765 - var $btn = $(this),  
1766 - $sub = $btn.closest('.senior-sub'),  
1767 - val = '';  
1768 -  
1769 - if ($btn.hasClass('dis')) {  
1770 - return;  
1771 - }  
1772 -  
1773 - $sub.find('.checked').each(function() {  
1774 - var id = $(this).data('id');  
1775 -  
1776 - val += (val === '') ? id : (',' + id);  
1777 - });  
1778 -  
1779 - uriLoc($sub.data('attr'), val);  
1780 -}).on('mouseenter', function() {  
1781 - clearTimeout(seniorHoverTime);  
1782 -}).on('mouseleave', function() {  
1783 - hideSeniorPanel(); 1486 +/**
  1487 + * 商品筛选逻辑
  1488 + * @author: xuqi<qi.xu@yoho.cn>
  1489 + * @date: 2015/12/4
  1490 + */
  1491 +
  1492 +var $ = require("jquery");
  1493 +
  1494 +var checkUnicode = {
  1495 + unchecked: '&#xe613;',
  1496 + checked: '&#xe612;'
  1497 +},
  1498 +moreUnicode = {
  1499 + up: '&#xe610;',
  1500 + down: '&#xe600;'
  1501 +};
  1502 +
  1503 +//品牌相关变量
  1504 +var $brandDefault = $('.brand .default'),
  1505 + $brandPanel = $('.brand .brand-panel'),
  1506 + $brandAttrs = $('.brand .attr'),
  1507 + $brandMore = $('#brand-more'),
  1508 + $brandMulti = $('#brand-multi');
  1509 +
  1510 +var $brandMoreTxt, $brandMoreIcon;
  1511 +
  1512 +//价格相关变量
  1513 +var $udPrice = $('.ud-price-range'),
  1514 + interReg = /^\d+$/,
  1515 + $limit, $min, $max, $btn;
  1516 +
  1517 +//分类相关变量
  1518 +var $sortSub = $('.sort-sub-wrap');
  1519 +
  1520 +//高级选项相关变量
  1521 +var $seniorSubWrap = $('.senior-sub-wrap'),
  1522 + $seniorAttrWrap = $('.senior-attr-wrap');
  1523 +
  1524 +var seniorHoverTime, hoveredIndex;
  1525 +
  1526 +//清除checkbox选中状态
  1527 +function clearChecked($checkbox) {
  1528 + $checkbox.removeClass('checked').html(checkUnicode.unchecked);
  1529 +}
  1530 +
  1531 +//显示更多品牌面板
  1532 +function brandShowMore() {
  1533 + $brandDefault.addClass('hide');
  1534 + $brandPanel.removeClass('hide');
  1535 +}
  1536 +
  1537 +//隐藏更多品牌面板
  1538 +function brandHideMore() {
  1539 + $brandPanel.addClass('hide');
  1540 + $brandDefault.removeClass('hide');
  1541 +}
  1542 +
  1543 +//url构造&跳转
  1544 +function uriLoc(attr, val) {
  1545 + var href = decodeURIComponent(window.location.search),
  1546 + query = attr + '=' + val,
  1547 + newHref;
  1548 +
  1549 + if (href === '') {
  1550 + newHref = '?' + query;
  1551 + } else {
  1552 + newHref = href + '&' + query;
  1553 + }
  1554 +
  1555 + window.location.href = newHref;
  1556 +}
  1557 +
  1558 +//隐藏高级选项面板
  1559 +function hideSeniorPanel(index) {
  1560 + $seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide');
  1561 + $seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover');
  1562 + hoveredIndex = -1;
  1563 +}
  1564 +
  1565 +//屏蔽筛选项双击文字选中
  1566 +$('.filter-box').on('selectstart', '.attr, .brands-index span', function() {
  1567 + return false;
  1568 +});
  1569 +
  1570 +//【分类】
  1571 +$('.sort-pre').on('click', 'li', function() {
  1572 + var $this = $(this),
  1573 + index = $this.index();
  1574 +
  1575 + $this.siblings('.active').removeClass('active');
  1576 + $this.addClass('active');
  1577 +
  1578 + $sortSub.children(':not(.hide)').addClass('hide');
  1579 + $sortSub.children(':eq(' + index + ')').removeClass('hide');
  1580 +});
  1581 +
  1582 +//【品牌】
  1583 +if ($brandMore.length > 0) {
  1584 + $brandMoreTxt = $brandMore.children('em');
  1585 + $brandMoreIcon = $brandMore.children('.iconfont');
  1586 +}
  1587 +
  1588 +//【品牌】多选
  1589 +$brandMulti.click(function() {
  1590 + if ($brandPanel.css('display') === 'none') {
  1591 +
  1592 + //显示品牌面板
  1593 + brandShowMore();
  1594 + }
  1595 +
  1596 + $brandPanel.addClass('multi'); //显示出checkbox
  1597 + $(this).addClass('hide');
  1598 +});
  1599 +
  1600 +//【品牌】更多
  1601 +$brandMore.click(function() {
  1602 + var $this = $(this);
  1603 +
  1604 + if ($this.hasClass('more')) {
  1605 + brandHideMore();
  1606 +
  1607 + $brandMoreTxt.text('更多');
  1608 + $brandMoreIcon.html(moreUnicode.down);
  1609 + } else {
  1610 + brandShowMore();
  1611 +
  1612 + $brandMoreTxt.text('收起');
  1613 + $brandMoreIcon.html(moreUnicode.up);
  1614 + }
  1615 +
  1616 + $(this).toggleClass('more');
  1617 +});
  1618 +
  1619 +//【品牌】索引
  1620 +$('.brands-index').on('click', 'span', function() {
  1621 + var $this = $(this),
  1622 + index = $this.data('index');
  1623 +
  1624 + if ($this.index() === 0) {
  1625 +
  1626 + //全部
  1627 + $brandAttrs.removeClass('hide');
  1628 + } else {
  1629 + $brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide');
  1630 + }
1784 }); 1631 });
  1632 +
  1633 +//【品牌】搜索
  1634 +$('#brand-search-input').keyup(function() {
  1635 + var val = $(this).val().toLowerCase();
  1636 +
  1637 + if (val === '') {
  1638 + $brandAttrs.removeClass('hide');
  1639 + } else {
  1640 + $brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide');
  1641 + }
  1642 +});
  1643 +
  1644 +//【品牌】多选确定
  1645 +$('#brand-multi-ok').click(function() {
  1646 + var val = '';
  1647 +
  1648 + if ($(this).hasClass('dis')) {
  1649 + return;
  1650 + }
  1651 +
  1652 + $brandPanel.find('.checked').each(function() {
  1653 + var id = $(this).data('id');
  1654 +
  1655 + val += (val === '') ? id : (',' + id);
  1656 + });
  1657 +
  1658 + uriLoc('brand', val);
  1659 +});
  1660 +
  1661 +//【品牌/高级选项】多选取消
  1662 +$('.multi-select-cancel').click(function() {
  1663 + var $panel = $(this).closest('.multi');
  1664 +
  1665 + if ($panel.hasClass('brand-panel')) {
  1666 + brandHideMore();
  1667 +
  1668 + $brandMulti.removeClass('hide'); //显示多选按钮
  1669 + }
  1670 +
  1671 + $panel.removeClass('multi');
  1672 + clearChecked($panel.find('.checkbox.checked')); //清除选中状态
  1673 +});
  1674 +
  1675 +//【品牌/高级选项】checkbox
  1676 +$('.check-container').on('click', '.attr', function() {
  1677 + var $this = $(this),
  1678 + $check = $this.find('.checkbox'),
  1679 + $btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');
  1680 +
  1681 + $check.toggleClass('checked');
  1682 +
  1683 + if ($check.hasClass('checked')) {
  1684 + $check.html(checkUnicode.checked);
  1685 + } else {
  1686 + $check.html(checkUnicode.unchecked);
  1687 + }
  1688 +
  1689 + //更新按钮状态
  1690 + if ($check.hasClass('checked') ||
  1691 + $this.siblings('.attr').find('.checked').length > 0) {
  1692 + $btnOk.removeClass('dis');
  1693 + } else {
  1694 + $btnOk.addClass('dis');
  1695 + }
  1696 +});
  1697 +
  1698 +//【品牌/高级选项】当多选时阻止链接默认跳转
  1699 +$('.brand, .senior').on('click', '.attr > a', function(e) {
  1700 + if ($(this).closest('.multi').length > 0) {
  1701 + e.preventDefault();
  1702 + }
  1703 +});
  1704 +
  1705 +//【价格】用户定义价格处理
  1706 +if ($udPrice.length > 0) {
  1707 + $limit = $udPrice.find('.limit');
  1708 + $min = $limit.filter('.min');
  1709 + $max = $limit.filter('.max');
  1710 + $btn = $udPrice.find('.price-sure');
  1711 +
  1712 + //【价格】输入
  1713 + $limit.keyup(function() {
  1714 + var min = $.trim($min.val()),
  1715 + max = $.trim($max.val()),
  1716 + isMinInt = interReg.test(min),
  1717 + isMaxInt = interReg.test(max);
  1718 +
  1719 + if (isMaxInt && (min === '' || isMinInt) ||
  1720 + isMinInt && (max === '' || isMaxInt)
  1721 + ) {
  1722 + $btn.removeClass('hide');
  1723 + } else {
  1724 + $btn.addClass('hide');
  1725 + }
  1726 + });
  1727 +
  1728 + //【价格】多项查询
  1729 + $btn.click(function() {
  1730 + var min = $.trim($min.val()),
  1731 + max = $.trim($max.val()),
  1732 + tmp;
  1733 +
  1734 + //对于min大于max的情况,交换位置
  1735 + if (min !== '' && max !== '' && +min > +max) {
  1736 + tmp = max;
  1737 + max = min;
  1738 + min = tmp;
  1739 + }
  1740 +
  1741 + uriLoc('price', min + ',' + max);
  1742 + });
  1743 +}
  1744 +
  1745 +//【高级选项】鼠标移入显示子项
  1746 +$seniorAttrWrap.on('mouseenter', '.attr', function() {
  1747 + var $this = $(this);
  1748 + var index = $this.index();
  1749 +
  1750 + $this.addClass('hover').siblings().removeClass('hover');
  1751 +
  1752 + $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide');
  1753 +}).on('mouseleave', '.attr', function() {
  1754 + var $this = $(this),
  1755 + index = $this.index();
  1756 +
  1757 + hoveredIndex = index;
  1758 +
  1759 + seniorHoverTime = setTimeout(function() {
  1760 + hideSeniorPanel();
  1761 + }, 100);
  1762 +});
  1763 +
  1764 +//【高级选项】多选
  1765 +$('.senior-sub').on('click', '.multi-select', function() {
  1766 + $(this).closest('.senior-sub').addClass('multi');
  1767 +}).on('click', '.multi-select-ok', function() {
  1768 + var $btn = $(this),
  1769 + $sub = $btn.closest('.senior-sub'),
  1770 + val = '';
  1771 +
  1772 + if ($btn.hasClass('dis')) {
  1773 + return;
  1774 + }
  1775 +
  1776 + $sub.find('.checked').each(function() {
  1777 + var id = $(this).data('id');
  1778 +
  1779 + val += (val === '') ? id : (',' + id);
  1780 + });
  1781 +
  1782 + uriLoc($sub.data('attr'), val);
  1783 +}).on('mouseenter', function() {
  1784 + clearTimeout(seniorHoverTime);
  1785 +}).on('mouseleave', function() {
  1786 + hideSeniorPanel();
  1787 +});
  1788 +
1785 }); 1789 });
1786 define("js/product/sort-pager", ["jquery"], function(require, exports, module){ 1790 define("js/product/sort-pager", ["jquery"], function(require, exports, module){
1787 /** 1791 /**
@@ -3962,7 +3966,7 @@ function picCaptchaAjaxFn(page, callback) { @@ -3962,7 +3966,7 @@ function picCaptchaAjaxFn(page, callback) {
3962 type: 'POST', 3966 type: 'POST',
3963 url: url, 3967 url: url,
3964 data: { 3968 data: {
3965 - code: $ca.val() 3969 + verifyCode: $ca.val()
3966 3970
3967 //mobile: $pn.val(), 3971 //mobile: $pn.val(),
3968 //area: $region.text().split('+')[1] 3972 //area: $region.text().split('+')[1]
@@ -3995,7 +3999,7 @@ function msgCaptchaAjaxFn(page, callback) { @@ -3995,7 +3999,7 @@ function msgCaptchaAjaxFn(page, callback) {
3995 type: 'POST', 3999 type: 'POST',
3996 url: url, 4000 url: url,
3997 data: { 4001 data: {
3998 - code: $ca.val(), 4002 + verifyCode: $ca.val(),
3999 mobile: $pn.val(), 4003 mobile: $pn.val(),
4000 area: $region.text().split('+')[1] 4004 area: $region.text().split('+')[1]
4001 } 4005 }
@@ -4291,7 +4295,7 @@ exports.init = function(page) { @@ -4291,7 +4295,7 @@ exports.init = function(page) {
4291 4295
4292 $regionSelect.change(function() { 4296 $regionSelect.change(function() {
4293 4297
4294 - $region.text('+' + $('#region').val()); 4298 + $region.text($('#region').val());
4295 4299
4296 validateRule(page, $pn, showErrTip); //验证 4300 validateRule(page, $pn, showErrTip); //验证
4297 }); 4301 });
@@ -4319,7 +4323,7 @@ exports.init = function(page) { @@ -4319,7 +4323,7 @@ exports.init = function(page) {
4319 data: { 4323 data: {
4320 area: $region.text().split('+')[1], 4324 area: $region.text().split('+')[1],
4321 mobile: $pn.val(), 4325 mobile: $pn.val(),
4322 - code: $ca.val() 4326 + verifyCode: $ca.val()
4323 } 4327 }
4324 }).then(function(data) { 4328 }).then(function(data) {
4325 if (data.code === 200) { 4329 if (data.code === 200) {
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -218,10 +218,11 @@ @@ -218,10 +218,11 @@
218 .price-sure { 218 .price-sure {
219 height: 24px; 219 height: 24px;
220 width: 44px; 220 width: 44px;
221 - border: 1px solid #e0e0e0;  
222 - background: #fff;  
223 - color: #666; 221 + background: #333;
  222 + color: #fff;
224 margin-left: 10px; 223 margin-left: 10px;
  224 + outline: none;
  225 + border: none;
225 } 226 }
226 227
227 .color-block { 228 .color-block {
@@ -265,7 +266,7 @@ @@ -265,7 +266,7 @@
265 top: 39px; 266 top: 39px;
266 background: #fff; 267 background: #fff;
267 border: 1px solid #eaeceb; 268 border: 1px solid #eaeceb;
268 - z-index: 1; 269 + z-index: 2;
269 270
270 ul { 271 ul {
271 max-width: 950px; 272 max-width: 950px;
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 color: #222; 43 color: #222;
44 cursor: pointer; 44 cursor: pointer;
45 margin-right: 10px; 45 margin-right: 10px;
  46 + background: #fff;
46 } 47 }
47 48
48 .iconfont { 49 .iconfont {
@@ -54,14 +55,21 @@ @@ -54,14 +55,21 @@
54 > ul { 55 > ul {
55 position: absolute; 56 position: absolute;
56 display: none; 57 display: none;
57 - width: 42px;  
58 - padding: 0 3px; 58 + width: 48px;
59 border-left: 1px solid #ccc; 59 border-left: 1px solid #ccc;
60 border-right: 1px solid #ccc; 60 border-right: 1px solid #ccc;
  61 + background: #fff;
  62 + z-index: 1;
61 } 63 }
62 64
63 li { 65 li {
  66 + padding: 0 3px;
64 border-bottom: 1px solid #ccc; 67 border-bottom: 1px solid #ccc;
  68 +
  69 + &:hover {
  70 + background: #376cf7;
  71 + color: #fff;
  72 + }
65 } 73 }
66 74
67 a { 75 a {
@@ -84,4 +92,4 @@ @@ -84,4 +92,4 @@
84 color: #f00; 92 color: #f00;
85 } 93 }
86 } 94 }
87 -}  
  95 +}
@@ -997,6 +997,7 @@ class HomeController extends AbstractAction @@ -997,6 +997,7 @@ class HomeController extends AbstractAction
997 $this->_view->display('currency-detail', array( 997 $this->_view->display('currency-detail', array(
998 'money' => $data['money'], 998 'money' => $data['money'],
999 'pageFooter' => true, 999 'pageFooter' => true,
  1000 + 'currencyPage' => true,
1000 'currencyDetail' => true, 1001 'currencyDetail' => true,
1001 'currencyDetailPage' => true 1002 'currencyDetailPage' => true
1002 )); 1003 ));
1 <?php 1 <?php
2 namespace Product; 2 namespace Product;
3 3
  4 +use Api\Yohobuy;
  5 +use Plugin\Helpers;
4 use Plugin\HelperSearch; 6 use Plugin\HelperSearch;
5 use \LibModels\Web\Product\SearchData; 7 use \LibModels\Web\Product\SearchData;
6 8
@@ -17,40 +19,141 @@ class SearchModel @@ -17,40 +19,141 @@ class SearchModel
17 { 19 {
18 20
19 /** 21 /**
20 - * 根据条件获取搜索数据  
21 - *  
22 - * @param $condition 搜索数据的条件  
23 - * @param $options Array([imgSize]  
24 - * => Array([0] => 235[1] => 314)[minImgSize] => Array([0] => 60[1] => 80)[gender] => 1[needPd] => Y[rowNum] => 5[viewNum] => 60)  
25 - * @author sefon 2015-12-17 16:12:18  
26 - * @return array 22 + * 搜索相关页面公共条件处理
  23 + * @param $param
  24 + * @param $option
  25 + * @return mixed
27 */ 26 */
28 - public static function getSearchData($condition, $options) 27 + public static function SearchCondition($param, $option)
29 { 28 {
30 - $data = array();  
31 - // 调用接口查询商品数据  
32 - $result = SearchData::searchElasticByCondition($condition);  
33 - if (isset($result['code']) && $result['code'] === 200) {  
34 - // 调用分类信息  
35 - $category = SearchData::getClassesData($condition);  
36 - if (isset($category['code']) && $category['code'] === 200) {  
37 - $result['data']['filter']['group_sort'] = $category['data']['sort']; 29 + /* 过滤请求参数 */
  30 + $condition = filter_input_array(INPUT_GET, array(
  31 + 'query' => FILTER_SANITIZE_STRING,
  32 + 'brand' => FILTER_VALIDATE_INT,
  33 + 'sort' => FILTER_VALIDATE_INT,
  34 + 'msort' => FILTER_VALIDATE_INT,
  35 + 'misort' => FILTER_VALIDATE_INT,
  36 + 'color' => FILTER_VALIDATE_INT,
  37 + 'size' => FILTER_DEFAULT,
  38 + 'style' => FILTER_DEFAULT,
  39 + 'price' => FILTER_DEFAULT,
  40 + 'gender' => FILTER_SANITIZE_STRING,
  41 + 'p_d' => FILTER_DEFAULT,
  42 + 'shelve_time' => FILTER_DEFAULT,
  43 + 'isNew' => FILTER_DEFAULT,
  44 + 'specialoffer' => FILTER_DEFAULT,
  45 + 'limited' => FILTER_DEFAULT,
  46 + 'order' => FILTER_DEFAULT,
  47 + 'viewNum' => FILTER_VALIDATE_INT,
  48 + 'rowNum' => FILTER_VALIDATE_INT,
  49 + 'page' => FILTER_VALIDATE_INT), false);
  50 + //关键字
  51 + if (isset($condition['query']) && !empty($condition['query'])) {
  52 + $condition['query'] = rawurldecode($condition['query']);
  53 + }
  54 + //性别
  55 + if (isset($condition['gender']) && !empty($condition['gender'])) {
  56 + $condition['gender'] = rawurldecode($condition['gender']);
  57 + }
  58 + else {
  59 + $condition['gender'] = Helpers::getGenderByCookie();
  60 + }
  61 + //每页显示商品数
  62 + $viewNumArray = array(60, 100, 200);
  63 + if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
  64 + $condition['viewNum'] =60;
  65 + }
  66 + if (!in_array($condition['viewNum'], $viewNumArray)) {
  67 + $condition['viewNum'] = 60;
  68 + }
  69 + //每行显示的商品数量
  70 + if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
  71 + $condition['rowNum'] =5;
  72 + }
  73 + if ($condition['rowNum'] == 6) {
  74 + $imgSize = array(195, 260);
  75 + $minImgSize = array(50, 67);
  76 + }
  77 + else {
  78 + $condition['rowNum'] = 5;
  79 + $imgSize = array(235, 314);
  80 + $minImgSize = array(60, 80);
  81 + }
  82 + //自定义搜索价格
  83 + if (isset($condition['price']) && !empty($condition['price'])) {
  84 + $price = explode(',', $condition['price']);
  85 + if (!$price[0]) {
  86 + $price[0] = 0;
38 } 87 }
39 - // 调用折扣区间  
40 - $discount = SearchData::getDiscount();  
41 - if (isset($discount['code']) && $discount['code'] === 200) {  
42 - $result['data']['filter']['discount'] = $discount['data']['discount']; 88 + if (!$price[1]) {
  89 + $price[1] = 99999;
43 } 90 }
44 - // 调用最新上架  
45 - $recent = SearchData::recentShelve();  
46 - if (isset($discount['code']) && $discount['code'] === 200) {  
47 - $result['data']['filter']['recent'] = $recent['data']['recent']; 91 + $condition['price'] = implode(',', $price);
  92 + }
  93 + //返回搜索条件
  94 + $condition['needFilter'] = 1;
  95 + //过滤赠品
  96 + $condition['attribute_not'] = 2;
  97 + //默认排序
  98 + if (!isset($condition['order']) || empty($condition['order'])) {
  99 + $condition['order'] = 's_n_desc';
  100 + }
  101 + if (!isset($condition['p_d']) || empty($condition['p_d'])) {
  102 + $condition['p_d'] = '0,0.9';
  103 + }
  104 + $options = array(
  105 + 'imgSize' => $imgSize,
  106 + 'minImgSize' => $minImgSize,
  107 + 'rowNum' =>$condition['rowNum'],
  108 + 'viewNum' =>$condition['viewNum'],
  109 + );
  110 + //接收高级选项
  111 + foreach ($_GET as $key =>$val) {
  112 + if (strpos('parameter_',$key) !== false) {
  113 + $condition[$key] = (int) $val;
48 } 114 }
49 - //用户浏览记录  
50 - $result['data']['filter']['review'] = SearchData::getRecentReview();  
51 - // 组织模板数据  
52 - $data = HelperSearch::getList($result, $options);  
53 } 115 }
  116 + //每页记录数减1,下一页占位
  117 + $condition['viewNum'] = $condition['viewNum'] - 1;
  118 + $condition = array_merge($condition, $param);
  119 + $options = array_merge($options, $option);
  120 + $data['condition'] = $condition;
  121 + $data['options'] = $options;
  122 + return $data;
  123 + }
  124 +
  125 + /**
  126 + * 根据条件获取搜索数据
  127 + * @param array $customCondition
  128 + * @param array $customOptions
  129 + * @return array
  130 + */
  131 + public static function getSearchData($customCondition = array(), $customOptions = array())
  132 + {
  133 + $data = array();
  134 + $searchCondition = self::searchCondition($customCondition, $customOptions);
  135 + // 调用接口查询商品数据
  136 + $urlList['productUrl'] = HelperSearch::getProductUrl($searchCondition['condition']);
  137 + // 调用分类信息
  138 + $urlList['sortUrl'] = HelperSearch::getSortUrl($searchCondition['condition']);
  139 +// $result['data']['filter']['group_sort'] = $category['data']['sort'];
  140 +
  141 + // 调用折扣区间
  142 + $urlList['discountUrl'] = HelperSearch::getDiscountUrl($searchCondition['condition']);
  143 +// $result['data']['filter']['discount'] = $discount['data']['discount'];
  144 + // 调用最新上架
  145 + $urlList['recentUrl'] = HelperSearch::getRecentUrl($searchCondition['condition']);
  146 +// $result['data']['filter']['recent'] = $recent['data']['recent'];
  147 +
  148 + //用户浏览记录
  149 + //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
  150 +
  151 + $result = Yohobuy::getMulti($urlList, array(), true);
  152 +
  153 +
  154 +
  155 + // 组织模板数据
  156 + $data = HelperSearch::getList($result, $searchCondition['options']);
54 return $data; 157 return $data;
55 } 158 }
56 159
@@ -60,7 +163,8 @@ class SearchModel @@ -60,7 +163,8 @@ class SearchModel
60 * @param $options 163 * @param $options
61 * @return array 164 * @return array
62 */ 165 */
63 - public static function searchData($condition, $options){ 166 + public static function searchData($condition, $options)
  167 + {
64 $data = self::getSearchData($condition, $options); 168 $data = self::getSearchData($condition, $options);
65 //获取品牌店铺信息 169 //获取品牌店铺信息
66 if (isset($condition['query'])) { 170 if (isset($condition['query'])) {
@@ -22,6 +22,7 @@ class BackController extends WebAction @@ -22,6 +22,7 @@ class BackController extends WebAction
22 'coverImg' => $banner['img'], 22 'coverImg' => $banner['img'],
23 'countryCode' => '86', 23 'countryCode' => '86',
24 'countryName' => '中国', 24 'countryName' => '中国',
  25 + 'captchaUrl'=>'/passport/images?t=1449799445',
25 'countryList' => RegData::getAreasData(), 26 'countryList' => RegData::getAreasData(),
26 ) 27 )
27 ); 28 );
@@ -40,7 +41,7 @@ class BackController extends WebAction @@ -40,7 +41,7 @@ class BackController extends WebAction
40 { 41 {
41 $phoneNum = $this->post('phoneNum',''); 42 $phoneNum = $this->post('phoneNum','');
42 $area = $this->post('area','86'); 43 $area = $this->post('area','86');
43 - $captcha = $this->post('captcha',''); 44 + $verifyCode = $this->post('verifyCode','');
44 if(Helpers::verifyEmail($phoneNum)){ //验证邮箱 45 if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
45 $email = $phoneNum; 46 $email = $phoneNum;
46 $data = BackData::sendCodeToEmail($email); 47 $data = BackData::sendCodeToEmail($email);
@@ -56,7 +57,7 @@ class BackController extends WebAction @@ -56,7 +57,7 @@ class BackController extends WebAction
56 $data = BackData::sendCodeToMobile($mobile); 57 $data = BackData::sendCodeToMobile($mobile);
57 $this->setSession('phoneNum', $phoneNum); 58 $this->setSession('phoneNum', $phoneNum);
58 $this->setSession('area', $area); 59 $this->setSession('area', $area);
59 - $this->setSession('captcha', $captcha); 60 + $this->setSession('verifyCode', $verifyCode);
60 if($data['code'] == 200) { 61 if($data['code'] == 200) {
61 $this->redirect('verification'); 62 $this->redirect('verification');
62 } 63 }
@@ -75,23 +76,6 @@ class BackController extends WebAction @@ -75,23 +76,6 @@ class BackController extends WebAction
75 $this->redirect('index'); 76 $this->redirect('index');
76 } 77 }
77 $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE); 78 $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
78 - $simpleHeader = array(  
79 - 'logo' => array(  
80 - 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',  
81 - 'url' => 'http://www.yohobuy.com'  
82 - ),  
83 - 'tool' => array(  
84 - 'user' => '2586703@qq.com',  
85 - 'userCenter' => '',  
86 - 'loginHref' => '',  
87 - 'logoutHref' => '',  
88 - 'registerHref' => '',  
89 - 'favoriteHref' => '',  
90 - 'couponHref' => '',  
91 - 'orderHref' => '',  
92 - 'helpHref' => ''  
93 - )  
94 - );  
95 $data = array( 79 $data = array(
96 'simpleHeader' => PassportModel::getSimpleHeader(false), 80 'simpleHeader' => PassportModel::getSimpleHeader(false),
97 'sendEmail' => array( 81 'sendEmail' => array(
@@ -176,7 +160,7 @@ class BackController extends WebAction @@ -176,7 +160,7 @@ class BackController extends WebAction
176 public function verificationAction() { 160 public function verificationAction() {
177 $phoneNum = $this->getSession('phoneNum'); 161 $phoneNum = $this->getSession('phoneNum');
178 $area = $this->getSession('area'); 162 $area = $this->getSession('area');
179 - $captcha = $this->getSession('captcha'); 163 + $verifyCode = $this->getSession('verifyCode');
180 if(empty($phoneNum)) { 164 if(empty($phoneNum)) {
181 $this->redirect('index'); 165 $this->redirect('index');
182 } 166 }
@@ -27,7 +27,7 @@ class RegisterController extends WebAction @@ -27,7 +27,7 @@ class RegisterController extends WebAction
27 'loginUrl' => '/signin.html?refer='.$refer, 27 'loginUrl' => '/signin.html?refer='.$refer,
28 'coverHref' => $cover['url'], 28 'coverHref' => $cover['url'],
29 'coverImg' => $cover['img'], 29 'coverImg' => $cover['img'],
30 - 'regBtnText' => '快速登录' 30 + 'regBtnText' => '立即注册'
31 ) 31 )
32 ); 32 );
33 $this->setCookie('refer', $refer); 33 $this->setCookie('refer', $refer);
@@ -5,93 +5,9 @@ class SearchController extends WebAction @@ -5,93 +5,9 @@ class SearchController extends WebAction
5 { 5 {
6 public function indexAction() 6 public function indexAction()
7 { 7 {
8 - /* 过滤请求参数 */  
9 - $condition = filter_input_array(INPUT_GET, array(  
10 - 'query' => FILTER_SANITIZE_STRING,  
11 - 'brand' => FILTER_VALIDATE_INT,  
12 - 'sort' => FILTER_VALIDATE_INT,  
13 - 'msort' => FILTER_VALIDATE_INT,  
14 - 'misort' => FILTER_VALIDATE_INT,  
15 - 'color' => FILTER_VALIDATE_INT,  
16 - 'size' => FILTER_DEFAULT,  
17 - 'style' => FILTER_DEFAULT,  
18 - 'price' => FILTER_DEFAULT,  
19 - 'gender' => FILTER_DEFAULT,  
20 - 'p_d' => FILTER_DEFAULT,  
21 - 'shelve_time' => FILTER_DEFAULT,  
22 - 'isNew' => FILTER_DEFAULT,  
23 - 'specialoffer' => FILTER_DEFAULT,  
24 - 'limited' => FILTER_DEFAULT,  
25 - 'order' => FILTER_DEFAULT,  
26 - 'viewNum' => FILTER_VALIDATE_INT,  
27 - 'rowNum' => FILTER_VALIDATE_INT,  
28 - 'page' => FILTER_VALIDATE_INT), false);  
29 - //字符转码  
30 - foreach($condition as $key => $val){  
31 - $condition[$key] = rawurldecode($val);  
32 - }  
33 - //性別(频道)  
34 - $gender_cookie = !isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1);  
35 - $gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : $gender_cookie ;  
36 - $condition['gender'] = $gender;  
37 - //每页显示商品数  
38 - if(!isset($condition['viewNum']) || empty($condition['viewNum'])){  
39 - $condition['viewNum'] =60;  
40 - }  
41 - $view_num_arr = array(60, 100, 200);  
42 - if (!in_array($condition['viewNum'], $view_num_arr)) {  
43 - $condition['viewNum'] = 60;  
44 - }  
45 - //每行显示的商品数量  
46 - if(!isset($condition['rowNum']) || empty($condition['rowNum'])){  
47 - $condition['rowNum'] =5;  
48 - }  
49 - if ($condition['rowNum'] == 6) {  
50 - $imgSize = array(195, 260);  
51 - $minImgSize = array(50, 67);  
52 - } else {  
53 - $condition['rowNum'] = 5;  
54 - $imgSize = array(235, 314);  
55 - $minImgSize = array(60, 80);  
56 - }  
57 - //自定义搜索价格  
58 - if (isset($condition['price']) && !empty($condition['price'])) {  
59 - $price = explode(',', $condition['price']);  
60 - if (!$price[0]) {  
61 - $price[0] = 0;  
62 - }  
63 - if (!$price[1]) {  
64 - $price[1] = 99999;  
65 - }  
66 - $condition['price'] = implode(',', $price);  
67 - }  
68 -  
69 - //返回搜索条件  
70 - $condition['needFilter'] = 1;  
71 - //过滤赠品  
72 - $condition['attribute_not'] = 2;  
73 - /*sale*/  
74 - //默认排序  
75 - if (!isset($condition['order']) || empty($condition['order'])) {  
76 - $condition['order'] = 's_n_desc';  
77 - }  
78 - if (!isset($condition['p_d']) || empty($condition['p_d'])) {  
79 - $condition['p_d'] = '0,0.9';  
80 - }  
81 - $options = array(  
82 - 'imgSize' => $imgSize,  
83 - 'minImgSize' => $minImgSize,  
84 - 'rowNum' =>$condition['rowNum'],  
85 - 'viewNum' =>$condition['viewNum'],  
86 - );  
87 - $params = $condition + $_GET;  
88 - $params = array_filter($params);  
89 - //每页记录数减1,下一页占位  
90 - $params['viewNum'] = $params['viewNum'] - 1;  
91 $options['controller'] = $this->_request->controller; 8 $options['controller'] = $this->_request->controller;
92 - $searchData = SearchModel::searchData($params,$options);  
93 - $cate = array('boys','girls','kids','lifestyle');  
94 - $this->setWebNavHeader($cate[$gender-1]); 9 + $searchData = SearchModel::searchData('',$options);
  10 + $this->setWebNavHeader();
95 $data = array( 11 $data = array(
96 //初始化js 12 //初始化js
97 'searchListPage' => true, 13 'searchListPage' => true,