上图是体验版根据路径生成二维码
在页面中
<view>{{fscene.id}}</view> 不显示内容
wxjs 为
data: {
fscene:{}
},
onLoad: function (options) {
// options 中的 scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
var scene = decodeURIComponent(options.scene)
this.setData({
fscene: scene
})
}
求各位大神指导!
二楼的方法在 var scene = options.id 在预览中是正确的,谢谢
体验版生成的 url 是经过 encodeURI 的,先解码应该没有问题吧?能给解释一下scene的的结构吗?是json吗?
你取的这种方法是生成小程序码接口B
你取的方法不对,应该是:
var scene = options.id