https://www.jianshu.com/p/4567568c957c
onLoad: function (options) {
onsole.log(options['key1'])
wx.showToast({
title: options['key2'],
})
}
打开小程序二维码链接
小程序获取二维码参数
onLoad(options){
this.removeStore('options')
if (options.scene) {
let sence = this.getScene(options.scene)
this.options = sence.P;
this.setStorageSync('options',sence.P)
this.getUserInfo()//拉新获取用户信息
}
},
/**
* 获取小程序二维码参数
* @param {String} scene 需要转换的参数字符串
*/
getScene: function(scene = "") {
if (scene == "") return {}
let res = {}
console.log("scene",decodeURIComponent(scene))
let params = decodeURIComponent(scene).split("&")
params.forEach(item => {
let pram = item.split("=")
res[pram[0]] = pram[1]
})
return res
},
App打开微信小程序并传递参数
https://www.jianshu.com/p/c08b54299e8a