wx.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <link rel="icon" href="data:;base64,=">
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title></title>
  9. <meta name="description" content="">
  10. <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.1/weui.min.css"></link>
  11. <!-- 全埋点监控 -->
  12. <script src="https://s3.ssl.qhres2.com/!1e1fd6c6/feb/monitor.js"></script>
  13. <script src="https://n.stcfile.com/inner/wlh5/jquery.min.js"></script>
  14. <link rel="stylesheet" type="text/css" href="https://n.stcfile.com/inner/wlh5/home_links.css">
  15. <script>
  16. window.onerror = e => {
  17. console.error(e)
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <div class="page full">
  23. <div id="public-web-container" class="public-container">
  24. <div id="safe-notice" style="display:none;">
  25. <div class="safe-notice">
  26. <img src="https://n.stcfile.com/inner/wlh5/safe.png">
  27. <p>本链接经过<font style="font-weight: 500;color: #333333;">SSL安全加密</font>,请放心点击!</p>
  28. </div>
  29. </div>
  30. <div id="style_normal" style="display:none;">
  31. <img class="logo" src="">
  32. <p class="notice-msg"><small style="font-weight: 500;">正在跳转中...</small><br>如未自动打开微信请点击下方按钮</p>
  33. <div class="button-container" onclick="getInfos()">
  34. <a id="public-web-jump-button" type="button" class="default" style="width: 66%; margin-top: 20px;">
  35. <span id="public-web-jump-button-loading" class="weui-primary-loading weui-primary-loading_transparent">
  36. <i class="weui-primary-loading__dot"></i>
  37. </span>
  38. <span style="font-weight: 500;">正在打开微信</span>
  39. </a>
  40. </div>
  41. <a id="dianjiimg_links" href="">
  42. </a>
  43. <div class="qrcodes-container" id="qrcodes"></div>
  44. </div>
  45. <div id="style_full" style="display:none;">
  46. <a id="dianjiimg_links_full" href="">
  47. <img class="fullimg" src="">
  48. </a>
  49. <div id="button_container_full" class="button-container-none">
  50. <a id="public-web-jump-button-full" href="" style="">
  51. </a>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <script type="text/javascript">
  57. var cid=0;
  58. $(document).ready(function() {
  59. cid=getQueryString("id");
  60. htmlInfo();
  61. getInfos();
  62. });
  63. function getQueryString(name){
  64. var reg = new RegExp( "(^|&)" + name + "=([^&]*)(&|$)" );
  65. var r = window.location.search.substr(1).match(reg);
  66. if (r!= null ) return unescape(r[2]); return null ;
  67. }
  68. function htmlInfo() {
  69. var mobile_flag = isMobile();
  70. if (mobile_flag) {
  71. $("#safe-notice").show();
  72. $("#style_normal").show();
  73. $(".logo").attr("src","https://n.stcfile.com/inner/wlh5/wx_202204.png")
  74. } else {
  75. $("#safe-notice").hide();
  76. $("#style_normal").hide();
  77. $(".public-container").html('请使用手机访问本链接'+'</p>');
  78. }
  79. }
  80. function getInfos() {
  81. var weixin = isWeiXin();
  82. // var res={
  83. // "code": 200,
  84. // "msg": "success",
  85. // "result": {
  86. // "openlink": "weixin:\/\/dl\/business\/?t=Dyq5kn9Vfyf"
  87. // }
  88. // };
  89. // if (res.code === 200) {
  90. // if (!weixin) {
  91. // $("#dianjiimg_links").attr('href', res.result.openlink)
  92. // // $("#public-web-jump-button").attr("href", res.result.openlink)
  93. // jsUpdate(res)
  94. // }
  95. // } else {
  96. // $(".public-container").html('<p class="error-msg">'+res.msg+'</p>');
  97. // }
  98. $.ajax({
  99. type: "get",
  100. //async: false,
  101. //dataType: "jsonp",
  102. //jsonp: "callback",//传递给请求处理程序或页面的,标识jsonp回调函数名(一般为:callback)
  103. //jsonpCallback: "GetData",//callback的function名称
  104. //url: "http://127.0.0.1:7015/app/user/getAppletScheme",
  105. url: "http://139.186.77.83:7015/app/user/getAppletScheme",
  106. data: {
  107. "cardId":cid,
  108. // "domain": "eturl.cn",
  109. // "cookie":"ca77320dfefbda77f218b15fb5e64e96",
  110. // "f":"bd084627"
  111. },
  112. success: function(res) {
  113. if (res.code === 200) {
  114. if (!weixin) {
  115. $("#dianjiimg_links").attr('href', res.result.openlink)
  116. // $("#public-web-jump-button").attr("href", res.result.openlink)
  117. jsUpdate(res)
  118. }
  119. }
  120. else {
  121. $(".public-container").html('<p class="error-msg">'+res.msg+'</p>');
  122. }
  123. }
  124. });
  125. }
  126. function jsUpdate(res) {
  127. var mobile_flag = isMobile();
  128. var weixin = isWeiXin();
  129. if(mobile_flag){
  130. var baidu = isBaidu();
  131. var uc = isUc();
  132. var weibo = isWeibo();
  133. var douyin = isDouyin();
  134. if (weixin) {
  135. }
  136. else if (uc) {
  137. $("#public-web-jump-button").html("点击立即前往微信");
  138. $("#dianjiimg").show();
  139. window.location.href = res.result.openlink;
  140. }
  141. else if (douyin) {
  142. if (res.result.openlink !== '') {
  143. window.location.href = res.result.openlink;
  144. // $("#public-web-jump-button span").click();
  145. }
  146. }
  147. else if (weibo) {
  148. window.location.href = res.result.openlink;
  149. }
  150. else {
  151. $("#dianjiimg").show();
  152. if (res.result.openlink !== '') {
  153. window.location.href = res.result.openlink;
  154. // $("#public-web-jump-button span").click();
  155. }
  156. setTimeout(function (){
  157. $("#public-web-jump-button").html("点击立即前往微信");
  158. $("#dianjiimg").show();
  159. }, 3000);
  160. }
  161. } else {
  162. // 强行调用一波URLScheme
  163. if (res.result.openlink !== '') {
  164. window.location.href = res.result.openlink;
  165. }
  166. $(".notice-msg").html("请使用手机访问本网页!");
  167. }
  168. }
  169. function isWeiXin(){
  170. var ua = navigator.userAgent.toLowerCase()
  171. var isWXWork = ua.match(/wxwork/i) == 'wxwork'
  172. var isWeixin = !isWXWork && ua.match(/micromessenger/i) == 'micromessenger'
  173. return isWeixin;
  174. }
  175. function isDouyin(){
  176. ua = navigator.userAgent.toLowerCase();
  177. if (ua.indexOf('aweme') >-1){
  178. return true;
  179. } else {
  180. return false;
  181. }
  182. }
  183. function isBaidu(){
  184. ua = navigator.userAgent.toLowerCase();
  185. if (ua.indexOf('baiduboxapp/') >-1){
  186. return true;
  187. } else {
  188. return false;
  189. }
  190. }
  191. function isUc() {
  192. if (navigator.userAgent.match(/(UCBrowser|Quark)/i)) {
  193. return true;
  194. } else {
  195. return false;
  196. }
  197. }
  198. function isWeibo() {
  199. var ua = navigator.userAgent;
  200. if(ua.indexOf('Weibo') > -1) {
  201. return true;
  202. } else {
  203. return false;
  204. }
  205. }
  206. function getQueryVariable(variable)
  207. {
  208. var query = window.location.search.substring(1);
  209. var vars = query.split("&");
  210. for (var i=0;i<vars.length;i++) {
  211. var pair = vars[i].split("=");
  212. if(pair[0] == variable){return pair[1];}
  213. }
  214. return(false);
  215. }
  216. function isMobile() {
  217. var mobile_flag = true;
  218. if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|XiaoMi|IEMobile)/i)) {
  219. mobile_flag = true;
  220. } else {
  221. mobile_flag = false;
  222. }
  223. var screen_width = window.screen.availWidth;
  224. if(screen_width < 700){
  225. mobile_flag = true;
  226. }
  227. return mobile_flag;
  228. }
  229. function isIphone() {
  230. if (navigator.userAgent.match(/(iPhone|iPod|ios|iPad)/i)) {
  231. return true;
  232. } else {
  233. return false;
  234. }
  235. }
  236. </script>
  237. </body>
  238. </html>