Authored by hf

do product detail page

  1 +{
  2 + "arrivalTime": 1309514897,
  3 + "attribute": 1,
  4 + "auditingTime": 0,
  5 + "brand": {
  6 + "brandAlif": "R",
  7 + "brandBanner": "/2011/06/26/14/02d2214a0a7feb6112a8ebbd39de301192.jpg",
  8 + "brandCertificate": "",
  9 + "brandCss": "",
  10 + "brandDomain": "REVELATOR",
  11 + "brandGroupId": 0,
  12 + "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",
  13 + "brandInitials": "",
  14 + "brandKeyword": "REVELATOR",
  15 + "brandLevel": 1,
  16 + "brandName": "REVELATOR",
  17 + "brandNameCn": "",
  18 + "brandNameEn": "REVELATOR",
  19 + "brandOutline": "所有围绕在我们身边并且默默在对这个世界付出的人,都是我们所认知的启示者。",
  20 + "brandScale": 3,
  21 + "brandSign": "",
  22 + "brandStyle": "个性,潮流,嘻哈,街头,",
  23 + "brandTemplate": 1,
  24 + "brandTypeId": 3,
  25 + "brandUrl": "",
  26 + "hotKeyword": "REVELATOR",
  27 + "id": 119,
  28 + "isHot": "N",
  29 + "isIndependent": "N",
  30 + "orderBy": 0,
  31 + "parentId": 0,
  32 + "relateBrandIds": "",
  33 + "shelvesBrandTime": 0,
  34 + "staticContentCode": "",
  35 + "status": 0
  36 + },
  37 + "brandId": 119,
  38 + "categoryBoList": [
  39 + {
  40 + "categoryId": 1,
  41 + "categoryName": "上衣",
  42 + "isleaf": true,
  43 + "level": 1
  44 + },
  45 + {
  46 + "categoryId": 11,
  47 + "categoryName": "T恤",
  48 + "isleaf": true,
  49 + "level": 2
  50 + },
  51 + {
  52 + "categoryId": 114,
  53 + "categoryName": "T恤",
  54 + "isleaf": true,
  55 + "level": 3
  56 + }
  57 + ],
  58 + "cnAlphabet": "REVELATORTHERDuanXiuTXu",
  59 + "createTime": 1308726112,
  60 + "editTime": 0,
  61 + "erpProductId": 50004331,
  62 + "expectArrivalTime": 1309514897,
  63 + "firstShelveTime": 1309514897,
  64 + "folderId": 0,
  65 + "gender": "1",
  66 + "goodsList": [
  67 + {
  68 + "colorId": 1,
  69 + "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",
  70 + "colorName": "白",
  71 + "factorySn": "",
  72 + "firstShelveTime": 1309514897,
  73 + "goodsImagesList": [
  74 + {
  75 + "angle": 0,
  76 + "genderCover": 0,
  77 + "goodsId": 3241,
  78 + "id": 131463,
  79 + "imageName": "",
  80 + "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",
  81 + "intro": 0,
  82 + "isDefault": "Y",
  83 + "orderBy": 1,
  84 + "productId": 2631,
  85 + "status": 1
  86 + },
  87 + {
  88 + "angle": 0,
  89 + "genderCover": 0,
  90 + "goodsId": 3241,
  91 + "id": 131462,
  92 + "imageName": "",
  93 + "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",
  94 + "intro": 0,
  95 + "isDefault": "N",
  96 + "orderBy": 0,
  97 + "productId": 2631,
  98 + "status": 1
  99 + }
  100 + ],
  101 + "goodsName": "THE R TEE",
  102 + "goodsSizeBoList": [
  103 + {
  104 + "createTime": 0,
  105 + "goodsId": 3241,
  106 + "goodsSizeSkuId": 102000,
  107 + "goodsSizeStorageNum": 0,
  108 + "id": 203,
  109 + "orderBy": 1175,
  110 + "sizeName": "M",
  111 + "sortId": 0,
  112 + "updateTime": 0
  113 + },
  114 + {
  115 + "createTime": 0,
  116 + "goodsId": 3241,
  117 + "goodsSizeSkuId": 102001,
  118 + "goodsSizeStorageNum": 0,
  119 + "id": 201,
  120 + "orderBy": 1169,
  121 + "sizeName": "L",
  122 + "sortId": 0,
  123 + "updateTime": 0
  124 + }
  125 + ],
  126 + "id": 3241,
  127 + "isDefault": "N",
  128 + "isDown": "N",
  129 + "matchExplain": "",
  130 + "productId": 2631,
  131 + "productSkc": 3241,
  132 + "status": 1,
  133 + "viewNum": 0
  134 + }
  135 + ],
  136 + "id": 2631,
  137 + "isAdvance": "N",
  138 + "isAuditing": "Y",
  139 + "isDown": "N",
  140 + "isEdit": 1,
  141 + "isHot": "N",
  142 + "isJit": "N",
  143 + "isLimited": "N",
  144 + "isNew": "N",
  145 + "isOutlets": "N",
  146 + "isPromotion": 0,
  147 + "isRecommend": "N",
  148 + "isReplenishment": 0,
  149 + "isRetrieval": "N",
  150 + "isSales": "Y",
  151 + "isSpecial": "N",
  152 + "maxSortId": 1,
  153 + "middleSortId": 11,
  154 + "phrase": "以品牌字首R字母為设计重点,环绕式轮廓线营造渐层视觉 ",
  155 + "productName": "REVELATORTHER 短袖T恤",
  156 + "productPriceBo": {
  157 + "formatMarketPrice": "¥255.0",
  158 + "formatSalesPrice": "¥99.0",
  159 + "formatSpecialPrice": "¥99.0",
  160 + "marketPrice": 255,
  161 + "productId": 2631,
  162 + "salesPrice": 99,
  163 + "specialPrice": 99,
  164 + "vipPrice": "¥0.0",
  165 + "vipPrices": [
  166 + {
  167 + "vipLevel": 1,
  168 + "vipPrice": "¥94",
  169 + "vipTitle": "银卡"
  170 + },
  171 + {
  172 + "vipLevel": 2,
  173 + "vipPrice": "¥89",
  174 + "vipTitle": "金卡"
  175 + },
  176 + {
  177 + "vipLevel": 3,
  178 + "vipPrice": "¥87",
  179 + "vipTitle": "白金"
  180 + }
  181 + ]
  182 + },
  183 + "productTagBoList": [
  184 + {
  185 + "tagLabel": "is_discount",
  186 + "tagValue": "Y"
  187 + },
  188 + {
  189 + "tagLabel": "is_soon_sold_out",
  190 + "tagValue": "Y"
  191 + }
  192 + ],
  193 +
  194 + "promotionBoList": [
  195 + {
  196 + "promotionTitle": "【秋冬热促】满¥2188减¥800",
  197 + "promotionType": "满减"
  198 + },
  199 + {
  200 + "promotionTitle": "【秋冬热促】满¥1488减¥500",
  201 + "promotionType": "满减"
  202 + }
  203 + ],
  204 + "consultBoWrapper": {
  205 + "consultBoList": [
  206 + {
  207 + "answer": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
  208 + "answerTime": "2012-05-02 15:10:08",
  209 + "ask": "请问 这件的灰色的L码还会不会补货?",
  210 + "askTime": "2012-05-02 14:23:09",
  211 + "id": 68252
  212 + }
  213 + ],
  214 + "consultTotal": 5
  215 + },
  216 +
  217 + "commentBoWrapper": {
  218 + "commentBoList": [
  219 + {
  220 + "productId": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
  221 + "id": "2012-05-02 15:10:08",
  222 + "uid": "请问 这件的灰色的L码还会不会补货?",
  223 + "content": "2012-05-02 14:23:09",
  224 + "createTime": "2012-05-02 14:23:09",
  225 + "sizeName":"L",
  226 + "colorName":"red",
  227 + "nickName":"xieyong",
  228 + "headIcon":"http://dddd"
  229 + }
  230 + ],
  231 + "commentTotal": 5
  232 + }
  233 +
  234 + "productUrl": "http://m.yohobuy.com/product/pro_2631_3241/REVELATORTHERDuanXiuTXu.html",
  235 + "salableTime": "0",
  236 + "salesPhrase": "",
  237 + "seasons": "summer",
  238 + "sellChannels": "0",
  239 + "seriesId": 0,
  240 + "shelveTime": 1325135169,
  241 + "shopId": 0,
  242 + "smallSortId": 114,
  243 + "sortId": 0,
  244 + "status": 1,
  245 + "storage": 0,
  246 + "style": "",
  247 + "supplierId": 0,
  248 + "vipDiscountType": 1
  249 +}
  1 +{
  2 + "modelBos": [],
  3 + "null": false,
  4 + "productDescBo": {
  5 + "colorName": "灰色",
  6 + "erpProductId": "50002468",
  7 + "gender": 1,
  8 + "null": false,
  9 + "standardBos": []
  10 + },
  11 + "productExtra": {
  12 + "null": true
  13 + },
  14 + "productIntroBo": {
  15 + "productId": 10,
  16 + "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>"
  17 + },
  18 + "productMaterialList": [],
  19 + "sizeImage": "http://static.yohobuy.com/images/1.jpg",
  20 + "sizeInfoBo": {
  21 + "sizeAttributeBos": [
  22 + {
  23 + "attributeName": "后衣长",
  24 + "id": 49
  25 + },
  26 + {
  27 + "attributeName": "前衣长",
  28 + "id": 48
  29 + },
  30 + {
  31 + "attributeName": "袖长",
  32 + "id": 5
  33 + },
  34 + {
  35 + "attributeName": "胸围",
  36 + "id": 4
  37 + },
  38 + {
  39 + "attributeName": "肩宽",
  40 + "id": 3
  41 + },
  42 + {
  43 + "attributeName": "后中长",
  44 + "id": 1
  45 + }
  46 + ],
  47 + "sizeBoList": [
  48 + {
  49 + "id": 201,
  50 + "sizeName": "L",
  51 + "sortAttributes": [
  52 + {
  53 + "id": 49,
  54 + "sizeValue": ""
  55 + },
  56 + {
  57 + "id": 48,
  58 + "sizeValue": ""
  59 + },
  60 + {
  61 + "id": 5,
  62 + "sizeValue": "64"
  63 + },
  64 + {
  65 + "id": 4,
  66 + "sizeValue": "108"
  67 + },
  68 + {
  69 + "id": 3,
  70 + "sizeValue": "49"
  71 + },
  72 + {
  73 + "id": 1,
  74 + "sizeValue": "67"
  75 + }
  76 + ]
  77 + },
  78 + {
  79 + "id": 203,
  80 + "sizeName": "M",
  81 + "sortAttributes": [
  82 + {
  83 + "id": 5,
  84 + "sizeValue": "62"
  85 + },
  86 + {
  87 + "id": 4,
  88 + "sizeValue": "102"
  89 + },
  90 + {
  91 + "id": 3,
  92 + "sizeValue": "46"
  93 + },
  94 + {
  95 + "id": 1,
  96 + "sizeValue": "64"
  97 + },
  98 + {
  99 + "id": 49,
  100 + "sizeValue": ""
  101 + },
  102 + {
  103 + "id": 48,
  104 + "sizeValue": ""
  105 + }
  106 + ]
  107 + }
  108 + ]
  109 + },
  110 + "washTipsBoList": [
  111 + {
  112 + "caption": "不可转笼翻转干燥",
  113 + "img": "http://static.yohobuy.com/images/wash_2.png"
  114 + },
  115 + {
  116 + "caption": "30度水温弱速洗",
  117 + "img": "http://static.yohobuy.com/images/wash_3.png"
  118 + },
  119 + {
  120 + "caption": "分色洗涤",
  121 + "img": "http://static.yohobuy.com/images/wash_7.png"
  122 + }
  123 + ]
  124 +}
