onLoad: function(options) {
//判断公众号截取official_shop_id
const getShopId = name => {
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
};
let official_shop_id = getShopId('official_shop_id'); //是否存在official_shop_id 参数名是什么就写什么
}
微信H5获取url上面的参数(uniapp)
最新推荐文章于 2023-05-22 09:35:49 发布