feat: 增加微信判断

This commit is contained in:
zhangds 2024-04-16 09:23:26 +08:00
parent afdd07a5c1
commit 315cc37311
6 changed files with 33 additions and 3 deletions

View File

@ -1,4 +1,4 @@
let baseurl = "http://pre.marketapi.1688sup.com";
let baseurl = "http://192.168.6.75";
let pathname = window.location.host;
function global_dev_fun(hots) {

View File

@ -122,9 +122,9 @@
let self = this;
//获取链接携带的参数
let linkId = getQueryString('id');
// let linkId = "2460"
let keyCode = getQueryString('key');
// let keyCode = "AAACD7YNCF83rnPr"
// let linkId = "2502"
// let keyCode = "AAACFqXSu4J3spMz"
if (!linkId) {//地址栏无携带id
let path = window.location.pathname;
let parmas = path.split('/');

13
libs.js
View File

@ -71,3 +71,16 @@ const pageOutTime = (timestamp) => {
}
}
};
/**
* 判断是否是微信环境
* @returns
*/
const globalIsWx = () => {
let wx = navigator.userAgent.toLowerCase();
if (wx.match(/MicroMessenger/i) === "micromessenger") {
return true;
} else {
return false;
}
};

1
packkey/README.md Normal file
View File

@ -0,0 +1 @@
packkey 加了包码埋点

16
xw-page/README.md Normal file
View File

@ -0,0 +1,16 @@
说明:该文件是通过前端判断环境,进入不同页面进行立减金领取
# 微信环境
如果是微信可以进行公众号领取
# App环境
如果是App环境拉起微信小程序领取
# 支付宝环境
走以前逻辑
点击立即领取 -> 判断是否是 微信环境
是微信环境 -> 微信环境,走微信公众号授权 -> 获取openid -> 领取立减金
不是微信环境 -> 拉起微信小程序领取 -> 参数:拉起代码 wx:xxxxx -> 领取立减金

0
xw-page/index.html Normal file
View File