Favorite.php
13 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<?php
use Action\WebAction;
use WebPlugin\Helpers;
use Home\UserModel;
use LibModels\Web\Product\FavoriteData;
use LibModels\Wap\Home\UserData;
/**
* 商品收藏
*/
class FavoriteController extends WebAction
{
/**
* 我的收藏
*/
public function indexAction()
{
//判断是否登录
$uid = $this->auditJumpLogin();
$page = 1;
$result = FavoriteData::favoriteProductData($uid, $page, 10);
// print_r($result);
$all = array();
if($result['data']){
$all[0]['name'] = '全部';
$all[0]['url'] = Helpers::url('/product/favorite');
$all[0]['count'] = $result['data']['total'];
foreach ($result['data']['category_list'] as $catekey => $cateval){
$all[$catekey + 1]['name'] = $cateval['category_name'];
$all[$catekey + 1]['url'] = Helpers::url('/product/favorite', array('middle_sort_id' => $cateval['category_id']));
$all[$catekey + 1]['count'] = 0;
}
}
$data = array(
'path' => UserModel::getCenterCrumb('我的收藏'),
'userThumb' => UserModel::getUserHeadImg($uid),
'homeNav' => UserModel::getCenterLeftNav('我的收藏'),
'tabs' => array(
array(
'active' => true,
'url' => '',
'name' => '商品收藏'
),
array(
'url' => '',
'name' => '品牌收藏'
),
array(
'url' => '',
'name' => '文章收藏'
)
),
'favProducts' => array(
'sort' => array(
'default' => array(
array(
'name' => '全部',
'count' => 140,
'focus' => true,
'url' => ''
)
),
'all' => $all
// 'all' => array(
// array(
// 'name' => '全部',
// 'count' => 140,
// 'focus' => true,
// 'url' => ''
// ),
// array(
// 'name' => 'T恤',
// 'count' => 5,
// 'url' => ''
// ),
// array(
// 'name' => '衬衫',
// 'count' => 40,
// 'url' => ''
// )
// )
),
'reduction' => array(
'count' => 0,
'url' => ''
),
'filter' => array(
'reductionUrl' => '',
'reductionChecked' => true,
'activityUrl' => '',
'activityChecked' => true
),
'goods' => array(
array(
'skn' => '239557',
'img' => 'http://img12.static.yhbimg.com/goodsimg/2016/01/14/07/02b9ce4acb9374022cf645634574902f1a.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90',
'name' => 'VEIL ADVOCATED CHAOS Snapback 熔岩体刺绣棒球帽',
'url' => '',
'activites' => array(
'count' => 1,
'list' => array(
array(
'type' => '现金折扣',
'name' => '冬装季末特享',
'desc' => '折上满¥599再减¥100'
),
array(
'type' => '满送礼品',
'name' => '全场99元加价购'
),
array(
'type' => '满送礼品',
'name' => '全场59元加价购'
)
)
),
'price' => '239.00',
'priceDown' => '30.00',
'buyNow' => '/path/to/buy',
// 'buyAgain' => '/path/to/buy', //再次购买链接
// 'soldOut' => true,
// 'hadNoticed' => true, //已经订阅通知
'delUrl' => ''
)
),
'pager' => array(
'hasCheckAll' => true,
'count' => 24,
'curPage' => 1,
'totalPages' => 4,
'pagerHtml' => '<a href="?page=2&type=3"><span class="iconfont"></span>上一页</a><a href="?page=1&type=3">1</a><a class="cur" href="?page=2&type=3">2</a><a href="?page=3&type=3">3</a><a href="?page=2&type=3">下一页<span class="iconfont"></span></a>'
)
)
// 'favBrands' => array(
// 'brands' => array(
// array(
// 'img' => 'http://img13.static.yhbimg.com/brandLogo/2015/12/07/11/02ad8c091053e36261ac4eace80ba40c54.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90',
// 'url' => '',
// 'name' => 'ACROSS!',
// 'naCount' => 1,
// 'colCount' => 2300,
// 'delUrl' => ''
// )
// ),
// 'pager' => array(
// 'hasCheckAll' => true,
// 'count' => 24,
// 'curPage' => 1,
// 'totalPages' => 4,
// 'pagerHtml' => '<a href="?page=2&type=3"><span class="iconfont"></span>上一页</a><a href="?page=1&type=3">1</a><a class="cur" href="?page=2&type=3">2</a><a href="?page=3&type=3">3</a><a href="?page=2&type=3">下一页<span class="iconfont"></span></a>'
// )
// )
// 'favArticles' => array(
// 'articles' => array(
// array(
// 'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/02/17/06/02f6d182974252df932839932b1f2f8b9c.jpg?imageView/2/w/600/h/200',
// 'url' => '',
// 'name' => ' 趁着好天气,换上一身轻松的装备,骑车去郊游吧',
// 'desc' => '看着外面天气这么好,春节假期的欢乐应该延续一下,马上周末,快约上三五好友去郊游吧!'
// )
// ),
// 'pager' => array(
// 'hasCheckAll' => true,
// 'count' => 24,
// 'curPage' => 1,
// 'totalPages' => 4,
// 'pagerHtml' => '<a href="?page=2&type=3"><span class="iconfont"></span>上一页</a><a href="?page=1&type=3">1</a><a class="cur" href="?page=2&type=3">2</a><a href="?page=3&type=3">3</a><a href="?page=2&type=3">下一页<span class="iconfont"></span></a>'
// )
// )
);
$this->_view->display('favorite', array('meFavoritePage' => true, 'meFavorite' => $data));
}
/**
* 品牌收藏-新品到着
*/
public function newproductAction()
{
$this->_view->display('na-list', array(
'naGoods' => array(
// 'pre' => 'path/to/ajax',
'goods' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2016/02/02/08/0262ec823af3dcecc5fff8c687fc872c31.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90',
'url' => '',
'name' => 'Master Plan PU拼接魔术贴运动鞋 ',
'salePrice' => '699.00',
'marketPrice' => '799.00'
)
),
'next' => '/home/newproduct'
)
));
}
/**
* 商品收藏,降价通知
*/
public function reductionAction()
{
$data = array(
'path' => array(
array(
'href' => 'www.yohobuy.com',
'name' => 'YOHO!有货首页'
),
array(
'href' => 'www.yohobuy.com/home',
'name' => '个人中心'
),
array(
'name' => '订单中心'
)
),
'userThumb' => 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100',
'homeNav' => array(
array(
'title' => '交易管理',
'subNav' => array(
array(
'name' => '我的订单',
'href' => '/',
'active' => true
),
array(
'name' => '我的收藏',
'href' => '/'
),
array(
'name' => '我的YOHO币',
'href' => '/'
),
array(
'name' => '我的红包',
'href' => '/'
),
array(
'name' => '我的优惠券',
'href' => '/'
),
array(
'name' => '我的VIP',
'href' => '/'
)
)
)
),
'tabs' => array(
array(
'active' => true,
'url' => '',
'name' => '商品收藏'
),
array(
'url' => '',
'name' => '品牌收藏'
),
array(
'url' => '',
'name' => '文章收藏'
)
),
//'reductionUrl' => 'xxx',
'goods' => array(
array(
'skn' => '239557',
'img' => 'http://img12.static.yhbimg.com/goodsimg/2016/01/14/07/02b9ce4acb9374022cf645634574902f1a.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90',
'name' => 'VEIL ADVOCATED CHAOS Snapback 熔岩体刺绣棒球帽',
'url' => '',
'activites' => array(
'count' => 1,
'list' => array(
array(
'type' => '现金折扣',
'name' => '冬装季末特享',
'desc' => '折上满¥599再减¥100'
),
array(
'type' => '满送礼品',
'name' => '全场99元加价购'
),
array(
'type' => '满送礼品',
'name' => '全场59元加价购'
)
)
),
'price' => '239.00',
'priceDown' => '30.00',
'buyNow' => '/path/to/buy',
// 'buyAgain' => '/path/to/buy', //再次购买链接
// 'soldOut' => true,
'hadNoticed' => true, //已经订阅通知
'delUrl' => ''
)
)
);
$this->_view->display('../../index/home/reduction', array('meFavoritePage' => true, 'meFavorite' => $data));
}
/**
* 降价通知
*/
public function noticeAction()
{
$this->echoJson(array('code' => 200, 'data' => array('num' => 3)));
}
/**
* 取消通知
*/
public function cancelnoticeAction()
{
$this->echoJson(array('code' => 200, 'data' => array('num' => 3)));
}
}