|
@@ -0,0 +1,60 @@
|
|
|
|
+const baseSize = 16
|
|
|
|
+
|
|
|
|
+function setRem() {
|
|
|
|
+ const scale = document.documentElement.clientWidth / 375
|
|
|
|
+ document.documentElement.style.fontSize = baseSize * scale + 'px'
|
|
|
|
+}
|
|
|
|
+setRem()
|
|
|
|
+window.onresize = function () {
|
|
|
|
+ setRem()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function isIPhoneX() {
|
|
|
|
+ var u = navigator.userAgent,
|
|
|
|
+ isX;
|
|
|
|
+ var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
|
|
|
|
+ if (isIOS) {
|
|
|
|
+ if (screen.height == 812 && screen.width == 375) {
|
|
|
|
+ isX = true
|
|
|
|
+ } else {
|
|
|
|
+ isX = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return isX
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+if (isIPhoneX()) {
|
|
|
|
+ document.querySelector('.bar').style.padding = "8px 15px 42px"
|
|
|
|
+ document.querySelector('.iphoneX').style.display = "block"
|
|
|
|
+}
|
|
|
|
+let u = navigator.userAgent,
|
|
|
|
+ ios = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
|
|
|
|
+ a = document.querySelector('.bar>a');
|
|
|
|
+if (ios) {
|
|
|
|
+ a.setAttribute("href", "https://itunes.apple.com/app/id1511863353");
|
|
|
|
+}
|
|
|
|
+// $.get("/h5/wxjsapi/signature", {
|
|
|
|
+// url: encodeURIComponent(window.location.href)
|
|
|
|
+// },
|
|
|
|
+// function (res) {
|
|
|
|
+// wx.config({
|
|
|
|
+// debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
|
+// appId: res.data.appid, // 必填,公众号的唯一标识
|
|
|
|
+// timestamp: res.data.timestamp, // 必填,生成签名的时间戳
|
|
|
|
+// nonceStr: res.data.noncestr, // 必填,生成签名的随机串
|
|
|
|
+// signature: res.data.signature, // 必填,签名
|
|
|
|
+// jsApiList: ["updateAppMessageShareData"] // 必填,需要使用的JS接口列表
|
|
|
|
+// });
|
|
|
|
+// wx.error(function (res) {
|
|
|
|
+// console.log(res);
|
|
|
|
+// });
|
|
|
|
+// wx.ready(function () {
|
|
|
|
+// wx.updateAppMessageShareData({
|
|
|
|
+// title: "友期app", // 分享标题
|
|
|
|
+// desc: "真人短视频匹配交友,游戏开黑陪玩就在友期", // 分享描述
|
|
|
|
+// link: "http://front.test.uqchat.cn/download ", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
|
+// imgUrl: "http://www.xsbanruo.com/xsbanruo-logo.png", // 分享图标
|
|
|
|
+// });
|
|
|
|
+// });
|
|
|
|
+// },
|
|
|
|
+// );
|