获取小程序码参数scene?
我这样获取scene有不对的地方吗?打印query为空
onLoad:function(query) {
let that = this;
if (query.scene){
const scene = decodeURIComponent(query.scene)
var id = scene.split(’&’)[0].split(’=’)[1]
var shopName = scene.split(’&’)[1].split(’=’)[1]
that.setData({
sid: id,
shopName: shopName
})
}
}