参考文档获取二维码 - 接口 B:适用于需要的码数量极多的业务场景
前端需要关注以下的文档
后台开发者会将携带的参数放在scene中,演示获取scene中携带的id,代码如下
onLoad: function (options) {
let scene = decodeURIComponent(options.scene);
console.log(scene.id);
}
拓展:encodeURI和encodeURIComponent都是对URL编码的方法,encodeURIComponent编码的范围更大。