Authored by 毕凯

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

@@ -636,7 +636,15 @@ class HelperSearch @@ -636,7 +636,15 @@ class HelperSearch
636 //设置已选中价格 636 //设置已选中价格
637 if (!empty($priceId)) { 637 if (!empty($priceId)) {
638 $price = explode(',' ,$priceId); 638 $price = explode(',' ,$priceId);
639 - $customName = isset($price[1]) && $price[1] == 99999 ? '¥'.$price[0].'以上' : '¥' . intval($price[0]-1) . '-' . intval($price[1]); 639 + if (isset($price[1]) && empty($price[1])) {
  640 + $customName = '¥' . intval($price[0]) . '-99999';
  641 + }
  642 + elseif (isset($price[1]) && $price[1] == 99999) {
  643 + $customName = '¥'.intval($price[0]-1).'以上';
  644 + }
  645 + else {
  646 + $customName = '¥' . intval($price[0]) . '-' . intval($price[1]);
  647 + }
640 $name = isset($filter['price'][$priceId]) ? $filter['price'][$priceId] : $customName; 648 $name = isset($filter['price'][$priceId]) ? $filter['price'][$priceId] : $customName;
641 self::$selected['price'] = array( 649 self::$selected['price'] = array(
642 'name' => $name, 650 'name' => $name,
@@ -875,10 +883,12 @@ class HelperSearch @@ -875,10 +883,12 @@ class HelperSearch
875 } 883 }
876 $result = array( 884 $result = array(
877 'name' => '最新', 885 'name' => '最新',
878 - 'href' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? self::buildUrl($params) : self::buildUrl(array_merge($params, array( 886 + 'href' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? self::buildUrl(array_merge($params, array(
879 'order' => 's_t_asc' 887 'order' => 's_t_asc'
  888 + ))) : self::buildUrl(array_merge($params, array(
  889 + 'order' => 's_t_desc'
880 ))) , 890 ))) ,
881 - 'active' => isset(self::$params['order']) && self::$params['order'] == 's_t_asc' ? true : '' 891 + 'active' => isset(self::$params['order']) && self::$params['order'] == 's_t_desc' ? true : ''
882 ); 892 );
883 return $result; 893 return $result;
884 } 894 }
@@ -1347,6 +1357,9 @@ class HelperSearch @@ -1347,6 +1357,9 @@ class HelperSearch
1347 elseif ($controller == 'list' && $action == 'sale') { 1357 elseif ($controller == 'list' && $action == 'sale') {
1348 $type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9'; 1358 $type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
1349 } 1359 }
  1360 + elseif ($controller == 'sale' && $action == 'index') {
  1361 + $type = isset(self::$params['specialsale_id']) && self::$params['specialsale_id'] ? self::$params['specialsale_id'] : '';
  1362 + }
1350 // 品牌 1363 // 品牌
1351 elseif ($controller == 'list' && $action == 'sale') { 1364 elseif ($controller == 'list' && $action == 'sale') {
1352 $type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : ''; 1365 $type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
@@ -285,7 +285,7 @@ $('#login-btn').on('click', function() { @@ -285,7 +285,7 @@ $('#login-btn').on('click', function() {
285 } 285 }
286 } else { 286 } else {
287 $passwordTip.removeClass('hide').children('em').html(data.message); 287 $passwordTip.removeClass('hide').children('em').html(data.message);
288 - $password.addClass('error'); 288 + $password.addClass('error').val('');
289 } 289 }
290 }, 290 },
291 complete: function() { 291 complete: function() {
@@ -173,6 +173,18 @@ @@ -173,6 +173,18 @@
173 height: 150px; 173 height: 150px;
174 line-height: 150px; 174 line-height: 150px;
175 } 175 }
  176 + .logo-brand-switch {
  177 + .iconfont {
  178 + font-size: 24px;
  179 +
  180 + &.prev {
  181 + top: -12px;
  182 + }
  183 + &.bottom {
  184 + bottom: -12px;
  185 + }
  186 + }
  187 + }
