Authored by 周少峰

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

@@ -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">&#xe601;</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 +{{# 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">&#xe601;</span>
  23 + </a>
  24 + </div>
  25 +{{/ shopEntry}}
@@ -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': // 主站
@@ -70,18 +70,14 @@ class BrandsModel { @@ -70,18 +70,14 @@ class BrandsModel {
70 70
71 //获取静态内容(20141219-100447) 71 //获取静态内容(20141219-100447)
72 if($node){ 72 if($node){
73 - $nodeContent = BrandData::getByNodeContent($node);  
74 - if(isset($nodeContent['code']) && $nodeContent['code'] === 200){  
75 - $result = $nodeContent['data'];  
76 - //接口返回html格式,非前端需要格式。  
77 - } 73 + $nodeContent = HelperSearch::formatNodeContent($node);
  74 + $data['list']['leftContent'][]['picLink']['list'] = $nodeContent;
78 } 75 }
79 76
80 return $data; 77 return $data;
81 } 78 }
82 79
83 80
84 -  
85 /** 81 /**
86 * 获取品牌首页banner条 82 * 获取品牌首页banner条
87 * @string $domain 品牌域名 83 * @string $domain 品牌域名
@@ -99,52 +95,29 @@ class BrandsModel { @@ -99,52 +95,29 @@ class BrandsModel {
99 $bannerImg = Helpers::getImageUrl($bannerImg['data']['banner'], '', 150); 95 $bannerImg = Helpers::getImageUrl($bannerImg['data']['banner'], '', 150);
100 } 96 }
101 // 根据品牌Id获取品牌(简介)、收藏 97 // 根据品牌Id获取品牌(简介)、收藏
102 - if (isset($uid)) {  
103 - $intro = BrandData::getBrandIntro($brandId, $uid);  
104 - } 98 + $intro = BrandData::getBrandIntro($brandId, $uid);
  99 +
105 $is_favorite = false; 100 $is_favorite = false;
106 - $logo = false;  
107 $shopName = false; 101 $shopName = false;
108 -  
109 - do {  
110 - if (!isset($intro['data'])) {  
111 - break;  
112 - } 102 + if(isset($intro['data'])){
113 // 获取是否收藏 103 // 获取是否收藏
114 if ($intro['data']['is_favorite'] == 'Y') { 104 if ($intro['data']['is_favorite'] == 'Y') {
115 $is_favorite = true; 105 $is_favorite = true;
116 } elseif ($intro['data']['is_favorite'] == 'N') { 106 } elseif ($intro['data']['is_favorite'] == 'N') {
117 $is_favorite = false; 107 $is_favorite = false;
118 } 108 }
119 - // 获取品牌logo  
120 - $logo = Helpers::getImageUrl($intro['data']['brand_ico'], 80, 50);  
121 // 获取品牌名 109 // 获取品牌名
122 - self::$shopName = $intro['data']['brand_name'];  
123 - } while (false);  
124 - 110 + self::$shopName = $intro['data']['brand_name'];
  111 + }
  112 +
125 // 返回banner数据 113 // 返回banner数据
126 return array( 114 return array(
127 - 'brandBanner' => array(  
128 - 'bannerHeight' => '150',  
129 - 'coled' => $is_favorite,  
130 - 'banner' => $bannerImg  
131 - ),  
132 - 'shopEntry' => array(  
133 - 'home' => self::$home,  
134 - 'logo' => $logo,  
135 - 'shopName' => self::$shopName,  
136 - 'sort' => array(  
137 - array(  
138 - 'href' => '',  
139 - 'name' => 'T恤'  
140 - ),  
141 - array(  
142 - 'href' => '',  
143 - 'name' => '卫衣'  
144 - )  
145 - )  
146 - )  
147 - ); 115 + 'brandBanner' => array(
  116 + 'bannerHeight' => '150',
  117 + 'coled' => $is_favorite,
  118 + 'banner' => $bannerImg
  119 + )
  120 + );
148 } 121 }
149 122
150 //获取品牌系列数据 123 //获取品牌系列数据
@@ -158,6 +131,8 @@ class BrandsModel { @@ -158,6 +131,8 @@ class BrandsModel {
158 $result['list'][$key]['src'] = $value['brand_sort_ico']; 131 $result['list'][$key]['src'] = $value['brand_sort_ico'];
159 } 132 }
160 } 133 }
  134 + $result['picTitle'] = '经典系列';
  135 +
161 return $result; 136 return $result;
162 } 137 }
163 138
@@ -58,10 +58,9 @@ class SaleModel @@ -58,10 +58,9 @@ class SaleModel
58 $data['newSale']['saleTitle']['count'] = $data['newSale']['totalCount']; 58 $data['newSale']['saleTitle']['count'] = $data['newSale']['totalCount'];
59 59
60 60
61 - //获取广告位 61 + //获取广告位数据
62 $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']); 62 $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']);
63 - $data['newSale']['leftContent'][]['picLink'][] = $nodeContent;  
64 - 63 + $data['newSale']['leftContent'][]['picLink']['list'] = $nodeContent;
65 64
66 return $data; 65 return $data;
67 } 66 }
@@ -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 {
@@ -55,6 +54,7 @@ class IndexController extends WebAction @@ -55,6 +54,7 @@ class IndexController extends WebAction
55 } 54 }
56 //传品牌ID参数 55 //传品牌ID参数
57 $condition['brand'] = $brandId; 56 $condition['brand'] = $brandId;
  57 +
58 //获取性别数据 58 //获取性别数据
59 $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));
60 $condition['gender'] = $gender; 60 $condition['gender'] = $gender;
@@ -13,16 +13,13 @@ class SaleController extends WebAction @@ -13,16 +13,13 @@ class SaleController extends WebAction
13 public function indexAction() 13 public function indexAction()
14 { 14 {
15 //获取专区ID 15 //获取专区ID
16 - $specialsaleId = $this->Param('specialsaleId');  
17 - $specialsaleId = 1; //测试数据 16 + $specialsaleId = $this->param('specialsaleId');
18 $specialInfo = SaleData::getSpecial($specialsaleId); 17 $specialInfo = SaleData::getSpecial($specialsaleId);
19 $special = $specialInfo['data']; 18 $special = $specialInfo['data'];
20 -// if (empty($specialsale_id)) {  
21 -// $specialsale_id = str_replace('specialsale', '', explode('.', $_SERVER['HTTP_HOST'])[0]);  
22 -// } 19 +
23 //获取促销ID 20 //获取促销ID
24 - $promotion = $this->Param('promotion');  
25 - 21 + $promotion = $this->param('promotion');
  22 +
26 //专区ID和促销ID都为空时,跳转到主页 23 //专区ID和促销ID都为空时,跳转到主页
27 if (empty($specialsaleId) && empty($promotion)) { 24 if (empty($specialsaleId) && empty($promotion)) {
28 $this->go(SITE_MAIN); 25 $this->go(SITE_MAIN);
@@ -49,7 +46,7 @@ class SaleController extends WebAction @@ -49,7 +46,7 @@ class SaleController extends WebAction
49 'viewNum' => FILTER_VALIDATE_INT, 46 'viewNum' => FILTER_VALIDATE_INT,
50 'rowNum' => FILTER_VALIDATE_INT, 47 'rowNum' => FILTER_VALIDATE_INT,
51 'page' => FILTER_VALIDATE_INT,), false); 48 'page' => FILTER_VALIDATE_INT,), false);
52 - 49 +
53 //字符转码 50 //字符转码
54 if (!empty($condition)) { 51 if (!empty($condition)) {
55 foreach ($condition as &$value) { 52 foreach ($condition as &$value) {
@@ -63,7 +60,9 @@ class SaleController extends WebAction @@ -63,7 +60,9 @@ class SaleController extends WebAction
63 60
64 //传促销id 61 //传促销id
65 if(!empty($special['ispromotion'])){ 62 if(!empty($special['ispromotion'])){
66 - //$condition['promotion'] = $special['ispromotion']; 63 + $condition['promotion'] = $special['ispromotion'];
  64 + }else{
  65 + $condition['promotion'] = $promotion;
67 } 66 }
68 67
69 //获取性别数据 68 //获取性别数据
@@ -73,7 +72,7 @@ class SaleController extends WebAction @@ -73,7 +72,7 @@ class SaleController extends WebAction
73 //每页显示商品数 72 //每页显示商品数
74 if (!isset($condition['viewNum']) || empty($condition['viewNum'])) { 73 if (!isset($condition['viewNum']) || empty($condition['viewNum'])) {
75 $condition['viewNum'] = 59; 74 $condition['viewNum'] = 59;
76 - } 75 + }
77 $view_num_arr = array(60, 100, 200); 76 $view_num_arr = array(60, 100, 200);
78 if (!in_array($condition['viewNum'], $view_num_arr)) { 77 if (!in_array($condition['viewNum'], $view_num_arr)) {
79 $condition['viewNum'] = 59; 78 $condition['viewNum'] = 59;
@@ -108,7 +107,6 @@ class SaleController extends WebAction @@ -108,7 +107,6 @@ class SaleController extends WebAction
108 $params = array_filter($params); 107 $params = array_filter($params);
109 108
110 $data = Product\SaleModel::getSaleSearchData($params, $options, $specialInfo); 109 $data = Product\SaleModel::getSaleSearchData($params, $options, $specialInfo);
111 -  
112 $cate = array('boys', 'girls', 'kids', 'lifestyle'); 110 $cate = array('boys', 'girls', 'kids', 'lifestyle');
113 $this->setWebNavHeader($cate[$gender - 1]); 111 $this->setWebNavHeader($cate[$gender - 1]);
114 //渲染模板 112 //渲染模板