通过在微信内扫描普通二维码打开微信小程序。需要获取普通二维码中的信息。

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事件可以成功获取二维码信息。

   示例:小程序

TAG标签: 小程序微信二维码扫描

http://www.xiaochengxub.com/read-104175.html