navbar2.vue 10 KB

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