@xsyx/cute-bridge-sdk
v1.0.3
Published
H5页面与Flutter or 小程序桥接SDK
Downloads
2
Readme
@xsyx/cute-bridge-sdk
H5页面与Flutter or 小程序桥接SDK
使用方式 一
安装包 cnpm install @xsyx/cute-bridge-sdk
导入包
import cuteBridge from "@xsyx/cute-bridge-sdk";
- 开启调试 显示VConsole
- cuteBridge.vConsole();
使用方式 二
引入 cnd 路径 http://front-daily-cdn.xsyx.xyz/cute-bridge-sdk/1.0.0/cute-bridge.js
let cuteBridge = window.CuteBridge;
- 开启调试 显示VConsole
- cuteBridge.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)
})