Authored by hf

do plusstar list and detail page

@@ -38,11 +38,11 @@ class Helpers @@ -38,11 +38,11 @@ class Helpers
38 if (intval($productData['market_price']) === intval($productData['sales_price'])) { 38 if (intval($productData['market_price']) === intval($productData['sales_price'])) {
39 $productData['market_price'] = ''; 39 $productData['market_price'] = '';
40 } 40 }
41 - 41 +
42 $result = array(); 42 $result = array();
43 $result['id'] = $productData['product_skn']; 43 $result['id'] = $productData['product_skn'];
44 $result['product_id'] = $productData['product_id']; 44 $result['product_id'] = $productData['product_id'];
45 - $result['thumb'] = $productData['default_images']; 45 + $result['thumb'] = Helpers::getImageUrl($productData['default_images'], 235, 314);
46 $result['name'] = $productData['product_name']; 46 $result['name'] = $productData['product_name'];
47 $result['price'] = $productData['market_price']; 47 $result['price'] = $productData['market_price'];
48 $result['salePrice'] = $productData['sales_price']; 48 $result['salePrice'] = $productData['sales_price'];
@@ -17,7 +17,7 @@ class PlusstarController extends AbstractAction @@ -17,7 +17,7 @@ class PlusstarController extends AbstractAction
17 */ 17 */
18 public function listAction() 18 public function listAction()
19 { 19 {
20 - $data = array('ps' => array('star' => array(), 'plus' => array())); 20 + $data = array('psList' => true, 'ps' => array('star' => array(), 'plus' => array()));
21 21
22 $brandList = array(); 22 $brandList = array();
23 $build = array(); 23 $build = array();
@@ -108,22 +108,48 @@ class PlusstarController extends AbstractAction @@ -108,22 +108,48 @@ class PlusstarController extends AbstractAction
108 } 108 }
109 109
110 /* 判断品牌信息是否为空 */ 110 /* 判断品牌信息是否为空 */
111 - $brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid); var_dump($brandInfo); exit; 111 + $brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid);
112 if (empty($brandInfo['getBrandInfo']['brand_id'])) { 112 if (empty($brandInfo['getBrandInfo']['brand_id'])) {
113 break; 113 break;
114 } 114 }
115 115
116 - $data['id'] = $brandInfo['getBrandInfo']['brand_id'];  
117 - $data['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['cover_img'], 640, 309);  
118 - $data['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['brand_ico'], 160, 160);  
119 - $data['name'] = $brandInfo['getBrandInfo']['name'];  
120 - $data['isLike'] = $brandInfo['getUidBrandFav'];  
121 - $data['likeUrl'] = "http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}";  
122 - $data['intro'] = empty($brandInfo['brand_intro']) ? '' : strip_tags($brandInfo['brand_intro']);  
123 - $data['newArrival'] = array();  
124 - $data['newArrival']['moreUrl'] = ''; // @todo  
125 - $data['newArrival']['naList'] = $brandInfo['getNewProduct'];  
126 - $data['infos'] = array(); 116 + $data['psDetail'] = true;
  117 + $data['ps']['id'] = $brandInfo['getBrandInfo']['brand_id'];
  118 + $data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['cover_img'], 640, 309);
  119 + $data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['brand_ico'], 160, 160);
  120 + $data['ps']['name'] = $brandInfo['getBrandInfo']['brand_name'];
  121 + $data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
  122 + $data['ps']['likeUrl'] = "http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}";
  123 + $data['ps']['intro'] = empty($brandInfo['brand_intro']) ? '' : strip_tags($brandInfo['brand_intro']);
  124 + $data['ps']['newArrival'] = array();
  125 + $data['ps']['newArrival']['moreUrl'] = ''; // @todo
  126 + $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
  127 + $data['ps']['infos'] = array();
  128 +
  129 + if (empty($brandInfo['getArticleByBrand'])) {
  130 + break;
  131 + }
  132 +
  133 + // 相关文章
  134 + $build = array();
  135 + foreach ($brandInfo['getArticleByBrand'] as $value) {
  136 + $build = array();
  137 + $build['id'] = $value['id'];
  138 + $build['showTags'] = false; // 不显示标签
  139 + $build['img'] = Helpers::getImageUrl($value['src'], 640, 640, $value['cover_image_type']);
  140 + $build['url'] = $value['url']; // @todo
  141 + $build['title'] = $value['title'];
  142 + $build['text'] = $value['intro'];
  143 + $build['publishTime'] = $value['publish_time'];
  144 + $build['pageView'] = $value['views_num'];
  145 + $build['like'] = array();
  146 + $build['like']['isLiked'] = $value['like']['isLiked'];
  147 + $build['like']['count'] = $value['like']['count'];
  148 + $build['share'] = ''; //分享链接
  149 + $build['author'] = false; // 作者信息(接口暂未上线)
  150 +
  151 + $data['ps']['infos'][] = $build;
  152 + }
127 153
128 $brandInfo = array(); 154 $brandInfo = array();
129 155