Authored by Rock Zhang

收藏页添加一些字段标识页面

@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 {{product_favorite_total}} 15 {{product_favorite_total}}
16 <p>收藏的商品</p> 16 <p>收藏的商品</p>
17 </a> 17 </a>
18 - <a class="link-item" href="/home/favoritebrand"> 18 + <a class="link-item" href="/home/favorite?tab=brand">
19 {{brand_favorite_total}} 19 {{brand_favorite_total}}
20 <p>收藏的品牌</p> 20 <p>收藏的品牌</p>
21 </a> 21 </a>
@@ -68,20 +68,26 @@ class HomeController extends AbstractAction @@ -68,20 +68,26 @@ class HomeController extends AbstractAction
68 $this->setTitle('我的收藏'); 68 $this->setTitle('我的收藏');
69 $this->setNavHeader('我的收藏', true, SITE_MAIN); 69 $this->setNavHeader('我的收藏', true, SITE_MAIN);
70 70
  71 + $tab = $this->get('tab', '');
71 $uid = $this->getUid(); 72 $uid = $this->getUid();
72 $uid = 8826435; 73 $uid = 8826435;
73 $gender = Helpers::getGenderByCookie(); 74 $gender = Helpers::getGenderByCookie();
74 75
75 $favProducts = \Index\UserModel::getFavProductData($uid); 76 $favProducts = \Index\UserModel::getFavProductData($uid);
76 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender); 77 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
77 -  
78 - $this->_view->display('favorite', array(  
79 - 'favPage' => true, //加载js  
80 - 'pageFooter' => true,  
81 - 'favorite' => true,  
82 - 'hasFavProduct' => $favProducts,  
83 - 'hasFavBrand' => $favBrands  
84 - )); 78 + $data = array(
  79 + 'favPage' => true, //加载js
  80 + 'pageFooter' => true,
  81 + 'favorite' => true,
  82 + 'hasFavProduct' => $favProducts,
  83 + 'hasFavBrand' => $favBrands
  84 + );
  85 + // 判断时候为品牌页
  86 + if ($tab === 'brand') {
  87 + $data['brandTab'] = true;
  88 + }
  89 +
  90 + $this->_view->display('favorite', $data);
85 } 91 }
86 92
87 /** 93 /**
@@ -106,19 +112,6 @@ class HomeController extends AbstractAction @@ -106,19 +112,6 @@ class HomeController extends AbstractAction
106 } 112 }
107 113
108 /** 114 /**
109 - * 用户收藏的品牌  
110 - */  
111 - public function favoritebrandAction()  
112 - {  
113 - $uid = $this->getUid();  
114 - $gender = Helpers::getGenderByCookie();  
115 -  
116 - $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);  
117 -  
118 - print_r($favBrands);  
119 - }  
120 -  
121 - /**  
122 * 个人信息 115 * 个人信息
123 */ 116 */
124 public function personalDetailsAction() 117 public function personalDetailsAction()