H5页面与Flutter or 小程序桥接SDK
引入 cnd 路径 http://xxxxxx.com/cute-bridge.js
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)
})