Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
31 changed files
with
835 additions
and
275 deletions
@@ -34,7 +34,7 @@ class BrandData | @@ -34,7 +34,7 @@ class BrandData | ||
34 | // 构建必传参数 | 34 | // 构建必传参数 |
35 | $param = Yohobuy::param(); | 35 | $param = Yohobuy::param(); |
36 | $param['brand_id'] = $brandId; | 36 | $param['brand_id'] = $brandId; |
37 | - $param['uid'] = '10267443'; | 37 | + $param['uid'] = $uid; |
38 | $param['method'] = 'app.brand.getBrandIntro'; | 38 | $param['method'] = 'app.brand.getBrandIntro'; |
39 | $param['client_secret'] = Sign::getSign($param); | 39 | $param['client_secret'] = Sign::getSign($param); |
40 | 40 |
library/LibModels/Web/Product/SaleData.php
0 → 100644
1 | +<?php | ||
2 | +namespace LibModels\Web\Product; | ||
3 | + | ||
4 | +use Api\Yohobuy; | ||
5 | + | ||
6 | +/** | ||
7 | + * sale操作类 | ||
8 | + * @name SaleData | ||
9 | + * @package | ||
10 | + * @copyright yoho.inc | ||
11 | + * @version 1.0 (2016-01-07) | ||
12 | + * @author | ||
13 | + */ | ||
14 | +class SaleData | ||
15 | +{ | ||
16 | + const URL_SALE_SPECIAL = '/operating/service/v1/special'; | ||
17 | + | ||
18 | + /** | ||
19 | + * 获取专区信息 | ||
20 | + * @param $specialId 专区ID | ||
21 | + */ | ||
22 | + public static function getSpecial($specialsaleId) { | ||
23 | + | ||
24 | + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_SALE_SPECIAL, 'getOneSpecial', array($specialsaleId)); | ||
25 | + } | ||
26 | + | ||
27 | +} |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | namespace Plugin; | 3 | namespace Plugin; |
4 | use Plugin\Paging; | 4 | use Plugin\Paging; |
5 | +use LibModels\Web\Product\BrandData; | ||
5 | /** | 6 | /** |
6 | * 搜索辅助类 | 7 | * 搜索辅助类 |
7 | */ | 8 | */ |
@@ -12,6 +13,8 @@ class HelperSearch | @@ -12,6 +13,8 @@ class HelperSearch | ||
12 | */ | 13 | */ |
13 | public static $params = array(); | 14 | public static $params = array(); |
14 | 15 | ||
16 | + private static $from = ''; | ||
17 | + | ||
15 | //当前页 | 18 | //当前页 |
16 | public static $page = 1; | 19 | public static $page = 1; |
17 | 20 | ||
@@ -27,6 +30,12 @@ class HelperSearch | @@ -27,6 +30,12 @@ class HelperSearch | ||
27 | public static $listnav = array(); | 30 | public static $listnav = array(); |
28 | 31 | ||
29 | 32 | ||
33 | + private static function setFrom($from = '') | ||
34 | + { | ||
35 | + if ($from) { | ||
36 | + self::$from = $from; | ||
37 | + } | ||
38 | + } | ||
30 | //设置导航 | 39 | //设置导航 |
31 | private static function setListNav($option = array()) | 40 | private static function setListNav($option = array()) |
32 | { | 41 | { |
@@ -77,6 +86,7 @@ class HelperSearch | @@ -77,6 +86,7 @@ class HelperSearch | ||
77 | $result['filters']['brand'] = self::brand($filter, $options); | 86 | $result['filters']['brand'] = self::brand($filter, $options); |
78 | //价格 | 87 | //价格 |
79 | $result['filters']['price'] = self::price($filter); | 88 | $result['filters']['price'] = self::price($filter); |
89 | + $result['filters']['customPrice'] = self::customPrice($filter); | ||
80 | //颜色 | 90 | //颜色 |
81 | $result['filters']['color'] = self::color($filter); | 91 | $result['filters']['color'] = self::color($filter); |
82 | //尺寸 | 92 | //尺寸 |
@@ -152,7 +162,9 @@ class HelperSearch | @@ -152,7 +162,9 @@ class HelperSearch | ||
152 | 'salePrice' => $val['sales_price'], | 162 | 'salePrice' => $val['sales_price'], |
153 | 'marketPrice' => $val['market_price'], | 163 | 'marketPrice' => $val['market_price'], |
154 | 'isFew' => $isFew, | 164 | 'isFew' => $isFew, |
155 | - 'skn' => $val['product_skn'] | 165 | + 'skn' => $val['product_skn'], |
166 | + 'showColBtn' => true, | ||
167 | + 'coled' => true | ||
156 | ); | 168 | ); |
157 | } | 169 | } |
158 | return $goods; | 170 | return $goods; |
@@ -452,6 +464,15 @@ class HelperSearch | @@ -452,6 +464,15 @@ class HelperSearch | ||
452 | 'name' => $filter['price'][$priceId], | 464 | 'name' => $filter['price'][$priceId], |
453 | 'href' => self::buildUrl($params) | 465 | 'href' => self::buildUrl($params) |
454 | ); | 466 | ); |
467 | + }else{ | ||
468 | + $price = explode(',', $priceId); | ||
469 | + if (count($price) == 2) { | ||
470 | + | ||
471 | + self::$selected['price'] = array( | ||
472 | + 'name' => self::$params['price'] == '2000,99999' ? '¥2000以上' : '¥' . (int)$price[0] . '-' . (int)$price[1], | ||
473 | + 'href' => self::buildurl($params) | ||
474 | + ); | ||
475 | + } | ||
455 | } | 476 | } |
456 | //返回价格条件 | 477 | //返回价格条件 |
457 | foreach ($filter['price'] as $key => $val) { | 478 | foreach ($filter['price'] as $key => $val) { |
@@ -467,6 +488,27 @@ class HelperSearch | @@ -467,6 +488,27 @@ class HelperSearch | ||
467 | } | 488 | } |
468 | 489 | ||
469 | /** | 490 | /** |
491 | + * 获取自定义价格要提交的地址 | ||
492 | + */ | ||
493 | + public static function customPrice($filter) { | ||
494 | + $params = self::$params; | ||
495 | + $result = array( | ||
496 | + 'min' => '', | ||
497 | + 'max' => '' | ||
498 | + ); | ||
499 | + $priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : ''; | ||
500 | + if (isset($params['price']) && !isset($filter['price'][$priceId]) ) { | ||
501 | + $price = explode(',', $params['price']); | ||
502 | + unset($params['price']); | ||
503 | + $result = array( | ||
504 | + 'min' => $price[0], | ||
505 | + 'max' => $price[1] | ||
506 | + ); | ||
507 | + } | ||
508 | + return $result; | ||
509 | + } | ||
510 | + | ||
511 | + /** | ||
470 | * 风格,可以多选 | 512 | * 风格,可以多选 |
471 | * @param array $filter | 513 | * @param array $filter |
472 | * @return array | 514 | * @return array |
@@ -905,4 +947,25 @@ class HelperSearch | @@ -905,4 +947,25 @@ class HelperSearch | ||
905 | $Paging = new Paging('Yoho'); | 947 | $Paging = new Paging('Yoho'); |
906 | return $Paging->setTotal($total)->setSize($viewNum)->view(0); | 948 | return $Paging->setTotal($total)->setSize($viewNum)->view(0); |
907 | } | 949 | } |
950 | + | ||
951 | + //组织静态资源数据格式 | ||
952 | + public static function formatNodeContent($code){ | ||
953 | + $nodeContent = BrandData::getByNodeContent($code); | ||
954 | + if (isset($nodeContent['code']) && $nodeContent['code'] === 200) { | ||
955 | + $result = array(); | ||
956 | + | ||
957 | + $string = $nodeContent['data']; | ||
958 | + $hrefPatten="/<a href=[\'\"]?([^\'\" ]+).*?>/"; | ||
959 | + preg_match_all($hrefPatten, $string, $href); | ||
960 | + | ||
961 | + $pattern = "/[img|IMG].*?src=['|\"](.*?(?:[.gif|.jpg]))['|\"].*?[\/]?>/"; | ||
962 | + preg_match_all($pattern,$string,$img); | ||
963 | + | ||
964 | + foreach($href[1] as $key=>$vo){ | ||
965 | + $result[$key]['href'] = $vo; | ||
966 | + $result[$key]['src'] = $img[1][$key]; | ||
967 | + } | ||
968 | + return $result; | ||
969 | + } | ||
970 | + } | ||
908 | } | 971 | } |
@@ -4,11 +4,7 @@ | @@ -4,11 +4,7 @@ | ||
4 | <div class="infos"> | 4 | <div class="infos"> |
5 | <div class="basic-info" > | 5 | <div class="basic-info" > |
6 | {{#thumbs}} | 6 | {{#thumbs}} |
7 | - {{#if @first}} | ||
8 | - <img class="thumb" src={{img}}> | ||
9 | - {{else}} | ||
10 | - <img class="thumb hide" src={{img}}> | ||
11 | - {{/if}} | 7 | + <img class="thumb {{#unless @first}}hide{{/if}}" src={{img}}> |
12 | {{/thumbs}} | 8 | {{/thumbs}} |
13 | <div class="text-info"> | 9 | <div class="text-info"> |
14 | <p class="name">{{name}}</p> | 10 | <p class="name">{{name}}</p> |
@@ -34,7 +30,7 @@ | @@ -34,7 +30,7 @@ | ||
34 | <div class="size-list block-list"> | 30 | <div class="size-list block-list"> |
35 | <span>尺码</span> | 31 | <span>尺码</span> |
36 | {{# sizes}} | 32 | {{# sizes}} |
37 | - <ul class="size-row clearfix hide"> | 33 | + <ul class="size-row clearfix {{#unless @first}}hide{{/if}}"> |
38 | {{# size}} | 34 | {{# size}} |
39 | <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}"> | 35 | <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}"> |
40 | {{name}} | 36 | {{name}} |
@@ -43,13 +39,13 @@ | @@ -43,13 +39,13 @@ | ||
43 | </ul> | 39 | </ul> |
44 | {{/ sizes}} | 40 | {{/ sizes}} |
45 | 41 | ||
46 | - {{#if defaultSizes}} | 42 | + <!--{{#if defaultSizes}} |
47 | <ul class="size-row clearfix default-size"> | 43 | <ul class="size-row clearfix default-size"> |
48 | {{#each defaultSizes}} | 44 | {{#each defaultSizes}} |
49 | <li class="block {{#if numZero}}zero-stock{{/if}}" data-numstr="{{numStr}}">{{name}}</li> | 45 | <li class="block {{#if numZero}}zero-stock{{/if}}" data-numstr="{{numStr}}">{{name}}</li> |
50 | {{/each}} | 46 | {{/each}} |
51 | </ul> | 47 | </ul> |
52 | - {{/if}} | 48 | + {{/if}}--> |
53 | </div> | 49 | </div> |
54 | <p> | 50 | <p> |
55 | <div class="num"> | 51 | <div class="num"> |
@@ -8,8 +8,8 @@ | @@ -8,8 +8,8 @@ | ||
8 | <li class="head-title">验证身份</li> | 8 | <li class="head-title">验证身份</li> |
9 | <li class="po-re"> | 9 | <li class="po-re"> |
10 | <label class="pn-label">手机号码</label> | 10 | <label class="pn-label">手机号码</label> |
11 | - <span class="country-code">+86</span> | ||
12 | - <span class="phone-num">18115624066</span> | 11 | + <span class="country-code">+{{area}}</span> |
12 | + <span class="phone-num">{{phoneNum}}</span> | ||
13 | </li> | 13 | </li> |
14 | <li class="po-re"> | 14 | <li class="po-re"> |
15 | <input id="captcha" class="input va captcha" type="text" name="captcha"> | 15 | <input id="captcha" class="input va captcha" type="text" name="captcha"> |
@@ -21,8 +21,8 @@ | @@ -21,8 +21,8 @@ | ||
21 | </span> | 21 | </span> |
22 | </li> | 22 | </li> |
23 | <li> | 23 | <li> |
24 | - <input name="area" id="area" type="hidden" value="86"> | ||
25 | - <input name="mobile" id="mobile" type="hidden" value="18115624066"> | 24 | + <input name="area" id="area" type="hidden" value="{{area}}"> |
25 | + <input name="mobile" id="mobile" type="hidden" value="{{phoneNum}}"> | ||
26 | <input name="captchaPic" id="captchaPic" type="hidden" value="g7ce"> | 26 | <input name="captchaPic" id="captchaPic" type="hidden" value="g7ce"> |
27 | <input name="refer" id="refer" type="hidden" value=""> | 27 | <input name="refer" id="refer" type="hidden" value=""> |
28 | <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled=""> | 28 | <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled=""> |
@@ -34,31 +34,7 @@ | @@ -34,31 +34,7 @@ | ||
34 | {{> product/left-content}} | 34 | {{> product/left-content}} |
35 | </div> | 35 | </div> |
36 | <div class="list-right pull-right"> | 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"></span> | ||
59 | - </a> | ||
60 | - </div> | ||
61 | - {{/ shopEntry}} | 37 | + {{> product/shop-entry}} |
62 | 38 | ||
63 | {{> product/standard-content}} | 39 | {{> product/standard-content}} |
64 | 40 | ||
@@ -68,4 +44,4 @@ | @@ -68,4 +44,4 @@ | ||
68 | </div> | 44 | </div> |
69 | {{/ list}} | 45 | {{/ list}} |
70 | </div> | 46 | </div> |
71 | -{{> layout/footer}} | ||
47 | +{{> layout/footer}} |
@@ -3,9 +3,11 @@ | @@ -3,9 +3,11 @@ | ||
3 | {{# search}} | 3 | {{# search}} |
4 | {{> layout/path-nav}} | 4 | {{> layout/path-nav}} |
5 | 5 | ||
6 | + {{> product/shop-entry}} | ||
7 | + | ||
6 | {{> product/standard-content}} | 8 | {{> product/standard-content}} |
7 | 9 | ||
8 | {{> product/latest-walk}} | 10 | {{> product/latest-walk}} |
9 | {{/ search}} | 11 | {{/ search}} |
10 | </div> | 12 | </div> |
11 | -{{> layout/footer}} | ||
13 | +{{> 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"></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"></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}} |
@@ -78,10 +78,21 @@ | @@ -78,10 +78,21 @@ | ||
78 | {{!-- 注册页--}} | 78 | {{!-- 注册页--}} |
79 | {{#if registerPage}} | 79 | {{#if registerPage}} |
80 | <script> | 80 | <script> |
81 | - seajs.use('js/passport/reg'); | 81 | + seajs.use('js/passport/reg', function (reg) { |
82 | + reg.init('reg'); | ||
83 | + }); | ||
82 | </script> | 84 | </script> |
83 | {{/if}} | 85 | {{/if}} |
84 | 86 | ||
87 | +{{!-- 第三方登录完善信息页--}} | ||
88 | +{{#if thirdPage}} | ||
89 | +<script> | ||
90 | + seajs.use('js/passport/reg', function (reg) { | ||
91 | + reg.init('third'); | ||
92 | + }); | ||
93 | +</script> | ||
94 | +{{/if}} | ||
95 | + | ||
85 | {{!-- 找回密码--}} | 96 | {{!-- 找回密码--}} |
86 | {{#if backPage}} | 97 | {{#if backPage}} |
87 | <script> | 98 | <script> |
1 | +{{# shopEntry}} | ||
2 | + <div class="shop-entry clearfix"> | ||
3 | + <a class="pull-left" href="{{home}}"> | ||
4 | + <img class="logo" src="{{logo}}"> | ||
5 | + </a> | ||
6 | + | ||
7 | + <div class="name pull-left"> | ||
8 | + <a class="shop-name" href="{{home}}">{{shopName}}</a> | ||
9 | + <p class="sorts"> | ||
10 | + {{#each sort}} | ||
11 | + <a href="{{href}}">{{name}}</a> | ||
12 | + | ||
13 | + {{#unless @last}} | ||
14 | + / | ||
15 | + {{/unless}} | ||
16 | + {{/each}} | ||
17 | + </p> | ||
18 | + </div> | ||
19 | + | ||
20 | + <a class="entry-btn pull-right" href="{{home}}"> | ||
21 | + 进入品牌店铺 | ||
22 | + <span class="iconfont"></span> | ||
23 | + </a> | ||
24 | + </div> | ||
25 | +{{/ shopEntry}} |
@@ -83,14 +83,30 @@ validateResult = [ | @@ -83,14 +83,30 @@ validateResult = [ | ||
83 | ]; | 83 | ]; |
84 | 84 | ||
85 | //手机号ajax校验 | 85 | //手机号ajax校验 |
86 | -function phoneAjaxFn(callback) { | ||
87 | - $.ajax({ | ||
88 | - url: '/passport/register/checkmobile', | ||
89 | - type: 'POST', | ||
90 | - data: { | 86 | +function phoneAjaxFn(page, callback) { |
87 | + var url, | ||
88 | + data; | ||
89 | + | ||
90 | + if (page === 'reg') { | ||
91 | + url = '/passport/register/checkmobile'; | ||
92 | + data = { | ||
91 | mobile: $pn.val(), | 93 | mobile: $pn.val(), |
92 | area: $region.text().split('+')[1] | 94 | area: $region.text().split('+')[1] |
93 | - } | 95 | + }; |
96 | + } else if (page === 'third') { | ||
97 | + url = '/passport/autouserinfo/bindCheck'; | ||
98 | + data = { | ||
99 | + mobile: $pn.val(), | ||
100 | + area: $region.text().split('+')[1], | ||
101 | + openId: 1, | ||
102 | + sourceType: 'QQ' | ||
103 | + }; | ||
104 | + } | ||
105 | + | ||
106 | + $.ajax({ | ||
107 | + url: url, | ||
108 | + type: 'POST', | ||
109 | + data: data | ||
94 | }).then(function(data) { | 110 | }).then(function(data) { |
95 | switch (data.code) { | 111 | switch (data.code) { |
96 | case 200: | 112 | case 200: |
@@ -108,10 +124,17 @@ function phoneAjaxFn(callback) { | @@ -108,10 +124,17 @@ function phoneAjaxFn(callback) { | ||
108 | } | 124 | } |
109 | 125 | ||
110 | //图形验证码ajax校验 | 126 | //图形验证码ajax校验 |
111 | -function picCaptchaAjaxFn(callback) { | 127 | +function picCaptchaAjaxFn(page, callback) { |
128 | + var url; | ||
129 | + | ||
130 | + if (page === 'reg') { | ||
131 | + url = '/passport/register/piccaptcha'; | ||
132 | + } else if (page === 'third') { | ||
133 | + url = '/passport/autouserinfo/checkPicCode'; | ||
134 | + } | ||
112 | $.ajax({ | 135 | $.ajax({ |
113 | type: 'POST', | 136 | type: 'POST', |
114 | - url: '/passport/register/piccaptcha', | 137 | + url: url, |
115 | data: { | 138 | data: { |
116 | code: $ca.val(), | 139 | code: $ca.val(), |
117 | mobile: $pn.val(), | 140 | mobile: $pn.val(), |
@@ -123,7 +146,7 @@ function picCaptchaAjaxFn(callback) { | @@ -123,7 +146,7 @@ function picCaptchaAjaxFn(callback) { | ||
123 | validateResult[1].message = ''; | 146 | validateResult[1].message = ''; |
124 | validateResult[1].status = true; | 147 | validateResult[1].status = true; |
125 | break; | 148 | break; |
126 | - case 404: | 149 | + case 400: |
127 | validateResult[1].message = '图形验证码错误'; | 150 | validateResult[1].message = '图形验证码错误'; |
128 | validateResult[1].status = false; | 151 | validateResult[1].status = false; |
129 | break; | 152 | break; |
@@ -133,10 +156,17 @@ function picCaptchaAjaxFn(callback) { | @@ -133,10 +156,17 @@ function picCaptchaAjaxFn(callback) { | ||
133 | } | 156 | } |
134 | 157 | ||
135 | //短信验证码ajax校验 | 158 | //短信验证码ajax校验 |
136 | -function msgCaptchaAjaxFn(callback) { | 159 | +function msgCaptchaAjaxFn(page, callback) { |
160 | + var url; | ||
161 | + | ||
162 | + if (page === 'reg') { | ||
163 | + url = '/passport/register/msgcaptcha'; | ||
164 | + } else if (page === 'third') { | ||
165 | + url = '/passport/autouserinfo/checkBindMsg'; | ||
166 | + } | ||
137 | $.ajax({ | 167 | $.ajax({ |
138 | type: 'POST', | 168 | type: 'POST', |
139 | - url: '/passport/register/msgcaptcha', | 169 | + url: url, |
140 | data: { | 170 | data: { |
141 | code: $ca.val(), | 171 | code: $ca.val(), |
142 | mobile: $pn.val(), | 172 | mobile: $pn.val(), |
@@ -148,7 +178,7 @@ function msgCaptchaAjaxFn(callback) { | @@ -148,7 +178,7 @@ function msgCaptchaAjaxFn(callback) { | ||
148 | validateResult[2].message = ''; | 178 | validateResult[2].message = ''; |
149 | validateResult[2].status = true; | 179 | validateResult[2].status = true; |
150 | break; | 180 | break; |
151 | - case 404: | 181 | + case 400: |
152 | validateResult[2].message = '短信验证码错误'; | 182 | validateResult[2].message = '短信验证码错误'; |
153 | validateResult[2].status = false; | 183 | validateResult[2].status = false; |
154 | break; | 184 | break; |
@@ -159,7 +189,7 @@ function msgCaptchaAjaxFn(callback) { | @@ -159,7 +189,7 @@ function msgCaptchaAjaxFn(callback) { | ||
159 | } | 189 | } |
160 | 190 | ||
161 | // 验证 | 191 | // 验证 |
162 | -function validateRule($element, callback) { | 192 | +function validateRule(page, $element, callback) { |
163 | 193 | ||
164 | var val = $.trim($element.val()), | 194 | var val = $.trim($element.val()), |
165 | regionCode; | 195 | regionCode; |
@@ -181,7 +211,7 @@ function validateRule($element, callback) { | @@ -181,7 +211,7 @@ function validateRule($element, callback) { | ||
181 | callback(); | 211 | callback(); |
182 | 212 | ||
183 | } else { | 213 | } else { |
184 | - phoneAjaxFn(callback); | 214 | + phoneAjaxFn(page, callback); |
185 | } | 215 | } |
186 | 216 | ||
187 | //图形验证码校验 | 217 | //图形验证码校验 |
@@ -200,7 +230,7 @@ function validateRule($element, callback) { | @@ -200,7 +230,7 @@ function validateRule($element, callback) { | ||
200 | 230 | ||
201 | // 并且手机号正确 | 231 | // 并且手机号正确 |
202 | if (validateResult[0].status) { | 232 | if (validateResult[0].status) { |
203 | - picCaptchaAjaxFn(callback); | 233 | + picCaptchaAjaxFn(page, callback); |
204 | } else { | 234 | } else { |
205 | validateResult[1].message = '图形验证码错误'; | 235 | validateResult[1].message = '图形验证码错误'; |
206 | validateResult[1].status = false; | 236 | validateResult[1].status = false; |
@@ -226,7 +256,7 @@ function validateRule($element, callback) { | @@ -226,7 +256,7 @@ function validateRule($element, callback) { | ||
226 | 256 | ||
227 | // 并且图形验证码正确 | 257 | // 并且图形验证码正确 |
228 | if (validateResult[1].status) { | 258 | if (validateResult[1].status) { |
229 | - msgCaptchaAjaxFn(callback); | 259 | + msgCaptchaAjaxFn(page, callback); |
230 | } else { | 260 | } else { |
231 | validateResult[2].message = '短信验证码错误'; | 261 | validateResult[2].message = '短信验证码错误'; |
232 | validateResult[2].status = false; | 262 | validateResult[2].status = false; |
@@ -379,140 +409,169 @@ function pwdFn($obj) { | @@ -379,140 +409,169 @@ function pwdFn($obj) { | ||
379 | 409 | ||
380 | // 失去焦点时开始校验 | 410 | // 失去焦点时开始校验 |
381 | // Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题 | 411 | // Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题 |
382 | -$registerPage.find('.va').keyup(function() { | 412 | +// ( ▼-▼ )注册页和信息完善页面接口不同 |
413 | +exports.init = function(page) { | ||
414 | + $registerPage.find('.va').keyup(function() { | ||
383 | 415 | ||
384 | - var j, | ||
385 | - statusLen = 0, | ||
386 | - vLen = validateResult.length, | ||
387 | - $that = $(this); | 416 | + var j, |
417 | + statusLen = 0, | ||
418 | + vLen = validateResult.length, | ||
419 | + $that = $(this); | ||
388 | 420 | ||
389 | - validateRule($(this), function() { | ||
390 | - showErrTip(); // 显示错误提示 | ||
391 | - showBorder(); // 显示红色边框 | 421 | + validateRule(page, $(this), function() { |
422 | + showErrTip(); // 显示错误提示 | ||
423 | + showBorder(); // 显示红色边框 | ||
392 | 424 | ||
393 | - // 如果validateResult中有4个status为true表示验证通过 | ||
394 | - for (j = 0; j < vLen; j++) { | 425 | + // 如果validateResult中有4个status为true表示验证通过 |
426 | + for (j = 0; j < vLen; j++) { | ||
395 | 427 | ||
396 | - if (validateResult[j].status) { | 428 | + if (validateResult[j].status) { |
397 | 429 | ||
398 | - statusLen++; | ||
399 | - } | ||
400 | - | ||
401 | - } | 430 | + statusLen++; |
431 | + } | ||
402 | 432 | ||
403 | - if (statusLen === 4 && $('#agree-terms').is(':checked')) { | ||
404 | - $registerBtn.removeClass('disable').removeAttr('disabled'); | ||
405 | - } else { | ||
406 | - $registerBtn.addClass('disable').attr('disabled', 'true'); | ||
407 | - } | 433 | + } |
408 | 434 | ||
409 | - // 图形验证通过时,发送短信按钮可点击 | ||
410 | - if (validateResult[1].status) { | ||
411 | - $sendCaptcha.removeClass('disable'); | ||
412 | - } else { | ||
413 | - $sendCaptcha.addClass('disable'); | ||
414 | - } | 435 | + if (statusLen === 4 && $('#agree-terms').is(':checked')) { |
436 | + $registerBtn.removeClass('disable').removeAttr('disabled'); | ||
437 | + } else { | ||
438 | + $registerBtn.addClass('disable').attr('disabled', 'true'); | ||
439 | + } | ||
415 | 440 | ||
416 | - //图形验证通过时,发送短信按钮可点击 end | 441 | + // 图形验证通过时,发送短信按钮可点击 |
442 | + if (validateResult[1].status) { | ||
443 | + $sendCaptcha.removeClass('disable'); | ||
444 | + } else { | ||
445 | + $sendCaptcha.addClass('disable'); | ||
446 | + } | ||
417 | 447 | ||
418 | - }); | 448 | + //图形验证通过时,发送短信按钮可点击 end |
419 | 449 | ||
420 | - // 如果是密码则校验强度 | ||
421 | - if (($that).hasClass('pwd')) { | ||
422 | - pwdFn($that); | ||
423 | - } | ||
424 | - | ||
425 | -}).blur(function() { | 450 | + }); |
426 | 451 | ||
427 | - /*validateRule($(this), function() { | ||
428 | - showErrTip(); | ||
429 | - showBorder(); // 显示红色边框 | ||
430 | - });*/ | ||
431 | -}); | 452 | + // 如果是密码则校验强度 |
453 | + if (($that).hasClass('pwd')) { | ||
454 | + pwdFn($that); | ||
455 | + } | ||
432 | 456 | ||
433 | -$regionSelect.change(function() { | 457 | + }).blur(function() { |
434 | 458 | ||
435 | - $region.text('+' + $('#region').val()); | 459 | + /*validateRule($(this), function() { |
460 | + showErrTip(); | ||
461 | + showBorder(); // 显示红色边框 | ||
462 | + });*/ | ||
463 | + }); | ||
436 | 464 | ||
437 | - validateRule($pn, showErrTip); //验证 | ||
438 | -}); | 465 | + $regionSelect.change(function() { |
439 | 466 | ||
440 | -// 点击发送验证码 | ||
441 | -$sendCaptcha.click(function() { | ||
442 | - var timeResidue = 10, | ||
443 | - t; | 467 | + $region.text('+' + $('#region').val()); |
444 | 468 | ||
445 | - if ($(this).hasClass('disable')) { | ||
446 | - return; | ||
447 | - } | 469 | + validateRule(page, $pn, showErrTip); //验证 |
470 | + }); | ||
448 | 471 | ||
449 | - //todo ajax | 472 | + // 点击发送验证码 |
473 | + $sendCaptcha.click(function() { | ||
474 | + var timeResidue = 20, | ||
475 | + t, | ||
476 | + url; | ||
450 | 477 | ||
451 | - t = setInterval(function() { | ||
452 | - if (timeResidue <= 0) { | ||
453 | - $sendCaptcha.removeClass('disable').val('获取短信验证码'); | ||
454 | - clearInterval(t); | 478 | + if ($(this).hasClass('disable')) { |
455 | return; | 479 | return; |
456 | } | 480 | } |
457 | - $sendCaptcha.addClass('disable').val(timeResidue-- + '秒可重新发送'); | ||
458 | - }, 1000); | ||
459 | -}); | ||
460 | 481 | ||
461 | -//form表单提交 | ||
462 | -$registerBtn.click(function() { | ||
463 | - | ||
464 | - if ($(this).hasClass('disable')) { | ||
465 | - return; | ||
466 | - } else { | 482 | + if (page === 'reg') { |
483 | + url = '/passport/register/sendBindMsg'; | ||
484 | + } else if (page === 'third') { | ||
485 | + url = '/passport/autouserinfo/sendBindMsg'; | ||
486 | + } | ||
467 | 487 | ||
468 | - //ajax提交 | 488 | + //todo ajax 发送验证码 |
469 | $.ajax({ | 489 | $.ajax({ |
470 | type: 'POST', | 490 | type: 'POST', |
471 | - url: '/passport/register/mobileregister', | 491 | + url: url, |
472 | data: { | 492 | data: { |
473 | area: $region.text().split('+')[1], | 493 | area: $region.text().split('+')[1], |
474 | mobile: $pn.val(), | 494 | mobile: $pn.val(), |
475 | - captcha: $ca.val(), | ||
476 | - code: $mc.val(), | ||
477 | - password: $pwd.val() | 495 | + code: $ca.val() |
478 | } | 496 | } |
479 | }).then(function(data) { | 497 | }).then(function(data) { |
498 | + if (data.code === 200) { | ||
499 | + t = setInterval(function() { | ||
500 | + if (timeResidue <= 0) { | ||
501 | + $sendCaptcha.removeClass('disable').val('获取短信验证码'); | ||
502 | + clearInterval(t); | ||
503 | + return; | ||
504 | + } | ||
505 | + $sendCaptcha.addClass('disable').val(timeResidue-- + '秒可重新发送'); | ||
506 | + }, 1000); | ||
507 | + } | ||
508 | + }); | ||
509 | + }); | ||
480 | 510 | ||
481 | - var time = 0, | ||
482 | - t, | ||
483 | - refer = data.href; | 511 | + //ajax表单提交 |
512 | + $registerBtn.click(function() { | ||
484 | 513 | ||
485 | - t = setTimeout(function() { | ||
486 | - time++; | ||
487 | - }, 1000); | 514 | + var url; |
488 | 515 | ||
516 | + if (page === 'reg') { | ||
517 | + url = '/passport/register/mobileregister'; | ||
518 | + } else if (page === 'third') { | ||
519 | + url = '/passport/autouserinfo/bindMobile'; | ||
520 | + } | ||
521 | + | ||
522 | + if ($(this).hasClass('disable')) { | ||
523 | + return; | ||
524 | + } else { | ||
525 | + | ||
526 | + //ajax提交 | ||
489 | $.ajax({ | 527 | $.ajax({ |
490 | type: 'POST', | 528 | type: 'POST', |
491 | - url: '/passport/register/mobileregister', | 529 | + url: url, |
492 | data: { | 530 | data: { |
493 | - session: data.session | 531 | + area: $region.text().split('+')[1], |
532 | + mobile: $pn.val(), | ||
533 | + captcha: $ca.val(), | ||
534 | + code: $mc.val(), | ||
535 | + password: $pwd.val() | ||
494 | } | 536 | } |
495 | }).then(function(data) { | 537 | }).then(function(data) { |
496 | 538 | ||
497 | - if (data.code === 200 && t < 3) { | 539 | + var time = 0, |
540 | + t, | ||
541 | + refer = data.href; | ||
542 | + | ||
543 | + t = setTimeout(function() { | ||
544 | + time++; | ||
545 | + }, 1000); | ||
546 | + | ||
547 | + $.ajax({ | ||
548 | + type: 'POST', | ||
549 | + url: '/passport/register/mobileregister', | ||
550 | + data: { | ||
551 | + session: data.session | ||
552 | + } | ||
553 | + }).then(function(data) { | ||
554 | + | ||
555 | + if (data.code === 200 && t < 3) { | ||
556 | + clearInterval(t); | ||
557 | + location.href = refer; | ||
558 | + } | ||
559 | + }); | ||
560 | + | ||
561 | + if (t >= 3) { | ||
498 | clearInterval(t); | 562 | clearInterval(t); |
499 | location.href = refer; | 563 | location.href = refer; |
500 | } | 564 | } |
501 | - }); | ||
502 | - | ||
503 | - if (t >= 3) { | ||
504 | - clearInterval(t); | ||
505 | - location.href = refer; | ||
506 | - } | ||
507 | 565 | ||
508 | - }); | ||
509 | - } | ||
510 | -}); | 566 | + }); |
567 | + } | ||
568 | + }); | ||
511 | 569 | ||
512 | -$('.change-captcha').click(function() { | ||
513 | - var time = new Date(), | ||
514 | - $captchaImg = $('.captcha-img'), | ||
515 | - captchaImgSrc = $captchaImg.attr('src').split('?')[0]; | 570 | + $('.change-captcha').click(function() { |
571 | + var time = new Date(), | ||
572 | + $captchaImg = $('.captcha-img'), | ||
573 | + captchaImgSrc = $captchaImg.attr('src').split('?')[0]; | ||
516 | 574 | ||
517 | - $captchaImg.attr('src', captchaImgSrc + '?t=' + time.getTime()); | ||
518 | -}); | ||
575 | + $captchaImg.attr('src', captchaImgSrc + '?t=' + time.getTime()); | ||
576 | + }); | ||
577 | +}; |
@@ -149,66 +149,5 @@ | @@ -149,66 +149,5 @@ | ||
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | - .shop-entry { | ||
153 | - position: relative; | ||
154 | - background: #f5f7f6; | ||
155 | - border: 1px solid #eaeceb; | ||
156 | - padding: 12px 15px; | ||
157 | - margin-bottom: 10px; | ||
158 | - | ||
159 | - .logo { | ||
160 | - width: 80px; | ||
161 | - height: 50px; | ||
162 | - } | ||
163 | - | ||
164 | - .name { | ||
165 | - margin-left: 10px; | ||
166 | - } | ||
167 | - | ||
168 | - .shop-name { | ||
169 | - font-size: 16px; | ||
170 | - color: #222; | ||
171 | - line-height: 26px; | ||
172 | - } | ||
173 | - | ||
174 | - .sorts { | ||
175 | - color: #999; | ||
176 | - font-size: 12px; | ||
177 | - line-height: 18px; | ||
178 | - | ||
179 | - a { | ||
180 | - color: #999; | ||
181 | - } | ||
182 | - } | ||
183 | - | ||
184 | - .entry-btn { | ||
185 | - position: absolute; | ||
186 | - right: 15px; | ||
187 | - top: 50%; | ||
188 | - width: 110px; | ||
189 | - height: 32px; | ||
190 | - line-height: 32px; | ||
191 | - margin-top: -16px; | ||
192 | - background: #222; | ||
193 | - text-align: center; | ||
194 | - color: #fff; | ||
195 | - font-size: 12px; | ||
196 | - | ||
197 | - .iconfont { | ||
198 | - font-size: 12px; | ||
199 | - } | ||
200 | - } | ||
201 | - } | ||
202 | - | ||
203 | - .goods-container { | ||
204 | - height: auto; | ||
205 | - padding: 25px 0 0 0; | ||
206 | - position: relative; | ||
207 | - width: 970px + 10px;//每列增加右边距 | ||
208 | - | ||
209 | - .good-info { | ||
210 | - width: 235px; | ||
211 | - | ||
212 | - } | ||
213 | - } | ||
214 | -} | ||
152 | + @import "shop-entry"; | ||
153 | +} |
web-static/sass/product/_shop-entry.scss
0 → 100644
1 | +.shop-entry { | ||
2 | + position: relative; | ||
3 | + background: #f5f7f6; | ||
4 | + border: 1px solid #eaeceb; | ||
5 | + padding: 12px 15px; | ||
6 | + margin-bottom: 10px; | ||
7 | + | ||
8 | + .logo { | ||
9 | + width: 80px; | ||
10 | + height: 50px; | ||
11 | + } | ||
12 | + | ||
13 | + .name { | ||
14 | + margin-left: 10px; | ||
15 | + } | ||
16 | + | ||
17 | + .shop-name { | ||
18 | + font-size: 16px; | ||
19 | + color: #222; | ||
20 | + line-height: 26px; | ||
21 | + } | ||
22 | + | ||
23 | + .sorts { | ||
24 | + color: #999; | ||
25 | + font-size: 12px; | ||
26 | + line-height: 18px; | ||
27 | + | ||
28 | + a { | ||
29 | + color: #999; | ||
30 | + } | ||
31 | + } | ||
32 | + | ||
33 | + .entry-btn { | ||
34 | + position: absolute; | ||
35 | + right: 15px; | ||
36 | + top: 50%; | ||
37 | + width: 110px; | ||
38 | + height: 32px; | ||
39 | + line-height: 32px; | ||
40 | + margin-top: -16px; | ||
41 | + background: #222; | ||
42 | + text-align: center; | ||
43 | + color: #fff; | ||
44 | + font-size: 12px; | ||
45 | + | ||
46 | + .iconfont { | ||
47 | + font-size: 12px; | ||
48 | + } | ||
49 | + } | ||
50 | +} | ||
51 | + | ||
52 | +.goods-container { | ||
53 | + height: auto; | ||
54 | + padding: 25px 0 0 0; | ||
55 | + position: relative; | ||
56 | + width: 970px + 10px;//每列增加右边距 | ||
57 | + | ||
58 | + .good-info { | ||
59 | + width: 235px; | ||
60 | + | ||
61 | + } | ||
62 | +} |
@@ -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 = "1.3.3" | 53 | +application.version = "1.3.4" |
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 = "1.3.3" | 53 | +application.version = "1.3.4" |
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 = "1.3.3" | 53 | +application.version = "1.3.4" |
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 = "1.3.3" | 53 | +application.version = "1.3.4" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停" | 56 | application.seo.title = "Yoho!Buy有货 | 潮流购物逛不停" |
@@ -73,7 +73,7 @@ class Bootstrap extends Bootstrap_Abstract | @@ -73,7 +73,7 @@ class Bootstrap extends Bootstrap_Abstract | ||
73 | $action = 'Index'; | 73 | $action = 'Index'; |
74 | 74 | ||
75 | // 二级域名 | 75 | // 二级域名 |
76 | - if (2 === $level) { | 76 | + if (3 === $level) { |
77 | $subDomain = strval($hostParts[0]); | 77 | $subDomain = strval($hostParts[0]); |
78 | switch (strtolower($subDomain)) { | 78 | switch (strtolower($subDomain)) { |
79 | case 'www': // 主站 | 79 | case 'www': // 主站 |
@@ -28,8 +28,7 @@ class BrandsModel { | @@ -28,8 +28,7 @@ class BrandsModel { | ||
28 | * @param $options array | 28 | * @param $options array |
29 | * @return array | 29 | * @return array |
30 | */ | 30 | */ |
31 | - public static function getBrandSearchData($condition, $options, $domain, $uid, $brandId) { | ||
32 | - | 31 | + public static function getBrandSearchData($condition, $options, $domain, $uid, $brandId,$node) { |
33 | // 调用商品搜索接口 | 32 | // 调用商品搜索接口 |
34 | $data = SearchData::searchElasticByCondition($condition); | 33 | $data = SearchData::searchElasticByCondition($condition); |
35 | 34 | ||
@@ -68,9 +67,16 @@ class BrandsModel { | @@ -68,9 +67,16 @@ class BrandsModel { | ||
68 | //获取品牌系列数据 | 67 | //获取品牌系列数据 |
69 | $adNav = self::getAdNav($condition['brand']); | 68 | $adNav = self::getAdNav($condition['brand']); |
70 | $data['list']['leftContent'][] = array('picLink' => $adNav); | 69 | $data['list']['leftContent'][] = array('picLink' => $adNav); |
71 | - | 70 | + |
71 | + //获取静态内容(20141219-100447) | ||
72 | + if($node){ | ||
73 | + $nodeContent = HelperSearch::formatNodeContent($node); | ||
74 | + $data['list']['leftContent'][]['picLink']['list'] = $nodeContent; | ||
75 | + } | ||
76 | + | ||
72 | return $data; | 77 | return $data; |
73 | } | 78 | } |
79 | + | ||
74 | 80 | ||
75 | /** | 81 | /** |
76 | * 获取品牌首页banner条 | 82 | * 获取品牌首页banner条 |
@@ -89,52 +95,29 @@ class BrandsModel { | @@ -89,52 +95,29 @@ class BrandsModel { | ||
89 | $bannerImg = Helpers::getImageUrl($bannerImg['data']['banner'], '', 150); | 95 | $bannerImg = Helpers::getImageUrl($bannerImg['data']['banner'], '', 150); |
90 | } | 96 | } |
91 | // 根据品牌Id获取品牌(简介)、收藏 | 97 | // 根据品牌Id获取品牌(简介)、收藏 |
92 | - if (isset($uid)) { | ||
93 | - $intro = BrandData::getBrandIntro($brandId, $uid); | ||
94 | - } | 98 | + $intro = BrandData::getBrandIntro($brandId, $uid); |
99 | + | ||
95 | $is_favorite = false; | 100 | $is_favorite = false; |
96 | - $logo = false; | ||
97 | $shopName = false; | 101 | $shopName = false; |
98 | - | ||
99 | - do { | ||
100 | - if (!isset($intro['data'])) { | ||
101 | - break; | ||
102 | - } | 102 | + if(isset($intro['data'])){ |
103 | // 获取是否收藏 | 103 | // 获取是否收藏 |
104 | if ($intro['data']['is_favorite'] == 'Y') { | 104 | if ($intro['data']['is_favorite'] == 'Y') { |
105 | $is_favorite = true; | 105 | $is_favorite = true; |
106 | } elseif ($intro['data']['is_favorite'] == 'N') { | 106 | } elseif ($intro['data']['is_favorite'] == 'N') { |
107 | $is_favorite = false; | 107 | $is_favorite = false; |
108 | } | 108 | } |
109 | - // 获取品牌logo | ||
110 | - $logo = Helpers::getImageUrl($intro['data']['brand_ico'], 80, 50); | ||
111 | // 获取品牌名 | 109 | // 获取品牌名 |
112 | - self::$shopName = $intro['data']['brand_name']; | ||
113 | - } while (false); | ||
114 | - | 110 | + self::$shopName = $intro['data']['brand_name']; |
111 | + } | ||
112 | + | ||
115 | // 返回banner数据 | 113 | // 返回banner数据 |
116 | return array( | 114 | return array( |
117 | - 'brandBanner' => array( | ||
118 | - 'bannerHeight' => '150', | ||
119 | - 'coled' => $is_favorite, | ||
120 | - 'banner' => $bannerImg | ||
121 | - ), | ||
122 | - 'shopEntry' => array( | ||
123 | - 'home' => self::$home, | ||
124 | - 'logo' => $logo, | ||
125 | - 'shopName' => self::$shopName, | ||
126 | - 'sort' => array( | ||
127 | - array( | ||
128 | - 'href' => '', | ||
129 | - 'name' => 'T恤' | ||
130 | - ), | ||
131 | - array( | ||
132 | - 'href' => '', | ||
133 | - 'name' => '卫衣' | ||
134 | - ) | ||
135 | - ) | ||
136 | - ) | ||
137 | - ); | 115 | + 'brandBanner' => array( |
116 | + 'bannerHeight' => '150', | ||
117 | + 'coled' => $is_favorite, | ||
118 | + 'banner' => $bannerImg | ||
119 | + ) | ||
120 | + ); | ||
138 | } | 121 | } |
139 | 122 | ||
140 | //获取品牌系列数据 | 123 | //获取品牌系列数据 |
@@ -148,6 +131,8 @@ class BrandsModel { | @@ -148,6 +131,8 @@ class BrandsModel { | ||
148 | $result['list'][$key]['src'] = $value['brand_sort_ico']; | 131 | $result['list'][$key]['src'] = $value['brand_sort_ico']; |
149 | } | 132 | } |
150 | } | 133 | } |
134 | + $result['picTitle'] = '经典系列'; | ||
135 | + | ||
151 | return $result; | 136 | return $result; |
152 | } | 137 | } |
153 | 138 |
1 | +<?php | ||
2 | + | ||
3 | +namespace Product; | ||
4 | + | ||
5 | +use LibModels\Wap\Product\SearchData; | ||
6 | +use LibModels\Web\Product\SearchData as WebProduct; | ||
7 | +use Plugin\HelperSearch; | ||
8 | +use Plugin\Images; | ||
9 | +/** | ||
10 | + * sale首页模板数据模型 | ||
11 | + * | ||
12 | + */ | ||
13 | +class SaleModel | ||
14 | +{ | ||
15 | + | ||
16 | + public static function getSaleSearchData($params, $options, $specialInfo) | ||
17 | + { | ||
18 | + $data = SearchData::searchElasticByCondition($params); | ||
19 | + | ||
20 | + if (isset($data['code']) && $data['code'] === 200) { | ||
21 | + //获取分类列表数据 | ||
22 | + $classes = WebProduct::getClassesData(); | ||
23 | + if (isset($classes['code']) && $classes['code'] === 200) { | ||
24 | + $data['data']['filter']['group_sort'] = $classes['data']['sort']; | ||
25 | + } | ||
26 | + | ||
27 | + //用户浏览记录 | ||
28 | + | ||
29 | + // 组织模板数据 | ||
30 | + $list = HelperSearch::getList($data, $options); | ||
31 | + | ||
32 | + //删除面包屑导航数据 | ||
33 | + unset($list['pathNav']); | ||
34 | + | ||
35 | + $data = array( | ||
36 | + //初始化js | ||
37 | + 'productListPage' => true, | ||
38 | + 'newSale' => $list | ||
39 | + ); | ||
40 | + } else { | ||
41 | + $data = array(); | ||
42 | + } | ||
43 | + | ||
44 | + //组织sale数据 | ||
45 | + if (isset($specialInfo['data']) && !empty($specialInfo['data']['banner_img'])) { | ||
46 | + $banner = json_decode($specialInfo['data']['banner_img'], true); | ||
47 | + foreach ($banner as $k => $v) { | ||
48 | + $v['img'] = Images::getSourceUrl($v['img'], 'couponImg'); | ||
49 | + $specialInfo['data']['banner'][] = $v; | ||
50 | + } | ||
51 | + $special = $specialInfo['data']; | ||
52 | + } | ||
53 | + | ||
54 | + //Sale首页 banner数据 | ||
55 | + $data['newSale']['saleBanner']['bannerHeight'] = $special['banner'][0]['height']; | ||
56 | + $data['newSale']['saleBanner']['img'] = $special['banner'][0]['img']; | ||
57 | + $data['newSale']['saleTitle']['name'] = '全部商品'; | ||
58 | + $data['newSale']['saleTitle']['count'] = $data['newSale']['totalCount']; | ||
59 | + | ||
60 | + | ||
61 | + //获取广告位数据 | ||
62 | + $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']); | ||
63 | + $data['newSale']['leftContent'][]['picLink']['list'] = $nodeContent; | ||
64 | + | ||
65 | + return $data; | ||
66 | + } | ||
67 | + | ||
68 | +} |
@@ -60,6 +60,42 @@ class SearchModel | @@ -60,6 +60,42 @@ class SearchModel | ||
60 | } | 60 | } |
61 | 61 | ||
62 | /** | 62 | /** |
63 | + * 搜索页面获取搜索数据 | ||
64 | + * @param $condition | ||
65 | + * @param $options | ||
66 | + * @return array | ||
67 | + */ | ||
68 | + public static function searchData($condition, $options){ | ||
69 | + $data = self::getSearchData($condition, $options); | ||
70 | + //过滤频道 | ||
71 | + if (isset($condition['gender'])) { | ||
72 | + unset($data['list']['filters']['channel']); | ||
73 | + } | ||
74 | + //过滤品牌 | ||
75 | + if (isset($condition['brand'])) { | ||
76 | + unset($data['list']['filters']['brand']); | ||
77 | + } | ||
78 | + //过滤价格 | ||
79 | + if (isset($condition['price'])) { | ||
80 | + unset($data['list']['filters']['price']); | ||
81 | + unset($data['list']['filters']['customPrice']); | ||
82 | + } | ||
83 | + //过滤颜色 | ||
84 | + if (isset($condition['color'])) { | ||
85 | + unset($data['list']['filters']['color']); | ||
86 | + } | ||
87 | + //过滤风格 | ||
88 | + if (isset($condition['style'])) { | ||
89 | + unset($data['list']['filters']['seniorChose']); | ||
90 | + } | ||
91 | + //过滤尺码 | ||
92 | + if (isset($condition['size'])) { | ||
93 | + unset($data['list']['filters']['size']); | ||
94 | + } | ||
95 | + return $data; | ||
96 | + | ||
97 | + } | ||
98 | + /** | ||
63 | * 根据product_sn查询产品图片信息 | 99 | * 根据product_sn查询产品图片信息 |
64 | * @param $product_sn | 100 | * @param $product_sn |
65 | * @param $options | 101 | * @param $options |
@@ -44,13 +44,13 @@ class AutouserinfoController extends AbstractAction | @@ -44,13 +44,13 @@ class AutouserinfoController extends AbstractAction | ||
44 | 44 | ||
45 | //整合 | 45 | //整合 |
46 | $data = array( | 46 | $data = array( |
47 | - 'registerPage' => true, | 47 | + 'thirdPage' => true, |
48 | 'simpleHeader' => $simpleHeader, | 48 | 'simpleHeader' => $simpleHeader, |
49 | 'passport' => array( | 49 | 'passport' => array( |
50 | 'actionUrl' => Helpers::url('/autouserinfo/bind'), | 50 | 'actionUrl' => Helpers::url('/autouserinfo/bind'), |
51 | 'region' => RegData::getAreasData(), | 51 | 'region' => RegData::getAreasData(), |
52 | 'location' => '+86', | 52 | 'location' => '+86', |
53 | - 'captchaUrl' => Helpers::url('/passport/images?t=' . time()), | 53 | + 'captchaUrl' => '/passport/images?t=1449799445', |
54 | 'itemUrl' => Helpers::url('/help/?category_id=9'), | 54 | 'itemUrl' => Helpers::url('/help/?category_id=9'), |
55 | 'referUrl' => $refer, | 55 | 'referUrl' => $refer, |
56 | 'skipUrl' => SITE_MAIN, | 56 | 'skipUrl' => SITE_MAIN, |
@@ -55,6 +55,7 @@ class BackController extends WebAction | @@ -55,6 +55,7 @@ class BackController extends WebAction | ||
55 | $mobile = $phoneNum; | 55 | $mobile = $phoneNum; |
56 | $data = BackData::sendCodeToMobile($mobile); | 56 | $data = BackData::sendCodeToMobile($mobile); |
57 | $this->setSession('phoneNum', $phoneNum); | 57 | $this->setSession('phoneNum', $phoneNum); |
58 | + $this->setSession('area', $area); | ||
58 | if($data['code'] == 200) { | 59 | if($data['code'] == 200) { |
59 | $this->redirect('verification'); | 60 | $this->redirect('verification'); |
60 | } | 61 | } |
@@ -159,12 +160,20 @@ class BackController extends WebAction | @@ -159,12 +160,20 @@ class BackController extends WebAction | ||
159 | * 手机验证 | 160 | * 手机验证 |
160 | */ | 161 | */ |
161 | public function verificationAction() { | 162 | public function verificationAction() { |
163 | + $phoneNum = $this->getSession('phoneNum'); | ||
164 | + $area = $this->getSession('area'); | ||
165 | +// if(empty($phoneNum)) { | ||
166 | +// $this->redirect('index'); | ||
167 | +// } | ||
168 | + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE); | ||
162 | $data = array( | 169 | $data = array( |
163 | 'simpleHeader' => PassportModel::getSimpleHeader(false), | 170 | 'simpleHeader' => PassportModel::getSimpleHeader(false), |
164 | 'vertificationPage' => true, | 171 | 'vertificationPage' => true, |
165 | 'verification' => array( | 172 | 'verification' => array( |
166 | - 'coverHref' => '/passport', | ||
167 | - 'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190', | 173 | + 'coverHref' => $banner['url'], |
174 | + 'coverImg' => $banner['img'], | ||
175 | + 'phoneNum' => $phoneNum, | ||
176 | + 'area' => $area, | ||
168 | 'countrys' => array() | 177 | 'countrys' => array() |
169 | ) | 178 | ) |
170 | ); | 179 | ); |
1 | <?php | 1 | <?php |
2 | use Action\WebAction; | 2 | use Action\WebAction; |
3 | -use Product\BrandsModel; | ||
4 | use LibModels\Web\Product\BrandData; | 3 | use LibModels\Web\Product\BrandData; |
5 | class IndexController extends WebAction | 4 | class IndexController extends WebAction |
6 | { | 5 | { |
@@ -20,6 +19,7 @@ class IndexController extends WebAction | @@ -20,6 +19,7 @@ class IndexController extends WebAction | ||
20 | $brandInfo = BrandData::getBrandLogoByDomain($domain); | 19 | $brandInfo = BrandData::getBrandLogoByDomain($domain); |
21 | if(!empty($brandInfo['data']) && $brandInfo['code'] === 200){ | 20 | if(!empty($brandInfo['data']) && $brandInfo['code'] === 200){ |
22 | $brandId = $brandInfo['data']['id']; | 21 | $brandId = $brandInfo['data']['id']; |
22 | + $node = isset($brandInfo['static_content_code']) ? $brandInfo['static_content_code'] : false; | ||
23 | }else{ | 23 | }else{ |
24 | $this->go(SITE_MAIN); | 24 | $this->go(SITE_MAIN); |
25 | } | 25 | } |
@@ -54,6 +54,7 @@ class IndexController extends WebAction | @@ -54,6 +54,7 @@ class IndexController extends WebAction | ||
54 | } | 54 | } |
55 | //传品牌ID参数 | 55 | //传品牌ID参数 |
56 | $condition['brand'] = $brandId; | 56 | $condition['brand'] = $brandId; |
57 | + | ||
57 | //获取性别数据 | 58 | //获取性别数据 |
58 | $gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : (!isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1)); | 59 | $gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : (!isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1)); |
59 | $condition['gender'] = $gender; | 60 | $condition['gender'] = $gender; |
@@ -92,7 +93,7 @@ class IndexController extends WebAction | @@ -92,7 +93,7 @@ class IndexController extends WebAction | ||
92 | 93 | ||
93 | $params = $condition + $_GET; | 94 | $params = $condition + $_GET; |
94 | $params = array_filter($params); | 95 | $params = array_filter($params); |
95 | - $data = Product\BrandsModel::getBrandSearchData($params,$options,$domain,$uid,$brandId); | 96 | + $data = Product\BrandsModel::getBrandSearchData($params,$options,$domain,$uid,$brandId,$node); |
96 | $cate = array('boys','girls','kids','lifestyle'); | 97 | $cate = array('boys','girls','kids','lifestyle'); |
97 | $this->setWebNavHeader($cate[$gender-1]); | 98 | $this->setWebNavHeader($cate[$gender-1]); |
98 | //渲染模板 | 99 | //渲染模板 |
@@ -858,17 +858,29 @@ class Index1Controller extends AbstractAction | @@ -858,17 +858,29 @@ class Index1Controller extends AbstractAction | ||
858 | ), | 858 | ), |
859 | array( | 859 | array( |
860 | 'picLink' => array( | 860 | 'picLink' => array( |
861 | - 'title' => 'AAAA', | ||
862 | - 'list' => array( | ||
863 | - array( | ||
864 | - 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
865 | - 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | ||
866 | - ), | ||
867 | - array( | ||
868 | - 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
869 | - 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | 861 | + array( |
862 | + 'title' => 'AAAA', | ||
863 | + 'list' => array( | ||
864 | + array( | ||
865 | + 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
866 | + 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | ||
867 | + ), | ||
868 | + array( | ||
869 | + 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
870 | + 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | ||
871 | + ) | ||
872 | + ) | ||
873 | + ), | ||
874 | + array( | ||
875 | + array( | ||
876 | + 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
877 | + 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | ||
878 | + ), | ||
879 | + array( | ||
880 | + 'href' => 'http://adidas.yohobuy.com/?folder=1366', | ||
881 | + 'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg' | ||
882 | + ) | ||
870 | ) | 883 | ) |
871 | - ) | ||
872 | ) | 884 | ) |
873 | ), | 885 | ), |
874 | array( | 886 | array( |
1 | +<?php | ||
2 | + | ||
3 | +use Action\WebAction; | ||
4 | +use LibModels\Web\Product\SaleData; | ||
5 | + | ||
6 | +/** | ||
7 | + * sale页 | ||
8 | + * | ||
9 | + */ | ||
10 | +class SaleController extends WebAction | ||
11 | +{ | ||
12 | + | ||
13 | + public function indexAction() | ||
14 | + { | ||
15 | + //获取专区ID | ||
16 | + $specialsaleId = $this->param('specialsaleId'); | ||
17 | + $specialInfo = SaleData::getSpecial($specialsaleId); | ||
18 | + $special = $specialInfo['data']; | ||
19 | + | ||
20 | + //获取促销ID | ||
21 | + $promotion = $this->param('promotion'); | ||
22 | + | ||
23 | + //专区ID和促销ID都为空时,跳转到主页 | ||
24 | + if (empty($specialsaleId) && empty($promotion)) { | ||
25 | + $this->go(SITE_MAIN); | ||
26 | + } | ||
27 | + | ||
28 | + /* 过滤请求参数 */ | ||
29 | + $condition = array(); | ||
30 | + $condition = filter_input_array(INPUT_GET, array( | ||
31 | + //'query' => FILTER_SANITIZE_STRING, | ||
32 | + 'sort' => FILTER_VALIDATE_INT, | ||
33 | + 'msort' => FILTER_VALIDATE_INT, | ||
34 | + 'misort' => FILTER_VALIDATE_INT, | ||
35 | + 'color' => FILTER_VALIDATE_INT, | ||
36 | + 'size' => FILTER_VALIDATE_INT, | ||
37 | + 'style' => FILTER_DEFAULT, | ||
38 | + 'price' => FILTER_DEFAULT, | ||
39 | + 'gender' => FILTER_DEFAULT, | ||
40 | + 'p_d' => FILTER_DEFAULT, | ||
41 | + 'shelve_time' => FILTER_DEFAULT, | ||
42 | + 'isNew' => FILTER_DEFAULT, | ||
43 | + 'specialoffer' => FILTER_DEFAULT, | ||
44 | + 'limited' => FILTER_DEFAULT, | ||
45 | + 'order' => FILTER_DEFAULT, | ||
46 | + 'viewNum' => FILTER_VALIDATE_INT, | ||
47 | + 'rowNum' => FILTER_VALIDATE_INT, | ||
48 | + 'page' => FILTER_VALIDATE_INT,), false); | ||
49 | + | ||
50 | + //字符转码 | ||
51 | + if (!empty($condition)) { | ||
52 | + foreach ($condition as &$value) { | ||
53 | + $value = rawurldecode($value); | ||
54 | + } | ||
55 | + } | ||
56 | + //传品牌ID参数 | ||
57 | + if(!empty($special['brand_id'])){ | ||
58 | + $condition['brand'] = $special['brand_id']; | ||
59 | + } | ||
60 | + | ||
61 | + //传促销id | ||
62 | + if(!empty($special['ispromotion'])){ | ||
63 | + $condition['promotion'] = $special['ispromotion']; | ||
64 | + }else{ | ||
65 | + $condition['promotion'] = $promotion; | ||
66 | + } | ||
67 | + | ||
68 | + //获取性别数据 | ||
69 | + $gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : (!isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender'] == '2,3' ? 2 : 1)); | ||
70 | + $condition['gender'] = $gender; | ||
71 | + | ||
72 | + //每页显示商品数 | ||
73 | + if (!isset($condition['viewNum']) || empty($condition['viewNum'])) { | ||
74 | + $condition['viewNum'] = 59; | ||
75 | + } | ||
76 | + $view_num_arr = array(60, 100, 200); | ||
77 | + if (!in_array($condition['viewNum'], $view_num_arr)) { | ||
78 | + $condition['viewNum'] = 59; | ||
79 | + } | ||
80 | + //每行显示的商品数量 | ||
81 | + if (!isset($condition['rowNum']) || empty($condition['rowNum'])) { | ||
82 | + $condition['rowNum'] = 5; | ||
83 | + } | ||
84 | + if ($condition['rowNum'] == 6) { | ||
85 | + $imgSize = array(195, 260); | ||
86 | + $minImgSize = array(50, 67); | ||
87 | + } else { | ||
88 | + $condition['rowNum'] = 5; | ||
89 | + $imgSize = array(235, 314); | ||
90 | + $minImgSize = array(60, 80); | ||
91 | + } | ||
92 | + //搜索词 | ||
93 | + //$query = $this->get('query'); | ||
94 | + $condition['needFilter'] = 1; | ||
95 | + $options = array( | ||
96 | + 'imgSize' => $imgSize, | ||
97 | + 'minImgSize' => $minImgSize, | ||
98 | + 'gender' => $gender, | ||
99 | + 'needPd' => 'Y', | ||
100 | + 'rowNum' => $condition['rowNum'], | ||
101 | + 'viewNum' => $condition['viewNum'] - 1, | ||
102 | + 'specialsale_id' => 'Y' | ||
103 | + ); | ||
104 | + | ||
105 | + $params = $condition + $_GET; | ||
106 | + $params['attribute_not'] = 2; | ||
107 | + $params = array_filter($params); | ||
108 | + | ||
109 | + $data = Product\SaleModel::getSaleSearchData($params, $options, $specialInfo); | ||
110 | + $cate = array('boys', 'girls', 'kids', 'lifestyle'); | ||
111 | + $this->setWebNavHeader($cate[$gender - 1]); | ||
112 | + //渲染模板 | ||
113 | + $this->_view->display('new-sale', $data); | ||
114 | + } | ||
115 | + | ||
116 | +} |
1 | +<?php | ||
2 | +use Action\WebAction; | ||
3 | +use Product\SearchModel; | ||
4 | +class SearchController extends WebAction | ||
5 | +{ | ||
6 | + public function indexAction() | ||
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 | + $condition['query'] = '鞋'; | ||
35 | + //性別(频道) | ||
36 | + $gender_cookie = !isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1); | ||
37 | + $gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : $gender_cookie ; | ||
38 | + $condition['gender'] = $gender; | ||
39 | + //每页显示商品数 | ||
40 | + if(!isset($condition['viewNum']) || empty($condition['viewNum'])){ | ||
41 | + $condition['viewNum'] =60; | ||
42 | + } | ||
43 | + $view_num_arr = array(60, 100, 200); | ||
44 | + if (!in_array($condition['viewNum'], $view_num_arr)) { | ||
45 | + $condition['viewNum'] = 60; | ||
46 | + } | ||
47 | + //每行显示的商品数量 | ||
48 | + if(!isset($condition['rowNum']) || empty($condition['rowNum'])){ | ||
49 | + $condition['rowNum'] =5; | ||
50 | + } | ||
51 | + if ($condition['rowNum'] == 6) { | ||
52 | + $imgSize = array(195, 260); | ||
53 | + $minImgSize = array(50, 67); | ||
54 | + } else { | ||
55 | + $condition['rowNum'] = 5; | ||
56 | + $imgSize = array(235, 314); | ||
57 | + $minImgSize = array(60, 80); | ||
58 | + } | ||
59 | + //自定义搜索价格 | ||
60 | + if (isset($condition['price']) || !empty($condition['price'])) { | ||
61 | + $price = explode(',', $condition['price']); | ||
62 | + if (!$price[0]) { | ||
63 | + $price[0] = 0; | ||
64 | + } | ||
65 | + if ($price[1]) { | ||
66 | + $price[1] = 99999; | ||
67 | + } | ||
68 | + $condition['price'] = implode(',', $price); | ||
69 | + } | ||
70 | + | ||
71 | + //返回搜索条件 | ||
72 | + $condition['needFilter'] = 1; | ||
73 | + //过滤赠品 | ||
74 | + $condition['attribute_not'] = 2; | ||
75 | + /*sale*/ | ||
76 | + //默认排序 | ||
77 | + if (!isset($condition['order']) || empty($condition['order'])) { | ||
78 | + $condition['order'] = 's_n_desc'; | ||
79 | + } | ||
80 | + if (!isset($condition['p_d']) || empty($condition['p_d'])) { | ||
81 | + $condition['p_d'] = '0,0.9'; | ||
82 | + } | ||
83 | + $options = array( | ||
84 | + 'imgSize' => $imgSize, | ||
85 | + 'minImgSize' => $minImgSize, | ||
86 | + 'rowNum' =>$condition['rowNum'], | ||
87 | + 'viewNum' =>$condition['viewNum'], | ||
88 | + ); | ||
89 | + $params = $condition + $_GET; | ||
90 | + $params = array_filter($params); | ||
91 | + //每页记录数减1,下一页占位 | ||
92 | + $params['viewNum'] = $params['viewNum'] - 1; | ||
93 | + $searchData = SearchModel::searchData($params,$options); | ||
94 | + $cate = array('boys','girls','kids','lifestyle'); | ||
95 | + $this->setWebNavHeader($cate[$gender-1]); | ||
96 | + $data = array( | ||
97 | + 'searchListPage' => true, | ||
98 | + ); | ||
99 | + $data['search'] = $searchData['list']; | ||
100 | + $this->_view->display('search', $data); | ||
101 | + } | ||
102 | +} |
-
Please register or login to post a comment