|
@@ -37,8 +37,7 @@ class HomeController extends AbstractAction |
|
@@ -37,8 +37,7 @@ class HomeController extends AbstractAction |
37
|
/**
|
37
|
/**
|
38
|
* 个人中心入口
|
38
|
* 个人中心入口
|
39
|
*/
|
39
|
*/
|
40
|
- public function indexAction()
|
|
|
41
|
- {
|
40
|
+ public function indexAction() {
|
42
|
// 设置网站标题
|
41
|
// 设置网站标题
|
43
|
$this->setTitle('个人中心');
|
42
|
$this->setTitle('个人中心');
|
44
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
43
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
@@ -62,8 +61,7 @@ class HomeController extends AbstractAction |
|
@@ -62,8 +61,7 @@ class HomeController extends AbstractAction |
62
|
/**
|
61
|
/**
|
63
|
* 用户收藏的商品
|
62
|
* 用户收藏的商品
|
64
|
*/
|
63
|
*/
|
65
|
- public function favoriteAction()
|
|
|
66
|
- {
|
64
|
+ public function favoriteAction() {
|
67
|
// 设置网站标题
|
65
|
// 设置网站标题
|
68
|
$this->setTitle('我的收藏');
|
66
|
$this->setTitle('我的收藏');
|
69
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
67
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
|
@@ -93,8 +91,7 @@ class HomeController extends AbstractAction |
|
@@ -93,8 +91,7 @@ class HomeController extends AbstractAction |
93
|
/**
|
91
|
/**
|
94
|
* 用户收藏的商品-删除
|
92
|
* 用户收藏的商品-删除
|
95
|
*/
|
93
|
*/
|
96
|
- public function favoriteDelAction()
|
|
|
97
|
- {
|
94
|
+ public function favoriteDelAction() {
|
98
|
$result = array();
|
95
|
$result = array();
|
99
|
|
96
|
|
100
|
if ($this->isAjax()) {
|
97
|
if ($this->isAjax()) {
|
|
@@ -114,8 +111,7 @@ class HomeController extends AbstractAction |
|
@@ -114,8 +111,7 @@ class HomeController extends AbstractAction |
114
|
/**
|
111
|
/**
|
115
|
* 个人信息
|
112
|
* 个人信息
|
116
|
*/
|
113
|
*/
|
117
|
- public function personalDetailsAction()
|
|
|
118
|
- {
|
114
|
+ public function personalDetailsAction() {
|
119
|
$this->setTitle('个人信息');
|
115
|
$this->setTitle('个人信息');
|
120
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
116
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
121
|
|
117
|
|
|
@@ -129,8 +125,7 @@ class HomeController extends AbstractAction |
|
@@ -129,8 +125,7 @@ class HomeController extends AbstractAction |
129
|
/**
|
125
|
/**
|
130
|
* YOHO币
|
126
|
* YOHO币
|
131
|
*/
|
127
|
*/
|
132
|
- public function currencyAction()
|
|
|
133
|
- {
|
128
|
+ public function currencyAction() {
|
134
|
$this->setTitle('YOHO币');
|
129
|
$this->setTitle('YOHO币');
|
135
|
$this->setNavHeader('YOHO币', true, false);
|
130
|
$this->setNavHeader('YOHO币', true, false);
|
136
|
|
131
|
|
|
@@ -145,8 +140,7 @@ class HomeController extends AbstractAction |
|
@@ -145,8 +140,7 @@ class HomeController extends AbstractAction |
145
|
/**
|
140
|
/**
|
146
|
* 优惠券
|
141
|
* 优惠券
|
147
|
*/
|
142
|
*/
|
148
|
- public function couponsAction()
|
|
|
149
|
- {
|
143
|
+ public function couponsAction() {
|
150
|
|
144
|
|
151
|
$this->setTitle('优惠券');
|
145
|
$this->setTitle('优惠券');
|
152
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
146
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
@@ -163,8 +157,7 @@ class HomeController extends AbstractAction |
|
@@ -163,8 +157,7 @@ class HomeController extends AbstractAction |
163
|
/**
|
157
|
/**
|
164
|
* 我的消息
|
158
|
* 我的消息
|
165
|
*/
|
159
|
*/
|
166
|
- public function messageAction()
|
|
|
167
|
- {
|
160
|
+ public function messageAction() {
|
168
|
// $uid = $this->getUid();
|
161
|
// $uid = $this->getUid();
|
169
|
$page = $this->get('page', 0);
|
162
|
$page = $this->get('page', 0);
|
170
|
$size = $this->get('size', 10);
|
163
|
$size = $this->get('size', 10);
|
|
@@ -178,8 +171,7 @@ class HomeController extends AbstractAction |
|
@@ -178,8 +171,7 @@ class HomeController extends AbstractAction |
178
|
/**
|
171
|
/**
|
179
|
* 地址管理
|
172
|
* 地址管理
|
180
|
*/
|
173
|
*/
|
181
|
- public function addressAction()
|
|
|
182
|
- {
|
174
|
+ public function addressAction() {
|
183
|
// 设置网站标题
|
175
|
// 设置网站标题
|
184
|
$this->setTitle('地址管理');
|
176
|
$this->setTitle('地址管理');
|
185
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
177
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
|
@@ -203,8 +195,7 @@ class HomeController extends AbstractAction |
|
@@ -203,8 +195,7 @@ class HomeController extends AbstractAction |
203
|
/**
|
195
|
/**
|
204
|
* 修改地址或者添加新地址
|
196
|
* 修改地址或者添加新地址
|
205
|
*/
|
197
|
*/
|
206
|
- public function saveAddressAction()
|
|
|
207
|
- {
|
198
|
+ public function saveAddressAction() {
|
208
|
$result = array();
|
199
|
$result = array();
|
209
|
|
200
|
|
210
|
if ($this->isAjax()) {
|
201
|
if ($this->isAjax()) {
|
|
@@ -231,8 +222,7 @@ class HomeController extends AbstractAction |
|
@@ -231,8 +222,7 @@ class HomeController extends AbstractAction |
231
|
/**
|
222
|
/**
|
232
|
* 设置默认地址
|
223
|
* 设置默认地址
|
233
|
*/
|
224
|
*/
|
234
|
- public function defaultAddressAction()
|
|
|
235
|
- {
|
225
|
+ public function defaultAddressAction() {
|
236
|
$result = array();
|
226
|
$result = array();
|
237
|
|
227
|
|
238
|
if ($this->isAjax()) {
|
228
|
if ($this->isAjax()) {
|
|
@@ -253,8 +243,7 @@ class HomeController extends AbstractAction |
|
@@ -253,8 +243,7 @@ class HomeController extends AbstractAction |
253
|
/**
|
243
|
/**
|
254
|
* 删除地址
|
244
|
* 删除地址
|
255
|
*/
|
245
|
*/
|
256
|
- public function addressDelAction()
|
|
|
257
|
- {
|
246
|
+ public function addressDelAction() {
|
258
|
$result = array();
|
247
|
$result = array();
|
259
|
|
248
|
|
260
|
if ($this->isAjax()) {
|
249
|
if ($this->isAjax()) {
|
|
@@ -273,8 +262,7 @@ class HomeController extends AbstractAction |
|
@@ -273,8 +262,7 @@ class HomeController extends AbstractAction |
273
|
}
|
262
|
}
|
274
|
|
263
|
|
275
|
//在线客服
|
264
|
//在线客服
|
276
|
- public function onlineServiceAction()
|
|
|
277
|
- {
|
265
|
+ public function onlineServiceAction() {
|
278
|
// 设置网站标题
|
266
|
// 设置网站标题
|
279
|
$this->setTitle('在线客服');
|
267
|
$this->setTitle('在线客服');
|
280
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
268
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
|
@@ -289,8 +277,7 @@ class HomeController extends AbstractAction |
|
@@ -289,8 +277,7 @@ class HomeController extends AbstractAction |
289
|
}
|
277
|
}
|
290
|
|
278
|
|
291
|
//在线客服-具体详情
|
279
|
//在线客服-具体详情
|
292
|
- public function onlineServiceDetailAction()
|
|
|
293
|
- {
|
280
|
+ public function onlineServiceDetailAction() {
|
294
|
$service = array();
|
281
|
$service = array();
|
295
|
$cateId = $this->get('cateId', 0);
|
282
|
$cateId = $this->get('cateId', 0);
|
296
|
$cateName = $this->get('cateName', '');
|
283
|
$cateName = $this->get('cateName', '');
|
|
@@ -321,8 +308,7 @@ class HomeController extends AbstractAction |
|
@@ -321,8 +308,7 @@ class HomeController extends AbstractAction |
321
|
/**
|
308
|
/**
|
322
|
* 意见反馈
|
309
|
* 意见反馈
|
323
|
*/
|
310
|
*/
|
324
|
- public function suggestAction()
|
|
|
325
|
- {
|
311
|
+ public function suggestAction() {
|
326
|
// 设置网站标题
|
312
|
// 设置网站标题
|
327
|
$this->setTitle('意见反馈');
|
313
|
$this->setTitle('意见反馈');
|
328
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
314
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
|
@@ -344,8 +330,7 @@ class HomeController extends AbstractAction |
|
@@ -344,8 +330,7 @@ class HomeController extends AbstractAction |
344
|
/**
|
330
|
/**
|
345
|
* 意见反馈-提交表单页面
|
331
|
* 意见反馈-提交表单页面
|
346
|
*/
|
332
|
*/
|
347
|
- public function suggestSubAction()
|
|
|
348
|
- {
|
333
|
+ public function suggestSubAction() {
|
349
|
|
334
|
|
350
|
// 设置网站标题
|
335
|
// 设置网站标题
|
351
|
$this->setTitle('反馈问题');
|
336
|
$this->setTitle('反馈问题');
|
|
@@ -373,8 +358,7 @@ class HomeController extends AbstractAction |
|
@@ -373,8 +358,7 @@ class HomeController extends AbstractAction |
373
|
/**
|
358
|
/**
|
374
|
* 异步上传图片
|
359
|
* 异步上传图片
|
375
|
*/
|
360
|
*/
|
376
|
- public function suggestimgUploadAction()
|
|
|
377
|
- {
|
361
|
+ public function suggestimgUploadAction() {
|
378
|
$filename = $this->post('filename', '');
|
362
|
$filename = $this->post('filename', '');
|
379
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
363
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
380
|
|
364
|
|
|
@@ -384,8 +368,7 @@ class HomeController extends AbstractAction |
|
@@ -384,8 +368,7 @@ class HomeController extends AbstractAction |
384
|
/**
|
368
|
/**
|
385
|
* 异步保存意见反馈数据
|
369
|
* 异步保存意见反馈数据
|
386
|
*/
|
370
|
*/
|
387
|
- public function savesuggestAction()
|
|
|
388
|
- {
|
371
|
+ public function savesuggestAction() {
|
389
|
if ($this->isAjax()) {
|
372
|
if ($this->isAjax()) {
|
390
|
$uid = $this->getUid();
|
373
|
$uid = $this->getUid();
|
391
|
$content = $this->post('content', '');
|
374
|
$content = $this->post('content', '');
|
|
@@ -399,8 +382,7 @@ class HomeController extends AbstractAction |
|
@@ -399,8 +382,7 @@ class HomeController extends AbstractAction |
399
|
/**
|
382
|
/**
|
400
|
* 会员等级展示页
|
383
|
* 会员等级展示页
|
401
|
*/
|
384
|
*/
|
402
|
- public function gradeAction()
|
|
|
403
|
- {
|
385
|
+ public function gradeAction() {
|
404
|
//设置网站seo信息
|
386
|
//设置网站seo信息
|
405
|
$this->setTitle('会员等级');
|
387
|
$this->setTitle('会员等级');
|
406
|
//显示网站导航头部信息
|
388
|
//显示网站导航头部信息
|
|
@@ -419,8 +401,7 @@ class HomeController extends AbstractAction |
|
@@ -419,8 +401,7 @@ class HomeController extends AbstractAction |
419
|
* 会员特权查看页
|
401
|
* 会员特权查看页
|
420
|
*/
|
402
|
*/
|
421
|
|
403
|
|
422
|
- public function preferentialAction()
|
|
|
423
|
- {
|
404
|
+ public function preferentialAction() {
|
424
|
//设置网站seo信息
|
405
|
//设置网站seo信息
|
425
|
$this->setTitle('会员等级');
|
406
|
$this->setTitle('会员等级');
|
426
|
//显示网站导航头部信息
|
407
|
//显示网站导航头部信息
|
|
@@ -434,12 +415,11 @@ class HomeController extends AbstractAction |
|
@@ -434,12 +415,11 @@ class HomeController extends AbstractAction |
434
|
}
|
415
|
}
|
435
|
|
416
|
|
436
|
/*
|
417
|
/*
|
437
|
- * 我的订单页面
|
418
|
+ * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
438
|
*/
|
419
|
*/
|
439
|
|
420
|
|
440
|
- public function orderAction()
|
|
|
441
|
- {
|
|
|
442
|
- //获得type值
|
421
|
+ public function orderAction() {
|
|
|
422
|
+ //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
443
|
$type = $this->get('type', 1);
|
423
|
$type = $this->get('type', 1);
|
444
|
$this->setTitle('我的订单');
|
424
|
$this->setTitle('我的订单');
|
445
|
$this->setNavHeader('我的订单');
|
425
|
$this->setNavHeader('我的订单');
|
|
@@ -449,7 +429,7 @@ class HomeController extends AbstractAction |
|
@@ -449,7 +429,7 @@ class HomeController extends AbstractAction |
449
|
} else {
|
429
|
} else {
|
450
|
$this->error();
|
430
|
$this->error();
|
451
|
}
|
431
|
}
|
452
|
-
|
432
|
+ //渲染模板
|
453
|
$this->_view->display('order', array(
|
433
|
$this->_view->display('order', array(
|
454
|
'order' => $order,
|
434
|
'order' => $order,
|
455
|
'pageFooter' => true,
|
435
|
'pageFooter' => true,
|
|
@@ -458,8 +438,7 @@ class HomeController extends AbstractAction |
|
@@ -458,8 +438,7 @@ class HomeController extends AbstractAction |
458
|
}
|
438
|
}
|
459
|
|
439
|
|
460
|
//ajax请求订单页面
|
440
|
//ajax请求订单页面
|
461
|
- public function getOrdersAction()
|
|
|
462
|
- {
|
441
|
+ public function getOrdersAction() {
|
463
|
//判断是不是ajax请求
|
442
|
//判断是不是ajax请求
|
464
|
if (!$this->isAjax()) {
|
443
|
if (!$this->isAjax()) {
|
465
|
$this->error();
|
444
|
$this->error();
|
|
@@ -474,15 +453,18 @@ class HomeController extends AbstractAction |
|
@@ -474,15 +453,18 @@ class HomeController extends AbstractAction |
474
|
$uid = '10267443'; //测试用
|
453
|
$uid = '10267443'; //测试用
|
475
|
//调用模型层getOrder方法获得并处理数据
|
454
|
//调用模型层getOrder方法获得并处理数据
|
476
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
455
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
477
|
- //如果没有订单数据,就给一个随便逛逛链接
|
456
|
+ /* 如果取不到订单数据时,分两种情况:
|
|
|
457
|
+ 1、page>1时,echo一个空格字符串到浏览器。
|
|
|
458
|
+ 2、page=1时,就给一个随便逛逛的链接。
|
|
|
459
|
+ * */
|
478
|
$order = array();
|
460
|
$order = array();
|
479
|
if (!empty($data)) {
|
461
|
if (!empty($data)) {
|
480
|
$order['orders'] = $data;
|
462
|
$order['orders'] = $data;
|
481
|
} else {
|
463
|
} else {
|
482
|
if ($page > 1) {
|
464
|
if ($page > 1) {
|
483
|
echo " ";
|
465
|
echo " ";
|
484
|
- } else {
|
|
|
485
|
- $order['walkwayUrl'] = 'http://www.baidu.com';
|
466
|
+ } elseif ($page = 1) {
|
|
|
467
|
+ $order['walkwayUrl'] = self::strollAction();
|
486
|
}
|
468
|
}
|
487
|
}
|
469
|
}
|
488
|
//渲染模板
|
470
|
//渲染模板
|
|
@@ -493,21 +475,22 @@ class HomeController extends AbstractAction |
|
@@ -493,21 +475,22 @@ class HomeController extends AbstractAction |
493
|
* 我的订单-取消订单
|
475
|
* 我的订单-取消订单
|
494
|
*/
|
476
|
*/
|
495
|
|
477
|
|
496
|
- public function cancelOrderAction()
|
|
|
497
|
- {
|
478
|
+ public function cancelOrderAction() {
|
498
|
|
479
|
|
499
|
//判断是不是ajax请求
|
480
|
//判断是不是ajax请求
|
500
|
if (!$this->isAjax()) {
|
481
|
if (!$this->isAjax()) {
|
501
|
$this->error();
|
482
|
$this->error();
|
502
|
}
|
483
|
}
|
503
|
//传入order_code和uid以取消订单
|
484
|
//传入order_code和uid以取消订单
|
504
|
- $order_code = $this->get('orderCode');
|
485
|
+ $order_code = $this->get('id');
|
505
|
$uid = $this->getUid();
|
486
|
$uid = $this->getUid();
|
506
|
$uid = '10267443'; //测试用
|
487
|
$uid = '10267443'; //测试用
|
507
|
$gender = Helpers::getGenderByCookie();
|
488
|
$gender = Helpers::getGenderByCookie();
|
508
|
$yh_channel = $this->get('yh_channel', 1);
|
489
|
$yh_channel = $this->get('yh_channel', 1);
|
509
|
$method = 'app.SpaceOrders.close';
|
490
|
$method = 'app.SpaceOrders.close';
|
|
|
491
|
+ //调用取消订单接口,返回订单取消状态
|
510
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
492
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
493
|
+ //将取消状态返回至浏览器
|
511
|
$this->echoJson($data);
|
494
|
$this->echoJson($data);
|
512
|
}
|
495
|
}
|
513
|
|
496
|
|
|
@@ -515,8 +498,7 @@ class HomeController extends AbstractAction |
|
@@ -515,8 +498,7 @@ class HomeController extends AbstractAction |
515
|
* 我的订单-删除订单
|
498
|
* 我的订单-删除订单
|
516
|
*/
|
499
|
*/
|
517
|
|
500
|
|
518
|
- public function delOrderAction()
|
|
|
519
|
- {
|
501
|
+ public function delOrderAction() {
|
520
|
//判断是不是ajax请求
|
502
|
//判断是不是ajax请求
|
521
|
if (!$this->isAjax()) {
|
503
|
if (!$this->isAjax()) {
|
522
|
$this->error();
|
504
|
$this->error();
|
|
@@ -528,15 +510,39 @@ class HomeController extends AbstractAction |
|
@@ -528,15 +510,39 @@ class HomeController extends AbstractAction |
528
|
$gender = Helpers::getGenderByCookie();
|
510
|
$gender = Helpers::getGenderByCookie();
|
529
|
$yh_channel = $this->get('yh_channel', 1);
|
511
|
$yh_channel = $this->get('yh_channel', 1);
|
530
|
$method = 'app.SpaceOrders.delOrderByCode';
|
512
|
$method = 'app.SpaceOrders.delOrderByCode';
|
|
|
513
|
+ //调用接口删除订单,并返回订单删除状态
|
531
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
514
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
515
|
+ //将订单删除状态返回至浏览器
|
532
|
$this->echoJson($data);
|
516
|
$this->echoJson($data);
|
533
|
}
|
517
|
}
|
534
|
|
518
|
|
|
|
519
|
+ /*
|
|
|
520
|
+ * 我的订单-支付链接获取
|
|
|
521
|
+ */
|
|
|
522
|
+
|
|
|
523
|
+ private function paymentAction() {
|
|
|
524
|
+ $gender = Helpers::getGenderByCookie();
|
|
|
525
|
+ $yh_channel = $this->get('yh_channel', 1);
|
|
|
526
|
+ OrderModel::payment($gender, $yh_channel);
|
|
|
527
|
+ }
|
|
|
528
|
+
|
|
|
529
|
+ /*
|
|
|
530
|
+ * 我的订单-随便逛逛链接获取
|
|
|
531
|
+ */
|
|
|
532
|
+
|
|
|
533
|
+ private function strollAction() {
|
|
|
534
|
+ //获取性别、频道数据
|
|
|
535
|
+ $gender = Helpers::getGenderByCookie();
|
|
|
536
|
+ $yh_channel = $this->get('yh_channel', 1);
|
|
|
537
|
+ //调用接口获取随便逛逛url地址,并return数据
|
|
|
538
|
+ $data = OrderModel::stroll($gender, $yh_channel);
|
|
|
539
|
+ return $data;
|
|
|
540
|
+ }
|
|
|
541
|
+
|
535
|
/**
|
542
|
/**
|
536
|
* 订单详情页
|
543
|
* 订单详情页
|
537
|
*/
|
544
|
*/
|
538
|
- public function orderDetailAction()
|
|
|
539
|
- {
|
545
|
+ public function orderDetailAction() {
|
540
|
$data = array(
|
546
|
$data = array(
|
541
|
'name' => '毛毛莉Lydia',
|
547
|
'name' => '毛毛莉Lydia',
|
542
|
'phoneNum' => '18600001133',
|
548
|
'phoneNum' => '18600001133',
|