根据条件获得商品列表OPENAPI



  • 获得商品列表数据

    base_url/openapi/goods/gallery

    0_1448276104874_1.png

    //前端调用实例(Jquery):
    
    
    <script type="text/javascript">
        $(function(){
            var params = {
                'page_size':20,//每页20个
                'page_index':1,//请求第一页
                'orderby':'buy_count-desc',//按销量排序
                'filter[tag_name]':'中秋活动,5折封顶',//商品标签
                'cat_id':3,//分类ID
                'brand_id':9//品牌ID
            };
            $.post('/openapi/goods/gallery',params,function(obj){
                if(obj.result == 'success'){
                    $.each(function(i,item){
                        //TODO
                    });
                }
            },'json');
        });
    </script>
    
    
    //HTTP 响应实例:
    
    
    
        {
            "result": "success",
            "data": {
                 //总页数
                "page_total": 1,
                 //商品数据列表
                "goods_list": [{
                    "goods_id": "5",
                    "gid": "v26635722",
                    "name": "费雪婴儿游戏桌 多功能双语学习桌早教益智bjv34 儿童节礼物",//商品名称
                    "nostore_sell": "1", //忽略库存 "1"是,"0"否
                    "brief": "热销款 培养语言能力 四种游戏模式 大动作发展",
                    "image_default_id": "9150f7e6f2bf2a5876779f254403cd52",
                    "product": {
                        "product_id": "45",
                        "goods_id": "5",
                        "barcode": "fx2015",//条码
                        "bn": "fx2015", //SKU货号
                        "price": "5.00",//销售价价
                        "mktprice": "5.00",//市场价
                        "name": "费雪婴儿游戏桌 多功能双语学习桌早教益智bjv34 儿童节礼物",
                        "weight": "200.000",
                        "unit": "件",
                        "spec_info": null,
                        "image_id": "9150f7e6f2bf2a5876779f254403cd52",
                        "buy_price": "5.00", //会员身份价,未登录时为销售价
                        "promotion": { 
                            "plist": [{ //商品促销活动
                                "ref_id": "192",
                                "goods_id": "5",
                                "rule_id": "21",
                                "description": "全场减10",
                                "member_lv_ids": "-1,1,2,3,4,5",
                                "from_time": "1442927280",
                                "to_time": "1443532080",
                                "status": "true",
                                "stop_rules_processing": "false",
                                "save": "10.00",
                                "tag": "减价",
                                "now": 1442991229
                            }, {
                                "ref_id": "112",
                                "goods_id": "5",
                                "rule_id": "16",
                                "description": "6.1至7.1日,因幼儿玩具6.1折",
                                "member_lv_ids": "-1,1,2,3,4,5",
                                "from_time": "1442913720",
                                "to_time": "1450689720",
                                "status": "true",
                                "stop_rules_processing": "false",
                                "save": "-1.95",
                                "tag": "打折",
                                "now": 1442991229
                            }],
                            "sale_price": null //促销价,若没有则该值为null
                        },
                        "item_url": "http://vmcshop.local/item-45.html",
                        "image": "//statics.vmcshop.com/95/de/d85c6a9b12e4.jpg@470w_556h_100Q.jpg?27923_H800_W800" //规格货品相册中图
                    },
                    "mark_star": "4.50000", //综合评价星级
                    "category": {
                        "id": "4240",
                        "cat_name": "0-6个月"
                    },
                    "brand": {
                        "id": "4",
                        "brand_name": "FISHER-PRICE/费雪",
                        "brand_initial": "F", //品牌拼音首字母
                        "brand_logo": "48587059f56eafdbd6e14163d66f37b4",
                        "brand_logo_image": "//statics.vmcshop.com/ce/e9/ebe6f13f2305.jpg?24235_H45_W90"
                    },
                    "image": "//statics.vmcshop.com/95/de/d85c6a9b12e4.jpg@470w_556h_100Q.jpg?27923_H800_W800" //默认相册中图
                }, {
                    "goods_id": "11",
                    "gid": "v86033808",
                    "name": "IPHONE",
                    "nostore_sell": "0",
                    "brief": "",
                    "image_default_id": "ce5d365b5ef7df0262f8af20521914dc",
                    "product": {
                        "product_id": "202",
                        "goods_id": "11",
                        "barcode": "iphone-2221",
                        "bn": "2",
                        "price": "222.00",
                        "mktprice": "0.00",
                        "name": "IPHONE",
                        "weight": "0.000",
                        "unit": "件",
                        "spec_info": "3G/16G",
                        "image_id": "ce5d365b5ef7df0262f8af20521914dc",
                        "buy_price": "222.00",
                        "promotion": {
                            "plist": [{
                                "ref_id": "197",
                                "goods_id": "11",
                                "rule_id": "21",
                                "description": "全场减10",
                                "member_lv_ids": "-1,1,2,3,4,5",
                                "from_time": "1442927280",
                                "to_time": "1443532080",
                                "status": "true",
                                "stop_rules_processing": "false",
                                "save": "10.00",
                                "tag": "减价",
                                "now": 1442991229
                            }],
                            "sale_price": "212.00"
                        },
                        "item_url": "http://vmcshop.local/item-202.html",
                        "image": "//statics.vmcshop.com/f6/c4/ce6b5413757a.png@470w_556h_100Q.jpg?56888_H1112_W940"
                    },
                    "mark_star": 5,
                    "category": {
                        "id": "324",
                        "cat_name": "平板电脑"
                    },
                    "brand": false,
                    "image": "//statics.vmcshop.com/f6/c4/ce6b5413757a.png@470w_556h_100Q.jpg?56888_H1112_W940"
                }]
            }
        }
    

登录后回复