App.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div id="app">
  3. <div class="bg">
  4. <img src="@/assets/img/m1.png" >
  5. </div>
  6. <div>
  7. </div>
  8. <top-logo></top-logo>
  9. <nav-bar></nav-bar>
  10. <div class="main-wrapper">
  11. <router-view />
  12. </div>
  13. <page-bottom></page-bottom>
  14. </div>
  15. </template>
  16. <script>
  17. import TopLogo from './components/topLogo/TopLogo.vue'
  18. import NavBar from './components/navBar/NavBar.vue'
  19. import PageBottom from './components/pageBottom/PageBottom.vue'
  20. export default {
  21. components: {
  22. NavBar,
  23. TopLogo,
  24. PageBottom
  25. },
  26. created() {
  27. if(this.isMobile()) {
  28. window.location.href = 'http://jz.red.igxys.com/index/#/'
  29. }
  30. },
  31. methods: {
  32. isMobile() {
  33. if(/android/i.test(navigator.userAgent)) {
  34. //document.write("This is Android'browser.");//这是Android平台下浏览器
  35. return true;
  36. }
  37. if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
  38. //document.write("This is iOS'browser.");//这是iOS平台下浏览器
  39. return true;
  40. }
  41. return false;
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. #app {
  48. // max-width: 1920px;
  49. min-width: 1200px;
  50. margin: 0 auto;
  51. }
  52. .main-wrapper {
  53. width: 1200px;
  54. margin: 0 auto;
  55. }
  56. .bg {
  57. // position: absolute;
  58. // left: 0;
  59. // right: 0;
  60. margin: 0 auto;
  61. height: 300px;
  62. margin-bottom: -300px;
  63. // z-index: -1;
  64. img {
  65. // min-width: 100vw;
  66. width: 100%;
  67. height: 300px;
  68. }
  69. }
  70. </style>