Authored by hf

do product detail page

{
"arrivalTime": 1309514897,
"attribute": 1,
"auditingTime": 0,
"brand": {
"brandAlif": "R",
"brandBanner": "/2011/06/26/14/02d2214a0a7feb6112a8ebbd39de301192.jpg",
"brandCertificate": "",
"brandCss": "",
"brandDomain": "REVELATOR",
"brandGroupId": 0,
"brandIco": "http://img13.static.yhbimg.com/brandLogo/2011/06/26/14/020b083d91ebd1ff9a0600a8421fdbb388.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"brandInitials": "",
"brandKeyword": "REVELATOR",
"brandLevel": 1,
"brandName": "REVELATOR",
"brandNameCn": "",
"brandNameEn": "REVELATOR",
"brandOutline": "所有围绕在我们身边并且默默在对这个世界付出的人,都是我们所认知的启示者。",
"brandScale": 3,
"brandSign": "",
"brandStyle": "个性,潮流,嘻哈,街头,",
"brandTemplate": 1,
"brandTypeId": 3,
"brandUrl": "",
"hotKeyword": "REVELATOR",
"id": 119,
"isHot": "N",
"isIndependent": "N",
"orderBy": 0,
"parentId": 0,
"relateBrandIds": "",
"shelvesBrandTime": 0,
"staticContentCode": "",
"status": 0
},
"brandId": 119,
"categoryBoList": [
{
"categoryId": 1,
"categoryName": "上衣",
"isleaf": true,
"level": 1
},
{
"categoryId": 11,
"categoryName": "T恤",
"isleaf": true,
"level": 2
},
{
"categoryId": 114,
"categoryName": "T恤",
"isleaf": true,
"level": 3
}
],
"cnAlphabet": "REVELATORTHERDuanXiuTXu",
"createTime": 1308726112,
"editTime": 0,
"erpProductId": 50004331,
"expectArrivalTime": 1309514897,
"firstShelveTime": 1309514897,
"folderId": 0,
"gender": "1",
"goodsList": [
{
"colorId": 1,
"colorImage": "http://img12.static.yhbimg.com/goodsimg/2012/03/02/14/02ea70da41df2d162fe1ec1c5d53367086.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"colorName": "白",
"factorySn": "",
"firstShelveTime": 1309514897,
"goodsImagesList": [
{
"angle": 0,
"genderCover": 0,
"goodsId": 3241,
"id": 131463,
"imageName": "",
"imageUrl": "http://img12.static.yhbimg.com/goodsimg/2012/03/02/14/02ea70da41df2d162fe1ec1c5d53367086.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"intro": 0,
"isDefault": "Y",
"orderBy": 1,
"productId": 2631,
"status": 1
},
{
"angle": 0,
"genderCover": 0,
"goodsId": 3241,
"id": 131462,
"imageName": "",
"imageUrl": "http://img13.static.yhbimg.com/goodsimg/2012/03/02/14/02df4081143c563f1d0ea8192a316f40fd.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"intro": 0,
"isDefault": "N",
"orderBy": 0,
"productId": 2631,
"status": 1
}
],
"goodsName": "THE R TEE",
"goodsSizeBoList": [
{
"createTime": 0,
"goodsId": 3241,
"goodsSizeSkuId": 102000,
"goodsSizeStorageNum": 0,
"id": 203,
"orderBy": 1175,
"sizeName": "M",
"sortId": 0,
"updateTime": 0
},
{
"createTime": 0,
"goodsId": 3241,
"goodsSizeSkuId": 102001,
"goodsSizeStorageNum": 0,
"id": 201,
"orderBy": 1169,
"sizeName": "L",
"sortId": 0,
"updateTime": 0
}
],
"id": 3241,
"isDefault": "N",
"isDown": "N",
"matchExplain": "",
"productId": 2631,
"productSkc": 3241,
"status": 1,
"viewNum": 0
}
],
"id": 2631,
"isAdvance": "N",
"isAuditing": "Y",
"isDown": "N",
"isEdit": 1,
"isHot": "N",
"isJit": "N",
"isLimited": "N",
"isNew": "N",
"isOutlets": "N",
"isPromotion": 0,
"isRecommend": "N",
"isReplenishment": 0,
"isRetrieval": "N",
"isSales": "Y",
"isSpecial": "N",
"maxSortId": 1,
"middleSortId": 11,
"phrase": "以品牌字首R字母為设计重点,环绕式轮廓线营造渐层视觉 ",
"productName": "REVELATORTHER 短袖T恤",
"productPriceBo": {
"formatMarketPrice": "¥255.0",
"formatSalesPrice": "¥99.0",
"formatSpecialPrice": "¥99.0",
"marketPrice": 255,
"productId": 2631,
"salesPrice": 99,
"specialPrice": 99,
"vipPrice": "¥0.0",
"vipPrices": [
{
"vipLevel": 1,
"vipPrice": "¥94",
"vipTitle": "银卡"
},
{
"vipLevel": 2,
"vipPrice": "¥89",
"vipTitle": "金卡"
},
{
"vipLevel": 3,
"vipPrice": "¥87",
"vipTitle": "白金"
}
]
},
"productTagBoList": [
{
"tagLabel": "is_discount",
"tagValue": "Y"
},
{
"tagLabel": "is_soon_sold_out",
"tagValue": "Y"
}
],
"promotionBoList": [
{
"promotionTitle": "【秋冬热促】满¥2188减¥800",
"promotionType": "满减"
},
{
"promotionTitle": "【秋冬热促】满¥1488减¥500",
"promotionType": "满减"
}
],
"consultBoWrapper": {
"consultBoList": [
{
"answer": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
"answerTime": "2012-05-02 15:10:08",
"ask": "请问 这件的灰色的L码还会不会补货?",
"askTime": "2012-05-02 14:23:09",
"id": 68252
}
],
"consultTotal": 5
},
"commentBoWrapper": {
"commentBoList": [
{
"productId": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
"id": "2012-05-02 15:10:08",
"uid": "请问 这件的灰色的L码还会不会补货?",
"content": "2012-05-02 14:23:09",
"createTime": "2012-05-02 14:23:09",
"sizeName":"L",
"colorName":"red",
"nickName":"xieyong",
"headIcon":"http://dddd"
}
],
"commentTotal": 5
}
"productUrl": "http://m.yohobuy.com/product/pro_2631_3241/REVELATORTHERDuanXiuTXu.html",
"salableTime": "0",
"salesPhrase": "",
"seasons": "summer",
"sellChannels": "0",
"seriesId": 0,
"shelveTime": 1325135169,
"shopId": 0,
"smallSortId": 114,
"sortId": 0,
"status": 1,
"storage": 0,
"style": "",
"supplierId": 0,
"vipDiscountType": 1
}
\ No newline at end of file
... ...
{
"modelBos": [],
"null": false,
"productDescBo": {
"colorName": "灰色",
"erpProductId": "50002468",
"gender": 1,
"null": false,
"standardBos": []
},
"productExtra": {
"null": true
},
"productIntroBo": {
"productId": 10,
"productIntro": "<p>\r\n\t破壳小队长印花笔记本,夸张而卡通的设计,简单白皙的纸张,配有手缝带,味道十足。<br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02efe1bb1bc80d0ffd2911dc2f160c7974-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02b741288ddc8095598bbc7c487c8bc892-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/028c47cc3002d40c42f35120007f13ff17-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/026c9a61457a93c0473e4674f85344c8f0-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02da50cfde3d6cf203d8cb3df1eaa29353-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t&nbsp;</p>"
},
"productMaterialList": [],
"sizeImage": "http://static.yohobuy.com/images/1.jpg",
"sizeInfoBo": {
"sizeAttributeBos": [
{
"attributeName": "后衣长",
"id": 49
},
{
"attributeName": "前衣长",
"id": 48
},
{
"attributeName": "袖长",
"id": 5
},
{
"attributeName": "胸围",
"id": 4
},
{
"attributeName": "肩宽",
"id": 3
},
{
"attributeName": "后中长",
"id": 1
}
],
"sizeBoList": [
{
"id": 201,
"sizeName": "L",
"sortAttributes": [
{
"id": 49,
"sizeValue": ""
},
{
"id": 48,
"sizeValue": ""
},
{
"id": 5,
"sizeValue": "64"
},
{
"id": 4,
"sizeValue": "108"
},
{
"id": 3,
"sizeValue": "49"
},
{
"id": 1,
"sizeValue": "67"
}
]
},
{
"id": 203,
"sizeName": "M",
"sortAttributes": [
{
"id": 5,
"sizeValue": "62"
},
{
"id": 4,
"sizeValue": "102"
},
{
"id": 3,
"sizeValue": "46"
},
{
"id": 1,
"sizeValue": "64"
},
{
"id": 49,
"sizeValue": ""
},
{
"id": 48,
"sizeValue": ""
}
]
}
]
},
"washTipsBoList": [
{
"caption": "不可转笼翻转干燥",
"img": "http://static.yohobuy.com/images/wash_2.png"
},
{
"caption": "30度水温弱速洗",
"img": "http://static.yohobuy.com/images/wash_3.png"
},
{
"caption": "分色洗涤",
"img": "http://static.yohobuy.com/images/wash_7.png"
}
]
}
\ No newline at end of file
... ...
... ... @@ -26,8 +26,259 @@ class DetailData
* @param int $productId
* @return array
*/
public function product($productId)
public static function baseInfo($productId, $uid)
{
$data = json_decode('{
"arrivalTime": 1309514897,
"attribute": 1,
"auditingTime": 0,
"brand": {
"brandAlif": "R",
"brandBanner": "/2011/06/26/14/02d2214a0a7feb6112a8ebbd39de301192.jpg",
"brandCertificate": "",
"brandCss": "",
"brandDomain": "REVELATOR",
"brandGroupId": 0,
"brandIco": "http://img13.static.yhbimg.com/brandLogo/2011/06/26/14/020b083d91ebd1ff9a0600a8421fdbb388.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"brandInitials": "",
"brandKeyword": "REVELATOR",
"brandLevel": 1,
"brandName": "REVELATOR",
"brandNameCn": "",
"brandNameEn": "REVELATOR",
"brandOutline": "所有围绕在我们身边并且默默在对这个世界付出的人,都是我们所认知的启示者。",
"brandScale": 3,
"brandSign": "",
"brandStyle": "个性,潮流,嘻哈,街头,",
"brandTemplate": 1,
"brandTypeId": 3,
"brandUrl": "",
"hotKeyword": "REVELATOR",
"id": 119,
"isHot": "N",
"isIndependent": "N",
"orderBy": 0,
"parentId": 0,
"relateBrandIds": "",
"shelvesBrandTime": 0,
"staticContentCode": "",
"status": 0
},
"brandId": 119,
"categoryBoList": [
{
"categoryId": 1,
"categoryName": "上衣",
"isleaf": true,
"level": 1
},
{
"categoryId": 11,
"categoryName": "T恤",
"isleaf": true,
"level": 2
},
{
"categoryId": 114,
"categoryName": "T恤",
"isleaf": true,
"level": 3
}
],
"cnAlphabet": "REVELATORTHERDuanXiuTXu",
"createTime": 1308726112,
"editTime": 0,
"erpProductId": 50004331,
"expectArrivalTime": 1309514897,
"firstShelveTime": 1309514897,
"folderId": 0,
"gender": "1",
"goodsList": [
{
"colorId": 1,
"colorImage": "http://img12.static.yhbimg.com/goodsimg/2012/03/02/14/02ea70da41df2d162fe1ec1c5d53367086.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"colorName": "白",
"factorySn": "",
"firstShelveTime": 1309514897,
"goodsImagesList": [
{
"angle": 0,
"genderCover": 0,
"goodsId": 3241,
"id": 131463,
"imageName": "",
"imageUrl": "http://img12.static.yhbimg.com/goodsimg/2012/03/02/14/02ea70da41df2d162fe1ec1c5d53367086.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"intro": 0,
"isDefault": "Y",
"orderBy": 1,
"productId": 2631,
"status": 1
},
{
"angle": 0,
"genderCover": 0,
"goodsId": 3241,
"id": 131462,
"imageName": "",
"imageUrl": "http://img13.static.yhbimg.com/goodsimg/2012/03/02/14/02df4081143c563f1d0ea8192a316f40fd.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90",
"intro": 0,
"isDefault": "N",
"orderBy": 0,
"productId": 2631,
"status": 1
}
],
"goodsName": "THE R TEE",
"goodsSizeBoList": [
{
"createTime": 0,
"goodsId": 3241,
"goodsSizeSkuId": 102000,
"goodsSizeStorageNum": 0,
"id": 203,
"orderBy": 1175,
"sizeName": "M",
"sortId": 0,
"updateTime": 0
},
{
"createTime": 0,
"goodsId": 3241,
"goodsSizeSkuId": 102001,
"goodsSizeStorageNum": 0,
"id": 201,
"orderBy": 1169,
"sizeName": "L",
"sortId": 0,
"updateTime": 0
}
],
"id": 3241,
"isDefault": "N",
"isDown": "N",
"matchExplain": "",
"productId": 2631,
"productSkc": 3241,
"status": 1,
"viewNum": 0
}
],
"id": 2631,
"isAdvance": "N",
"isAuditing": "Y",
"isDown": "N",
"isEdit": 1,
"isHot": "N",
"isJit": "N",
"isLimited": "N",
"isNew": "N",
"isOutlets": "N",
"isPromotion": 0,
"isRecommend": "N",
"isReplenishment": 0,
"isRetrieval": "N",
"isSales": "Y",
"isSpecial": "N",
"isCollect": "N",
"maxSortId": 1,
"middleSortId": 11,
"phrase": "以品牌字首R字母為设计重点,环绕式轮廓线营造渐层视觉 ",
"productName": "REVELATORTHER 短袖T恤",
"productPriceBo": {
"formatMarketPrice": "¥255.0",
"formatSalesPrice": "¥99.0",
"formatSpecialPrice": "¥99.0",
"marketPrice": 255,
"productId": 2631,
"salesPrice": 99,
"specialPrice": 99,
"vipPrice": "¥0.0",
"vipPrices": [
{
"vipLevel": 1,
"vipPrice": "¥94",
"vipTitle": "银卡"
},
{
"vipLevel": 2,
"vipPrice": "¥89",
"vipTitle": "金卡"
},
{
"vipLevel": 3,
"vipPrice": "¥87",
"vipTitle": "白金"
}
]
},
"productTagBoList": [
{
"tagLabel": "is_discount",
"tagValue": "Y"
},
{
"tagLabel": "is_soon_sold_out",
"tagValue": "Y"
}
],
"promotionBoList": [
{
"promotionTitle": "【秋冬热促】满¥2188减¥800",
"promotionType": "满减"
},
{
"promotionTitle": "【秋冬热促】满¥1488减¥500",
"promotionType": "满减"
}
],
"consultBoWrapper": {
"consultBoList": [
{
"answer": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
"answerTime": "2012-05-02 15:10:08",
"ask": "请问 这件的灰色的L码还会不会补货?",
"askTime": "2012-05-02 14:23:09",
"id": 68252
}
],
"consultTotal": 5
},
"commentBoWrapper": {
"commentBoList": [
{
"productId": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
"id": "2012-05-02 15:10:08",
"uid": "请问 这件的灰色的L码还会不会补货?",
"content": "2012-05-02 14:23:09",
"createTime": "2012-05-02 14:23:09",
"sizeName":"L",
"colorName":"red",
"nickName":"xieyong",
"headIcon":"http://dddd"
}
],
"commentTotal": 5
}
"productUrl": "http://m.yohobuy.com/product/pro_2631_3241/REVELATORTHERDuanXiuTXu.html",
"salableTime": "0",
"salesPhrase": "",
"seasons": "summer",
"sellChannels": "0",
"seriesId": 0,
"shelveTime": 1325135169,
"shopId": 0,
"smallSortId": 114,
"sortId": 0,
"status": 1,
"storage": 0,
"style": "",
"supplierId": 0,
"vipDiscountType": 1
}', true);
return $data;
$result = array();
if (is_numeric($productId)) {
... ... @@ -38,53 +289,147 @@ class DetailData
}
/**
* 商品小图
* 商品尺码信息
*
* @param int $goodsId
* @param int $productSkn
* @return array
*/
public function goods($goodsId)
public static function sizeInfo($productSkn)
{
$result = array();
if (is_numeric($goodsId)) {
$result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_GOODS_INFO, array('goodsId' => $goodsId) );
$data = json_decode('{
"modelBos": [],
"null": false,
"productDescBo": {
"colorName": "灰色",
"erpProductId": "50002468",
"gender": 1,
"null": false,
"standardBos": []
},
"productExtra": {
"null": true
},
"productIntroBo": {
"productId": 10,
"productIntro": "<p>\r\n\t破壳小队长印花笔记本,夸张而卡通的设计,简单白皙的纸张,配有手缝带,味道十足。<br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02efe1bb1bc80d0ffd2911dc2f160c7974-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02b741288ddc8095598bbc7c487c8bc892-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/028c47cc3002d40c42f35120007f13ff17-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/026c9a61457a93c0473e4674f85344c8f0-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t<br />\r\n\t<img src=\"http://img04.static.yohobuy.com/thumb/2011/06/23/04/02da50cfde3d6cf203d8cb3df1eaa29353-0750x1500-1-goodsimg.jpg\" /><br />\r\n\t<br />\r\n\t&nbsp;</p>"
},
"productMaterialList": [],
"sizeImage": "http://static.yohobuy.com/images/1.jpg",
"sizeInfoBo": {
"sizeAttributeBos": [
{
"attributeName": "后衣长",
"id": 49
},
{
"attributeName": "前衣长",
"id": 48
},
{
"attributeName": "袖长",
"id": 5
},
{
"attributeName": "胸围",
"id": 4
},
{
"attributeName": "肩宽",
"id": 3
},
{
"attributeName": "后中长",
"id": 1
}
return $result;
],
"sizeBoList": [
{
"id": 201,
"sizeName": "L",
"sortAttributes": [
{
"id": 49,
"sizeValue": ""
},
{
"id": 48,
"sizeValue": ""
},
{
"id": 5,
"sizeValue": "64"
},
{
"id": 4,
"sizeValue": "108"
},
{
"id": 3,
"sizeValue": "49"
},
{
"id": 1,
"sizeValue": "67"
}
/**
* 品牌
*
* @param int $brandId
* @return array
*/
public function brand($brandId)
]
},
{
"id": 203,
"sizeName": "M",
"sortAttributes": [
{
"id": 5,
"sizeValue": "62"
},
{
"id": 4,
"sizeValue": "102"
},
{
"id": 3,
"sizeValue": "46"
},
{
"id": 1,
"sizeValue": "64"
},
{
"id": 49,
"sizeValue": ""
},
{
"id": 48,
"sizeValue": ""
}
/**
* 库存
*
* @param int $productId
* @return int
*/
public function storage($productId)
]
}
]
},
"washTipsBoList": [
{
"caption": "不可转笼翻转干燥",
"img": "http://static.yohobuy.com/images/wash_2.png"
},
{
"caption": "30度水温弱速洗",
"img": "http://static.yohobuy.com/images/wash_3.png"
},
{
"caption": "分色洗涤",
"img": "http://static.yohobuy.com/images/wash_7.png"
}
]
}', true);
/**
* 尺码
*
* @param int $productSkn
* @return array
*/
public function size($productSkn)
{
return $data;
$result = array();
if (is_numeric($productSkn)) {
$result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('productSkn' => $productSkn) );
}
return $result;
}
}
... ...
<?php
namespace Product;
use LibModels\Wap\Product\DetailData;
/**
* 商品详情页模板相关的数据模型
*
* @name DetailModel
* @package Product
* @copyright yoho.inc
* @version 1.0 (2015-11-19 10:49:36)
* @author fei.hong <fei.hong@yoho.cn>
*/
class DetailModel
{
/**
* 商品基本信息
*
* @param int $productId 商品ID
* @param int $uid 当前登录用户ID, 未登录为0
* @return array
*/
public static function getBaseInfo($productId, $uid)
{
$result = array();
if (is_numeric($productId)) {
// 调用接口
$baseInfo = DetailData::baseInfo($productId, $uid);
// 商品名称
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
}
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
$result['goodsPrice'] = array();
$result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice'];
if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) {
$result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice'];
}
}
// VIP商品价格
if (isset($baseInfo['productPriceBo']['vipPrices'])) {
$build = array();
foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
$build['level'] = $value['vipLevel'];
$build['text'] = $value['vipPrice'];
$result['vipLevel']['list'][] = $build;
}
}
// 上市期
if (isset($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['firstShelveTime']) . '月';
}
// 商品咨询和商品评价
$result['feedbacks'] = array();
if (isset($baseInfo['consultBoWrapper'])) {
$result['feedbacks']['consultTotal'] = $baseInfo['consultBoWrapper']['consultTotal'];
$result['feedbacks']['consults'] = array();
}
if (isset($baseInfo['commentBoWrapper'])) {
$result['feedbacks']['commentTotal'] = $baseInfo['commentBoWrapper']['commentTotal'];
$result['feedbacks']['comments'] = array();
$build = array();
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
$build['userName'] = $value['nickName'];
$build['desc'] = $value['colorName'] . $value['sizeName'];
$build['content'] = $value['content'];
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
}
}
if (!empty($baseInfo['goodsList'])) {
foreach ($baseInfo['goodsList'] as $value) {
foreach ($value['goodsImagesList'] as $image) {
}
foreach ($value['goodsSizeBoList'] as $size) {
}
}
// 多个
if (isset($baseInfo['goodsList'][1])) {
$result['bannerTop']['list'] = array();
foreach ($baseInfo['goodsList'][1] as $value) {
}
}
// 单个
else {
$result['bannerTop'] = array();
$result['bannerTop']['img'] = '';
}
}
}
return $result;
var_dump($baseInfo);
}
/**
* 商品尺码信息
*
* @param int $productSkn
* @return array
*/
public static function getSizeInfo($productSkn)
{
$sizeInfo = DetailData::sizeInfo($productSkn);
var_dump($sizeInfo);
}
}
... ...
... ... @@ -13,6 +13,17 @@ class DetailController extends AbstractAction
*/
public function indexAction()
{
$productId = $this->param('productId');
$goodsId = $this->param('goodsId');
$uid = $this->getUid();
$this->setNavHeader('商品详情');
$result = array();
$result['goodsDetailPage'] = true;
$baseInfo = \Product\DetailModel::getBaseInfo($productId, $uid);
$data = array (
'goodsDetailPage' => true,
'pageHeader' => array (
... ... @@ -65,8 +76,8 @@ SHOE BQT KEN BLOCK',
),
'goodsDiscount'=>'【summer final sale】满¥499立享6.8折',
'feedbacks'=>array(
'commentName'=>'商品评价(15)',
'consultName' =>'购买咨询(2)',
'commentTotal'=>'15',
'consultTotal' =>'2',
'moreComments'=>'http://www.baidu.com',
'comments'=>array(
... ...
... ... @@ -4,3 +4,19 @@ routes.goodsfilter.match = "/search/filter"
routes.goodsfilter.route.module = Index
routes.goodsfilter.route.controller = Search
routes.goodsfilter.route.action = Filter
routes.product.type = "regex"
routes.product.match = "#/product/pro_([0-9]+)_([0-9]+)/(.*)#"
routes.product.route.module = Product
routes.product.route.controller = Detail
routes.product.route.action = Index
routes.product.map.1 = product_id
routes.product.map.2 = goods_id
routes.buy.type = "regex"
routes.buy.match = "#/product/buy_([0-9]+)_([0-9]+).html#"
routes.buy.route.module = Product
routes.buy.route.controller = Detail
routes.buy.route.action = Index
routes.buy.map.1 = product_id
routes.buy.map.2 = goods_id
\ No newline at end of file
... ...