Skip to content

商品详情和banners链接

需求

  • [ ] station 商品库&报价单 新增【商品详情】图片的上传 和 【固定URL】的链接, 同时记录操作日志, 上传后在Bshop点击商品时展示
  • [ ] banners 图链接

新增字段

  • 固定URL: https://bshop.guanmai.cn/?cms_key=gm#/product/sku/detail?spu_id=D123456, 不存
  • 商品详情图片: mongo 新增字段
        库                 表                   字段             类型  
xnn_merchandise        spu_product        detail_images        Array
xnn_core_product_2    customized_info    is_open_sku_detail    Boolen

bshop 新增接口

/product/sku/detail

Method: Get
request:
    spu_id  M
response:
    code    M   int
    msg     M   string
    data    M   {
        "spu_id": "C111111",
        "name": "太湖鸭蛋",
        "is_fav": false,
        "cart_amount": 0,
        "detail_images": ["http://testpic.guanmai.cn/product_pic/ebf5c88d7fd53c86.png", ...],
        "skus": [{
            "cart_amount": 0,
            "category_id_1": "A3773",
            "category_id_2": "B18243",
            "desc": "",
            "id": "D2644432",
            "img_url": "http://testpic.guanmai.cn/product_pic/e2a2f352bf457b04.png",
            "is_price_timing": false,
            "is_valid": true,
            "order_begin_time": "2018-07-16 06:00:00",
            "order_end_time": "2018-07-16 06:00:00",
            "name": "太湖鸭蛋|个",
            "rule_price": null,
            "sale_num_least": 1,
            "sale_price": 100,
            "sale_ratio": 1,
            "sale_unit_name": "个",
            "salemenu_id": "S1111",
            "spu_id": "C111111",
            "state": 1,
            "station_id": "T7442",
            "std_sale_price": 100,
            "std_unit_name": "个",
            "stocks": 1000
        }, ...]
    }

已有接口(不变)

bshop

  • 收藏: /favorite/detail/update, POST
  • 加入购物车: /cart/update, POST

station

  • 上传图片: /image/upload, POST

已有接口(改动)

station

接口: /station/customized/update
Method: Post
request:
    ...
    新增
    is_open_sku_detail  O   bool
    改动 banners改成banners_with_url
    banners_with_url: [{
        img     M      string
        url     M      string
    }, ...]
request:
    code    M   int
    msg     M   string
    data    M   null

接口: /station/customized
Method: Get
request:
    不变
response:
    code    M   int
    msg     M   string
    data:{
        ...
        新增
        "is_open_sku_detail": 1,
        改动
        "banners_with_url": [{
            "id"  M  string,
            "name"  M  string,
            "url"  O  string (新增)
        },...]
  }
    }

接口: /merchandise/spu/create
Method: Post
request:
    ...
    新增
    detail_images    O   list
response:
    code            M   int
    msg             M   string
    data            M   null

接口: merchandise/spu/update
Method: Post
request:
    ...
    新增
    detail_images    O   list
response:
    code           M   int
    msg            M   string 
    data           M   null

接口: merchandise/spu/details
Method: Get
request:
    spu_id  M   string
response:
    code    M   int
    msg     M   string
    data: {
        ...
        新增
        "detail_images": ["1.jpg", "2.jpg"]
    }

注: - bshop 判断是否开启商品详情的字段在 index.html 中的 g_cms_config 的 is_open_sku_detail 字段, - 原先g_cms_config的banners由["a.jpg", "b.jpg", "c.png"]结构改成 --> [{"img": "a.jpg","url": "www.baidu.com"},...], 字段名改成了banners_with_url

商品库微服务(gm_server_merchandise)

接口: /spu/get
Method: Get
request:
    不变
response:
    code    M   int
    msg     M   string
    data: {
        ...
        新增
        "detail_images": ["1.jpg", "2.jpg"]
    }

接口: /spu/create
Method: Post
request:
    ...
    新增
    detail_images    O   list
response:
    code    M       int
    msg     M       string
    data: {
        "spu_id": "C111111"
    }

接口; /spu/update
Method: Post
request:
    ...
    新增
    detail_images   O    list
response:
    code    M   int
    msg     M   string
    data:{
        "spu_id": "C111111"
    }