Detail.php
4.66 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
<?php
use Action\AbstractAction;
/**
* 商品详情的控制器
*/
class DetailController extends AbstractAction
{
/**
* 商品详情
*
* @param int productId
* @param int goodsId
*/
public function indexAction()
{
$productId = $this->param('productId');
$productId = 22399;
if (!is_numeric($productId)) {
$this->error();
}
$goodsId = $this->param('goodsId');
$goodsId = 32443;
if (!is_numeric($goodsId)) {
$this->error();
}
$uid = $this->getUid();
$data = \Product\DetailModel::getBaseInfo($productId, $goodsId, $uid);
if (array() === $data) {
$this->error();
}
$data['goodsDetailPage'] = true;
if (isset($data['goodsName'])) {
$this->setTitle($data['goodsName']);
}
$this->setNavHeader('商品详情');
// 渲染模板
$this->_view->display('index', $data);
}
/**
* 尺码描述信息
*/
public function introAction()
{
$productSkn = $this->param('productSkn');
$productSkn = 50027562;
if (!is_numeric($productSkn)) {
$this->error();
}
$data = \Product\DetailModel::getSizeInfo($productSkn);
if (array() === $data) {
echo ' ';
exit();
}
$this->_view->display('intro', $data);
}
/**
* 购买评价列表
*
* @param int productId
* @param int total
*/
public function commentsAction()
{
$total = $this->get('total');
if (!is_numeric($total)) {
$total = 0;
}
if ($total) {
$this->setNavHeader('购买评价(' . $total . ')');
} else {
$this->setNavHeader('购买评价');
}
$this->setTitle('购买评价');
$data = array(
'goodsCommentsPage' => true,
'pageFooter' => true,
'comments' => array(
'list' => array(
array(
'userName' => 'Lynnic',
'desc' => '购买了白色Mate7',
'content' => '活动时买的,挺超值。上身效果也不错。质量
很好,买送人的,很满意。而且物流相当给...',
'time' => '2014-08-12 10:24:26'
),
array(
'userName' => 'Lynnic',
'desc' => '购买了白色Mate7',
'content' => '活动时买的,挺超值。上身效果也不错。质量
很好,买送人的,很满意。而且物流相当给...',
'time' => '2014-08-12 10:24:26'
),
array(
'userName' => 'Lynnic',
'desc' => '购买了白色Mate7',
'content' => '活动时买的,挺超值。上身效果也不错。质量
很好,买送人的,很满意。而且物流相当给...',
'time' => '2014-08-12 10:24:26'
)
)
),
);
// 渲染模板
$this->_view->display('comments', $data);
}
/**
* 购买咨询列表
*
* @param int productId
* @param int total
*/
public function consultsAction()
{
$productId = $this->get('product_id', 0);
$total = $this->get('total', 0);
if (!is_numeric($total)) {
$total = 0;
}
if ($total) {
$this->setNavHeader('购买咨询(' . $total . ')');
} else {
$this->setNavHeader('购买咨询');
}
$this->setTitle('购买咨询');
$data = array(
'goodsConsultsPage' => true,
'pageFooter' => true,
'consults' => array(
'list' => \Product\DetailModel::getConsults($productId),
)
);
// 渲染模板
$this->_view->display('consults', $data);
}
/**
* 我要咨询
*/
public function consultformAction()
{
$data = array(
'consultform' => true,
'pageHeader' => array(
'navBack' => 'sss ',
// 'navHome' => 'sss ',
'navTitle' => '我要咨询'
)
);
$this->_view->assign('title', '我要咨询');
//$this->_view->display('brand', compact('brands'));
// 渲染模板
$this->_view->display('consultform', $data);
}
}