@@ -26,65 +26,410 @@ class DetailData @@ -26,65 +26,410 @@ class DetailData
26 * @param int $productId 26 * @param int $productId
27 * @return array 27 * @return array
28 */ 28 */
29 - public function product($productId) 29 + public static function baseInfo($productId, $uid)
30 { 30 {
31 - $result = array();  
32 31
33 - if (is_numeric($productId)) {  
34 - $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('productId' => $productId) ); 32 + $data = json_decode('{
  33 + "arrivalTime": 1309514897,
  34 + "attribute": 1,
  35 + "auditingTime": 0,
  36 + "brand": {
  37 + "brandAlif": "R",
  38 + "brandBanner": "/2011/06/26/14/02d2214a0a7feb6112a8ebbd39de301192.jpg",
  39 + "brandCertificate": "",
  40 + "brandCss": "",
  41 + "brandDomain": "REVELATOR",
  42 + "brandGroupId": 0,
  43 + "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",
  44 + "brandInitials": "",
  45 + "brandKeyword": "REVELATOR",
  46 + "brandLevel": 1,
  47 + "brandName": "REVELATOR",
  48 + "brandNameCn": "",
  49 + "brandNameEn": "REVELATOR",
  50 + "brandOutline": "所有围绕在我们身边并且默默在对这个世界付出的人,都是我们所认知的启示者。",
  51 + "brandScale": 3,
  52 + "brandSign": "",
  53 + "brandStyle": "个性,潮流,嘻哈,街头,",
  54 + "brandTemplate": 1,
  55 + "brandTypeId": 3,
  56 + "brandUrl": "",
  57 + "hotKeyword": "REVELATOR",
  58 + "id": 119,
  59 + "isHot": "N",
  60 + "isIndependent": "N",
  61 + "orderBy": 0,
  62 + "parentId": 0,
  63 + "relateBrandIds": "",
  64 + "shelvesBrandTime": 0,
  65 + "staticContentCode": "",
  66 + "status": 0
  67 + },
  68 + "brandId": 119,
  69 + "categoryBoList": [
  70 + {
  71 + "categoryId": 1,
  72 + "categoryName": "上衣",
  73 + "isleaf": true,
  74 + "level": 1
  75 + },
  76 + {
  77 + "categoryId": 11,
  78 + "categoryName": "T恤",
  79 + "isleaf": true,
  80 + "level": 2
  81 + },
  82 + {
  83 + "categoryId": 114,
  84 + "categoryName": "T恤",
  85 + "isleaf": true,
  86 + "level": 3
  87 + }
  88 + ],
  89 + "cnAlphabet": "REVELATORTHERDuanXiuTXu",
  90 + "createTime": 1308726112,
  91 + "editTime": 0,
  92 + "erpProductId": 50004331,
  93 + "expectArrivalTime": 1309514897,
  94 + "firstShelveTime": 1309514897,
  95 + "folderId": 0,
  96 + "gender": "1",
  97 + "goodsList": [
  98 + {
  99 + "colorId": 1,
  100 + "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",
  101 + "colorName": "白",
  102 + "factorySn": "",
  103 + "firstShelveTime": 1309514897,
  104 + "goodsImagesList": [
  105 + {
  106 + "angle": 0,
  107 + "genderCover": 0,
  108 + "goodsId": 3241,
  109 + "id": 131463,
  110 + "imageName": "",
  111 + "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",
  112 + "intro": 0,
  113 + "isDefault": "Y",
  114 + "orderBy": 1,
  115 + "productId": 2631,
  116 + "status": 1
  117 + },
  118 + {
  119 + "angle": 0,
  120 + "genderCover": 0,
  121 + "goodsId": 3241,
  122 + "id": 131462,
  123 + "imageName": "",
  124 + "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",
  125 + "intro": 0,
  126 + "isDefault": "N",
  127 + "orderBy": 0,
  128 + "productId": 2631,
  129 + "status": 1
35 } 130 }
36 -  
37 - return $result; 131 + ],
  132 + "goodsName": "THE R TEE",
  133 + "goodsSizeBoList": [
  134 + {
  135 + "createTime": 0,
  136 + "goodsId": 3241,
  137 + "goodsSizeSkuId": 102000,
  138 + "goodsSizeStorageNum": 0,
  139 + "id": 203,
  140 + "orderBy": 1175,
  141 + "sizeName": "M",
  142 + "sortId": 0,
  143 + "updateTime": 0
  144 + },
  145 + {
  146 + "createTime": 0,
  147 + "goodsId": 3241,
  148 + "goodsSizeSkuId": 102001,
  149 + "goodsSizeStorageNum": 0,
  150 + "id": 201,
  151 + "orderBy": 1169,
  152 + "sizeName": "L",
  153 + "sortId": 0,
  154 + "updateTime": 0
  155 + }
  156 + ],
  157 + "id": 3241,
  158 + "isDefault": "N",
  159 + "isDown": "N",
  160 + "matchExplain": "",
  161 + "productId": 2631,
  162 + "productSkc": 3241,
  163 + "status": 1,
  164 + "viewNum": 0
38 } 165 }
39 -  
40 - /**  
41 - * 商品小图  
42 - *  
43 - * @param int $goodsId  
44 - * @return array  
45 - */  
46 - public function goods($goodsId) 166 + ],
  167 + "id": 2631,
  168 + "isAdvance": "N",
  169 + "isAuditing": "Y",
  170 + "isDown": "N",
  171 + "isEdit": 1,
  172 + "isHot": "N",
  173 + "isJit": "N",
  174 + "isLimited": "N",
  175 + "isNew": "N",
  176 + "isOutlets": "N",
  177 + "isPromotion": 0,
  178 + "isRecommend": "N",
  179 + "isReplenishment": 0,
  180 + "isRetrieval": "N",
  181 + "isSales": "Y",
  182 + "isSpecial": "N",
  183 + "isCollect": "N",
  184 + "maxSortId": 1,
  185 + "middleSortId": 11,
  186 + "phrase": "以品牌字首R字母為设计重点,环绕式轮廓线营造渐层视觉 ",
  187 + "productName": "REVELATORTHER 短袖T恤",
  188 + "productPriceBo": {
  189 + "formatMarketPrice": "¥255.0",
  190 + "formatSalesPrice": "¥99.0",
  191 + "formatSpecialPrice": "¥99.0",
  192 + "marketPrice": 255,
  193 + "productId": 2631,
  194 + "salesPrice": 99,
  195 + "specialPrice": 99,
  196 + "vipPrice": "¥0.0",
  197 + "vipPrices": [
  198 + {
  199 + "vipLevel": 1,
  200 + "vipPrice": "¥94",
  201 + "vipTitle": "银卡"
  202 + },
  203 + {
  204 + "vipLevel": 2,
  205 + "vipPrice": "¥89",
  206 + "vipTitle": "金卡"
  207 + },
  208 + {
  209 + "vipLevel": 3,
  210 + "vipPrice": "¥87",
  211 + "vipTitle": "白金"
  212 + }
  213 + ]
  214 + },
  215 + "productTagBoList": [
  216 + {
  217 + "tagLabel": "is_discount",
  218 + "tagValue": "Y"
  219 + },
  220 + {
  221 + "tagLabel": "is_soon_sold_out",
  222 + "tagValue": "Y"
  223 + }
  224 + ],
  225 + "promotionBoList": [
47 { 226 {
  227 + "promotionTitle": "【秋冬热促】满¥2188减¥800",
  228 + "promotionType": "满减"
  229 + },
  230 + {
  231 + "promotionTitle": "【秋冬热促】满¥1488减¥500",
  232 + "promotionType": "满减"
  233 + }
  234 + ],
  235 + "consultBoWrapper": {
  236 + "consultBoList": [
  237 + {
  238 + "answer": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
  239 + "answerTime": "2012-05-02 15:10:08",
  240 + "ask": "请问 这件的灰色的L码还会不会补货?",
  241 + "askTime": "2012-05-02 14:23:09",
  242 + "id": 68252
  243 + }
  244 + ],
  245 + "consultTotal": 5
  246 + },
  247 + "commentBoWrapper": {
  248 + "commentBoList": [
  249 + {
  250 + "productId": "您好,我们会联系品牌尽快补货,目前没有办法给您确切的答复,建议您进行到货通知的登记,补货到了,会第一时间短信联系您的。感谢您对yoho!有货的关注。",
  251 + "id": "2012-05-02 15:10:08",
  252 + "uid": "请问 这件的灰色的L码还会不会补货?",
  253 + "content": "2012-05-02 14:23:09",
  254 + "createTime": "2012-05-02 14:23:09",
  255 + "sizeName":"L",
  256 + "colorName":"red",
  257 + "nickName":"xieyong",
  258 + "headIcon":"http://dddd"
  259 + }
  260 + ],
  261 + "commentTotal": 5
  262 + }
  263 + "productUrl": "http://m.yohobuy.com/product/pro_2631_3241/REVELATORTHERDuanXiuTXu.html",
  264 + "salableTime": "0",
  265 + "salesPhrase": "",
  266 + "seasons": "summer",
  267 + "sellChannels": "0",
  268 + "seriesId": 0,
  269 + "shelveTime": 1325135169,
  270 + "shopId": 0,
  271 + "smallSortId": 114,
  272 + "sortId": 0,
  273 + "status": 1,
  274 + "storage": 0,
  275 + "style": "",
  276 + "supplierId": 0,
  277 + "vipDiscountType": 1
  278 +}', true);
  279 +
  280 + return $data;
  281 +
48 $result = array(); 282 $result = array();
49 283
50 - if (is_numeric($goodsId)) {  
51 - $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_GOODS_INFO, array('goodsId' => $goodsId) ); 284 + if (is_numeric($productId)) {
  285 + $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('productId' => $productId) );
52 } 286 }
53 287
54 return $result; 288 return $result;
55 } 289 }
56 290
57 /** 291 /**
58 - * 品牌 292 + * 商品尺码信息
59 * 293 *
60 - * @param int $brandId 294 + * @param int $productSkn
61 * @return array 295 * @return array
62 */ 296 */
63 - public function brand($brandId) 297 + public static function sizeInfo($productSkn)
64 { 298 {
65 -  
66 - }  
67 -  
68 - /**  
69 - * 库存  
70 - *  
71 - * @param int $productId  
72 - * @return int  
73 - */  
74 - public function storage($productId) 299 + $data = json_decode('{
  300 + "modelBos": [],
  301 + "null": false,
  302 + "productDescBo": {
  303 + "colorName": "灰色",
  304 + "erpProductId": "50002468",
  305 + "gender": 1,
  306 + "null": false,
  307 + "standardBos": []
  308 + },
  309 + "productExtra": {
  310 + "null": true
  311 + },
  312 + "productIntroBo": {
  313 + "productId": 10,
  314 + "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>"
  315 + },
  316 + "productMaterialList": [],
  317 + "sizeImage": "http://static.yohobuy.com/images/1.jpg",
  318 + "sizeInfoBo": {
  319 + "sizeAttributeBos": [
  320 + {
  321 + "attributeName": "后衣长",
  322 + "id": 49
  323 + },
  324 + {
  325 + "attributeName": "前衣长",
  326 + "id": 48
  327 + },
  328 + {
  329 + "attributeName": "袖长",
  330 + "id": 5
  331 + },
  332 + {
  333 + "attributeName": "胸围",
  334 + "id": 4
  335 + },
  336 + {
  337 + "attributeName": "肩宽",
  338 + "id": 3
  339 + },
  340 + {
  341 + "attributeName": "后中长",
  342 + "id": 1
  343 + }
  344 + ],
  345 + "sizeBoList": [
  346 + {
  347 + "id": 201,
  348 + "sizeName": "L",
  349 + "sortAttributes": [
  350 + {
  351 + "id": 49,
  352 + "sizeValue": ""
  353 + },
  354 + {
  355 + "id": 48,
  356 + "sizeValue": ""
  357 + },
  358 + {
  359 + "id": 5,
  360 + "sizeValue": "64"
  361 + },
  362 + {
  363 + "id": 4,
  364 + "sizeValue": "108"
  365 + },
  366 + {
  367 + "id": 3,
  368 + "sizeValue": "49"
  369 + },
  370 + {
  371 + "id": 1,
  372 + "sizeValue": "67"
  373 + }
  374 + ]
  375 + },
  376 + {
  377 + "id": 203,
  378 + "sizeName": "M",
  379 + "sortAttributes": [
  380 + {
  381 + "id": 5,
  382 + "sizeValue": "62"
  383 + },
  384 + {
  385 + "id": 4,
  386 + "sizeValue": "102"
  387 + },
  388 + {
  389 + "id": 3,
  390 + "sizeValue": "46"
  391 + },
  392 + {
  393 + "id": 1,
  394 + "sizeValue": "64"
  395 + },
  396 + {
  397 + "id": 49,
  398 + "sizeValue": ""
  399 + },
  400 + {
  401 + "id": 48,
  402 + "sizeValue": ""
  403 + }
  404 + ]
  405 + }
  406 + ]
  407 + },
  408 + "washTipsBoList": [
75 { 409 {
76 -  
77 - }  
78 -  
79 - /**  
80 - * 尺码  
81 - *  
82 - * @param int $productSkn  
83 - * @return array  
84 - */  
85 - public function size($productSkn) 410 + "caption": "不可转笼翻转干燥",
  411 + "img": "http://static.yohobuy.com/images/wash_2.png"
  412 + },
  413 + {
  414 + "caption": "30度水温弱速洗",
  415 + "img": "http://static.yohobuy.com/images/wash_3.png"
  416 + },
86 { 417 {
  418 + "caption": "分色洗涤",
  419 + "img": "http://static.yohobuy.com/images/wash_7.png"
  420 + }
  421 + ]
  422 +}', true);
87 423
  424 + return $data;
  425 +
  426 + $result = array();
  427 +
  428 + if (is_numeric($productSkn)) {
  429 + $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('productSkn' => $productSkn) );
  430 + }
  431 +
  432 + return $result;
88 } 433 }
89 434
90 } 435 }
  1 +<?php
  2 +
  3 +namespace Product;
  4 +
  5 +use LibModels\Wap\Product\DetailData;
  6 +
  7 +/**
  8 + * 商品详情页模板相关的数据模型
  9 + *
  10 + * @name DetailModel
  11 + * @package Product
  12 + * @copyright yoho.inc
  13 + * @version 1.0 (2015-11-19 10:49:36)
  14 + * @author fei.hong <fei.hong@yoho.cn>
  15 + */
  16 +class DetailModel
  17 +{
  18 +
  19 + /**
  20 + * 商品基本信息
  21 + *
  22 + * @param int $productId 商品ID
  23 + * @param int $uid 当前登录用户ID, 未登录为0
  24 + * @return array
  25 + */
  26 + public static function getBaseInfo($productId, $uid)
  27 + {
  28 + $result = array();
  29 +
  30 + if (is_numeric($productId)) {
  31 + // 调用接口
  32 + $baseInfo = DetailData::baseInfo($productId, $uid);
  33 +
  34 + // 商品名称
  35 + if (isset($baseInfo['productName'])) {
  36 + $result['goodsName'] = $baseInfo['productName'];
  37 + }
  38 + // 商品价格
  39 + if (isset($baseInfo['productPriceBo'])) {
  40 + $result['goodsPrice'] = array();
  41 + $result['goodsPrice']['currentPrice'] = $baseInfo['productPriceBo']['formatSalesPrice'];
  42 + if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) {
  43 + $result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice'];
  44 + }
  45 + }
  46 + // VIP商品价格
  47 + if (isset($baseInfo['productPriceBo']['vipPrices'])) {
  48 + $build = array();
  49 + foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
  50 + $build['level'] = $value['vipLevel'];
  51 + $build['text'] = $value['vipPrice'];
  52 + $result['vipLevel']['list'][] = $build;
  53 + }
  54 + }
  55 + // 上市期
  56 + if (isset($baseInfo['expectArrivalTime'])) {
  57 + $result['periodOfMarket'] = date('n', $baseInfo['firstShelveTime']) . '月';
  58 + }
  59 + // 商品咨询和商品评价
  60 + $result['feedbacks'] = array();
  61 + if (isset($baseInfo['consultBoWrapper'])) {
  62 + $result['feedbacks']['consultTotal'] = $baseInfo['consultBoWrapper']['consultTotal'];
  63 + $result['feedbacks']['consults'] = array();
  64 + }
  65 + if (isset($baseInfo['commentBoWrapper'])) {
  66 + $result['feedbacks']['commentTotal'] = $baseInfo['commentBoWrapper']['commentTotal'];
  67 + $result['feedbacks']['comments'] = array();
  68 + $build = array();
  69 + foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
  70 + $build['userName'] = $value['nickName'];
  71 + $build['desc'] = $value['colorName'] . $value['sizeName'];
  72 + $build['content'] = $value['content'];
  73 + $build['time'] = $value['createTime'];
  74 + $result['feedbacks']['comments'][] = $build;
  75 + }
  76 + }
  77 +
  78 + if (!empty($baseInfo['goodsList'])) {
  79 + foreach ($baseInfo['goodsList'] as $value) {
  80 + foreach ($value['goodsImagesList'] as $image) {
  81 +
  82 + }
  83 +
  84 + foreach ($value['goodsSizeBoList'] as $size) {
  85 +
  86 + }
  87 + }
  88 +
  89 + // 多个
  90 + if (isset($baseInfo['goodsList'][1])) {
  91 + $result['bannerTop']['list'] = array();
  92 + foreach ($baseInfo['goodsList'][1] as $value) {
  93 +
  94 + }
  95 + }
  96 + // 单个
  97 + else {
  98 + $result['bannerTop'] = array();
  99 + $result['bannerTop']['img'] = '';
  100 + }
  101 + }
  102 +
  103 + }
  104 +
  105 + return $result;
  106 + var_dump($baseInfo);
  107 +
  108 + }
  109 +
  110 + /**
  111 + * 商品尺码信息
  112 + *
  113 + * @param int $productSkn
  114 + * @return array
  115 + */
  116 + public static function getSizeInfo($productSkn)
  117 + {
  118 + $sizeInfo = DetailData::sizeInfo($productSkn);
  119 + var_dump($sizeInfo);
  120 + }
  121 +
  122 +}
