小程序扫码链接
2021-01-20 本文已影响0人
可乐不可乐_6e02
const { q = '' } = options || this.$wxpage.options;
let url = decodeURIComponent(q);
const querys = url.substring(url.indexOf('?') + 1).split('&');
let result = {};
for(let i = 0; i < querys.length; i++){
let temp = querys[i].split('=');
if(temp.length < 2){
result[temp[0]] = '';
}else{
result[temp[0]] = temp[1];
}
}
this.patientName = result.patName || '';
this.parentIdNo = result.idNo || '';
this.patientAddress = result.patientAddress || '';
this.patientMobile = result.patientMobile || '';