index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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. <!-- 联系方式 -->
  26. <div class="tab-item contact">
  27. <div class="section-title">
  28. <img src="/img/contact-title-contact.png" alt="联系方式" />
  29. <h3>联系方式</h3>
  30. </div>
  31. <div class="content">
  32. <div class="section">
  33. <div class="contact-logo"><img src="/img/contact-logo.png" alt="acebelle生物科技(深圳)有限公司" /></div>
  34. <div class="name">ACEBELLE生物科技(深圳)有限公司</div>
  35. <div class="subname">(ROS'S中国区总代理)</div>
  36. <ul>
  37. <li><div class="address">深圳市罗湖区东晓街道独树社区布心路3008号水贝珠宝总部大厦B座6B01</div></li>
  38. <li>
  39. <a href="tel:0755-23769340" class="phone">0755-23769340<span>(点击拨号)</span></a>
  40. </li>
  41. <li><div class="website">http://www.spainross.com</div></li>
  42. </ul>
  43. </div>
  44. <div class="map" v-show="showMap"><img src="/img/contact-map.png" alt="acebelle生物科技(深圳)有限公司" /></div>
  45. <div class="map" id="map" v-show="!showMap">地图区域</div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </template>
  52. <script>
  53. export default {
  54. head() {
  55. return {
  56. title: '首页-艾斯佰丽官网-联系方式',
  57. script: [{ src: 'https://webapi.amap.com/loader.js' }],
  58. }
  59. },
  60. data() {
  61. return {
  62. tabList: [],
  63. current: 1,
  64. showMap: false,
  65. }
  66. },
  67. asyncData() {
  68. return {
  69. tabList: [
  70. {
  71. id: 1,
  72. name: '联系方式',
  73. en: 'contact',
  74. url: '/contact.html',
  75. },
  76. {
  77. id: 2,
  78. name: '人才招聘',
  79. en: 'join us',
  80. url: '/contact/job.html',
  81. },
  82. {
  83. id: 3,
  84. name: '在线咨询',
  85. en: 'chat with us',
  86. url: '/contact/consult.html',
  87. },
  88. ],
  89. }
  90. },
  91. mounted() {
  92. new Swiper('#banner', {
  93. loop: false, // 循环模式选项
  94. showMapInfo: false,
  95. })
  96. this.initMap()
  97. },
  98. methods: {
  99. onTabChange(tab) {
  100. window.open(tab.url, '_self')
  101. },
  102. initMap() {
  103. console.log(window.AMapLoader)
  104. window.AMapLoader.load({
  105. key: 'ed0e0c030a16414f2a07cfbe350cb14a', // 申请好的Web端开发者Key,首次调用 load 时必填
  106. version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
  107. plugins: ['AMap.ToolBar', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
  108. Loca: {
  109. version: '2.0', // Loca 版本
  110. },
  111. })
  112. .then((AMap) => {
  113. const lnglat = new AMap.LngLat(114.124524, 22.574422)
  114. const map = new AMap.Map('map', {
  115. zoom: 17, //级别
  116. center: lnglat, //中心点坐标
  117. })
  118. const toolbar = new AMap.ToolBar()
  119. const scale = new AMap.Scale()
  120. map.addControl(toolbar)
  121. map.addControl(scale)
  122. const marker = new AMap.Marker({
  123. position: lnglat,
  124. title: '深圳市罗湖区东晓街道独树社区布心路3008号水贝珠宝总部大厦B座6B01',
  125. })
  126. map.add(marker)
  127. })
  128. .catch((e) => {
  129. console.error(e) //加载错误提示
  130. this.showMap = true
  131. })
  132. },
  133. },
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. @media screen and (min-width: 768px) {
  138. .main {
  139. .tabbar {
  140. background: #eeeeee;
  141. height: 100px;
  142. .container {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. height: 100%;
  147. }
  148. .line {
  149. height: 46px;
  150. width: 3px;
  151. background: #aaaaaa;
  152. }
  153. .tab {
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. flex-direction: column;
  158. position: relative;
  159. height: 100%;
  160. width: 16%;
  161. user-select: none;
  162. .name {
  163. font-size: 29px;
  164. font-weight: 400;
  165. color: #000000;
  166. text-align: center;
  167. }
  168. .en {
  169. font-size: 17px;
  170. font-weight: 300;
  171. color: #000000;
  172. text-align: center;
  173. margin-top: 10px;
  174. text-transform: uppercase;
  175. }
  176. &:hover {
  177. cursor: pointer;
  178. }
  179. &::after {
  180. content: '';
  181. position: absolute;
  182. opacity: 0;
  183. width: 0;
  184. height: 0;
  185. border-style: solid;
  186. border-width: 0 12px 8px 12px;
  187. border-color: transparent transparent #f3920d transparent;
  188. bottom: 0;
  189. }
  190. &.on {
  191. &::after {
  192. opacity: 1;
  193. }
  194. .name,
  195. .en {
  196. color: #f3920d;
  197. }
  198. }
  199. }
  200. }
  201. .tab-content {
  202. .contact {
  203. .content {
  204. display: flex;
  205. justify-content: space-between;
  206. .contact-logo {
  207. margin-bottom: 180px;
  208. img {
  209. display: block;
  210. width: 279px;
  211. height: 63px;
  212. }
  213. }
  214. .map {
  215. position: relative;
  216. width: 657px;
  217. }
  218. .name {
  219. font-size: 31px;
  220. font-weight: bold;
  221. color: #050001;
  222. }
  223. .subname {
  224. font-size: 25px;
  225. color: #050001;
  226. margin-top: 8px;
  227. }
  228. ul {
  229. margin-top: 40px;
  230. li {
  231. font-size: 20px;
  232. margin: 6px 0;
  233. .phone {
  234. span {
  235. display: none;
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. @media screen and (max-width: 768px) {
  246. .main {
  247. .tabbar {
  248. background: #eeeeee;
  249. padding: 0 0.6rem;
  250. height: 0.8rem;
  251. .container {
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. height: 100%;
  256. }
  257. .line {
  258. height: 0.4rem;
  259. width: 0.02rem;
  260. background: #aaaaaa;
  261. }
  262. .tab {
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. flex-direction: column;
  267. position: relative;
  268. height: 100%;
  269. width: 24%;
  270. user-select: none;
  271. .name {
  272. font-size: 0.26rem;
  273. font-weight: 400;
  274. color: #000000;
  275. text-align: center;
  276. }
  277. .en {
  278. display: none;
  279. }
  280. &:hover {
  281. cursor: pointer;
  282. }
  283. &::after {
  284. content: '';
  285. position: absolute;
  286. opacity: 0;
  287. width: 0;
  288. height: 0;
  289. border-style: solid;
  290. border-width: 0 0.12rem 0.08rem 0.12rem;
  291. border-color: transparent transparent #f3920d transparent;
  292. bottom: 0;
  293. }
  294. &.on {
  295. &::after {
  296. opacity: 1;
  297. }
  298. .name,
  299. .en {
  300. color: #f3920d;
  301. }
  302. }
  303. }
  304. }
  305. .tab-content {
  306. .contact {
  307. .content {
  308. width: 6.7rem;
  309. margin: 0 auto;
  310. .contact-logo {
  311. margin-bottom: 0.6rem;
  312. img {
  313. display: block;
  314. width: 2.8rem;
  315. height: 0.63rem;
  316. }
  317. }
  318. font-size: 0;
  319. .name {
  320. font-size: 0.32rem;
  321. font-weight: bold;
  322. color: #050001;
  323. display: inline;
  324. line-height: 0.48rem;
  325. }
  326. .subname {
  327. font-size: 0.32rem;
  328. font-weight: bold;
  329. color: #050001;
  330. display: inline;
  331. line-height: 0.48rem;
  332. }
  333. ul {
  334. margin-top: 0.4rem;
  335. margin-bottom: 0.4rem;
  336. li {
  337. font-size: 0.28rem;
  338. line-height: 0.48rem;
  339. .phone {
  340. span {
  341. color: #f3920d;
  342. }
  343. }
  344. }
  345. }
  346. .map {
  347. position: relative;
  348. height: 6rem;
  349. img {
  350. display: block;
  351. width: 100%;
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. }
  359. </style>