wx.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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("id");
  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. var weixin = isWeiXin();
  80. // var res={
  81. // "code": 200,
  82. // "msg": "success",
  83. // "result": {
  84. // "openlink": "weixin:\/\/dl\/business\/?t=Dyq5kn9Vfyf"
  85. // }
  86. // };
  87. // if (res.code === 200) {
  88. // if (!weixin) {
  89. // $("#dianjiimg_links").attr('href', res.result.openlink)
  90. // // $("#public-web-jump-button").attr("href", res.result.openlink)
  91. // jsUpdate(res)
  92. // }
  93. // } else {
  94. // $(".public-container").html('<p class="error-msg">'+res.msg+'</p>');
  95. // }
  96. $.ajax({
  97. type: "get",
  98. //async: false,
  99. //dataType: "jsonp",
  100. //jsonp: "callback",//传递给请求处理程序或页面的,标识jsonp回调函数名(一般为:callback)
  101. //jsonpCallback: "GetData",//callback的function名称
  102. //url: "http://127.0.0.1:7015/app/user/getAppletScheme",
  103. url: "http://139.186.77.83:7015/app/user/getAppletScheme",
  104. data: {
  105. "cardId":cid,
  106. // "domain": "eturl.cn",
  107. // "cookie":"ca77320dfefbda77f218b15fb5e64e96",
  108. // "f":"bd084627"
  109. },
  110. success: function(res) {
  111. if (res.code === 200) {
  112. if (!weixin) {
  113. $("#dianjiimg_links").attr('href', res.result.openlink)
  114. // $("#public-web-jump-button").attr("href", res.result.openlink)
  115. jsUpdate(res)
  116. }
  117. }
  118. else {
  119. $(".public-container").html('<p class="error-msg">'+res.msg+'</p>');
  120. }
  121. }
  122. });
  123. }
  124. function jsUpdate(res) {
  125. var mobile_flag = isMobile();
  126. var weixin = isWeiXin();
  127. if(mobile_flag){
  128. var baidu = isBaidu();
  129. var uc = isUc();
  130. var weibo = isWeibo();
  131. var douyin = isDouyin();
  132. if (weixin) {
  133. }
  134. else if (uc) {
  135. $("#public-web-jump-button").html("点击立即前往微信");
  136. $("#dianjiimg").show();
  137. window.location.href = res.result.openlink;
  138. }
  139. else if (douyin) {
  140. if (res.result.openlink !== '') {
  141. window.location.href = res.result.openlink;
  142. // $("#public-web-jump-button span").click();
  143. }
  144. }
  145. else if (weibo) {
  146. window.location.href = res.result.openlink;
  147. }
  148. else {
  149. $("#dianjiimg").show();
  150. if (res.result.openlink !== '') {
  151. window.location.href = res.result.openlink;
  152. // $("#public-web-jump-button span").click();
  153. }
  154. setTimeout(function (){
  155. $("#public-web-jump-button").html("点击立即前往微信");
  156. $("#dianjiimg").show();
  157. }, 3000);
  158. }
  159. } else {
  160. // 强行调用一波URLScheme
  161. if (res.result.openlink !== '') {
  162. window.location.href = res.result.openlink;
  163. }
  164. $(".notice-msg").html("请使用手机访问本网页!");
  165. }
  166. }
  167. function isWeiXin(){
  168. var ua = navigator.userAgent.toLowerCase()
  169. var isWXWork = ua.match(/wxwork/i) == 'wxwork'
  170. var isWeixin = !isWXWork && ua.match(/micromessenger/i) == 'micromessenger'
  171. return isWeixin;
  172. }
  173. function isDouyin(){
  174. ua = navigator.userAgent.toLowerCase();
  175. if (ua.indexOf('aweme') >-1){
  176. return true;
  177. } else {
  178. return false;
  179. }
  180. }
  181. function isBaidu(){
  182. ua = navigator.userAgent.toLowerCase();
  183. if (ua.indexOf('baiduboxapp/') >-1){
  184. return true;
  185. } else {
  186. return false;
  187. }
  188. }
  189. function isUc() {
  190. if (navigator.userAgent.match(/(UCBrowser|Quark)/i)) {
  191. return true;
  192. } else {
  193. return false;
  194. }
  195. }
  196. function isWeibo() {
  197. var ua = navigator.userAgent;
  198. if(ua.indexOf('Weibo') > -1) {
  199. return true;
  200. } else {
  201. return false;
  202. }
  203. }
  204. function getQueryVariable(variable)
  205. {
  206. var query = window.location.search.substring(1);
  207. var vars = query.split("&");
  208. for (var i=0;i<vars.length;i++) {
  209. var pair = vars[i].split("=");
  210. if(pair[0] == variable){return pair[1];}
  211. }
  212. return(false);
  213. }
  214. function isMobile() {
  215. var mobile_flag = true;
  216. if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|XiaoMi|IEMobile)/i)) {
  217. mobile_flag = true;
  218. } else {
  219. mobile_flag = false;
  220. }
  221. var screen_width = window.screen.availWidth;
  222. if(screen_width < 700){
  223. mobile_flag = true;
  224. }
  225. return mobile_flag;
  226. }
  227. function isIphone() {
  228. if (navigator.userAgent.match(/(iPhone|iPod|ios|iPad)/i)) {
  229. return true;
  230. } else {
  231. return false;
  232. }
  233. }
  234. </script>
  235. </body>
  236. </html>