cute-bridge-sdk

1.1.2 • Public • Published

cute-bridge-sdk

H5页面与Flutter or 小程序桥接SDK

使用方式

引入 cnd 路径 http://xxxxxx.com/cute-bridge.js

new 出CuteBridge对象

let cute = new CuteBridge({
  //是否开启调试-显示VConsole
  debug: true
});

  • debug: true 是否开启调试 显示VConsole

跳转购物车

  cute.navigateCart();
跳转首页
  cute.navigateHome();
跳转商品详细
   cute.navigateDetail({
      prType: "CHOICE",
      spuSn: "20200701000145101546870",
      skuSn: "000546870",
      acId: "629426",
      prId: "513435",
    })
  • 转商品详细页,这些参数都是必填
获取购物车数据
  cute.getCartList().then(res=>{
      console.log("获取购物车数据", res)
  });
添加购物车
  cute.addCart({
      prType: "CHOICE",
      spuSn: "20200701000145101546870",
      skuSn: "000546870",
      acId: "629426",
      prId: "513435",
  }).then(res=>{
      console.log("添加购物车成功", res)
  }).catch(res=>{
      console.log("添加购物车失败", res)
  })
减少购物车
  cute.minusCart({
      prType: "CHOICE",
      spuSn: "20200701000145101546870",
      skuSn: "000546870",
      acId: "629426",
      prId: "513435",
  }).then(res=>{
      console.log("减少购物车成功", res)
  }).catch(res=>{
      console.log("减少购物车失败", res)
  })

Readme

Keywords

none

Package Sidebar

Install

npm i cute-bridge-sdk

Weekly Downloads

12

Version

1.1.2

License

ISC

Unpacked Size

138 kB

Total Files

15

Last publish

Collaborators

  • luotao123