workPage.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  6. <title>工作页面 - CocoFlow</title>
  7. <link rel="icon" href="../static/logo.ico">
  8. </head>
  9. <body>
  10. <noscript>
  11. <strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  12. </noscript>
  13. <div id="app"></div>
  14. <!-- built files will be auto injected -->
  15. </body>
  16. </html>
  17. <script>
  18. function stopSafari() {
  19. //阻止safari浏览器双击放大功能
  20. let lastTouchEnd = 0 //更新手指弹起的时间
  21. document.documentElement.addEventListener("touchstart", function (event) {
  22. //多根手指同时按下屏幕,禁止默认行为
  23. if (event.touches.length > 1) {
  24. event.preventDefault();
  25. }
  26. });
  27. document.documentElement.addEventListener("touchend", function (event) {
  28. let now = (new Date()).getTime();
  29. if (now - lastTouchEnd <= 300) {
  30. //当两次手指弹起的时间小于300毫秒,认为双击屏幕行为
  31. event.preventDefault();
  32. } else { // 否则重新手指弹起的时间
  33. lastTouchEnd = now;
  34. }
  35. }, false);
  36. //阻止双指放大页面
  37. document.documentElement.addEventListener("gesturestart", function (event) {
  38. event.preventDefault();
  39. });
  40. }
  41. window.onload = () => {
  42. stopSafari();
  43. let topU = ""
  44. try{
  45. if(window.parent.U){
  46. topU = window.parent
  47. }else if(window.parent.parent.U){
  48. topU = window.parent.parent
  49. }else if(window.top.U){
  50. topU = window.top
  51. }
  52. }catch(e){
  53. try {
  54. if(window.parent.parent.U){
  55. topU = window.parent.parent
  56. }else if(window.top.U){
  57. topU = window.top
  58. }
  59. } catch (error) {
  60. if(window.top.U){
  61. topU = window.top
  62. }
  63. }
  64. }
  65. window.topU = topU
  66. }
  67. document.domain = document.domain.split(".").slice(-2).join(".");
  68. </script>