navbar2.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <!--
  2. * @Description:
  3. * @Author: 李阳滨
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-10-31 11:32:24
  6. * @LastEditTime: 2022-11-17 09:05:34
  7. -->
  8. <template>
  9. <div>
  10. <div
  11. class="navbar navbar-default header relative min-h-50px z-3 m-0 bg-transparent tiny:rounded-4px tiny:h-80px <tiny:z-112 <tiny:border-none bg-[#f8f8f8] border-gray-[#e7e7e7]"
  12. >
  13. <nav
  14. class="nav-header w-full max-w-1120px h-full mx-auto my-0 tiny:flex tiny:justify-between tiny:items-center tiny:py-0 tiny:px-20px lg:max-w-none lg:pl-[10%] lg:pr-[10%]"
  15. >
  16. <div
  17. class="navbar-header tiny:float-left <tiny:flex <tiny:items-center <tiny:justify-between <tiny:h-56px <tiny:py-0 <tiny:px-16px"
  18. >
  19. <!-- logo -->
  20. <a class="home" href="/">
  21. <img
  22. src="http://cn-file.17pdf.com/website/index/logo_pdf_top.png"
  23. class="tiny:ml-16px <tiny:w-170px align-middle"
  24. />
  25. </a>
  26. <!-- 按钮 -->
  27. <button
  28. type="button"
  29. class="navbar-toggle relative float-right bg-transparent border border-solid border-transparent rounded-4px tiny:hidden <tiny:block p-0 m-0 border-none"
  30. data-toggle="collapse"
  31. data-target="#navBar"
  32. @click="changeNavShow()"
  33. >
  34. <span class="hamburger_box inline-block relative w-15px h-14px">
  35. <span class="hamburger_inner" :class="{ beX: navShow }"></span>
  36. </span>
  37. </button>
  38. </div>
  39. <!-- 登录等选项 -->
  40. <div
  41. id="navBar"
  42. class="navbar-collapse menu px-15px transition-all duration-500 ease-in tiny:w-auto tiny:border-0 tiny:shadow-none <tiny:py-0 <tiny:px-16px <tiny:rounded-4px"
  43. aria-expanded="false"
  44. :class="{ hZero: !navShow, hFull: navShow }"
  45. >
  46. <ul
  47. class="nav navbar-nav tiny:float-left <tiny:pb-20px ting:flex tiny:items-center"
  48. >
  49. <li class="relative block tiny:float-left text-[0px]">
  50. <a
  51. href="/converter"
  52. class="index-menu-converter converter_menu relative block no-underline text-[16px] text-[#666] p-0 leading-[22px] <tiny:py-8px <tiny:px-0"
  53. title="行业领先的PDF转换器,支持将PDF与其他格式文件的互转,在线文件格式转换"
  54. >格式转换</a
  55. >
  56. </li>
  57. <li class="relative block tiny:float-left text-[0px] tiny:ml-35px">
  58. <a
  59. href="/pricing"
  60. class="index-menu-pricing relative block no-underline text-[16px] text-[#666] p-0 leading-[22px] <tiny:py-8px <tiny:px-0"
  61. title="订阅基础套餐和商务套餐,畅享无缝衔接无纸化办公"
  62. >订阅服务</a
  63. >
  64. </li>
  65. <li class="relative block tiny:float-left text-[0px] tiny:ml-35px">
  66. <a
  67. href="/sdk"
  68. class="index-menu-sdk relative block no-underline text-[16px] text-[#666] p-0 leading-[22px] <tiny:py-8px <tiny:px-0"
  69. title="为企业用户跨平台集成PDF阅读器核心功能,实现文本编辑、表单填写、OCR等进阶功能。"
  70. >SDK介绍</a
  71. >
  72. </li>
  73. <li class="relative block tiny:float-left text-[0px] tiny:ml-35px">
  74. <a
  75. class="download-contain relative block no-underline text-[16px] text-[#666] p-0 leading-[22px] <tiny:py-8px <tiny:px-0"
  76. href="/pdf-reader/download"
  77. >下载</a
  78. >
  79. </li>
  80. <li
  81. v-if="!token"
  82. class="relative block tiny:float-left text-[0px] tiny:ml-35px lg:ml-105px xl:ml-135px"
  83. >
  84. <a
  85. type="button"
  86. class="btn_login relative block no-underline text-[16px] text-[#666] p-0 leading-[22px] <tiny:py-8px <tiny:px-0 inline-flex justify-center items-center h-40px w-72px py-0 px-18px border border-solid border-gray-[#e93636] rounded-4px ml-9px cursor-pointer text-[#e93636] <tiny:ml-0"
  87. @click="handlerOpenLogin('login')"
  88. >登录</a
  89. >
  90. <a
  91. type="button"
  92. class="btn_sign_up relative block no-underline text-[16px] p-0 leading-[22px] <tiny:py-8px <tiny:px-0 inline-flex justify-center items-center h-40px w-72px py-0 px-18px border border-solid border-gray-[#e93636] rounded-4px ml-9px cursor-pointer text-[#e93636] bg-[#ff4f4f] text-[#fff] rounded-4px border-none ml-25px"
  93. @click="handlerOpenLogin('register')"
  94. >注册</a
  95. >
  96. </li>
  97. <img v-else class="w-36px h-36px rounded-full <tiny:mt-8px mr-0 md-0 cursor-pointer text-[0px] tiny:ml-35px lg:ml-135px xl:ml-190px" :src="userInfo?.subscriberType === 1 ? 'https://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg' : 'http://user-file.17pdf.com/avatars/2018/01/02/f183029426a996325853fa244e7df661-jpg.jpg'" @click="$router.push('/members/me/expenses')" />
  98. </ul>
  99. </div>
  100. </nav>
  101. </div>
  102. <div
  103. v-show="navShow"
  104. class="top-menu-overlay fixed top-60px left-0 w-full h-full z-100 bg-[#00000033]"
  105. ></div>
  106. <client-only>
  107. <el-dialog
  108. :visible="dialogVisiable"
  109. :close-on-click-modal="false"
  110. :close-on-press-escape="false"
  111. width="480px"
  112. append-to-body
  113. center
  114. :custom-class="interface === 'manage' ? 'manage-dialog': 'login-dialog'"
  115. @close="handlerCloseDialog"
  116. >
  117. <login v-show="interface === 'login'" ref="loginRef" @register="showChange" @close="handlerCloseDialog"></login>
  118. <register v-show="interface === 'register'" ref="registerRef" @login="showChange" @close="handlerCloseDialog"></register>
  119. </el-dialog>
  120. </client-only>
  121. </div>
  122. </template>
  123. <script>
  124. import { mapState } from 'vuex'
  125. import login from '~/components/LoginBar.vue'
  126. import register from '~/components/RegisterBar.vue'
  127. export default {
  128. components: {
  129. login,
  130. register
  131. },
  132. data() {
  133. return {
  134. navShow: false,
  135. dialogVisiable: false,
  136. interface: 'login'
  137. }
  138. },
  139. computed: {
  140. ...mapState([
  141. 'token',
  142. 'userInfo'
  143. ]),
  144. },
  145. methods: {
  146. handlerOpenLogin(type) {
  147. this.interface = type
  148. this.dialogVisiable = true
  149. // this.$store.commit('SET_INTERFACE', type)
  150. },
  151. handlerCloseDialog() {
  152. this.dialogVisiable = false
  153. // this.$store.commit('OPEN_LOGIN',false)
  154. this.$refs[`${this.interface}Ref`].resetInterfaceStatus()
  155. },
  156. // 切换弹窗界面
  157. showChange(type) {
  158. this.interface = type
  159. // this.$store.commit('SET_INTERFACE', type)
  160. },
  161. // 头部展示
  162. changeNavShow() {
  163. this.navShow = !this.navShow
  164. }
  165. }
  166. }
  167. </script>
  168. <style>
  169. body {
  170. min-width: 0px;
  171. }
  172. @media screen and (max-width: 959px) {
  173. .nav-header.active {
  174. background-color: #fff;
  175. }
  176. }
  177. /* 头部 */
  178. .navbar {
  179. margin: 0px !important;
  180. border: none;
  181. border-bottom: 1px solid #f0f0f0;
  182. }
  183. @media screen and (max-width: 959px) {
  184. .nav-header {
  185. position: fixed;
  186. height: auto;
  187. background-color: #fafafa;
  188. border-bottom-left-radius: 8px;
  189. border-bottom-right-radius: 8px;
  190. }
  191. }
  192. /* 三条短横线 */
  193. .nav-header .hamburger_box .hamburger_inner,
  194. .nav-header .hamburger_box .hamburger_inner::after,
  195. .nav-header .hamburger_box .hamburger_inner::before {
  196. position: absolute;
  197. right: 0;
  198. width: 15px;
  199. height: 2px;
  200. background-color: #333;
  201. transition-property: -webkit-transform;
  202. transition-property: transform;
  203. transition-property: transform, -webkit-transform;
  204. transition-duration: 0.3s;
  205. transition-timing-function: ease;
  206. }
  207. .nav-header .hamburger_box .hamburger_inner::before {
  208. top: 6px;
  209. }
  210. .hamburger_inner::after {
  211. top: 12px;
  212. }
  213. .nav-header .hamburger_box .hamburger_inner::after,
  214. .nav-header .hamburger_box .hamburger_inner::before {
  215. display: block;
  216. content: '';
  217. }
  218. @media screen and (max-width: 959px) {
  219. .beX {
  220. top: 0px;
  221. -webkit-transform: rotate(45deg);
  222. transform: rotate(45deg);
  223. }
  224. .beX::before {
  225. top: 0px;
  226. -webkit-transform: rotate(-45deg);
  227. transform: rotate(-45deg);
  228. opacity: 0;
  229. }
  230. .beX::after {
  231. top: 0px;
  232. -webkit-transform: rotate(-90deg);
  233. transform: rotate(-90deg);
  234. }
  235. }
  236. /* 右侧 */
  237. .navbar-collapse {
  238. border-top: 1px solid transparent;
  239. -webkit-overflow-scrolling: touch;
  240. }
  241. @media screen and (min-width: 960px) {
  242. .nav-header .navbar-collapse .navbar-nav {
  243. display: flex;
  244. align-items: center;
  245. }
  246. }
  247. /*注册 */
  248. .nav-header .navbar-collapse .navbar-nav li .btn_sign_up {
  249. color: white;
  250. }
  251. /* 遮盖层 */
  252. .top-menu-overlay {
  253. content: '';
  254. }
  255. /* 头部隐藏区 */
  256. @media screen and (max-width: 959px) {
  257. .hZero {
  258. height: 0;
  259. overflow: hidden;
  260. }
  261. .hFull {
  262. height: 212px;
  263. overflow: hidden;
  264. }
  265. }
  266. </style>