index.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta charset="utf-8" />
  6. <meta content="yes" name="apple-mobile-web-app-capable" />
  7. <meta content="yes" name="apple-touch-fullscreen" />
  8. <meta content="telephone=no,email=no" name="format-detection" />
  9. <meta content="maximum-dpr=2" name="flexible" />
  10. <!--<meta name="viewport" content="width=device-width">-->
  11. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  12. <title>心灵照相机</title>
  13. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  14. <script src="/static/global.js"></script>
  15. <script>
  16. var prod = false;
  17. var baseUrl = prod ? env.prod : env.dev;
  18. var photoUrl = prod ? env.photoUrl : env.photoUrl;
  19. var scoketUrl = env.scoketUrl;
  20. var systemUrl = env.systemUrl;
  21. // var IsPC = function () {
  22. // if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
  23. // return false;
  24. // } else {
  25. // return true;
  26. // }
  27. // }()
  28. // console.log(navigator.userAgent);
  29. var os = function () {
  30. var ua = navigator.userAgent,
  31. isWindowsPhone = /(?:Windows Phone)/.test(ua),
  32. isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
  33. isAndroid = /(?:Android)/.test(ua),
  34. isFireFox = /(?:Firefox)/.test(ua),
  35. isChrome = /(?:Chrome|CriOS)/.test(ua),
  36. isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
  37. isPhone = /(?:iPhone)/.test(ua) && !isTablet,
  38. isPc = !isPhone && !isAndroid && !isSymbian;
  39. return {
  40. isTablet: isTablet,
  41. isPhone: isPhone,
  42. isAndroid: isAndroid,
  43. isPc: isPc
  44. };
  45. }();
  46. var getQueryVariable = function (variable) {
  47. var query = window.location.search.substring(1);
  48. var vars = query.split("&");
  49. for (var i = 0; i < vars.length; i++) {
  50. var pair = vars[i].split("=");
  51. if (pair[0] == variable) { return pair[1]; }
  52. }
  53. return (false);
  54. }
  55. if ((os.isAndroid || os.isPhone) && (getQueryVariable('userType') != 2 && getQueryVariable('userType') != 3)) {
  56. let url = window.location.href;
  57. window.location.href = url + 'h5/index.html'
  58. }
  59. //阻止safari浏览器双击放大功能
  60. let lastTouchEnd = 0 //更新手指弹起的时间
  61. document.documentElement.addEventListener("touchstart", function (event) {
  62. //多根手指同时按下屏幕,禁止默认行为
  63. if (event.touches.length > 1) {
  64. event.preventDefault();
  65. }
  66. });
  67. document.documentElement.addEventListener("touchend", function (event) {
  68. let now = (new Date()).getTime();
  69. if (now - lastTouchEnd <= 300) {
  70. //当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
  71. event.preventDefault();
  72. }else{ // 否则重新手指弹起的时间
  73. lastTouchEnd = now;
  74. }
  75. }, false);
  76. //阻止双指放大页面
  77. document.documentElement.addEventListener("gesturestart", function (event) {
  78. event.preventDefault();
  79. });
  80. </script>
  81. </head>
  82. <body>
  83. <div id="app"></div>
  84. <!-- built files will be auto injected -->
  85. </body>
  86. <style scoped>
  87. html{
  88. width: 100%;
  89. height: 100%;
  90. /* position: relative !important; */
  91. }
  92. body {
  93. padding: 0px;
  94. margin: 0px;
  95. /* height: 100%;
  96. width: 100%; */
  97. /* height: 100vh;
  98. width: 100%; */
  99. /* position: relative !important; */
  100. /* width: 100%;
  101. height: 100%;
  102. margin: 0; */
  103. /* min-width: 1280px; */
  104. /* overflow: hidden; */
  105. }
  106. </style>
  107. </html>