Authored by Rock Zhang

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

@@ -36,13 +36,13 @@ class Helpers @@ -36,13 +36,13 @@ class Helpers
36 36
37 // 市场价和售价一样,则不显示市场价 37 // 市场价和售价一样,则不显示市场价
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'] = false;
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'];
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 seajs.config({ 4 seajs.config({
5 base: 'http://172.16.6.248:8000' 5 base: 'http://172.16.6.248:8000'
6 }); 6 });
7 - seajs.use('js/{{modulePath}}');  
8 </script> 7 </script>
  8 +{{> layout/use}}
9 </body> 9 </body>
10 </html> 10 </html>
  1 +
  2 +{{#if psList}}
  3 + <script>
  4 + seajs.use('js/guang/plus-star/list');
  5 + </script>
  6 +{{else if psDetail}}
  7 + <script>
  8 + seajs.use('js/guang/plus-star/detail');
  9 + </script>
  10 +{{/if}}
@@ -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&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";  
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&amp;openby:yohobuy={&quot;action&quot;:&quot;go.weblogin&quot;,&quot;params&quot;:{&quot;jumpurl&quot;:{&quot;url&quot;:&quot;http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo&quot;,&quot;param&quot;:{&quot;id&quot;:285}},&quot;requesturl&quot;:{&quot;url&quot;:&quot;\/guang\/api\/v1\/favorite\/togglebrand&quot;,&quot;param&quot;:{&quot;brand_id&quot;:&quot;701&quot;}},&quot;priority&quot;:&quot;Y&quot;}}";
  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