第一种:
功能:获取地址栏参数
使用:getQueryString('str')
代码:this.$getQueryString("order_id");//001002
代码:this.$getQueryString("order_title");//123
http://localhost:9010/index.html?order_id=001002&order_title=123&total_amount=1.99
*/
js:
function getQueryString(name) {
var search = document.location.href;
var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if (null != matcher) {
try {
items = decodeURIComponent(decodeURIComponent(matcher[1]));
} catch (e) {
try {
items = decodeURIComponent(matcher[