176 } 188 }
177 189
178 190
@@ -67,9 +67,9 @@ class HotrankModel @@ -67,9 +67,9 @@ class HotrankModel
67 public static function getHotrankResource($data, $sid, $page) 67 public static function getHotrankResource($data, $sid, $page)
68 { 68 {
69 //焦点图 热门品牌 69 //焦点图 热门品牌
70 -// $focus = self::getFocusResource($data['channel'], $data['code']);  
71 -// $data['slide'] = $focus[0]['slide'];  
72 -// $data['hotBrands'] = $focus[1]['hotBrands']; 70 + $focus = self::getFocusResource($data['channel'], $data['code']);
  71 + $data['slide'] = $focus[0]['slide'];
  72 + $data['hotBrands'] = $focus[1]['hotBrands'];
73 //人气单品 一周热卖 73 //人气单品 一周热卖
74 $sort = ($sid == 1) ? '' : $sid; 74 $sort = ($sid == 1) ? '' : $sid;
75 $config = array( 75 $config = array(
@@ -203,6 +203,7 @@ class HotrankModel @@ -203,6 +203,7 @@ class HotrankModel
203 public static function getProductList($result, $page, $ajax = 0) 203 public static function getProductList($result, $page, $ajax = 0)
204 { 204 {
205 $product = array(); 205 $product = array();
  206 + $url = Helpers::url('/product/pro', '', 'item');
206 if (empty($result) || empty($result['data']) || empty($result['data']['product_list'])) { 207 if (empty($result) || empty($result['data']) || empty($result['data']['product_list'])) {
207 return $product; 208 return $product;
208 } 209 }
@@ -213,36 +214,35 @@ class HotrankModel @@ -213,36 +214,35 @@ class HotrankModel
213 if (empty($val['goods_list'])) { 214 if (empty($val['goods_list'])) {
214 continue; 215 continue;
215 } 216 }
216 - $defaultGoodsId = 0; 217 + //$defaultGoodsId = 0;
217 foreach ($val['goods_list'] as $v) { 218 foreach ($val['goods_list'] as $v) {
218 if ($v['is_default'] == 'Y') { 219 if ($v['is_default'] == 'Y') {
219 - $defaultGoodsId = $v['goods_id']; 220 + $defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
220 } 221 }
221 } 222 }
222 - if (empty($defaultGoodsId)) {  
223 - $defaultGoodsId = $val['goods_list'][0]['goods_id'];  
224 - }  
225 $product_id = empty($val['product_id']) ? '' : $val['product_id']; 223 $product_id = empty($val['product_id']) ? '' : $val['product_id'];
226 - $product['name'] = $val['product_name'];  
227 if ($key <= 9 && $page == 1 && $ajax == 0) { 224 if ($key <= 9 && $page == 1 && $ajax == 0) {
228 //人气单品 225 //人气单品
229 $product['rank'] = $key + 1; 226 $product['rank'] = $key + 1;
230 - $product['href'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html'; 227 + $product['title'] = $val['product_name'];
  228 + $product['href'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
231 $product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price']; 229 $product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
232 $product['sPrice'] = empty($val['sales_price']) ? '' : $val['sales_price']; 230 $product['sPrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
233 if ($key <= 5) { 231 if ($key <= 5) {
  232 + //6张大图
234 $product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2); 233 $product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
235 $popular['list'][] = $product; 234 $popular['list'][] = $product;
236 } 235 }
237 else { 236 else {
  237 + //4张小图
238 $product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2); 238 $product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
239 $popular['list'][] = $product; 239 $popular['list'][] = $product;
240 } 240 }
241 } 241 }
242 else { 242 else {
243 //一周热卖 243 //一周热卖
244 -// $product['url'] = 'http://item.yohobuy.com/product/pro_' . $product_id . '_' . $defaultGoodsId . '.html';  
245 - $product['url'] = Helpers::url('/product/pro',array('product_id' => $product_id,'defaultGoodsId'=> $defaultGoodsId),'item'); 244 + $product['name'] = $val['product_name'];
  245 + $product['url'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
246 $product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price']; 246 $product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? '' : $val['market_price'];
247 $product['salePrice'] = empty($val['sales_price']) ? '' : $val['sales_price']; 247 $product['salePrice'] = empty($val['sales_price']) ? '' : $val['sales_price'];
248 $product['rank'] = ''; 248 $product['rank'] = '';
1 <?php 1 <?php
  2 +
2 use Action\WebAction; 3 use Action\WebAction;
3 use LibModels\Web\Product\FavoriteData; 4 use LibModels\Web\Product\FavoriteData;
4 use Product\BrandsModel; 5 use Product\BrandsModel;
5 -  
6 use product\HotrankModel; 6 use product\HotrankModel;
7 7
8 class IndexController extends WebAction 8 class IndexController extends WebAction
9 { 9 {
  10 +
10 /** 11 /**
11 * 品牌首页 12 * 品牌首页
12 */ 13 */
@@ -60,7 +61,7 @@ class IndexController extends WebAction @@ -60,7 +61,7 @@ class IndexController extends WebAction
60 $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'); 61 $this->setDescription('潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜');
61 $this->setWebNavHeader(); 62 $this->setWebNavHeader();
62 //渲染模板 63 //渲染模板
63 - $this->_view->display('list',$data); 64 + $this->_view->display('list', $data);
64 } 65 }
65 66
66 //品牌介绍页 67 //品牌介绍页
@@ -105,7 +106,7 @@ class IndexController extends WebAction @@ -105,7 +106,7 @@ class IndexController extends WebAction
105 106
106 $this->setWebNavHeader(); 107 $this->setWebNavHeader();
107 //渲染模板 108 //渲染模板
108 - $this->_view->display('list',$data); 109 + $this->_view->display('list', $data);
109 } 110 }
110 111
111 //收藏品牌 112 //收藏品牌
@@ -120,7 +121,7 @@ class IndexController extends WebAction @@ -120,7 +121,7 @@ class IndexController extends WebAction
120 ); 121 );
121 $uid = $this->getUid(); 122 $uid = $this->getUid();
122 $brandId = $this->post('brandId'); 123 $brandId = $this->post('brandId');
123 - do{ 124 + do {
124 if (!$uid) { 125 if (!$uid) {
125 $result = array( 126 $result = array(
126 'code' => 403, 127 'code' => 403,
@@ -133,7 +134,8 @@ class IndexController extends WebAction @@ -133,7 +134,8 @@ class IndexController extends WebAction
133 $result = FavoriteData::changeFavoriteBrand($uid, $brandId); 134 $result = FavoriteData::changeFavoriteBrand($uid, $brandId);
134 break; 135 break;
135 } 136 }
136 - }while(false); 137 + }
  138 + while (false);
137 139
138 $this->echoJson($result); 140 $this->echoJson($result);
139 } 141 }
@@ -146,28 +148,29 @@ class IndexController extends WebAction @@ -146,28 +148,29 @@ class IndexController extends WebAction
146 //获取频道 148 //获取频道
147 $channel = HotrankModel::getChannelResource(); 149 $channel = HotrankModel::getChannelResource();
148 $this->setWebNavHeader($channel['channel']); 150 $this->setWebNavHeader($channel['channel']);
149 - $page = $this->get('page',1);  
150 - $sort = $this->get('sid',1);  
151 - $data = array( 'hotrankPage' => true,  
152 - 'footerTop'=> true, 151 + $page = $this->get('page', 1);
  152 + $sort = $this->get('sid', 1);
  153 + $data = array('hotrankPage' => true,
  154 + 'footerTop' => true,
153 'hotrank' => HotrankModel::getHotrankResource($channel, $sort, $page) 155 'hotrank' => HotrankModel::getHotrankResource($channel, $sort, $page)
154 ); 156 );
  157 +
155 $this->_view->display('hotrank', $data); 158 $this->_view->display('hotrank', $data);
156 } 159 }
157 160
158 /* 161 /*
159 * 一周热卖加载更多 162 * 一周热卖加载更多
160 */ 163 */
  164 +
161 public function getdataAction() 165 public function getdataAction()
162 { 166 {
163 - $page = $this->get('page',1); 167 + $page = $this->get('page', 1);
164 //加载到100个以后停止 168 //加载到100个以后停止
165 - if($page > 2)  
166 - {  
167 - echo json_encode(array('code'=>201,'data'=>'')); 169 + if ($page > 2) {
  170 + echo json_encode(array('code' => 201, 'data' => ''));
168 exit; 171 exit;
169 } 172 }
170 - $sid = $this->get('sid',1); 173 + $sid = $this->get('sid', 1);
171 //获取频道资源 174 //获取频道资源
172 $channel = HotrankModel::getChannelResource(); 175 $channel = HotrankModel::getChannelResource();
173 //获取一周热卖资源 176 //获取一周热卖资源
@@ -175,4 +178,5 @@ class IndexController extends WebAction @@ -175,4 +178,5 @@ class IndexController extends WebAction
175 echo json_encode($data); 178 echo json_encode($data);
176 exit; 179 exit;
177 } 180 }
  181 +
178 } 182 }