通过在微信内扫描普通二维码打开微信小程序。需要获取普通二维码中的信息。
1.
onLoad: function (options) {
//src = decodeURIComponent(options.q);
// src.match(/ id=(S*)&share=1/)[1];
///console.log(src);
if (options.q !== undefined) {
var scan_url = decodeURIComponent(options.q);
console.log(scan_url);
}else{
console.log(123);
}
// var that = this;
// console.log(that.data.session3rd);
}
在小程序的首页.js中通过onLoad事件可以成功获取二维码信息。
示例: