wx.html 8.2 KB

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