From 315cc373113abda603a9e1c773b8e686b0eeac8f Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 16 Apr 2024 09:23:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api2_0.js | 2 +- index.html | 4 ++-- libs.js | 13 +++++++++++++ packkey/README.md | 1 + xw-page/README.md | 16 ++++++++++++++++ xw-page/index.html | 0 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packkey/README.md create mode 100644 xw-page/README.md create mode 100644 xw-page/index.html diff --git a/api2_0.js b/api2_0.js index cac7442..ea6c3ac 100644 --- a/api2_0.js +++ b/api2_0.js @@ -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) { diff --git a/index.html b/index.html index 3754429..d64ed94 100644 --- a/index.html +++ b/index.html @@ -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('/'); diff --git a/libs.js b/libs.js index 4e9de30..3e88336 100644 --- a/libs.js +++ b/libs.js @@ -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; + } +}; diff --git a/packkey/README.md b/packkey/README.md new file mode 100644 index 0000000..8bcab52 --- /dev/null +++ b/packkey/README.md @@ -0,0 +1 @@ +packkey 加了包码埋点 \ No newline at end of file diff --git a/xw-page/README.md b/xw-page/README.md new file mode 100644 index 0000000..6378df1 --- /dev/null +++ b/xw-page/README.md @@ -0,0 +1,16 @@ + 说明:该文件是通过前端判断环境,进入不同页面进行立减金领取 + + +# 微信环境 + 如果是微信可以进行公众号领取 + +# App环境 + 如果是App环境,拉起微信小程序,领取 + +# 支付宝环境 + 走以前逻辑 + +点击立即领取 -> 判断是否是 微信环境 + 是微信环境 -> 微信环境,走微信公众号授权 -> 获取openid -> 领取立减金 + 不是微信环境 -> 拉起微信小程序领取 -> 参数:拉起代码 wx:xxxxx -> 领取立减金 + \ No newline at end of file diff --git a/xw-page/index.html b/xw-page/index.html new file mode 100644 index 0000000..e69de29