@@ -13,6 +13,17 @@ class DetailController extends AbstractAction @@ -13,6 +13,17 @@ class DetailController extends AbstractAction
13 */ 13 */
14 public function indexAction() 14 public function indexAction()
15 { 15 {
  16 + $productId = $this->param('productId');
  17 + $goodsId = $this->param('goodsId');
  18 + $uid = $this->getUid();
  19 +
  20 + $this->setNavHeader('商品详情');
  21 +
  22 + $result = array();
  23 + $result['goodsDetailPage'] = true;
  24 +
  25 + $baseInfo = \Product\DetailModel::getBaseInfo($productId, $uid);
  26 +
16 $data = array ( 27 $data = array (
17 'goodsDetailPage' => true, 28 'goodsDetailPage' => true,
18 'pageHeader' => array ( 29 'pageHeader' => array (
@@ -65,8 +76,8 @@ SHOE BQT KEN BLOCK', @@ -65,8 +76,8 @@ SHOE BQT KEN BLOCK',
65 ), 76 ),
66 'goodsDiscount'=>'【summer final sale】满¥499立享6.8折', 77 'goodsDiscount'=>'【summer final sale】满¥499立享6.8折',
67 'feedbacks'=>array( 78 'feedbacks'=>array(
68 - 'commentName'=>'商品评价(15)',  
69 - 'consultName' =>'购买咨询(2)', 79 + 'commentTotal'=>'15',
  80 + 'consultTotal' =>'2',
70 'moreComments'=>'http://www.baidu.com', 81 'moreComments'=>'http://www.baidu.com',
71 'comments'=>array( 82 'comments'=>array(
72 83
@@ -3,4 +3,20 @@ routes.goodsfilter.type = "rewrite" @@ -3,4 +3,20 @@ routes.goodsfilter.type = "rewrite"
3 routes.goodsfilter.match = "/search/filter" 3 routes.goodsfilter.match = "/search/filter"
4 routes.goodsfilter.route.module = Index 4 routes.goodsfilter.route.module = Index
5 routes.goodsfilter.route.controller = Search 5 routes.goodsfilter.route.controller = Search
6 -routes.goodsfilter.route.action = Filter  
  6 +routes.goodsfilter.route.action = Filter
  7 +
  8 +routes.product.type = "regex"
  9 +routes.product.match = "#/product/pro_([0-9]+)_([0-9]+)/(.*)#"
  10 +routes.product.route.module = Product
  11 +routes.product.route.controller = Detail
  12 +routes.product.route.action = Index
  13 +routes.product.map.1 = product_id
  14 +routes.product.map.2 = goods_id
  15 +
  16 +routes.buy.type = "regex"
  17 +routes.buy.match = "#/product/buy_([0-9]+)_([0-9]+).html#"
  18 +routes.buy.route.module = Product
  19 +routes.buy.route.controller = Detail
  20 +routes.buy.route.action = Index
  21 +routes.buy.map.1 = product_id
  22 +routes.buy.map.2 = goods_id