do add product detail page
Showing
1 changed file
with
127 additions
and
2 deletions
@@ -30,7 +30,7 @@ class DetailModel | @@ -30,7 +30,7 @@ class DetailModel | ||
30 | $result = array(); | 30 | $result = array(); |
31 | 31 | ||
32 | if (is_numeric($productId) && is_numeric($goodsId)) { | 32 | if (is_numeric($productId) && is_numeric($goodsId)) { |
33 | - // 调用接口 | 33 | + // 调用服务 |
34 | $baseInfo = DetailData::baseInfo($productId, $uid); | 34 | $baseInfo = DetailData::baseInfo($productId, $uid); |
35 | 35 | ||
36 | // 商品名称 | 36 | // 商品名称 |
@@ -176,9 +176,134 @@ class DetailModel | @@ -176,9 +176,134 @@ class DetailModel | ||
176 | */ | 176 | */ |
177 | public static function getSizeInfo($productSkn) | 177 | public static function getSizeInfo($productSkn) |
178 | { | 178 | { |
179 | + $result = array(); | ||
180 | + | ||
181 | + if (is_numeric($productSkn)) { | ||
182 | + // 调用服务 | ||
179 | $sizeInfo = DetailData::sizeInfo($productSkn); | 183 | $sizeInfo = DetailData::sizeInfo($productSkn); |
180 | 184 | ||
181 | - var_dump($sizeInfo); | 185 | + // 商品信息 |
186 | + if (isset($sizeInfo['productDescBo']['erpProductId'])) { | ||
187 | + $result['goodsDescription'] = array( | ||
188 | + 'title' => '商品信息', | ||
189 | + 'enTitle' => 'PRODUCT INFO', | ||
190 | + 'detail' => array( | ||
191 | + array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']), | ||
192 | + array('param' => '颜色:' . $sizeInfo['productDescBo']['colorName']), | ||
193 | + ), | ||
194 | + ); | ||
195 | + } | ||
196 | + if (!empty($sizeInfo['productDescBo']['standardBos'])) { | ||
197 | + foreach ($sizeInfo['productDescBo']['standardBos'] as $value) { | ||
198 | + $result['goodsDescription']['detail'][] = $value['standardName'] . ':' . $value['standardVal']; | ||
199 | + } | ||
200 | + } | ||
201 | + if (isset($sizeInfo['productIntroBo']['productIntro'])) { | ||
202 | + $productIntro = strstr($sizeInfo['productIntroBo']['productIntro'], '<br />', true); | ||
203 | + if ($productIntro) { | ||
204 | + $result['goodsDescription']['desc'] = strtr($productIntro, array('<p>\r\n\t' => '')); | ||
205 | + } | ||
206 | + } | ||
207 | + | ||
208 | + // 尺码信息 | ||
209 | + if (!empty($sizeInfo['productIntroBo']['sizeInfoBo'])) { | ||
210 | + $result['sizeInfo'] = array( | ||
211 | + 'title' => '尺码信息', | ||
212 | + 'enTitle' => 'SIZE INFO', | ||
213 | + 'detail' => array('list' => array()), | ||
214 | + ); | ||
215 | + $sizeNameList = array(0 => array('param' => '吊牌尺码') ); // 尺码名称 | ||
216 | + $sizeBoGroup = array(); // 尺码按ID分组 | ||
217 | + foreach ($sizeInfo['productIntroBo']['sizeInfoBo']['sizeAttributeBos'] as $attr) { | ||
218 | + $sizeBoGroup[ $attr['id'] ][0] = array('param' => $value['attributeName']); | ||
219 | + } | ||
220 | + foreach ($sizeInfo['productIntroBo']['sizeInfoBo']['sizeBoList'] as $value) { | ||
221 | + foreach ($value['sortAttributes'] as $attr) { | ||
222 | + $sizeBoGroup[ $attr['id'] ][] = array('param' => $attr['sizeValue']); | ||
223 | + $sizeNameList[] = array('param' => $value['sizeName']); | ||
224 | + } | ||
225 | + } | ||
226 | + | ||
227 | + // 根据模板页面的显示,按表格一列一列来显示 | ||
228 | + $result['detail']['list'][0] = $sizeNameList; | ||
229 | + foreach ($sizeBoGroup as $value) { | ||
230 | + $result['detail']['list'][] = $value; | ||
231 | + } | ||
232 | + } | ||
233 | + | ||
234 | + // 测量方式 | ||
235 | + if (isset($sizeInfo['sizeImage'])) { | ||
236 | + $result['measurementMethod'] = array( | ||
237 | + 'title' => '测量方式', | ||
238 | + 'enTitle' => 'MEASUREMENT METHOD', | ||
239 | + 'img' => $sizeInfo['sizeImage'], | ||
240 | + ); | ||
241 | + } | ||
242 | + | ||
243 | + // 模特试穿 | ||
244 | + if (!empty($sizeInfo['modelBos'])) { | ||
245 | + $result['reference'] = array( | ||
246 | + 'title' => '模特试穿', | ||
247 | + 'enTitle' => 'REFERENCE', | ||
248 | + 'detail' => array('list' => array()), | ||
249 | + ); | ||
250 | + $result['reference']['detail']['list'][0] = array(0 => array('param' => '')); // 头像列表 | ||
251 | + $result['reference']['detail']['list'][1] = array(0 => array('param' => '模特')); // 模特名字列表 | ||
252 | + $result['reference']['detail']['list'][2] = array(0 => array('param' => '身高')); // 身高列表 | ||
253 | + $result['reference']['detail']['list'][3] = array(0 => array('param' => '体重')); // 体重列表 | ||
254 | + $result['reference']['detail']['list'][4] = array(0 => array('param' => '三围')); // 三围列表 | ||
255 | + $result['reference']['detail']['list'][5] = array(0 => array('param' => '吊牌尺码')); // 吊牌尺码 | ||
256 | + $result['reference']['detail']['list'][6] = array(0 => array('param' => '试穿描述')); // 试穿描述 | ||
257 | + foreach ($sizeInfo['modelBos'] as $value) { | ||
258 | + $result['reference']['detail']['list'][0][] = array('param' => $value['avatar']); | ||
259 | + $result['reference']['detail']['list'][1][] = array('param' => $value['modelName']); | ||
260 | + $result['reference']['detail']['list'][2][] = array('param' => $value['height']); | ||
261 | + $result['reference']['detail']['list'][3][] = array('param' => $value['weight']); | ||
262 | + $result['reference']['detail']['list'][4][] = array('param' => $value['vitalStatistics']); | ||
263 | + $result['reference']['detail']['list'][5][] = array('param' => $value['fitModelBo']['fit_size']); | ||
264 | + $result['reference']['detail']['list'][6][] = array('param' => $value['fitModelBo']['feel']); | ||
265 | + } | ||
266 | + } | ||
267 | + | ||
268 | + // 商品材质 | ||
269 | + if (!empty($sizeInfo['productMaterialList'])) { | ||
270 | + foreach ($sizeInfo['productMaterialList'] as $value) { | ||
271 | + | ||
272 | + } | ||
273 | + } | ||
274 | + | ||
275 | + } | ||
276 | + | ||
277 | + return $result; | ||
278 | + | ||
279 | + 'materials' : { | ||
280 | + 'title' : '商品材质', | ||
281 | + 'enTitle' : '', | ||
282 | + 'list'' | ||
283 | + 'img' : '', | ||
284 | + 'desc' : '用各种洗涤剂',//remark | ||
285 | + 'materialType' : '' | ||
286 | + }, | ||
287 | + 'washTips' : { | ||
288 | + 'list' : [ | ||
289 | + { | ||
290 | + "caption":"不可干洗", | ||
291 | + "img":"http://static.yohobuy.com/images/wash_5.png" | ||
292 | + } | ||
293 | + ] | ||
294 | + } | ||
295 | + | ||
296 | + 'productDetail' : { | ||
297 | + 'title' : '商品详情', | ||
298 | + 'enTitle' : '', | ||
299 | + 'desc' : 'Married to the MOB是由Leah McSweeney创立的女装品牌,一向标榜不羁、大胆的女性streetwear设计', | ||
300 | + 'img' : '' | ||
301 | + }, | ||
302 | + | ||
303 | + 'cartInfo' : { | ||
304 | + 'numInCart' : 3, | ||
305 | + 'goodsInstore' : 0 | ||
306 | + } | ||
182 | } | 307 | } |
183 | 308 | ||
184 | } | 309 | } |
-
Please register or login to post a comment