|
@@ -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);
|
|
@@ -87,8 +85,7 @@ class HomeController extends AbstractAction |
|
@@ -87,8 +85,7 @@ class HomeController extends AbstractAction |
87
|
/**
|
85
|
/**
|
88
|
* 用户收藏的商品-删除
|
86
|
* 用户收藏的商品-删除
|
89
|
*/
|
87
|
*/
|
90
|
- public function favoriteDelAction()
|
|
|
91
|
- {
|
88
|
+ public function favoriteDelAction() {
|
92
|
$result = array();
|
89
|
$result = array();
|
93
|
|
90
|
|
94
|
if ($this->isAjax()) {
|
91
|
if ($this->isAjax()) {
|
|
@@ -108,8 +105,7 @@ class HomeController extends AbstractAction |
|
@@ -108,8 +105,7 @@ class HomeController extends AbstractAction |
108
|
/**
|
105
|
/**
|
109
|
* 用户收藏的品牌
|
106
|
* 用户收藏的品牌
|
110
|
*/
|
107
|
*/
|
111
|
- public function favoritebrandAction()
|
|
|
112
|
- {
|
108
|
+ public function favoritebrandAction() {
|
113
|
$uid = $this->getUid();
|
109
|
$uid = $this->getUid();
|
114
|
$gender = Helpers::getGenderByCookie();
|
110
|
$gender = Helpers::getGenderByCookie();
|
115
|
|
111
|
|
|
@@ -121,8 +117,7 @@ class HomeController extends AbstractAction |
|
@@ -121,8 +117,7 @@ class HomeController extends AbstractAction |
121
|
/**
|
117
|
/**
|
122
|
* 个人信息
|
118
|
* 个人信息
|
123
|
*/
|
119
|
*/
|
124
|
- public function personalDetailsAction()
|
|
|
125
|
- {
|
120
|
+ public function personalDetailsAction() {
|
126
|
$this->setTitle('个人信息');
|
121
|
$this->setTitle('个人信息');
|
127
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
122
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
128
|
|
123
|
|
|
@@ -136,8 +131,7 @@ class HomeController extends AbstractAction |
|
@@ -136,8 +131,7 @@ class HomeController extends AbstractAction |
136
|
/**
|
131
|
/**
|
137
|
* YOHO币
|
132
|
* YOHO币
|
138
|
*/
|
133
|
*/
|
139
|
- public function currencyAction()
|
|
|
140
|
- {
|
134
|
+ public function currencyAction() {
|
141
|
$this->setTitle('YOHO币');
|
135
|
$this->setTitle('YOHO币');
|
142
|
$this->setNavHeader('YOHO币', true, false);
|
136
|
$this->setNavHeader('YOHO币', true, false);
|
143
|
|
137
|
|
|
@@ -152,8 +146,7 @@ class HomeController extends AbstractAction |
|
@@ -152,8 +146,7 @@ class HomeController extends AbstractAction |
152
|
/**
|
146
|
/**
|
153
|
* 优惠券
|
147
|
* 优惠券
|
154
|
*/
|
148
|
*/
|
155
|
- public function couponsAction()
|
|
|
156
|
- {
|
149
|
+ public function couponsAction() {
|
157
|
|
150
|
|
158
|
$this->setTitle('优惠券');
|
151
|
$this->setTitle('优惠券');
|
159
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
152
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
@@ -170,8 +163,7 @@ class HomeController extends AbstractAction |
|
@@ -170,8 +163,7 @@ class HomeController extends AbstractAction |
170
|
/**
|
163
|
/**
|
171
|
* 我的消息
|
164
|
* 我的消息
|
172
|
*/
|
165
|
*/
|
173
|
- public function messageAction()
|
|
|
174
|
- {
|
166
|
+ public function messageAction() {
|
175
|
// $uid = $this->getUid();
|
167
|
// $uid = $this->getUid();
|
176
|
$page = $this->get('page', 0);
|
168
|
$page = $this->get('page', 0);
|
177
|
$size = $this->get('size', 10);
|
169
|
$size = $this->get('size', 10);
|
|
@@ -185,8 +177,7 @@ class HomeController extends AbstractAction |
|
@@ -185,8 +177,7 @@ class HomeController extends AbstractAction |
185
|
/**
|
177
|
/**
|
186
|
* 地址管理
|
178
|
* 地址管理
|
187
|
*/
|
179
|
*/
|
188
|
- public function addressAction()
|
|
|
189
|
- {
|
180
|
+ public function addressAction() {
|
190
|
// 设置网站标题
|
181
|
// 设置网站标题
|
191
|
$this->setTitle('地址管理');
|
182
|
$this->setTitle('地址管理');
|
192
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
183
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
|
@@ -210,8 +201,7 @@ class HomeController extends AbstractAction |
|
@@ -210,8 +201,7 @@ class HomeController extends AbstractAction |
210
|
/**
|
201
|
/**
|
211
|
* 修改地址或者添加新地址
|
202
|
* 修改地址或者添加新地址
|
212
|
*/
|
203
|
*/
|
213
|
- public function saveAddressAction()
|
|
|
214
|
- {
|
204
|
+ public function saveAddressAction() {
|
215
|
$result = array();
|
205
|
$result = array();
|
216
|
|
206
|
|
217
|
if ($this->isAjax()) {
|
207
|
if ($this->isAjax()) {
|
|
@@ -238,8 +228,7 @@ class HomeController extends AbstractAction |
|
@@ -238,8 +228,7 @@ class HomeController extends AbstractAction |
238
|
/**
|
228
|
/**
|
239
|
* 设置默认地址
|
229
|
* 设置默认地址
|
240
|
*/
|
230
|
*/
|
241
|
- public function defaultAddressAction()
|
|
|
242
|
- {
|
231
|
+ public function defaultAddressAction() {
|
243
|
$result = array();
|
232
|
$result = array();
|
244
|
|
233
|
|
245
|
if ($this->isAjax()) {
|
234
|
if ($this->isAjax()) {
|
|
@@ -260,8 +249,7 @@ class HomeController extends AbstractAction |
|
@@ -260,8 +249,7 @@ class HomeController extends AbstractAction |
260
|
/**
|
249
|
/**
|
261
|
* 删除地址
|
250
|
* 删除地址
|
262
|
*/
|
251
|
*/
|
263
|
- public function addressDelAction()
|
|
|
264
|
- {
|
252
|
+ public function addressDelAction() {
|
265
|
$result = array();
|
253
|
$result = array();
|
266
|
|
254
|
|
267
|
if ($this->isAjax()) {
|
255
|
if ($this->isAjax()) {
|
|
@@ -280,8 +268,7 @@ class HomeController extends AbstractAction |
|
@@ -280,8 +268,7 @@ class HomeController extends AbstractAction |
280
|
}
|
268
|
}
|
281
|
|
269
|
|
282
|
//在线客服
|
270
|
//在线客服
|
283
|
- public function onlineServiceAction()
|
|
|
284
|
- {
|
271
|
+ public function onlineServiceAction() {
|
285
|
// 设置网站标题
|
272
|
// 设置网站标题
|
286
|
$this->setTitle('在线客服');
|
273
|
$this->setTitle('在线客服');
|
287
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
274
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
|
@@ -296,8 +283,7 @@ class HomeController extends AbstractAction |
|
@@ -296,8 +283,7 @@ class HomeController extends AbstractAction |
296
|
}
|
283
|
}
|
297
|
|
284
|
|
298
|
//在线客服-具体详情
|
285
|
//在线客服-具体详情
|
299
|
- public function onlineServiceDetailAction()
|
|
|
300
|
- {
|
286
|
+ public function onlineServiceDetailAction() {
|
301
|
$service = array();
|
287
|
$service = array();
|
302
|
$cateId = $this->get('cateId', 0);
|
288
|
$cateId = $this->get('cateId', 0);
|
303
|
$cateName = $this->get('cateName', '');
|
289
|
$cateName = $this->get('cateName', '');
|
|
@@ -312,16 +298,14 @@ class HomeController extends AbstractAction |
|
@@ -312,16 +298,14 @@ class HomeController extends AbstractAction |
312
|
/**
|
298
|
/**
|
313
|
* 我的逛
|
299
|
* 我的逛
|
314
|
*/
|
300
|
*/
|
315
|
- public function myGuangAction()
|
|
|
316
|
- {
|
301
|
+ public function myGuangAction() {
|
317
|
echo 'My Guang';
|
302
|
echo 'My Guang';
|
318
|
}
|
303
|
}
|
319
|
|
304
|
|
320
|
/**
|
305
|
/**
|
321
|
* 意见反馈
|
306
|
* 意见反馈
|
322
|
*/
|
307
|
*/
|
323
|
- public function suggestAction()
|
|
|
324
|
- {
|
308
|
+ public function suggestAction() {
|
325
|
// 设置网站标题
|
309
|
// 设置网站标题
|
326
|
$this->setTitle('意见反馈');
|
310
|
$this->setTitle('意见反馈');
|
327
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
311
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
|
@@ -343,8 +327,7 @@ class HomeController extends AbstractAction |
|
@@ -343,8 +327,7 @@ class HomeController extends AbstractAction |
343
|
/**
|
327
|
/**
|
344
|
* 意见反馈-提交表单页面
|
328
|
* 意见反馈-提交表单页面
|
345
|
*/
|
329
|
*/
|
346
|
- public function suggestSubAction()
|
|
|
347
|
- {
|
330
|
+ public function suggestSubAction() {
|
348
|
|
331
|
|
349
|
// 设置网站标题
|
332
|
// 设置网站标题
|
350
|
$this->setTitle('反馈问题');
|
333
|
$this->setTitle('反馈问题');
|
|
@@ -372,8 +355,7 @@ class HomeController extends AbstractAction |
|
@@ -372,8 +355,7 @@ class HomeController extends AbstractAction |
372
|
/**
|
355
|
/**
|
373
|
* 异步上传图片
|
356
|
* 异步上传图片
|
374
|
*/
|
357
|
*/
|
375
|
- public function suggestimgUploadAction()
|
|
|
376
|
- {
|
358
|
+ public function suggestimgUploadAction() {
|
377
|
$filename = $this->post('filename', '');
|
359
|
$filename = $this->post('filename', '');
|
378
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
360
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
379
|
|
361
|
|
|
@@ -383,8 +365,7 @@ class HomeController extends AbstractAction |
|
@@ -383,8 +365,7 @@ class HomeController extends AbstractAction |
383
|
/**
|
365
|
/**
|
384
|
* 异步保存意见反馈数据
|
366
|
* 异步保存意见反馈数据
|
385
|
*/
|
367
|
*/
|
386
|
- public function savesuggestAction()
|
|
|
387
|
- {
|
368
|
+ public function savesuggestAction() {
|
388
|
if ($this->isAjax()) {
|
369
|
if ($this->isAjax()) {
|
389
|
$uid = $this->getUid();
|
370
|
$uid = $this->getUid();
|
390
|
$content = $this->post('content', '');
|
371
|
$content = $this->post('content', '');
|
|
@@ -398,8 +379,7 @@ class HomeController extends AbstractAction |
|
@@ -398,8 +379,7 @@ class HomeController extends AbstractAction |
398
|
/**
|
379
|
/**
|
399
|
* 会员等级展示页
|
380
|
* 会员等级展示页
|
400
|
*/
|
381
|
*/
|
401
|
- public function gradeAction()
|
|
|
402
|
- {
|
382
|
+ public function gradeAction() {
|
403
|
//设置网站seo信息
|
383
|
//设置网站seo信息
|
404
|
$this->setTitle('会员等级');
|
384
|
$this->setTitle('会员等级');
|
405
|
//显示网站导航头部信息
|
385
|
//显示网站导航头部信息
|
|
@@ -418,8 +398,7 @@ class HomeController extends AbstractAction |
|
@@ -418,8 +398,7 @@ class HomeController extends AbstractAction |
418
|
* 会员特权查看页
|
398
|
* 会员特权查看页
|
419
|
*/
|
399
|
*/
|
420
|
|
400
|
|
421
|
- public function preferentialAction()
|
|
|
422
|
- {
|
401
|
+ public function preferentialAction() {
|
423
|
//设置网站seo信息
|
402
|
//设置网站seo信息
|
424
|
$this->setTitle('会员等级');
|
403
|
$this->setTitle('会员等级');
|
425
|
//显示网站导航头部信息
|
404
|
//显示网站导航头部信息
|
|
@@ -433,12 +412,11 @@ class HomeController extends AbstractAction |
|
@@ -433,12 +412,11 @@ class HomeController extends AbstractAction |
433
|
}
|
412
|
}
|
434
|
|
413
|
|
435
|
/*
|
414
|
/*
|
436
|
- * 我的订单页面
|
415
|
+ * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
437
|
*/
|
416
|
*/
|
438
|
|
417
|
|
439
|
- public function orderAction()
|
|
|
440
|
- {
|
|
|
441
|
- //获得type值
|
418
|
+ public function orderAction() {
|
|
|
419
|
+ //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
442
|
$type = $this->get('type', 1);
|
420
|
$type = $this->get('type', 1);
|
443
|
$this->setTitle('我的订单');
|
421
|
$this->setTitle('我的订单');
|
444
|
$this->setNavHeader('我的订单');
|
422
|
$this->setNavHeader('我的订单');
|
|
@@ -448,7 +426,7 @@ class HomeController extends AbstractAction |
|
@@ -448,7 +426,7 @@ class HomeController extends AbstractAction |
448
|
} else {
|
426
|
} else {
|
449
|
$this->error();
|
427
|
$this->error();
|
450
|
}
|
428
|
}
|
451
|
-
|
429
|
+ //渲染模板
|
452
|
$this->_view->display('order', array(
|
430
|
$this->_view->display('order', array(
|
453
|
'order' => $order,
|
431
|
'order' => $order,
|
454
|
'pageFooter' => true,
|
432
|
'pageFooter' => true,
|
|
@@ -457,8 +435,7 @@ class HomeController extends AbstractAction |
|
@@ -457,8 +435,7 @@ class HomeController extends AbstractAction |
457
|
}
|
435
|
}
|
458
|
|
436
|
|
459
|
//ajax请求订单页面
|
437
|
//ajax请求订单页面
|
460
|
- public function getOrdersAction()
|
|
|
461
|
- {
|
438
|
+ public function getOrdersAction() {
|
462
|
//判断是不是ajax请求
|
439
|
//判断是不是ajax请求
|
463
|
if (!$this->isAjax()) {
|
440
|
if (!$this->isAjax()) {
|
464
|
$this->error();
|
441
|
$this->error();
|
|
@@ -473,15 +450,18 @@ class HomeController extends AbstractAction |
|
@@ -473,15 +450,18 @@ class HomeController extends AbstractAction |
473
|
$uid = '10267443'; //测试用
|
450
|
$uid = '10267443'; //测试用
|
474
|
//调用模型层getOrder方法获得并处理数据
|
451
|
//调用模型层getOrder方法获得并处理数据
|
475
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
452
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
476
|
- //如果没有订单数据,就给一个随便逛逛链接
|
453
|
+ /* 如果取不到订单数据时,分两种情况:
|
|
|
454
|
+ 1、page>1时,echo一个空格字符串到浏览器。
|
|
|
455
|
+ 2、page=1时,就给一个随便逛逛的链接。
|
|
|
456
|
+ * */
|
477
|
$order = array();
|
457
|
$order = array();
|
478
|
if (!empty($data)) {
|
458
|
if (!empty($data)) {
|
479
|
$order['orders'] = $data;
|
459
|
$order['orders'] = $data;
|
480
|
} else {
|
460
|
} else {
|
481
|
if ($page > 1) {
|
461
|
if ($page > 1) {
|
482
|
echo " ";
|
462
|
echo " ";
|
483
|
- } else {
|
|
|
484
|
- $order['walkwayUrl'] = 'http://www.baidu.com';
|
463
|
+ } elseif ($page = 1) {
|
|
|
464
|
+ $order['walkwayUrl'] = self::strollAction();
|
485
|
}
|
465
|
}
|
486
|
}
|
466
|
}
|
487
|
//渲染模板
|
467
|
//渲染模板
|
|
@@ -492,8 +472,7 @@ class HomeController extends AbstractAction |
|
@@ -492,8 +472,7 @@ class HomeController extends AbstractAction |
492
|
* 我的订单-取消订单
|
472
|
* 我的订单-取消订单
|
493
|
*/
|
473
|
*/
|
494
|
|
474
|
|
495
|
- public function cancelOrderAction()
|
|
|
496
|
- {
|
475
|
+ public function cancelOrderAction() {
|
497
|
|
476
|
|
498
|
//判断是不是ajax请求
|
477
|
//判断是不是ajax请求
|
499
|
if (!$this->isAjax()) {
|
478
|
if (!$this->isAjax()) {
|
|
@@ -506,8 +485,9 @@ class HomeController extends AbstractAction |
|
@@ -506,8 +485,9 @@ class HomeController extends AbstractAction |
506
|
$gender = Helpers::getGenderByCookie();
|
485
|
$gender = Helpers::getGenderByCookie();
|
507
|
$yh_channel = $this->get('yh_channel', 1);
|
486
|
$yh_channel = $this->get('yh_channel', 1);
|
508
|
$method = 'app.SpaceOrders.close';
|
487
|
$method = 'app.SpaceOrders.close';
|
|
|
488
|
+ //调用取消订单接口,返回订单取消状态
|
509
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
489
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
510
|
-
|
490
|
+ //将取消状态返回至浏览器
|
511
|
$this->echoJson($data);
|
491
|
$this->echoJson($data);
|
512
|
}
|
492
|
}
|
513
|
|
493
|
|
|
@@ -515,8 +495,7 @@ class HomeController extends AbstractAction |
|
@@ -515,8 +495,7 @@ class HomeController extends AbstractAction |
515
|
* 我的订单-删除订单
|
495
|
* 我的订单-删除订单
|
516
|
*/
|
496
|
*/
|
517
|
|
497
|
|
518
|
- public function delOrderAction()
|
|
|
519
|
- {
|
498
|
+ public function delOrderAction() {
|
520
|
//判断是不是ajax请求
|
499
|
//判断是不是ajax请求
|
521
|
if (!$this->isAjax()) {
|
500
|
if (!$this->isAjax()) {
|
522
|
$this->error();
|
501
|
$this->error();
|
|
@@ -528,15 +507,39 @@ class HomeController extends AbstractAction |
|
@@ -528,15 +507,39 @@ class HomeController extends AbstractAction |
528
|
$gender = Helpers::getGenderByCookie();
|
507
|
$gender = Helpers::getGenderByCookie();
|
529
|
$yh_channel = $this->get('yh_channel', 1);
|
508
|
$yh_channel = $this->get('yh_channel', 1);
|
530
|
$method = 'app.SpaceOrders.delOrderByCode';
|
509
|
$method = 'app.SpaceOrders.delOrderByCode';
|
|
|
510
|
+ //调用接口删除订单,并返回订单删除状态
|
531
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
511
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
512
|
+ //将订单删除状态返回至浏览器
|
532
|
$this->echoJson($data);
|
513
|
$this->echoJson($data);
|
533
|
}
|
514
|
}
|
534
|
|
515
|
|
|
|
516
|
+ /*
|
|
|
517
|
+ * 我的订单-支付链接获取
|
|
|
518
|
+ */
|
|
|
519
|
+
|
|
|
520
|
+ private function paymentAction() {
|
|
|
521
|
+ $gender = Helpers::getGenderByCookie();
|
|
|
522
|
+ $yh_channel = $this->get('yh_channel', 1);
|
|
|
523
|
+ OrderModel::payment($gender, $yh_channel);
|
|
|
524
|
+ }
|
|
|
525
|
+
|
|
|
526
|
+ /*
|
|
|
527
|
+ * 我的订单-随便逛逛链接获取
|
|
|
528
|
+ */
|
|
|
529
|
+
|
|
|
530
|
+ private function strollAction() {
|
|
|
531
|
+ //获取性别、频道数据
|
|
|
532
|
+ $gender = Helpers::getGenderByCookie();
|
|
|
533
|
+ $yh_channel = $this->get('yh_channel', 1);
|
|
|
534
|
+ //调用接口获取随便逛逛url地址,并return数据
|
|
|
535
|
+ $data = OrderModel::stroll($gender, $yh_channel);
|
|
|
536
|
+ return $data;
|
|
|
537
|
+ }
|
|
|
538
|
+
|
535
|
/**
|
539
|
/**
|
536
|
* 订单详情页
|
540
|
* 订单详情页
|
537
|
*/
|
541
|
*/
|
538
|
- public function orderDetailAction()
|
|
|
539
|
- {
|
542
|
+ public function orderDetailAction() {
|
540
|
$data = array(
|
543
|
$data = array(
|
541
|
'name' => '毛毛莉Lydia',
|
544
|
'name' => '毛毛莉Lydia',
|
542
|
'phoneNum' => '18600001133',
|
545
|
'phoneNum' => '18600001133',
|