Authored by wujiexiang

compute接口

@@ -296,3 +296,118 @@ code为200即为成功,否则是失败。 @@ -296,3 +296,118 @@ code为200即为成功,否则是失败。
296 "message": "payment data." 296 "message": "payment data."
297 } 297 }
298 ``` 298 ```
  299 +## 4、购物车compute接口 ##
  300 +#### 说明
  301 +购物车结算(app.Shopping.compute)
  302 +#### 请求参数
  303 +| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
  304 +|:-------| -----:|-----:|-----:|-----:|----:|
  305 +|uid|int|否|3236556|0|用户id|
  306 +|cart_type|string|是|ordinary|ordinary|购物车类型|
  307 +|yoho_coin_mode|int|是|1|1|是否使用yoho币,1使用,0不使用|
  308 +|payment_type|int|否|1|1|支付方式,1 在线支付 2 货到付款|
  309 +|delivery_way|int|否|1|1|快递方式,1 普通 2 加急|
  310 +|use_yoho_coin|double|是|1.00|1.00使用的yoho币金额,单位元|
  311 +|use_red_envelopes|double|是|1.00|1.00使用的红包,单位元|
  312 +|coupon_code|string|是|b123456|b123456|优惠券code|
  313 +|promotion_code|string|是|1345abc|1345abc|优惠码code|
  314 +|product_sku_list|string|是|[{'type':'limitcode','sku':307502,'limitproductcode':'2016030711453248','buy_number':1,'skn':51001888}]||购买限购商品|
  315 +
  316 +### 响应
  317 +code为200即为成功,否则是失败。
  318 +响应JSON格式如下所示:
  319 +
  320 +```json
  321 +{
  322 + "alg": "SALT_MD5",
  323 + "code": 200,
  324 + "data": {
  325 + "coupon_amount": 0,
  326 + "delivery_way": [{
  327 + "default": "Y",
  328 + "delivery_way_cost": 0,
  329 + "delivery_way_id": 1,
  330 + "delivery_way_name": "普通快递",
  331 + "is_delivery": "Y",
  332 + "is_support": "Y"
  333 + }, {
  334 + "default": "N",
  335 + "delivery_way_cost": 5,
  336 + "delivery_way_id": 2,
  337 + "delivery_way_name": "顺丰速运",
  338 + "is_delivery": "Y",
  339 + "is_support": "Y"
  340 + }],
  341 + "discount_amount": 0,
  342 + "fast_shopping_cost": 5,
  343 + "gain_yoho_coin": 0,
  344 + "goods_count": 4,
  345 + "last_order_amount": 340,
  346 + "order_amount": 335,
  347 + "payment_way": [{
  348 + "default": "Y",
  349 + "is_support": "Y",
  350 + "is_support_message": "",
  351 + "payment_id": 15,
  352 + "payment_name": "支付宝",
  353 + "payment_type": 1,
  354 + "payment_type_name": "在线支付(推荐)"
  355 + }, {
  356 + "default": "N",
  357 + "is_support": "Y",
  358 + "is_support_message": "送货上门后再付款",
  359 + "payment_id": 0,
  360 + "payment_name": "货到付款",
  361 + "payment_type": 2,
  362 + "payment_type_name": "货到付款"
  363 + }],
  364 + "promotion_formula": "总计¥340.00=商品金额¥335.00+运费¥5.00",
  365 + "promotion_formula_list": [{
  366 + "promotion": "商品金额",
  367 + "promotion_amount": "¥335.00"
  368 + }, {
  369 + "promotion": "运费",
  370 + "promotion_amount": "+¥5.00"
  371 + }],
  372 + "selected_goods_count": 2,
  373 + "shipping_cost": 0,
  374 + "str_discount_amount": "¥0.00",
  375 + "str_order_amount": "¥335.00",
  376 + "use_red_envelopes": 0,
  377 + "use_yoho_coin": 0,
  378 + "is_multi_package":"Y",
  379 + "package_list":[{
  380 + "supplier_id":"0",
  381 + "goods_list":[{
  382 + "buy_number": "1",
  383 + "goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
  384 + "goods_type": "ordinary",
  385 + "product_id": 329795,
  386 + "product_name": "Blackbird 黑鸟锥形香-Ai香型",
  387 + "product_skc": "320280",
  388 + "product_skn": "51184595",
  389 + "product_sku": "1003938"
  390 + }],
  391 + "shopping_cost":3,
  392 + "shopping_orig_cost:10
  393 + },
  394 + {
  395 + "supplier_id":"23",
  396 + "goods_list":[{
  397 + "buy_number": "1",
  398 + "goods_images": "http://img11.static.yhbimg.com/goodsimg/2015/12/23/07/0115f6f0e2ca345d2b413396202f97c8b5.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
  399 + "goods_type": "gift",
  400 + "product_id": 329795,
  401 + "product_name": "Blackbird 黑鸟锥形香-Ai香型",
  402 + "product_skc": "320280",
  403 + "product_skn": "51184595",
  404 + "product_sku": "1003938"
  405 + }],
  406 + "shopping_cost":3,
  407 + "shopping_orig_cost:10
  408 + }]
  409 + },
  410 + "md5": "c743135bb9ee4afe3c522c59e64604ea",
  411 + "message": "compute list."
  412 +}
  413 +```