app.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="layout">
  3. <div class="header">
  4. <div class="navbar flex justify-between items-center">
  5. <div class="logo flex items-center">
  6. <img
  7. src="https://static.caimei365.com/www/authentic/h5/icon-logo.png"
  8. />
  9. <span>认证通</span>
  10. </div>
  11. <div class="user-info">
  12. <template v-if="false">
  13. <span>15872950940</span>
  14. <span class="underline logout">退出登录</span>
  15. </template>
  16. <template v-else>
  17. <div
  18. class="login pr-3 pl-3 border rounded-sm border-white leading-6"
  19. >
  20. 登录
  21. </div>
  22. </template>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="content">
  27. <nuxt />
  28. </div>
  29. <div class="footer flex justify-center items-center">
  30. - 由采美网提供技术支持 -
  31. </div>
  32. <simple-login></simple-login>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. mounted() {
  38. this.init()
  39. },
  40. beforeDestroy() {},
  41. methods: {
  42. init() {
  43. this.responseWidth()
  44. },
  45. // 响应页面宽度变化
  46. responseWidth() {
  47. this.$store.commit('app/SET_SCREEN', window.innerWidth)
  48. window.addEventListener('resize', (e) => {
  49. this.$store.commit('app/SET_SCREEN', e.target.innerWidth)
  50. })
  51. },
  52. },
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. // PC端
  57. @media screen and (min-width: 768px) {
  58. .layout {
  59. padding-top: 80px;
  60. .header {
  61. position: fixed;
  62. top: 0;
  63. left: 0;
  64. width: 100%;
  65. height: 80px;
  66. box-sizing: border-box;
  67. background: linear-gradient(90deg, #101010 0%, #404040 100%);
  68. .navbar {
  69. width: 1200px;
  70. margin: 0 auto;
  71. height: 100%;
  72. }
  73. .logo {
  74. img {
  75. display: block;
  76. width: 44px;
  77. height: 44px;
  78. }
  79. span {
  80. font-size: 24px;
  81. color: #fff;
  82. }
  83. }
  84. .user-info {
  85. color: #fff;
  86. font-size: 16px;
  87. .login,
  88. .logout {
  89. cursor: pointer;
  90. }
  91. }
  92. }
  93. .content {
  94. min-height: calc(100vh - 80px - 80px);
  95. background-color: #f7f7f7;
  96. overflow: hidden;
  97. }
  98. .footer {
  99. height: 80px;
  100. background-color: #2c3038;
  101. color: #fff;
  102. font-size: 14px;
  103. }
  104. }
  105. }
  106. // 移动端
  107. @media screen and (max-width: 768px) {
  108. .layout {
  109. padding-top: 12.8vw;
  110. .header {
  111. position: fixed;
  112. top: 0;
  113. left: 0;
  114. width: 100%;
  115. padding: 0 2.4vw;
  116. height: 12.8vw;
  117. box-sizing: border-box;
  118. background: linear-gradient(90deg, #101010 0%, #404040 100%);
  119. .navbar {
  120. height: 100%;
  121. }
  122. .logo {
  123. img {
  124. display: block;
  125. width: 8vw;
  126. height: 8vw;
  127. }
  128. span {
  129. font-size: 4vw;
  130. color: #fff;
  131. }
  132. }
  133. .user-info {
  134. color: #fff;
  135. font-size: 3vw;
  136. }
  137. }
  138. .content {
  139. min-height: calc(100vh - 12.8vw - 12.4vw);
  140. }
  141. .footer {
  142. height: 12.4vw;
  143. background-color: #2c3038;
  144. color: #fff;
  145. font-size: 3vw;
  146. }
  147. }
  148. }
  149. </style>