navbar2.vue 9.4 KB

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