1.0.0 • Published 8 years ago

vdian v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

vdian

微店 非官方 SDK for node.js

使用方法请参照 官方文档

技术支持

请发邮件至:yecheng@amandapp.com

初始化

const Vdian = require('vdian')
const vdian = new Vdian(APPKEY, SECRET) // 证书信息
const itemDao = vdian.item              // 商品API
const cateDao = vdian.cate              // 商品分类API
const orderDao = vdian.order            // 订单API
const seckillDao = vdian.seckill        // 限时折扣商品 API
const couponDao = vdian.coupon          // 店铺优惠券 API
const cpsDao = vdian.cps                // CPS API

安装

Node.js 安装

npm install vdian

使用方法及代码示例

商品接口

在 samples/item 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 list.js,将其中的参数改成你自己的 item 实例参数
  • 执行示例文件即可, 如:

    cd samples/item
    node list

商品分类接口

在 samples/cate 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 get.js,将其中的参数改成你自己的 cate 实例参数
  • 执行示例文件即可, 如:

    cd samples/cate
    node get

订单接口

在 samples/order 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 list.js,将其中的参数改成你自己的 order 实例参数
  • 执行示例文件即可, 如:

    cd samples/order
    node list

限时折扣商品接口

在 samples/seckill 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 list.js,将其中的参数改成你自己的 seckill 实例参数
  • 执行示例文件即可, 如:

    cd samples/seckill
    node list

店铺优惠券接口

在 samples/coupon 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 list.js,将其中的参数改成你自己的 coupon 实例参数
  • 执行示例文件即可, 如:

    cd samples/coupon
    node list

CPS接口

在 samples/cps 目录下的代码示例,使用方法:

  • 将 sample/vdian.js 中需要的参数修改
  • 打开需要执行的某个实例文件,如 search.js,将其中的参数改成你自己的 cps 实例参数
  • 执行示例文件即可, 如:

    cd samples/cps
    node search

API

商品接口

商品分类接口

订单接口

限时折扣商品接口

店铺优惠券接口

CPS接口

贡献者

https://github.com/wzbg/vdian

依赖

  • dateformat - A node.js package for Steven Levithan's excellent dateFormat() function.
  • sync-request - Make synchronous web requests with cross platform support.

我们在代码中使用了ES6的不定参数、默认参数和解构等新特性,使用本SDK请升级到6.0或以上版本的node.js,在此声明。

License

The MIT License (MIT)

Copyright (c) 2016

1.0.0

8 years ago

0.5.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago