获取参数页面的onload
onLoad: function (t) {
console.log(t)
let q = decodeURIComponent(t.q)
if (q) {
console.log("index 生命周期 onload url=" + q)
console.log("index 生命周期 onload 参数 flag=" + this.getQueryString(q, 'zbid'))
}
},
getQueryString: function (url, name) {
var reg = new RegExp('(^|&|%|/?)' + name + '=([^&|%|/?]*)(&|%|/?|$)', 'i')
var r = url.substr(1).match(reg)
if (r != null) {
// console.log("r = " + r)
// console.log("r[2] = " + r[2])
return r[2]
}
return null;
}