GuidePage.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div id="guide" @click="openContactInfo">
  3. <img id="background1" src="@/assets/images/background.png" />
  4. <div id="contact">
  5. <img
  6. id="contactButton"
  7. @click="isShowContact = !isShowContact"
  8. src="@/assets/images/contactbutton.png"
  9. />
  10. <div id="info" v-show="isShowContact">
  11. <img id="contactInfo" src="@/assets/images/contactinfo.png" />
  12. <div id="phone">
  13. <div class="contact-title">
  14. <img class="img-contact" src="@/assets/images/phoneIcon.png" />
  15. 商务合作电话:
  16. </div>
  17. <div
  18. class="contact-content"
  19. v-for="(phoneNumber, index) of phones"
  20. :key="index"
  21. >
  22. {{ phoneNumber }}
  23. </div>
  24. </div>
  25. <div id="email">
  26. <div class="contact-title">
  27. <img class="img-contact" src="@/assets/images/emailIcon.png" />
  28. 商务合作邮箱:
  29. </div>
  30. <div class="contact-content">{{ email }}</div>
  31. </div>
  32. <div id="weChat">
  33. <div class="contact-title">
  34. <img class="img-contact" src="@/assets/images/wechatIcon.png" />
  35. 商务合作微信:
  36. </div>
  37. <div class="qrcode"><img class="img-qrcode" src="@/assets/images/qrcode.png" /></div>
  38. </div>
  39. </div>
  40. </div>
  41. <guide-button></guide-button>
  42. </div>
  43. </template>
  44. <script>
  45. import GuideButton from "./GuideButton.vue";
  46. export default {
  47. components: { GuideButton },
  48. name: "GuidePage",
  49. data() {
  50. return {
  51. isShowContact: false,
  52. phones: ["13581625033(黎先生)", "15733737800(刘小姐)"],
  53. email: "sales@4dage.com",
  54. buttoInGuidePage: {
  55. titles: ["点击看展", "参加云展", "往届博博会"],
  56. },
  57. };
  58. },
  59. methods: {
  60. openContactInfo(event) {
  61. let contactId = [
  62. "contactButton",
  63. "contactInfo",
  64. "phone",
  65. "email",
  66. "weChat",
  67. ];
  68. if (
  69. !contactId.includes(event.target.id) &&
  70. ![].slice.call(event.target.classList).includes("contact-content") &&
  71. ![].slice.call(event.target.classList).includes("contact-title") &&
  72. ![].slice.call(event.target.classList).includes("img-qrcode")
  73. ) {
  74. this.isShowContact = false;
  75. //TODO:测试下点击其他组件时能不能收回
  76. }
  77. },
  78. },
  79. };
  80. </script>
  81. <!-- Add "scoped" attribute to limit CSS to this component only -->
  82. <style scoped>
  83. #guide {
  84. position: relative;
  85. font-size: 16px;
  86. }
  87. #background1 {
  88. width: 100%;
  89. opacity: 0.5;
  90. }
  91. #contact {
  92. position: fixed;
  93. right: 0.5rem;
  94. top: 1rem;
  95. width: 3.6rem;
  96. height: 3.6rem;
  97. }
  98. @media screen and (min-width: 780px) {
  99. #contact {
  100. position: absolute;
  101. right: 0.5rem;
  102. top: 1rem;
  103. width: 3.6rem;
  104. height: 3.6rem;
  105. }
  106. }
  107. #contactButton {
  108. width: 3.6rem;
  109. height: 3.6rem;
  110. }
  111. #info {
  112. position: absolute;
  113. right: 1rem;
  114. top: 3.6rem;
  115. width: 20.7rem;
  116. height: 27.3rem;
  117. }
  118. #contactInfo {
  119. width: 100%;
  120. height: 100%;
  121. opacity: 0.8;
  122. }
  123. #phone {
  124. position: absolute;
  125. top: 2rem;
  126. left: 50%;
  127. transform: translateX(-50%);
  128. width: 13.3rem;
  129. height: 4.4rem;
  130. display: flex;
  131. flex-direction: column;
  132. justify-content: space-between;
  133. }
  134. #info .contact-title {
  135. width: 9.8rem;
  136. height: 1.3rem;
  137. font-size: 1rem;
  138. font-family: Microsoft YaHei;
  139. font-weight: 400;
  140. color: #d06814;
  141. opacity: 1;
  142. }
  143. .contact-content {
  144. position: relative;
  145. left: 2.5rem;
  146. color: #ffffff;
  147. font-size: 0.9rem;
  148. text-align: left;
  149. }
  150. #email {
  151. position: absolute;
  152. top: 11rem;
  153. left: 50%;
  154. transform: translateX(-50%);
  155. width: 13.3rem;
  156. height: 3.1rem;
  157. display: flex;
  158. flex-direction: column;
  159. justify-content: space-between;
  160. }
  161. div.qrcode {
  162. width: 4.6rem;
  163. height: 4.6rem;
  164. }
  165. .qrcode > img {
  166. position: relative;
  167. width: 100%;
  168. left: 2.5rem;
  169. top: 1.3rem;
  170. }
  171. #weChat {
  172. position: absolute;
  173. top: 18rem;
  174. left: 50%;
  175. transform: translateX(-50%);
  176. width: 13.3rem;
  177. }
  178. img.img-contact {
  179. width: 1.4rem;
  180. height: 1.4rem;
  181. vertical-align: sub;
  182. margin-right: 0.3rem;
  183. pointer-events: none;
  184. }
  185. #guide-button {
  186. position: absolute;
  187. top: 38.1rem;
  188. left: 50%;
  189. width: 18.9rem;
  190. height: 9.4rem;
  191. transform: translateX(-50%);
  192. }
  193. </style>