consult.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div>
  3. <!-- banner区域 start -->
  4. <div class="swiper-container banner" id="banner">
  5. <div class="swiper-wrapper">
  6. <div class="swiper-slide">
  7. <img src="/img/contact-banner.jpg" alt="" />
  8. </div>
  9. </div>
  10. </div>
  11. <!-- banner区域 end -->
  12. <div class="main">
  13. <div class="tabbar">
  14. <div class="container">
  15. <template v-for="(tab, index) in tabList">
  16. <div class="tab" :class="{ on: tab.id === current }" :key="tab.en" @click="onTabChange(tab)">
  17. <div class="name" v-text="tab.name"></div>
  18. <div class="en" v-text="tab.en"></div>
  19. </div>
  20. <div class="line" :key="index" v-if="index < 2"></div>
  21. </template>
  22. </div>
  23. </div>
  24. <div class="tab-content container">
  25. <div class="tab-item online">
  26. <div class="section-title">
  27. <img src="/img/contact-title-online.png" alt="在线咨询" />
  28. <h3>在线咨询</h3>
  29. </div>
  30. <div class="content">
  31. <ContactConsult />
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. head() {
  41. return {
  42. title: '首页-艾斯佰丽官网-在线咨询',
  43. }
  44. },
  45. data() {
  46. return {
  47. tabList: [],
  48. current: 3,
  49. }
  50. },
  51. asyncData() {
  52. return {
  53. tabList: [
  54. {
  55. id: 1,
  56. name: '联系方式',
  57. en: 'contact',
  58. url: '/contact.html',
  59. },
  60. {
  61. id: 2,
  62. name: '人才招聘',
  63. en: 'join us',
  64. url: '/contact/job.html',
  65. },
  66. {
  67. id: 3,
  68. name: '在线咨询',
  69. en: 'chat with us',
  70. url: '/contact/consult.html',
  71. },
  72. ],
  73. }
  74. },
  75. mounted() {
  76. new Swiper('#banner', {
  77. loop: false, // 循环模式选项
  78. })
  79. },
  80. methods: {
  81. onTabChange(tab) {
  82. // this.current = tab.id
  83. window.open(tab.url, '_self')
  84. },
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. @media screen and (min-width: 768px) {
  90. .main {
  91. .tabbar {
  92. background: #eeeeee;
  93. height: 100px;
  94. .container {
  95. display: flex;
  96. justify-content: space-between;
  97. align-items: center;
  98. height: 100%;
  99. }
  100. .line {
  101. height: 46px;
  102. width: 3px;
  103. background: #aaaaaa;
  104. }
  105. .tab {
  106. display: flex;
  107. justify-content: center;
  108. align-items: center;
  109. flex-direction: column;
  110. position: relative;
  111. height: 100%;
  112. width: 16%;
  113. user-select: none;
  114. .name {
  115. font-size: 29px;
  116. font-weight: 400;
  117. color: #000000;
  118. text-align: center;
  119. }
  120. .en {
  121. font-size: 17px;
  122. font-weight: 300;
  123. color: #000000;
  124. text-align: center;
  125. margin-top: 10px;
  126. text-transform: uppercase;
  127. }
  128. &:hover {
  129. cursor: pointer;
  130. }
  131. &::after {
  132. content: '';
  133. position: absolute;
  134. opacity: 0;
  135. width: 0;
  136. height: 0;
  137. border-style: solid;
  138. border-width: 0 12px 8px 12px;
  139. border-color: transparent transparent #f3920d transparent;
  140. bottom: 0;
  141. }
  142. &.on {
  143. &::after {
  144. opacity: 1;
  145. }
  146. .name,
  147. .en {
  148. color: #f3920d;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. @media screen and (max-width: 768px) {
  156. .main {
  157. .tabbar {
  158. background: #eeeeee;
  159. padding: 0 0.6rem;
  160. height: 0.8rem;
  161. .container {
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. height: 100%;
  166. }
  167. .line {
  168. height: 0.4rem;
  169. width: 0.02rem;
  170. background: #aaaaaa;
  171. }
  172. .tab {
  173. display: flex;
  174. justify-content: center;
  175. align-items: center;
  176. flex-direction: column;
  177. position: relative;
  178. height: 100%;
  179. width: 24%;
  180. user-select: none;
  181. .name {
  182. font-size: 0.26rem;
  183. font-weight: 400;
  184. color: #000000;
  185. text-align: center;
  186. }
  187. .en {
  188. display: none;
  189. }
  190. &:hover {
  191. cursor: pointer;
  192. }
  193. &::after {
  194. content: '';
  195. position: absolute;
  196. opacity: 0;
  197. width: 0;
  198. height: 0;
  199. border-style: solid;
  200. border-width: 0 0.12rem 0.08rem 0.12rem;
  201. border-color: transparent transparent #f3920d transparent;
  202. bottom: 0;
  203. }
  204. &.on {
  205. &::after {
  206. opacity: 1;
  207. }
  208. .name,
  209. .en {
  210. color: #f3920d;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. </style>