|
@@ -24,23 +24,21 @@ class HomeController extends AbstractAction |
|
@@ -24,23 +24,21 @@ class HomeController extends AbstractAction |
24
|
/**
|
24
|
/**
|
25
|
* 初始化
|
25
|
* 初始化
|
26
|
*/
|
26
|
*/
|
27
|
- public function init()
|
|
|
28
|
- {
|
27
|
+ public function init() {
|
29
|
// 检查用户是否登录, 未登录则跳转到登录页
|
28
|
// 检查用户是否登录, 未登录则跳转到登录页
|
30
|
$this->_uid = $this->getUid(false);
|
29
|
$this->_uid = $this->getUid(false);
|
31
|
$action = $this->getRequest()->getActionName();
|
30
|
$action = $this->getRequest()->getActionName();
|
32
|
if (!$this->_uid && $action !== 'index') {
|
31
|
if (!$this->_uid && $action !== 'index') {
|
33
|
$this->go(Helpers::url('/signin.html'));
|
32
|
$this->go(Helpers::url('/signin.html'));
|
34
|
}
|
33
|
}
|
35
|
-
|
34
|
+
|
36
|
parent::init();
|
35
|
parent::init();
|
37
|
}
|
36
|
}
|
38
|
|
37
|
|
39
|
/**
|
38
|
/**
|
40
|
* 个人中心入口
|
39
|
* 个人中心入口
|
41
|
*/
|
40
|
*/
|
42
|
- public function indexAction()
|
|
|
43
|
- {
|
41
|
+ public function indexAction() {
|
44
|
// 设置网站标题
|
42
|
// 设置网站标题
|
45
|
$this->setTitle('个人中心');
|
43
|
$this->setTitle('个人中心');
|
46
|
$this->setNavHeader('个人中心');
|
44
|
$this->setNavHeader('个人中心');
|
|
@@ -65,8 +63,7 @@ class HomeController extends AbstractAction |
|
@@ -65,8 +63,7 @@ class HomeController extends AbstractAction |
65
|
/**
|
63
|
/**
|
66
|
* 用户收藏的商品
|
64
|
* 用户收藏的商品
|
67
|
*/
|
65
|
*/
|
68
|
- public function favoriteAction()
|
|
|
69
|
- {
|
66
|
+ public function favoriteAction() {
|
70
|
// 设置网站标题
|
67
|
// 设置网站标题
|
71
|
$this->setTitle('我的收藏');
|
68
|
$this->setTitle('我的收藏');
|
72
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
69
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
|
@@ -81,9 +78,9 @@ class HomeController extends AbstractAction |
|
@@ -81,9 +78,9 @@ class HomeController extends AbstractAction |
81
|
'pageFooter' => true,
|
78
|
'pageFooter' => true,
|
82
|
'favorite' => true,
|
79
|
'favorite' => true,
|
83
|
'hasFavProduct' => $favProducts,
|
80
|
'hasFavProduct' => $favProducts,
|
84
|
- 'productUrl' => '/product/new',
|
81
|
+ 'productUrl' => '/product/new',
|
85
|
'hasFavBrand' => $favBrands,
|
82
|
'hasFavBrand' => $favBrands,
|
86
|
- 'brandUrl' => '/product/new'
|
83
|
+ 'brandUrl' => '/product/new'
|
87
|
);
|
84
|
);
|
88
|
// 判断是否为品牌收藏页
|
85
|
// 判断是否为品牌收藏页
|
89
|
if ($tab === 'brand') {
|
86
|
if ($tab === 'brand') {
|
|
@@ -96,8 +93,7 @@ class HomeController extends AbstractAction |
|
@@ -96,8 +93,7 @@ class HomeController extends AbstractAction |
96
|
/**
|
93
|
/**
|
97
|
* 用户收藏的商品-删除
|
94
|
* 用户收藏的商品-删除
|
98
|
*/
|
95
|
*/
|
99
|
- public function favoriteDelAction()
|
|
|
100
|
- {
|
96
|
+ public function favoriteDelAction() {
|
101
|
$result = array();
|
97
|
$result = array();
|
102
|
|
98
|
|
103
|
if ($this->isAjax()) {
|
99
|
if ($this->isAjax()) {
|
|
@@ -117,8 +113,7 @@ class HomeController extends AbstractAction |
|
@@ -117,8 +113,7 @@ class HomeController extends AbstractAction |
117
|
/**
|
113
|
/**
|
118
|
* 个人信息
|
114
|
* 个人信息
|
119
|
*/
|
115
|
*/
|
120
|
- public function personalDetailsAction()
|
|
|
121
|
- {
|
116
|
+ public function personalDetailsAction() {
|
122
|
$this->setTitle('个人信息');
|
117
|
$this->setTitle('个人信息');
|
123
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
118
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
124
|
|
119
|
|
|
@@ -132,8 +127,7 @@ class HomeController extends AbstractAction |
|
@@ -132,8 +127,7 @@ class HomeController extends AbstractAction |
132
|
/**
|
127
|
/**
|
133
|
* YOHO币
|
128
|
* YOHO币
|
134
|
*/
|
129
|
*/
|
135
|
- public function currencyAction()
|
|
|
136
|
- {
|
130
|
+ public function currencyAction() {
|
137
|
$this->setTitle('YOHO币');
|
131
|
$this->setTitle('YOHO币');
|
138
|
$this->setNavHeader('YOHO币', true, false);
|
132
|
$this->setNavHeader('YOHO币', true, false);
|
139
|
|
133
|
|
|
@@ -147,8 +141,7 @@ class HomeController extends AbstractAction |
|
@@ -147,8 +141,7 @@ class HomeController extends AbstractAction |
147
|
/**
|
141
|
/**
|
148
|
* 优惠券
|
142
|
* 优惠券
|
149
|
*/
|
143
|
*/
|
150
|
- public function couponsAction()
|
|
|
151
|
- {
|
144
|
+ public function couponsAction() {
|
152
|
$this->setTitle('优惠券');
|
145
|
$this->setTitle('优惠券');
|
153
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
146
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
154
|
|
147
|
|
|
@@ -168,8 +161,7 @@ class HomeController extends AbstractAction |
|
@@ -168,8 +161,7 @@ class HomeController extends AbstractAction |
168
|
/**
|
161
|
/**
|
169
|
* 我的消息
|
162
|
* 我的消息
|
170
|
*/
|
163
|
*/
|
171
|
- public function messageAction()
|
|
|
172
|
- {
|
164
|
+ public function messageAction() {
|
173
|
$uid = $this->getUid();
|
165
|
$uid = $this->getUid();
|
174
|
$page = $this->get('page', 0);
|
166
|
$page = $this->get('page', 0);
|
175
|
$size = $this->get('size', 10);
|
167
|
$size = $this->get('size', 10);
|
|
@@ -182,8 +174,7 @@ class HomeController extends AbstractAction |
|
@@ -182,8 +174,7 @@ class HomeController extends AbstractAction |
182
|
/**
|
174
|
/**
|
183
|
* 地址管理
|
175
|
* 地址管理
|
184
|
*/
|
176
|
*/
|
185
|
- public function addressAction()
|
|
|
186
|
- {
|
177
|
+ public function addressAction() {
|
187
|
// 设置网站标题
|
178
|
// 设置网站标题
|
188
|
$this->setTitle('地址管理');
|
179
|
$this->setTitle('地址管理');
|
189
|
$this->setNavHeader('地址管理');
|
180
|
$this->setNavHeader('地址管理');
|
|
@@ -203,8 +194,7 @@ class HomeController extends AbstractAction |
|
@@ -203,8 +194,7 @@ class HomeController extends AbstractAction |
203
|
/**
|
194
|
/**
|
204
|
* 修改地址或者添加新地址
|
195
|
* 修改地址或者添加新地址
|
205
|
*/
|
196
|
*/
|
206
|
- public function saveAddressAction()
|
|
|
207
|
- {
|
197
|
+ public function saveAddressAction() {
|
208
|
$result = array();
|
198
|
$result = array();
|
209
|
|
199
|
|
210
|
if ($this->isAjax()) {
|
200
|
if ($this->isAjax()) {
|
|
@@ -230,8 +220,7 @@ class HomeController extends AbstractAction |
|
@@ -230,8 +220,7 @@ class HomeController extends AbstractAction |
230
|
/**
|
220
|
/**
|
231
|
* 设置默认地址
|
221
|
* 设置默认地址
|
232
|
*/
|
222
|
*/
|
233
|
- public function defaultAddressAction()
|
|
|
234
|
- {
|
223
|
+ public function defaultAddressAction() {
|
235
|
$result = array();
|
224
|
$result = array();
|
236
|
|
225
|
|
237
|
if ($this->isAjax()) {
|
226
|
if ($this->isAjax()) {
|
|
@@ -250,8 +239,7 @@ class HomeController extends AbstractAction |
|
@@ -250,8 +239,7 @@ class HomeController extends AbstractAction |
250
|
/**
|
239
|
/**
|
251
|
* 删除地址
|
240
|
* 删除地址
|
252
|
*/
|
241
|
*/
|
253
|
- public function delAddressAction()
|
|
|
254
|
- {
|
242
|
+ public function delAddressAction() {
|
255
|
$result = array();
|
243
|
$result = array();
|
256
|
|
244
|
|
257
|
if ($this->isAjax()) {
|
245
|
if ($this->isAjax()) {
|
|
@@ -269,8 +257,7 @@ class HomeController extends AbstractAction |
|
@@ -269,8 +257,7 @@ class HomeController extends AbstractAction |
269
|
}
|
257
|
}
|
270
|
|
258
|
|
271
|
//在线客服
|
259
|
//在线客服
|
272
|
- public function onlineServiceAction()
|
|
|
273
|
- {
|
260
|
+ public function onlineServiceAction() {
|
274
|
// 设置网站标题
|
261
|
// 设置网站标题
|
275
|
$this->setTitle('在线客服');
|
262
|
$this->setTitle('在线客服');
|
276
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
263
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
|
@@ -285,8 +272,7 @@ class HomeController extends AbstractAction |
|
@@ -285,8 +272,7 @@ class HomeController extends AbstractAction |
285
|
}
|
272
|
}
|
286
|
|
273
|
|
287
|
//在线客服-具体详情
|
274
|
//在线客服-具体详情
|
288
|
- public function onlineServiceDetailAction()
|
|
|
289
|
- {
|
275
|
+ public function onlineServiceDetailAction() {
|
290
|
$service = array();
|
276
|
$service = array();
|
291
|
$cateId = $this->get('cateId', 0);
|
277
|
$cateId = $this->get('cateId', 0);
|
292
|
$cateName = $this->get('cateName', '');
|
278
|
$cateName = $this->get('cateName', '');
|
|
@@ -301,8 +287,7 @@ class HomeController extends AbstractAction |
|
@@ -301,8 +287,7 @@ class HomeController extends AbstractAction |
301
|
/**
|
287
|
/**
|
302
|
* 我的逛
|
288
|
* 我的逛
|
303
|
*/
|
289
|
*/
|
304
|
- public function myGuangAction()
|
|
|
305
|
- {
|
290
|
+ public function myGuangAction() {
|
306
|
$page = $this->get('page', 1);
|
291
|
$page = $this->get('page', 1);
|
307
|
$limit = $this->get('limit', 10);
|
292
|
$limit = $this->get('limit', 10);
|
308
|
$uid = $this->getUid();
|
293
|
$uid = $this->getUid();
|
|
@@ -325,8 +310,7 @@ class HomeController extends AbstractAction |
|
@@ -325,8 +310,7 @@ class HomeController extends AbstractAction |
325
|
/**
|
310
|
/**
|
326
|
* 意见反馈
|
311
|
* 意见反馈
|
327
|
*/
|
312
|
*/
|
328
|
- public function suggestAction()
|
|
|
329
|
- {
|
313
|
+ public function suggestAction() {
|
330
|
// 设置网站标题
|
314
|
// 设置网站标题
|
331
|
$this->setTitle('意见反馈');
|
315
|
$this->setTitle('意见反馈');
|
332
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
316
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
|
@@ -348,8 +332,7 @@ class HomeController extends AbstractAction |
|
@@ -348,8 +332,7 @@ class HomeController extends AbstractAction |
348
|
/**
|
332
|
/**
|
349
|
* 意见反馈-提交表单页面
|
333
|
* 意见反馈-提交表单页面
|
350
|
*/
|
334
|
*/
|
351
|
- public function suggestSubAction()
|
|
|
352
|
- {
|
335
|
+ public function suggestSubAction() {
|
353
|
// 设置网站标题
|
336
|
// 设置网站标题
|
354
|
$this->setTitle('反馈问题');
|
337
|
$this->setTitle('反馈问题');
|
355
|
|
338
|
|
|
@@ -370,8 +353,7 @@ class HomeController extends AbstractAction |
|
@@ -370,8 +353,7 @@ class HomeController extends AbstractAction |
370
|
/**
|
353
|
/**
|
371
|
* 异步上传图片
|
354
|
* 异步上传图片
|
372
|
*/
|
355
|
*/
|
373
|
- public function suggestimgUploadAction()
|
|
|
374
|
- {
|
356
|
+ public function suggestimgUploadAction() {
|
375
|
//$filename = $this->post('filename', '');
|
357
|
//$filename = $this->post('filename', '');
|
376
|
$result = UserModel::saveSuggestImg('fileData');
|
358
|
$result = UserModel::saveSuggestImg('fileData');
|
377
|
|
359
|
|
|
@@ -381,8 +363,7 @@ class HomeController extends AbstractAction |
|
@@ -381,8 +363,7 @@ class HomeController extends AbstractAction |
381
|
/**
|
363
|
/**
|
382
|
* 异步保存意见反馈数据
|
364
|
* 异步保存意见反馈数据
|
383
|
*/
|
365
|
*/
|
384
|
- public function savesuggestAction()
|
|
|
385
|
- {
|
366
|
+ public function savesuggestAction() {
|
386
|
if ($this->isAjax()) {
|
367
|
if ($this->isAjax()) {
|
387
|
$uid = $this->getUid();
|
368
|
$uid = $this->getUid();
|
388
|
$content = $this->post('content', '');
|
369
|
$content = $this->post('content', '');
|
|
@@ -397,8 +378,7 @@ class HomeController extends AbstractAction |
|
@@ -397,8 +378,7 @@ class HomeController extends AbstractAction |
397
|
/**
|
378
|
/**
|
398
|
* 异步点击靠谱或者不靠谱
|
379
|
* 异步点击靠谱或者不靠谱
|
399
|
*/
|
380
|
*/
|
400
|
- public function upAndDownAction()
|
|
|
401
|
- {
|
381
|
+ public function upAndDownAction() {
|
402
|
if ($this->isAjax()) {
|
382
|
if ($this->isAjax()) {
|
403
|
$uid = $this->getUid();
|
383
|
$uid = $this->getUid();
|
404
|
$udid = $this->getUdid();
|
384
|
$udid = $this->getUdid();
|
|
@@ -412,8 +392,7 @@ class HomeController extends AbstractAction |
|
@@ -412,8 +392,7 @@ class HomeController extends AbstractAction |
412
|
/**
|
392
|
/**
|
413
|
* 会员等级展示页
|
393
|
* 会员等级展示页
|
414
|
*/
|
394
|
*/
|
415
|
- public function gradeAction()
|
|
|
416
|
- {
|
395
|
+ public function gradeAction() {
|
417
|
//设置网站seo信息
|
396
|
//设置网站seo信息
|
418
|
$this->setTitle('会员等级');
|
397
|
$this->setTitle('会员等级');
|
419
|
//显示网站导航头部信息
|
398
|
//显示网站导航头部信息
|
|
@@ -428,23 +407,23 @@ class HomeController extends AbstractAction |
|
@@ -428,23 +407,23 @@ class HomeController extends AbstractAction |
428
|
/*
|
407
|
/*
|
429
|
* 会员特权查看页
|
408
|
* 会员特权查看页
|
430
|
*/
|
409
|
*/
|
431
|
- public function preferentialAction()
|
|
|
432
|
- {
|
410
|
+
|
|
|
411
|
+ public function preferentialAction() {
|
433
|
//设置网站seo信息
|
412
|
//设置网站seo信息
|
434
|
$this->setTitle('会员等级');
|
413
|
$this->setTitle('会员等级');
|
435
|
//显示网站导航头部信息
|
414
|
//显示网站导航头部信息
|
436
|
$this->setNavHeader('会员特权详情');
|
415
|
$this->setNavHeader('会员特权详情');
|
437
|
$data = GradeModel::getPreferential();
|
416
|
$data = GradeModel::getPreferential();
|
438
|
$data['pageFooter'] = true;
|
417
|
$data['pageFooter'] = true;
|
439
|
-
|
418
|
+
|
440
|
$this->_view->display('privilege', $data);
|
419
|
$this->_view->display('privilege', $data);
|
441
|
}
|
420
|
}
|
442
|
|
421
|
|
443
|
/*
|
422
|
/*
|
444
|
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
423
|
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
445
|
*/
|
424
|
*/
|
446
|
- public function orderAction()
|
|
|
447
|
- {
|
425
|
+
|
|
|
426
|
+ public function orderAction() {
|
448
|
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
427
|
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
449
|
$type = $this->get('type', 1);
|
428
|
$type = $this->get('type', 1);
|
450
|
$this->setTitle('我的订单');
|
429
|
$this->setTitle('我的订单');
|
|
@@ -464,17 +443,17 @@ class HomeController extends AbstractAction |
|
@@ -464,17 +443,17 @@ class HomeController extends AbstractAction |
464
|
}
|
443
|
}
|
465
|
|
444
|
|
466
|
//ajax请求订单页面
|
445
|
//ajax请求订单页面
|
467
|
- public function getOrdersAction()
|
|
|
468
|
- {
|
446
|
+ public function getOrdersAction() {
|
469
|
//判断是不是ajax请求
|
447
|
//判断是不是ajax请求
|
470
|
if (!$this->isAjax()) {
|
448
|
if (!$this->isAjax()) {
|
471
|
$this->error();
|
449
|
$this->error();
|
472
|
}
|
450
|
}
|
473
|
- //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
|
451
|
+ //获取基本参数:type 1:全部 2:待付款 3:待发货 4:待收货 5:待评论 7:失败 取消 订单
|
474
|
$type = $this->get('type', 1);
|
452
|
$type = $this->get('type', 1);
|
475
|
$page = $this->get('page', 1);
|
453
|
$page = $this->get('page', 1);
|
476
|
$limit = $this->get('limit', 10);
|
454
|
$limit = $this->get('limit', 10);
|
477
|
$uid = $this->getUid();
|
455
|
$uid = $this->getUid();
|
|
|
456
|
+ $uid = '12';//测试数据
|
478
|
//调用模型层getOrder方法获得并处理数据
|
457
|
//调用模型层getOrder方法获得并处理数据
|
479
|
$data = OrderModel::getOrder($type, $page, $limit, $uid);
|
458
|
$data = OrderModel::getOrder($type, $page, $limit, $uid);
|
480
|
/* 如果取不到订单数据时,分两种情况:
|
459
|
/* 如果取不到订单数据时,分两种情况:
|
|
@@ -499,8 +478,7 @@ class HomeController extends AbstractAction |
|
@@ -499,8 +478,7 @@ class HomeController extends AbstractAction |
499
|
* 我的订单-取消订单
|
478
|
* 我的订单-取消订单
|
500
|
*/
|
479
|
*/
|
501
|
|
480
|
|
502
|
- public function cancelOrderAction()
|
|
|
503
|
- {
|
481
|
+ public function cancelOrderAction() {
|
504
|
|
482
|
|
505
|
//判断是不是ajax请求
|
483
|
//判断是不是ajax请求
|
506
|
if (!$this->isAjax()) {
|
484
|
if (!$this->isAjax()) {
|
|
@@ -522,8 +500,7 @@ class HomeController extends AbstractAction |
|
@@ -522,8 +500,7 @@ class HomeController extends AbstractAction |
522
|
* 我的订单-删除订单
|
500
|
* 我的订单-删除订单
|
523
|
*/
|
501
|
*/
|
524
|
|
502
|
|
525
|
- public function delOrderAction()
|
|
|
526
|
- {
|
503
|
+ public function delOrderAction() {
|
527
|
//判断是不是ajax请求
|
504
|
//判断是不是ajax请求
|
528
|
if (!$this->isAjax()) {
|
505
|
if (!$this->isAjax()) {
|
529
|
$this->error();
|
506
|
$this->error();
|
|
@@ -544,8 +521,7 @@ class HomeController extends AbstractAction |
|
@@ -544,8 +521,7 @@ class HomeController extends AbstractAction |
544
|
* 我的订单-支付链接获取
|
521
|
* 我的订单-支付链接获取
|
545
|
*/
|
522
|
*/
|
546
|
|
523
|
|
547
|
- private function paymentAction()
|
|
|
548
|
- {
|
524
|
+ private function paymentAction() {
|
549
|
$gender = Helpers::getGenderByCookie();
|
525
|
$gender = Helpers::getGenderByCookie();
|
550
|
$yh_channel = $this->get('yh_channel', 1);
|
526
|
$yh_channel = $this->get('yh_channel', 1);
|
551
|
OrderModel::payment($gender, $yh_channel);
|
527
|
OrderModel::payment($gender, $yh_channel);
|
|
@@ -555,8 +531,7 @@ class HomeController extends AbstractAction |
|
@@ -555,8 +531,7 @@ class HomeController extends AbstractAction |
555
|
* 我的订单-随便逛逛链接获取
|
531
|
* 我的订单-随便逛逛链接获取
|
556
|
*/
|
532
|
*/
|
557
|
|
533
|
|
558
|
- private function strollAction()
|
|
|
559
|
- {
|
534
|
+ private function strollAction() {
|
560
|
//获取性别、频道数据
|
535
|
//获取性别、频道数据
|
561
|
$gender = Helpers::getGenderByCookie();
|
536
|
$gender = Helpers::getGenderByCookie();
|
562
|
$yh_channel = $this->get('yh_channel', 1);
|
537
|
$yh_channel = $this->get('yh_channel', 1);
|
|
@@ -568,8 +543,7 @@ class HomeController extends AbstractAction |
|
@@ -568,8 +543,7 @@ class HomeController extends AbstractAction |
568
|
/**
|
543
|
/**
|
569
|
* 订单详情页
|
544
|
* 订单详情页
|
570
|
*/
|
545
|
*/
|
571
|
- public function orderDetailAction()
|
|
|
572
|
- {
|
546
|
+ public function orderDetailAction() {
|
573
|
$data = array(
|
547
|
$data = array(
|
574
|
'name' => '毛毛莉Lydia',
|
548
|
'name' => '毛毛莉Lydia',
|
575
|
'phoneNum' => '18600001133',
|
549
|
'phoneNum' => '18600001133',
|