Authored by hf

do debug call product detail page api

@@ -29,7 +29,7 @@ class DetailData @@ -29,7 +29,7 @@ class DetailData
29 */ 29 */
30 public static function baseInfo($productId, $uid) 30 public static function baseInfo($productId, $uid)
31 { 31 {
32 - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('param' => $productId, 'userId' => $uid) ); 32 + return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('param' => intval($productId), 'userId' => intval($uid)) );
33 } 33 }
34 34
35 /** 35 /**
@@ -40,7 +40,7 @@ class DetailData @@ -40,7 +40,7 @@ class DetailData
40 */ 40 */
41 public static function sizeInfo($productSkn) 41 public static function sizeInfo($productSkn)
42 { 42 {
43 - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => $productSkn) ); 43 + return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn) ) );
44 } 44 }
45 45
46 } 46 }
@@ -87,8 +87,6 @@ @@ -87,8 +87,6 @@
87 87
88 <div class="gap-block"></div> 88 <div class="gap-block"></div>
89 89
90 - {{> product/product_description}}  
91 -  
92 {{#cartInfo}} 90 {{#cartInfo}}
93 <div class="cart-bar"> 91 <div class="cart-bar">
94 <span class="num-tag">{{numInCart}}</span> 92 <span class="num-tag">{{numInCart}}</span>
@@ -20,20 +20,20 @@ class HomeController extends AbstractAction @@ -20,20 +20,20 @@ class HomeController extends AbstractAction
20 20
21 protected $_uid; 21 protected $_uid;
22 22
23 -// /**  
24 -// * 初始化  
25 -// */  
26 -// public function init()  
27 -// {  
28 -// // 检查用户是否登录, 未登录则跳转到登录页  
29 -// $uid = $this->getUid(true);  
30 -// $action = $this->getRequest()->getActionName();  
31 -// if (!$uid && $action !== 'index') {  
32 -// $this->go(Helpers::url('/signin.html'));  
33 -// }  
34 -//  
35 -// parent::init();  
36 -// } 23 + /**
  24 + * 初始化
  25 + */
  26 + public function init()
  27 + {
  28 + // 检查用户是否登录, 未登录则跳转到登录页
  29 + $uid = 8826435; //$this->getUid(true);
  30 + $action = $this->getRequest()->getActionName();
  31 + if (!$uid && $action !== 'index') {
  32 + $this->go(Helpers::url('/signin.html'));
  33 + }
  34 +
  35 + parent::init();
  36 + }
37 37
38 /** 38 /**
39 * 个人中心入口 39 * 个人中心入口
@@ -44,21 +44,20 @@ class HomeController extends AbstractAction @@ -44,21 +44,20 @@ class HomeController extends AbstractAction
44 $this->setTitle('个人中心'); 44 $this->setTitle('个人中心');
45 $this->setNavHeader('个人中心'); 45 $this->setNavHeader('个人中心');
46 46
47 - $data = array(  
48 - 'myIndexPage' => true,  
49 - 'pageFooter' => true  
50 - ); 47 + $data = array(
  48 + 'myIndexPage' => true,
  49 + 'pageFooter' => true
  50 + );
51 $uid = $this->getUid(); 51 $uid = $this->getUid();
52 - if ($uid) {  
53 - $data['isLogin'] = true;  
54 - $uid = 8826435;  
55 - $data += \Index\UserModel::getUserProfileData($uid);  
56 - $data += \Index\UserModel::getInfoNumData($uid);  
57 -  
58 - // 优选新品数据  
59 - $channel = Helpers::getChannelByCookie();  
60 - $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);  
61 - } 52 + if ($uid) {
  53 + $data['isLogin'] = true;
  54 + $data += \Index\UserModel::getUserProfileData($uid);
  55 + $data += \Index\UserModel::getInfoNumData($uid);
  56 +
  57 + // 优选新品数据
  58 + $channel = Helpers::getChannelByCookie();
  59 + $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
  60 + }
62 61
63 $this->_view->display('index', $data); 62 $this->_view->display('index', $data);
64 } 63 }
@@ -74,23 +73,22 @@ class HomeController extends AbstractAction @@ -74,23 +73,22 @@ class HomeController extends AbstractAction
74 73
75 $tab = $this->get('tab', ''); 74 $tab = $this->get('tab', '');
76 $uid = $this->getUid(); 75 $uid = $this->getUid();
77 - $uid = 8826435;  
78 $gender = Helpers::getGenderByCookie(); 76 $gender = Helpers::getGenderByCookie();
79 77
80 $favProducts = \Index\UserModel::getFavProductData($uid); 78 $favProducts = \Index\UserModel::getFavProductData($uid);
81 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender); 79 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
82 80
83 - $data = array(  
84 - 'favPage' => true, //加载js  
85 - 'pageFooter' => true,  
86 - 'favorite' => true,  
87 - 'hasFavProduct' => $favProducts,  
88 - 'hasFavBrand' => $favBrands  
89 - );  
90 - // 判断是否为品牌收藏页  
91 - if ($tab === 'brand') {  
92 - $data['brandTab'] = true;  
93 - } 81 + $data = array(
  82 + 'favPage' => true, //加载js
  83 + 'pageFooter' => true,
  84 + 'favorite' => true,
  85 + 'hasFavProduct' => $favProducts,
  86 + 'hasFavBrand' => $favBrands
  87 + );
  88 + // 判断是否为品牌收藏页
  89 + if ($tab === 'brand') {
  90 + $data['brandTab'] = true;
  91 + }
94 92
95 $this->_view->display('favorite', $data); 93 $this->_view->display('favorite', $data);
96 } 94 }
@@ -102,20 +100,16 @@ class HomeController extends AbstractAction @@ -102,20 +100,16 @@ class HomeController extends AbstractAction
102 { 100 {
103 $result = array(); 101 $result = array();
104 102
105 - if ($this->isAjax())  
106 - { 103 + if ($this->isAjax()) {
107 $uid = $this->getUid(); 104 $uid = $this->getUid();
108 $fav_id = $this->post('fav_id', 0); 105 $fav_id = $this->post('fav_id', 0);
109 106
110 $result = \Index\UserModel::favoriteDelete($uid, $fav_id); 107 $result = \Index\UserModel::favoriteDelete($uid, $fav_id);
111 } 108 }
112 109
113 - if (empty($result))  
114 - { 110 + if (empty($result)) {
115 echo ' '; 111 echo ' ';
116 - }  
117 - else  
118 - { 112 + } else {
119 $this->echoJson($result); 113 $this->echoJson($result);
120 } 114 }
121 } 115 }
@@ -128,8 +122,7 @@ class HomeController extends AbstractAction @@ -128,8 +122,7 @@ class HomeController extends AbstractAction
128 $this->setTitle('个人信息'); 122 $this->setTitle('个人信息');
129 $this->setNavHeader('个人信息', true, SITE_MAIN); 123 $this->setNavHeader('个人信息', true, SITE_MAIN);
130 124
131 - // $uid = $this->getUid();  
132 - $uid = 967016; 125 + $uid = $this->getUid();
133 $data = \Index\UserModel::getUserProfileData($uid); 126 $data = \Index\UserModel::getUserProfileData($uid);
134 $data['personalDetailsPage'] = true; 127 $data['personalDetailsPage'] = true;
135 $data['pageFooter'] = true; 128 $data['pageFooter'] = true;
@@ -144,8 +137,7 @@ class HomeController extends AbstractAction @@ -144,8 +137,7 @@ class HomeController extends AbstractAction
144 $this->setTitle('YOHO币'); 137 $this->setTitle('YOHO币');
145 $this->setNavHeader('YOHO币', true, false); 138 $this->setNavHeader('YOHO币', true, false);
146 139
147 - // $uid = $this->getUid();  
148 - $uid = 8826435; 140 + $uid = $this->getUid();
149 $currency = \Index\UserModel::getYohoCoinData($uid); 141 $currency = \Index\UserModel::getYohoCoinData($uid);
150 142
151 $currency['pageFooter'] = true; 143 $currency['pageFooter'] = true;
@@ -159,9 +151,8 @@ class HomeController extends AbstractAction @@ -159,9 +151,8 @@ class HomeController extends AbstractAction
159 { 151 {
160 152
161 $this->setTitle('优惠券'); 153 $this->setTitle('优惠券');
162 - $this->setNavHeader('优惠券', true, SITE_MAIN);  
163 - // $uid = $this->getUid();  
164 - $uid = 8826435; 154 + $this->setNavHeader('优惠券');
  155 + $uid = $this->getUid();
165 $status = $this->get('status', 0); 156 $status = $this->get('status', 0);
166 $coupons = array( 157 $coupons = array(
167 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), 158 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
@@ -175,11 +166,10 @@ class HomeController extends AbstractAction @@ -175,11 +166,10 @@ class HomeController extends AbstractAction
175 */ 166 */
176 public function messageAction() 167 public function messageAction()
177 { 168 {
178 - // $uid = $this->getUid(); 169 + $uid = $this->getUid();
179 $page = $this->get('page', 0); 170 $page = $this->get('page', 0);
180 $size = $this->get('size', 10); 171 $size = $this->get('size', 10);
181 172
182 - $uid = 8826435;  
183 $messages = \Index\UserModel::getMessageData($uid, $page, $size); 173 $messages = \Index\UserModel::getMessageData($uid, $page, $size);
184 174
185 print_r($messages); 175 print_r($messages);
@@ -192,16 +182,12 @@ class HomeController extends AbstractAction @@ -192,16 +182,12 @@ class HomeController extends AbstractAction
192 { 182 {
193 // 设置网站标题 183 // 设置网站标题
194 $this->setTitle('地址管理'); 184 $this->setTitle('地址管理');
195 - $this->setNavHeader('地址管理', true, SITE_MAIN);  
196 -  
197 - // $uid = $this->getUid();  
198 - $uid = 8826435; 185 + $this->setNavHeader('地址管理');
199 186
  187 + $uid = $this->getUid();
200 $address = \Index\UserModel::getAddressData($uid); 188 $address = \Index\UserModel::getAddressData($uid);
201 $addressList = \Index\UserModel::getAddressListData($uid); 189 $addressList = \Index\UserModel::getAddressListData($uid);
202 190
203 - // print_r($addressList);  
204 -  
205 $this->_view->display('address', array( 191 $this->_view->display('address', array(
206 'addressPage' => true, 192 'addressPage' => true,
207 'pageFooter' => true, 193 'pageFooter' => true,
@@ -217,10 +203,8 @@ class HomeController extends AbstractAction @@ -217,10 +203,8 @@ class HomeController extends AbstractAction
217 { 203 {
218 $result = array(); 204 $result = array();
219 205
220 - if ($this->isAjax())  
221 - {  
222 - // $uid = $this->getUid();  
223 - $uid = 8826435; 206 + if ($this->isAjax()) {
  207 + $uid = $this->getUid();
224 $address = $this->post('address', ''); 208 $address = $this->post('address', '');
225 $area_code = $this->post('area_code', ''); 209 $area_code = $this->post('area_code', '');
226 $consignee = $this->post('consignee', ''); 210 $consignee = $this->post('consignee', '');
@@ -232,12 +216,9 @@ class HomeController extends AbstractAction @@ -232,12 +216,9 @@ class HomeController extends AbstractAction
232 $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code); 216 $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
233 } 217 }
234 218
235 - if (empty($result))  
236 - { 219 + if (empty($result)) {
237 echo ' '; 220 echo ' ';
238 - }  
239 - else  
240 - { 221 + } else {
241 $this->echoJson($result); 222 $this->echoJson($result);
242 } 223 }
243 } 224 }
@@ -249,21 +230,15 @@ class HomeController extends AbstractAction @@ -249,21 +230,15 @@ class HomeController extends AbstractAction
249 { 230 {
250 $result = array(); 231 $result = array();
251 232
252 - if ($this->isAjax())  
253 - {  
254 - // $uid = $this->getUid();  
255 - $uid = 8826435; 233 + if ($this->isAjax()) {
  234 + $uid = $this->getUid();
256 $id = $this->post('id', ''); 235 $id = $this->post('id', '');
257 -  
258 $result = \Index\UserModel::setDefaultAddress($uid, $id); 236 $result = \Index\UserModel::setDefaultAddress($uid, $id);
259 } 237 }
260 238
261 - if (empty($result))  
262 - { 239 + if (empty($result)) {
263 echo ' '; 240 echo ' ';
264 - }  
265 - else  
266 - { 241 + } else {
267 $this->echoJson($result); 242 $this->echoJson($result);
268 } 243 }
269 } 244 }
@@ -275,21 +250,16 @@ class HomeController extends AbstractAction @@ -275,21 +250,16 @@ class HomeController extends AbstractAction
275 { 250 {
276 $result = array(); 251 $result = array();
277 252
278 - if ($this->isAjax())  
279 - {  
280 - // $uid = $this->getUid();  
281 - $uid = 8826435; 253 + if ($this->isAjax()) {
  254 + $uid = $this->getUid();
282 $id = $this->post('id', ''); 255 $id = $this->post('id', '');
283 256
284 $result = \Index\UserModel::deleteAddress($uid, $id); 257 $result = \Index\UserModel::deleteAddress($uid, $id);
285 } 258 }
286 259
287 - if (empty($result))  
288 - { 260 + if (empty($result)) {
289 echo ' '; 261 echo ' ';
290 - }  
291 - else  
292 - { 262 + } else {
293 $this->echoJson($result); 263 $this->echoJson($result);
294 } 264 }
295 } 265 }
@@ -316,8 +286,7 @@ class HomeController extends AbstractAction @@ -316,8 +286,7 @@ class HomeController extends AbstractAction
316 $service = array(); 286 $service = array();
317 $cateId = $this->get('cateId', 0); 287 $cateId = $this->get('cateId', 0);
318 $cateName = $this->get('cateName', ''); 288 $cateName = $this->get('cateName', '');
319 - if ($cateId > 0)  
320 - { 289 + if ($cateId > 0) {
321 $service = home\OnlineModel::getOnlineServiceDetail($cateId); 290 $service = home\OnlineModel::getOnlineServiceDetail($cateId);
322 } 291 }
323 $this->setTitle('在线客服'); 292 $this->setTitle('在线客服');
@@ -333,25 +302,19 @@ class HomeController extends AbstractAction @@ -333,25 +302,19 @@ class HomeController extends AbstractAction
333 $page = $this->get('page', 1); 302 $page = $this->get('page', 1);
334 $limit = $this->get('limit', 10); 303 $limit = $this->get('limit', 10);
335 $uid = $this->getUid(); 304 $uid = $this->getUid();
336 - $uid=5687179;  
337 $gender = Helpers::getGenderByCookie(); 305 $gender = Helpers::getGenderByCookie();
338 $yh_channel = Helpers::getChannelByCookie(); 306 $yh_channel = Helpers::getChannelByCookie();
339 $guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit); 307 $guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
340 $totalPage = $guangInfo['totalPage']; 308 $totalPage = $guangInfo['totalPage'];
341 unset($guangInfo['totalPage']); 309 unset($guangInfo['totalPage']);
342 - if ($page == 1)  
343 - { 310 + if ($page == 1) {
344 $this->setTitle('我收藏的'); 311 $this->setTitle('我收藏的');
345 $this->setNavHeader('我收藏的', true, ''); 312 $this->setNavHeader('我收藏的', true, '');
346 $this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true)); 313 $this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
347 - }  
348 - else if ($page > 1 && $page<=$totalPage)  
349 - { 314 + } else if ($page > 1 && $page <= $totalPage) {
350 $this->_view->display('my-guang-partial', array('infos' => $guangInfo)); 315 $this->_view->display('my-guang-partial', array('infos' => $guangInfo));
351 - }  
352 - else if ($page > 1 && $page>$totalPage)  
353 - {  
354 - echo ' ';//退出循环 316 + } else if ($page > 1 && $page > $totalPage) {
  317 + echo ' '; //退出循环
355 } 318 }
356 } 319 }
357 320
@@ -383,7 +346,6 @@ class HomeController extends AbstractAction @@ -383,7 +346,6 @@ class HomeController extends AbstractAction
383 */ 346 */
384 public function suggestSubAction() 347 public function suggestSubAction()
385 { 348 {
386 -  
387 // 设置网站标题 349 // 设置网站标题
388 $this->setTitle('反馈问题'); 350 $this->setTitle('反馈问题');
389 351
@@ -417,8 +379,7 @@ class HomeController extends AbstractAction @@ -417,8 +379,7 @@ class HomeController extends AbstractAction
417 */ 379 */
418 public function savesuggestAction() 380 public function savesuggestAction()
419 { 381 {
420 - if ($this->isAjax())  
421 - { 382 + if ($this->isAjax()) {
422 $uid = $this->getUid(); 383 $uid = $this->getUid();
423 $content = $this->post('content', ''); 384 $content = $this->post('content', '');
424 $suggest_type = $this->post('suggest_type', 2); 385 $suggest_type = $this->post('suggest_type', 2);
@@ -433,12 +394,11 @@ class HomeController extends AbstractAction @@ -433,12 +394,11 @@ class HomeController extends AbstractAction
433 */ 394 */
434 public function upAndDownAction() 395 public function upAndDownAction()
435 { 396 {
436 - if ($this->isAjax())  
437 - {  
438 - $uid = $this->getUid();  
439 - $udid = $this->getUdid();  
440 - $suggest_id = $this->post('suggest_id', 0);  
441 - $result = \Index\UserModel::upAndDown($uid, $udid, $suggest_id); 397 + if ($this->isAjax()) {
  398 + $uid = $this->getUid();
  399 + $udid = $this->getUdid();
  400 + $suggest_id = $this->post('suggest_id', 0);
  401 + $result = \Index\UserModel::upAndDown($uid, $udid, $suggest_id);
442 402
443 $this->echoJson($result); 403 $this->echoJson($result);
444 } 404 }
@@ -457,7 +417,6 @@ class HomeController extends AbstractAction @@ -457,7 +417,6 @@ class HomeController extends AbstractAction
457 $gender = Helpers::getGenderByCookie(); 417 $gender = Helpers::getGenderByCookie();
458 $channel = Helpers::getChannelByCookie(); 418 $channel = Helpers::getChannelByCookie();
459 $uid = $this->getUid(); 419 $uid = $this->getUid();
460 - $uid = '10267443'; //临时测试用  
461 $data = GradeModel::getGrade($gender, $channel, $uid); 420 $data = GradeModel::getGrade($gender, $channel, $uid);
462 $data['pageFooter'] = true; 421 $data['pageFooter'] = true;
463 $this->_view->display('vip-grade', $data); 422 $this->_view->display('vip-grade', $data);
@@ -492,12 +451,9 @@ class HomeController extends AbstractAction @@ -492,12 +451,9 @@ class HomeController extends AbstractAction
492 $this->setTitle('我的订单'); 451 $this->setTitle('我的订单');
493 $this->setNavHeader('我的订单'); 452 $this->setNavHeader('我的订单');
494 $data = OrderModel::getNavs($type); 453 $data = OrderModel::getNavs($type);
495 - if (!empty($data))  
496 - { 454 + if (!empty($data)) {
497 $order['navs'] = $data; 455 $order['navs'] = $data;
498 - }  
499 - else  
500 - { 456 + } else {
501 $this->error(); 457 $this->error();
502 } 458 }
503 //渲染模板 459 //渲染模板
@@ -512,8 +468,7 @@ class HomeController extends AbstractAction @@ -512,8 +468,7 @@ class HomeController extends AbstractAction
512 public function getOrdersAction() 468 public function getOrdersAction()
513 { 469 {
514 //判断是不是ajax请求 470 //判断是不是ajax请求
515 - if (!$this->isAjax())  
516 - { 471 + if (!$this->isAjax()) {
517 $this->error(); 472 $this->error();
518 } 473 }
519 //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 474 //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
@@ -523,7 +478,6 @@ class HomeController extends AbstractAction @@ -523,7 +478,6 @@ class HomeController extends AbstractAction
523 $gender = Helpers::getGenderByCookie(); 478 $gender = Helpers::getGenderByCookie();
524 $yh_channel = $this->get('yh_channel', 1); 479 $yh_channel = $this->get('yh_channel', 1);
525 $uid = $this->getUid(); 480 $uid = $this->getUid();
526 - $uid = '10267443'; //测试用  
527 //调用模型层getOrder方法获得并处理数据 481 //调用模型层getOrder方法获得并处理数据
528 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); 482 $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
529 /* 如果取不到订单数据时,分两种情况: 483 /* 如果取不到订单数据时,分两种情况:
@@ -531,18 +485,12 @@ class HomeController extends AbstractAction @@ -531,18 +485,12 @@ class HomeController extends AbstractAction
531 2、page=1时,就给一个随便逛逛的链接。 485 2、page=1时,就给一个随便逛逛的链接。
532 * */ 486 * */
533 $order = array(); 487 $order = array();
534 - if (!empty($data))  
535 - { 488 + if (!empty($data)) {
536 $order['orders'] = $data; 489 $order['orders'] = $data;
537 - }  
538 - else  
539 - {  
540 - if ($page > 1)  
541 - { 490 + } else {
  491 + if ($page > 1) {
542 echo " "; 492 echo " ";
543 - }  
544 - elseif ($page == 1)  
545 - { 493 + } elseif ($page == 1) {
546 $order['walkwayUrl'] = self::strollAction(); 494 $order['walkwayUrl'] = self::strollAction();
547 } 495 }
548 } 496 }
@@ -558,14 +506,12 @@ class HomeController extends AbstractAction @@ -558,14 +506,12 @@ class HomeController extends AbstractAction
558 { 506 {
559 507
560 //判断是不是ajax请求 508 //判断是不是ajax请求
561 - if (!$this->isAjax())  
562 - { 509 + if (!$this->isAjax()) {
563 $this->error(); 510 $this->error();
564 } 511 }
565 //传入order_code和uid以取消订单 512 //传入order_code和uid以取消订单
566 $order_code = $this->get('id'); 513 $order_code = $this->get('id');
567 $uid = $this->getUid(); 514 $uid = $this->getUid();
568 - $uid = '10267443'; //测试用  
569 $gender = Helpers::getGenderByCookie(); 515 $gender = Helpers::getGenderByCookie();
570 $yh_channel = $this->get('yh_channel', 1); 516 $yh_channel = $this->get('yh_channel', 1);
571 $method = 'app.SpaceOrders.close'; 517 $method = 'app.SpaceOrders.close';
@@ -582,14 +528,12 @@ class HomeController extends AbstractAction @@ -582,14 +528,12 @@ class HomeController extends AbstractAction
582 public function delOrderAction() 528 public function delOrderAction()
583 { 529 {
584 //判断是不是ajax请求 530 //判断是不是ajax请求
585 - if (!$this->isAjax())  
586 - { 531 + if (!$this->isAjax()) {
587 $this->error(); 532 $this->error();
588 } 533 }
589 //传入order_code和uid以删除订单 534 //传入order_code和uid以删除订单
590 $order_code = $this->get('id'); 535 $order_code = $this->get('id');
591 $uid = $this->getUid(); 536 $uid = $this->getUid();
592 - $uid = '10267443'; //测试用  
593 $gender = Helpers::getGenderByCookie(); 537 $gender = Helpers::getGenderByCookie();
594 $yh_channel = $this->get('yh_channel', 1); 538 $yh_channel = $this->get('yh_channel', 1);
595 $method = 'app.SpaceOrders.delOrderByCode'; 539 $method = 'app.SpaceOrders.delOrderByCode';
@@ -31,7 +31,7 @@ class DetailModel @@ -31,7 +31,7 @@ class DetailModel
31 31
32 if (is_numeric($productId) && is_numeric($goodsId)) { 32 if (is_numeric($productId) && is_numeric($goodsId)) {
33 // 调用服务 33 // 调用服务
34 - $baseInfo = DetailData::baseInfo($productId, $uid); 34 + $baseInfo = DetailData::baseInfo($productId, $uid);
35 35
36 // 商品名称 36 // 商品名称
37 if (isset($baseInfo['productName'])) { 37 if (isset($baseInfo['productName'])) {
@@ -161,16 +161,14 @@ class DetailModel @@ -161,16 +161,14 @@ class DetailModel
161 } 161 }
162 } 162 }
163 163
164 - // 调用尺码需要的SKN号  
165 - if (isset($baseInfo['erpProductId'])) {  
166 - $result['skn'] = $baseInfo['erpProductId'];  
167 - }  
168 -  
169 - // 底部悬浮的购物车信息 164 + // 悬浮的购物车信息
170 $result['cartInfo'] = array( 165 $result['cartInfo'] = array(
171 'numInCart' => 0, 166 'numInCart' => 0,
172 'goodsInstore' => $baseInfo['storage'], 167 'goodsInstore' => $baseInfo['storage'],
173 ); 168 );
  169 +
  170 + // 底部简介的URL链接
  171 + $result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html');
174 } 172 }
175 173
176 return $result; 174 return $result;
@@ -188,7 +186,7 @@ class DetailModel @@ -188,7 +186,7 @@ class DetailModel
188 186
189 if (is_numeric($productSkn)) { 187 if (is_numeric($productSkn)) {
190 // 调用服务 188 // 调用服务
191 - $sizeInfo = DetailData::sizeInfo($productSkn); 189 + $sizeInfo = DetailData::sizeInfo($productSkn);
192 190
193 // 商品信息 191 // 商品信息
194 if (isset($sizeInfo['productDescBo']['erpProductId'])) { 192 if (isset($sizeInfo['productDescBo']['erpProductId'])) {
@@ -206,11 +204,8 @@ class DetailModel @@ -206,11 +204,8 @@ class DetailModel
206 $result['goodsDescription']['detail'][] = $value['standardName'] . ':' . $value['standardVal']; 204 $result['goodsDescription']['detail'][] = $value['standardName'] . ':' . $value['standardVal'];
207 } 205 }
208 } 206 }
209 - if (isset($sizeInfo['productIntroBo']['productIntro'])) {  
210 - $productIntro = strstr($sizeInfo['productIntroBo']['productIntro'], '<br />', true);  
211 - if ($productIntro) {  
212 - $result['goodsDescription']['desc'] = strtr($productIntro, array('<p>' => '', '\r\n\t' => ''));  
213 - } 207 + if (isset($sizeInfo['phrase'])) {
  208 + $result['goodsDescription']['desc'] = $sizeInfo['phrase'];
214 } 209 }
215 210
216 // 尺码信息 211 // 尺码信息
@@ -16,17 +16,19 @@ class DetailController extends AbstractAction @@ -16,17 +16,19 @@ class DetailController extends AbstractAction
16 */ 16 */
17 public function indexAction() 17 public function indexAction()
18 { 18 {
19 - $productId = $this->param('productId', 22399); 19 + $productId = $this->param('productId');
  20 + $productId = 22399;
20 if (!is_numeric($productId)) { 21 if (!is_numeric($productId)) {
21 $this->error(); 22 $this->error();
22 } 23 }
23 - $goodsId = $this->param('goodsId', 382089); 24 + $goodsId = $this->param('goodsId');
  25 + $goodsId = 32443;
24 if (!is_numeric($goodsId)) { 26 if (!is_numeric($goodsId)) {
25 $this->error(); 27 $this->error();
26 } 28 }
27 $uid = $this->getUid(); 29 $uid = $this->getUid();
28 30
29 - $data = \Product\DetailModel::getBaseInfo($productId, $goodsId, $uid); 31 + $data = \Product\DetailModel::getBaseInfo($productId, $goodsId, $uid); var_dump($data);
30 if (array() === $data) { 32 if (array() === $data) {
31 $this->error(); 33 $this->error();
32 } 34 }
@@ -40,6 +42,24 @@ class DetailController extends AbstractAction @@ -40,6 +42,24 @@ class DetailController extends AbstractAction
40 // 渲染模板 42 // 渲染模板
41 $this->_view->display('index', $data); 43 $this->_view->display('index', $data);
42 } 44 }
  45 +
  46 + /**
  47 + * 尺码描述信息
  48 + */
  49 + public function introAction()
  50 + {
  51 + $productSkn = $this->param('productSkn');
  52 + if (!is_numeric($productSkn)) {
  53 + $this->error();
  54 + }
  55 + $data = \Product\DetailModel::getSizeInfo($productSkn);
  56 + if (array() === $data) {
  57 + echo ' ';
  58 + exit();
  59 + }
  60 + $this->_view->display('intro', $data);
  61 + }
  62 +
43 63
44 public function commentsAction() 64 public function commentsAction()
45 { 65 {
@@ -117,4 +117,19 @@ routes.brandsearch.route.module = Category @@ -117,4 +117,19 @@ routes.brandsearch.route.module = Category
117 routes.brandsearch.route.controller = Brand 117 routes.brandsearch.route.controller = Brand
118 routes.brandsearch.route.action = Search 118 routes.brandsearch.route.action = Search
119 119
  120 +; 商品详情
  121 +routes.product.type = "regex"
  122 +routes.product.match = "#/product/pro_([0-9]+)_([0-9]+)/(.*)#"
  123 +routes.product.route.module = Product
  124 +routes.product.route.controller = Detail
  125 +routes.product.route.action = Index
  126 +routes.product.map.1 = productId
  127 +routes.product.map.2 = goodsId
  128 +
  129 +routes.buy.type = "regex"
  130 +routes.buy.match = "#/product/intro_([0-9]+)/(.*).html#"
  131 +routes.buy.route.module = Product
  132 +routes.buy.route.controller = Detail
  133 +routes.buy.route.action = Intro
  134 +routes.buy.map.1 = productSkn
120 135
@@ -4,19 +4,3 @@ routes.goodsfilter.match = "/search/filter" @@ -4,19 +4,3 @@ routes.goodsfilter.match = "/search/filter"
4 routes.goodsfilter.route.module = Index 4 routes.goodsfilter.route.module = Index
5 routes.goodsfilter.route.controller = Search 5 routes.goodsfilter.route.controller = Search
6 routes.goodsfilter.route.action = Filter 6 routes.goodsfilter.route.action = Filter
7 -  
8 -routes.product.type = "regex"  
9 -routes.product.match = "#/product/pro_([0-9]+)_([0-9]+)/(.*)#"  
10 -routes.product.route.module = Product  
11 -routes.product.route.controller = Detail  
12 -routes.product.route.action = Index  
13 -routes.product.map.1 = productId  
14 -routes.product.map.2 = goodsId  
15 -  
16 -routes.buy.type = "regex"  
17 -routes.buy.match = "#/product/buy_([0-9]+)_([0-9]+).html#"  
18 -routes.buy.route.module = Product  
19 -routes.buy.route.controller = Detail  
20 -routes.buy.route.action = Index  
21 -routes.buy.map.1 = productId  
22 -routes.buy.map.2 = goodsId