uniapp中要獲取地址http: //xxxxxxx/#/pages/my/index?id=124 的參數
1 : 獲取本頁面的地址
let local = location.href;
2:獲取參數
let payment_id = this.getParam(local, "payment_id");
//獲取url中的參數
getParam(path, name) {
var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
if (reg.test(path))
return unescape(RegExp.$2.replace(/\+/g, " "));
return "";
}