Home.php
4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 个人中心相关的控制器
*
* @name HomeController
* @package
* @copyright yoho.inc
* @version 1.0 (2015-10-28 16:28:32)
* @author fei.hong <fei.hong@yoho.cn>
*/
class HomeController extends AbstractAction
{
/**
* 个人中心入口
*/
public function indexAction()
{
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
// print_r($data);
$data['homeHeader'] = array(
'myHomePage' => true,
'searchUrl' => Helpers::url('/search', null, 'search')
);
$data['recommendForYou'] = array(
'recommendList' => array(
array(
'img' => ''
),
array(
'img' => ''
),
array(
'img' => ''
),
array(
'img' => ''
),
array(
'img' => ''
)
)
);
$data['pageFooter'] = true;
// 设置网站标题
$this->setTitle('个人中心');
$this->_view->display('index', $data);
}
/**
* 用户订单
*/
public function ordersAction()
{
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$order = array(
'orders' => array(
array(
'orderNum' => '408539077',
'tradingStatus' => '交易成功',
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'count' => 2,
'sumCost' => '699.00',
'unpaid' => true,
)
)
);
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
// print_r($orders);
}
/**
* 用户收藏的商品
*/
public function favoriteAction()
{
$uid = $this->getUid();
$favProducts = \Index\UserModel::getFavProductData($uid);
print_r($favProducts);
}
/**
* 用户收藏的品牌
*/
public function favoritebrandAction()
{
$uid = $this->getUid();
$gender = Helpers::getGenderByCookie();
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
print_r($favBrands);
}
/**
* 个人信息
*/
public function personalDetailsAction()
{
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
$this->_view->display('personal-details', $data);
}
/**
* YOHO币
*/
public function currencyAction()
{
// $uid = $this->getUid();
// $favBrands = \Index\UserModel::getYohoCoinData($uid);
// print_r($favBrands);
$this->_view->display('yoho-coin', array('yohoCoin' => array('coinNum' => 0)));
}
/**
* 优惠券
*/
public function couponsAction()
{
$uid = $this->getUid();
$status = $this->get('status', 0);
$coupons = \Index\UserModel::getCouponData($uid, $status);
print_r($coupons);
}
/**
* 地址管理
*/
public function addressAction()
{
$uid = $this->getUid();
$address = \Index\UserModel::getAddressData($uid);
print_r($address);
}
/**
* 我的逛
*/
public function myGuangAction()
{
echo 'My Guang';
}
/**
* 意见反馈
*/
public function suggestAction()
{
$udid = $this->getUdid();
$page = $this->get('page', 1);
$limit = $this->get('limit', 30);
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
print_r($suggest);
}
/**
* 异步保存意见反馈数据
*/
public function savesuggestAction()
{
if($this->isAjax()) {
$uid = $this->getUid();
$content = $this->post('content', '');
$suggest_type = $this->get('suggest_type', 2);
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
$this->echoJson($result);
}
}
}