Authored by xiaowei

我的逛

@@ -29,7 +29,6 @@ class GuangData @@ -29,7 +29,6 @@ class GuangData
29 $param['limit'] = $limit; 29 $param['limit'] = $limit;
30 $param['yh_channel'] = $yh_channel; 30 $param['yh_channel'] = $yh_channel;
31 $param['client_secret'] = Sign::getSign($param); 31 $param['client_secret'] = Sign::getSign($param);
32 -// return Yohobuy::post(Yohobuy::API_URL, $param);  
33 return Yohobuy::post(Yohobuy::SERVICE_URL . self::GUANG_URI . 'getUserFavArticleList', $param); 32 return Yohobuy::post(Yohobuy::SERVICE_URL . self::GUANG_URI . 'getUserFavArticleList', $param);
34 } 33 }
35 34
@@ -37,7 +37,8 @@ class HomeController extends AbstractAction @@ -37,7 +37,8 @@ class HomeController extends AbstractAction
37 /** 37 /**
38 * 个人中心入口 38 * 个人中心入口
39 */ 39 */
40 - public function indexAction() { 40 + public function indexAction()
  41 + {
41 // 设置网站标题 42 // 设置网站标题
42 $this->setTitle('个人中心'); 43 $this->setTitle('个人中心');
43 $this->setNavHeader('个人中心', true, SITE_MAIN); 44 $this->setNavHeader('个人中心', true, SITE_MAIN);
@@ -61,29 +62,31 @@ class HomeController extends AbstractAction @@ -61,29 +62,31 @@ class HomeController extends AbstractAction
61 /** 62 /**
62 * 用户收藏的商品 63 * 用户收藏的商品
63 */ 64 */
64 - public function favoriteAction() { 65 + public function favoriteAction()
  66 + {
65 // 设置网站标题 67 // 设置网站标题
66 $this->setTitle('我的收藏'); 68 $this->setTitle('我的收藏');
67 $this->setNavHeader('我的收藏', true, SITE_MAIN); 69 $this->setNavHeader('我的收藏', true, SITE_MAIN);
68 70
69 - $tab = $this->get('tab', ''); 71 + $tab = $this->get('tab', '');
70 $uid = $this->getUid(); 72 $uid = $this->getUid();
71 $uid = 8826435; 73 $uid = 8826435;
72 $gender = Helpers::getGenderByCookie(); 74 $gender = Helpers::getGenderByCookie();
73 75
74 $favProducts = \Index\UserModel::getFavProductData($uid); 76 $favProducts = \Index\UserModel::getFavProductData($uid);
75 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender); 77 $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
76 - $data = array(  
77 - 'favPage' => true, //加载js  
78 - 'pageFooter' => true,  
79 - 'favorite' => true,  
80 - 'hasFavProduct' => $favProducts,  
81 - 'hasFavBrand' => $favBrands  
82 - );  
83 - // 判断时候为品牌页  
84 - if ($tab === 'brand') {  
85 - $data['brandTab'] = true;  
86 - } 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 + {
  88 + $data['brandTab'] = true;
  89 + }
87 90
88 $this->_view->display('favorite', $data); 91 $this->_view->display('favorite', $data);
89 } 92 }
@@ -91,19 +94,24 @@ class HomeController extends AbstractAction @@ -91,19 +94,24 @@ class HomeController extends AbstractAction
91 /** 94 /**
92 * 用户收藏的商品-删除 95 * 用户收藏的商品-删除
93 */ 96 */
94 - public function favoriteDelAction() { 97 + public function favoriteDelAction()
  98 + {
95 $result = array(); 99 $result = array();
96 100
97 - if ($this->isAjax()) { 101 + if ($this->isAjax())
  102 + {
98 $uid = $this->getUid(); 103 $uid = $this->getUid();
99 $fav_id = $this->post('fav_id', 0); 104 $fav_id = $this->post('fav_id', 0);
100 105
101 $result = \Index\UserModel::favoriteDelete($uid, $fav_id); 106 $result = \Index\UserModel::favoriteDelete($uid, $fav_id);
102 } 107 }
103 108
104 - if (empty($result)) { 109 + if (empty($result))
  110 + {
105 echo ' '; 111 echo ' ';
106 - } else { 112 + }
  113 + else
  114 + {
107 $this->echoJson($result); 115 $this->echoJson($result);
108 } 116 }
109 } 117 }
@@ -111,7 +119,8 @@ class HomeController extends AbstractAction @@ -111,7 +119,8 @@ class HomeController extends AbstractAction
111 /** 119 /**
112 * 个人信息 120 * 个人信息
113 */ 121 */
114 - public function personalDetailsAction() { 122 + public function personalDetailsAction()
  123 + {
115 $this->setTitle('个人信息'); 124 $this->setTitle('个人信息');
116 $this->setNavHeader('个人信息', true, SITE_MAIN); 125 $this->setNavHeader('个人信息', true, SITE_MAIN);
117 126
@@ -125,7 +134,8 @@ class HomeController extends AbstractAction @@ -125,7 +134,8 @@ class HomeController extends AbstractAction
125 /** 134 /**
126 * YOHO币 135 * YOHO币
127 */ 136 */
128 - public function currencyAction() { 137 + public function currencyAction()
  138 + {
129 $this->setTitle('YOHO币'); 139 $this->setTitle('YOHO币');
130 $this->setNavHeader('YOHO币', true, false); 140 $this->setNavHeader('YOHO币', true, false);
131 141
@@ -140,7 +150,8 @@ class HomeController extends AbstractAction @@ -140,7 +150,8 @@ class HomeController extends AbstractAction
140 /** 150 /**
141 * 优惠券 151 * 优惠券
142 */ 152 */
143 - public function couponsAction() { 153 + public function couponsAction()
  154 + {
144 155
145 $this->setTitle('优惠券'); 156 $this->setTitle('优惠券');
146 $this->setNavHeader('优惠券', true, SITE_MAIN); 157 $this->setNavHeader('优惠券', true, SITE_MAIN);
@@ -157,7 +168,8 @@ class HomeController extends AbstractAction @@ -157,7 +168,8 @@ class HomeController extends AbstractAction
157 /** 168 /**
158 * 我的消息 169 * 我的消息
159 */ 170 */
160 - public function messageAction() { 171 + public function messageAction()
  172 + {
161 // $uid = $this->getUid(); 173 // $uid = $this->getUid();
162 $page = $this->get('page', 0); 174 $page = $this->get('page', 0);
163 $size = $this->get('size', 10); 175 $size = $this->get('size', 10);
@@ -171,7 +183,8 @@ class HomeController extends AbstractAction @@ -171,7 +183,8 @@ class HomeController extends AbstractAction
171 /** 183 /**
172 * 地址管理 184 * 地址管理
173 */ 185 */
174 - public function addressAction() { 186 + public function addressAction()
  187 + {
175 // 设置网站标题 188 // 设置网站标题
176 $this->setTitle('地址管理'); 189 $this->setTitle('地址管理');
177 $this->setNavHeader('地址管理', true, SITE_MAIN); 190 $this->setNavHeader('地址管理', true, SITE_MAIN);
@@ -195,10 +208,12 @@ class HomeController extends AbstractAction @@ -195,10 +208,12 @@ class HomeController extends AbstractAction
195 /** 208 /**
196 * 修改地址或者添加新地址 209 * 修改地址或者添加新地址
197 */ 210 */
198 - public function saveAddressAction() { 211 + public function saveAddressAction()
  212 + {
199 $result = array(); 213 $result = array();
200 214
201 - if ($this->isAjax()) { 215 + if ($this->isAjax())
  216 + {
202 // $uid = $this->getUid(); 217 // $uid = $this->getUid();
203 $uid = 8826435; 218 $uid = 8826435;
204 $address = $this->post('address', ''); 219 $address = $this->post('address', '');
@@ -212,9 +227,12 @@ class HomeController extends AbstractAction @@ -212,9 +227,12 @@ class HomeController extends AbstractAction
212 $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code); 227 $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
213 } 228 }
214 229
215 - if (empty($result)) { 230 + if (empty($result))
  231 + {
216 echo ' '; 232 echo ' ';
217 - } else { 233 + }
  234 + else
  235 + {
218 $this->echoJson($result); 236 $this->echoJson($result);
219 } 237 }
220 } 238 }
@@ -222,10 +240,12 @@ class HomeController extends AbstractAction @@ -222,10 +240,12 @@ class HomeController extends AbstractAction
222 /** 240 /**
223 * 设置默认地址 241 * 设置默认地址
224 */ 242 */
225 - public function defaultAddressAction() { 243 + public function defaultAddressAction()
  244 + {
226 $result = array(); 245 $result = array();
227 246
228 - if ($this->isAjax()) { 247 + if ($this->isAjax())
  248 + {
229 // $uid = $this->getUid(); 249 // $uid = $this->getUid();
230 $uid = 8826435; 250 $uid = 8826435;
231 $id = $this->post('id', ''); 251 $id = $this->post('id', '');
@@ -233,9 +253,12 @@ class HomeController extends AbstractAction @@ -233,9 +253,12 @@ class HomeController extends AbstractAction
233 $result = \Index\UserModel::setDefaultAddress($uid, $id); 253 $result = \Index\UserModel::setDefaultAddress($uid, $id);
234 } 254 }
235 255
236 - if (empty($result)) { 256 + if (empty($result))
  257 + {
237 echo ' '; 258 echo ' ';
238 - } else { 259 + }
  260 + else
  261 + {
239 $this->echoJson($result); 262 $this->echoJson($result);
240 } 263 }
241 } 264 }
@@ -243,10 +266,12 @@ class HomeController extends AbstractAction @@ -243,10 +266,12 @@ class HomeController extends AbstractAction
243 /** 266 /**
244 * 删除地址 267 * 删除地址
245 */ 268 */
246 - public function addressDelAction() { 269 + public function addressDelAction()
  270 + {
247 $result = array(); 271 $result = array();
248 272
249 - if ($this->isAjax()) { 273 + if ($this->isAjax())
  274 + {
250 // $uid = $this->getUid(); 275 // $uid = $this->getUid();
251 $uid = 8826435; 276 $uid = 8826435;
252 $id = $this->post('id', ''); 277 $id = $this->post('id', '');
@@ -254,15 +279,19 @@ class HomeController extends AbstractAction @@ -254,15 +279,19 @@ class HomeController extends AbstractAction
254 $result = \Index\UserModel::deleteAddress($uid, $id); 279 $result = \Index\UserModel::deleteAddress($uid, $id);
255 } 280 }
256 281
257 - if (empty($result)) { 282 + if (empty($result))
  283 + {
258 echo ' '; 284 echo ' ';
259 - } else { 285 + }
  286 + else
  287 + {
260 $this->echoJson($result); 288 $this->echoJson($result);
261 } 289 }
262 } 290 }
263 291
264 //在线客服 292 //在线客服
265 - public function onlineServiceAction() { 293 + public function onlineServiceAction()
  294 + {
266 // 设置网站标题 295 // 设置网站标题
267 $this->setTitle('在线客服'); 296 $this->setTitle('在线客服');
268 $this->setNavHeader('在线客服', true, SITE_MAIN); 297 $this->setNavHeader('在线客服', true, SITE_MAIN);
@@ -277,11 +306,13 @@ class HomeController extends AbstractAction @@ -277,11 +306,13 @@ class HomeController extends AbstractAction
277 } 306 }
278 307
279 //在线客服-具体详情 308 //在线客服-具体详情
280 - public function onlineServiceDetailAction() { 309 + public function onlineServiceDetailAction()
  310 + {
281 $service = array(); 311 $service = array();
282 $cateId = $this->get('cateId', 0); 312 $cateId = $this->get('cateId', 0);
283 $cateName = $this->get('cateName', ''); 313 $cateName = $this->get('cateName', '');
284 - if ($cateId > 0) { 314 + if ($cateId > 0)
  315 + {
285 $service = home\OnlineModel::getOnlineServiceDetail($cateId); 316 $service = home\OnlineModel::getOnlineServiceDetail($cateId);
286 } 317 }
287 $this->setTitle('在线客服'); 318 $this->setTitle('在线客服');
@@ -297,19 +328,27 @@ class HomeController extends AbstractAction @@ -297,19 +328,27 @@ class HomeController extends AbstractAction
297 $page = $this->get('page', 1); 328 $page = $this->get('page', 1);
298 $limit = $this->get('limit', 10); 329 $limit = $this->get('limit', 10);
299 $uid = $this->getUid(); 330 $uid = $this->getUid();
300 - $uid=5687179; 331 + $uid = 5687179;
301 $gender = Helpers::getGenderByCookie(); 332 $gender = Helpers::getGenderByCookie();
302 $yh_channel = Helpers::getChannelByCookie(); 333 $yh_channel = Helpers::getChannelByCookie();
303 - $guangInfo = \home\GuangModel::getMyGuang($uid, $page,$yh_channel,$gender, $limit);  
304 - $this->setTitle('我收藏的');  
305 - $this->setNavHeader('我收藏的', true, '');  
306 - $this->_view->display('my-guang', array( 'myGuangPage' => true,'myGuang'=>array('infos'=>$guangInfo),'pageFooter' => true)); 334 + $guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
  335 + if ($page == 1)
  336 + {
  337 + $this->setTitle('我收藏的');
  338 + $this->setNavHeader('我收藏的', true, '');
  339 + $this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
  340 + }
  341 + else
  342 + {
  343 + $this->_view->display('my-guang-partial', array('infos' => $guangInfo));
  344 + }
307 } 345 }
308 346
309 /** 347 /**
310 * 意见反馈 348 * 意见反馈
311 */ 349 */
312 - public function suggestAction() { 350 + public function suggestAction()
  351 + {
313 // 设置网站标题 352 // 设置网站标题
314 $this->setTitle('意见反馈'); 353 $this->setTitle('意见反馈');
315 $this->setNavHeader('意见反馈', true, SITE_MAIN); 354 $this->setNavHeader('意见反馈', true, SITE_MAIN);
@@ -331,7 +370,8 @@ class HomeController extends AbstractAction @@ -331,7 +370,8 @@ class HomeController extends AbstractAction
331 /** 370 /**
332 * 意见反馈-提交表单页面 371 * 意见反馈-提交表单页面
333 */ 372 */
334 - public function suggestSubAction() { 373 + public function suggestSubAction()
  374 + {
335 375
336 // 设置网站标题 376 // 设置网站标题
337 $this->setTitle('反馈问题'); 377 $this->setTitle('反馈问题');
@@ -359,7 +399,8 @@ class HomeController extends AbstractAction @@ -359,7 +399,8 @@ class HomeController extends AbstractAction
359 /** 399 /**
360 * 异步上传图片 400 * 异步上传图片
361 */ 401 */
362 - public function suggestimgUploadAction() { 402 + public function suggestimgUploadAction()
  403 + {
363 $filename = $this->post('filename', ''); 404 $filename = $this->post('filename', '');
364 $result = \Index\UserModel::saveSuggestImg($filename); 405 $result = \Index\UserModel::saveSuggestImg($filename);
365 406
@@ -369,8 +410,10 @@ class HomeController extends AbstractAction @@ -369,8 +410,10 @@ class HomeController extends AbstractAction
369 /** 410 /**
370 * 异步保存意见反馈数据 411 * 异步保存意见反馈数据
371 */ 412 */
372 - public function savesuggestAction() {  
373 - if ($this->isAjax()) { 413 + public function savesuggestAction()
  414 + {
  415 + if ($this->isAjax())
  416 + {
374 $uid = $this->getUid(); 417 $uid = $this->getUid();
375 $content = $this->post('content', ''); 418 $content = $this->post('content', '');
376 $suggest_type = $this->get('suggest_type', 2); 419 $suggest_type = $this->get('suggest_type', 2);
@@ -383,7 +426,8 @@ class HomeController extends AbstractAction @@ -383,7 +426,8 @@ class HomeController extends AbstractAction
383 /** 426 /**
384 * 会员等级展示页 427 * 会员等级展示页
385 */ 428 */
386 - public function gradeAction() { 429 + public function gradeAction()
  430 + {
387 //设置网站seo信息 431 //设置网站seo信息
388 $this->setTitle('会员等级'); 432 $this->setTitle('会员等级');
389 //显示网站导航头部信息 433 //显示网站导航头部信息
@@ -402,7 +446,8 @@ class HomeController extends AbstractAction @@ -402,7 +446,8 @@ class HomeController extends AbstractAction
402 * 会员特权查看页 446 * 会员特权查看页
403 */ 447 */
404 448
405 - public function preferentialAction() { 449 + public function preferentialAction()
  450 + {
406 //设置网站seo信息 451 //设置网站seo信息
407 $this->setTitle('会员等级'); 452 $this->setTitle('会员等级');
408 //显示网站导航头部信息 453 //显示网站导航头部信息
@@ -419,15 +464,19 @@ class HomeController extends AbstractAction @@ -419,15 +464,19 @@ class HomeController extends AbstractAction
419 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) 464 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
420 */ 465 */
421 466
422 - public function orderAction() { 467 + public function orderAction()
  468 + {
423 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。 469 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
424 $type = $this->get('type', 1); 470 $type = $this->get('type', 1);
425 $this->setTitle('我的订单'); 471 $this->setTitle('我的订单');
426 $this->setNavHeader('我的订单'); 472 $this->setNavHeader('我的订单');
427 $data = OrderModel::getNavs($type); 473 $data = OrderModel::getNavs($type);
428 - if (!empty($data)) { 474 + if (!empty($data))
  475 + {
429 $order['navs'] = $data; 476 $order['navs'] = $data;
430 - } else { 477 + }
  478 + else
  479 + {
431 $this->error(); 480 $this->error();
432 } 481 }
433 //渲染模板 482 //渲染模板
@@ -439,9 +488,11 @@ class HomeController extends AbstractAction @@ -439,9 +488,11 @@ class HomeController extends AbstractAction
439 } 488 }
440 489
441 //ajax请求订单页面 490 //ajax请求订单页面
442 - public function getOrdersAction() { 491 + public function getOrdersAction()
  492 + {
443 //判断是不是ajax请求 493 //判断是不是ajax请求
444 - if (!$this->isAjax()) { 494 + if (!$this->isAjax())
  495 + {
445 $this->error(); 496 $this->error();
446 } 497 }
447 //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 498 //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
@@ -459,12 +510,18 @@ class HomeController extends AbstractAction @@ -459,12 +510,18 @@ class HomeController extends AbstractAction
459 2、page=1时,就给一个随便逛逛的链接。 510 2、page=1时,就给一个随便逛逛的链接。
460 * */ 511 * */
461 $order = array(); 512 $order = array();
462 - if (!empty($data)) { 513 + if (!empty($data))
  514 + {
463 $order['orders'] = $data; 515 $order['orders'] = $data;
464 - } else {  
465 - if ($page > 1) { 516 + }
  517 + else
  518 + {
  519 + if ($page > 1)
  520 + {
466 echo " "; 521 echo " ";
467 - } elseif ($page = 1) { 522 + }
  523 + elseif ($page = 1)
  524 + {
468 $order['walkwayUrl'] = self::strollAction(); 525 $order['walkwayUrl'] = self::strollAction();
469 } 526 }
470 } 527 }
@@ -476,10 +533,12 @@ class HomeController extends AbstractAction @@ -476,10 +533,12 @@ class HomeController extends AbstractAction
476 * 我的订单-取消订单 533 * 我的订单-取消订单
477 */ 534 */
478 535
479 - public function cancelOrderAction() { 536 + public function cancelOrderAction()
  537 + {
480 538
481 //判断是不是ajax请求 539 //判断是不是ajax请求
482 - if (!$this->isAjax()) { 540 + if (!$this->isAjax())
  541 + {
483 $this->error(); 542 $this->error();
484 } 543 }
485 //传入order_code和uid以取消订单 544 //传入order_code和uid以取消订单
@@ -499,9 +558,11 @@ class HomeController extends AbstractAction @@ -499,9 +558,11 @@ class HomeController extends AbstractAction
499 * 我的订单-删除订单 558 * 我的订单-删除订单
500 */ 559 */
501 560
502 - public function delOrderAction() { 561 + public function delOrderAction()
  562 + {
503 //判断是不是ajax请求 563 //判断是不是ajax请求
504 - if (!$this->isAjax()) { 564 + if (!$this->isAjax())
  565 + {
505 $this->error(); 566 $this->error();
506 } 567 }
507 //传入order_code和uid以删除订单 568 //传入order_code和uid以删除订单
@@ -521,7 +582,8 @@ class HomeController extends AbstractAction @@ -521,7 +582,8 @@ class HomeController extends AbstractAction
521 * 我的订单-支付链接获取 582 * 我的订单-支付链接获取
522 */ 583 */
523 584
524 - private function paymentAction() { 585 + private function paymentAction()
  586 + {
525 $gender = Helpers::getGenderByCookie(); 587 $gender = Helpers::getGenderByCookie();
526 $yh_channel = $this->get('yh_channel', 1); 588 $yh_channel = $this->get('yh_channel', 1);
527 OrderModel::payment($gender, $yh_channel); 589 OrderModel::payment($gender, $yh_channel);
@@ -531,7 +593,8 @@ class HomeController extends AbstractAction @@ -531,7 +593,8 @@ class HomeController extends AbstractAction
531 * 我的订单-随便逛逛链接获取 593 * 我的订单-随便逛逛链接获取
532 */ 594 */
533 595
534 - private function strollAction() { 596 + private function strollAction()
  597 + {
535 //获取性别、频道数据 598 //获取性别、频道数据
536 $gender = Helpers::getGenderByCookie(); 599 $gender = Helpers::getGenderByCookie();
537 $yh_channel = $this->get('yh_channel', 1); 600 $yh_channel = $this->get('yh_channel', 1);
@@ -543,7 +606,8 @@ class HomeController extends AbstractAction @@ -543,7 +606,8 @@ class HomeController extends AbstractAction
543 /** 606 /**
544 * 订单详情页 607 * 订单详情页
545 */ 608 */
546 - public function orderDetailAction() { 609 + public function orderDetailAction()
  610 + {
547 $data = array( 611 $data = array(
548 'name' => '毛毛莉Lydia', 612 'name' => '毛毛莉Lydia',
549 'phoneNum' => '18600001133', 613 'phoneNum' => '18600001133',