onLoad: function (options) { if (options.q) { let queryAll = decodeURIComponent(options.q); let id = gup(‘id‘, queryAll); //console.log(queryAll); //console.log(id); } }, /** * 获取URL中某个字符串字段 * gup(‘id‘, ‘https://www.lubanso.com/wx/home/?id=bHViYW5zb7W7DJI=&jhkfdhkjfda‘) * //===> bHViYW5zb7W7DJI= */ function gup(name, url) { if (!url) url = location.href; name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(url); return results == null ? null : results[1]; }