NavBar.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <!--
  2. * @Description:
  3. * @Author: 欧阳承珺
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-10-17 15:19:11
  6. * @LastEditTime: 2022-11-16 17:06:45
  7. -->
  8. <template>
  9. <div class="h-80px flex relative z-3 justify-between px-[10%] border-b-1 border-b-[#f0f0f0] border-b-solid">
  10. <div class="flex items-center ml-16px">
  11. <nuxt-link to="/" title="17PDF Reader阅读器支持文件扫描和文件格式转换">
  12. <!-- <img src="http://cn-file.17pdf.com/website/index/logo_pdf_top.png"/> -->
  13. <img src="~/assets/images/common/bars.svg"/>
  14. </nuxt-link>
  15. <!-- <a href="/" title="17PDF Reader阅读器支持文件扫描和文件格式转换">
  16. <img src="http://cn-file.17pdf.com/website/index/logo_pdf_top.png"></img>
  17. </a> -->
  18. </div>
  19. <div class="flex justify-between">
  20. <div class="text-[#666] flex mr-4px">
  21. <div class="showConverter relative">
  22. <NuxtLink to="/converter" active-class="menu-active" class="inline-block mx-0 mt-28px md-35px hover:text-[#E93636] hover:opacity-70"
  23. title="行业领先的PDF转换器,支持将PDF与其他格式文件的互转,在线文件格式转换">
  24. 格式转换
  25. </NuxtLink>
  26. <div class="more_menu clear">
  27. <img src="http://cn-file.17pdf.com/website/converter/jiao.png" class="horn">
  28. <div class="package_type">
  29. <h3>会员专享</h3>
  30. <ul>
  31. <li>
  32. <a href=' /converter?type=docx'>
  33. <img src="@/assets/images/converter/ic_pdf_word.png">
  34. <span>PDF to Word</span>
  35. </a>
  36. </li>
  37. <li>
  38. <a href=' /converter?type=pptx'>
  39. <img src="http://cn-file.17pdf.com/website/converter/ic_pdf_ppt.png">
  40. <span>PDF to PowerPoint</span>
  41. </a>
  42. </li>
  43. <li>
  44. <a href=' /converter?type=xlsx'>
  45. <img src="http://cn-file.17pdf.com/website/converter/ic_pdf_execl.png">
  46. <span>PDF to Excel</span>
  47. </a>
  48. </li>
  49. <li>
  50. <a href=' /converter?type=txt'>
  51. <img src="@/assets/images/converter/ic_pdf_txt.png">
  52. <span>PDF to TXT</span>
  53. </a>
  54. </li>
  55. <li>
  56. <a href=' /converter?type=jpg'>
  57. <img src="@/assets/images/converter/imagePDFtoJPG.png">
  58. <span>PDF to JPG</span>
  59. </a>
  60. </li>
  61. <li>
  62. <a href=' /converter?type=png'>
  63. <img src="@/assets/images/converter/pngPDFtoPNG.png">
  64. <span>PDF to PNG</span>
  65. </a>
  66. </li>
  67. </ul>
  68. </div>
  69. </div>
  70. </div>
  71. <NuxtLink to="/pricing" active-class="menu-active" class="inline-block mt-28px mr-0 md-0 ml-35px hover:text-[#E93636] hover:opacity-70"
  72. title="订阅基础套餐和商务套餐,畅享无缝衔接无纸化办公">
  73. 订阅服务
  74. </NuxtLink>
  75. <NuxtLink to="/sdk" active-class="menu-active" class="inline-block mt-28px mr-0 md-0 ml-35px hover:text-[#E93636] hover:opacity-70"
  76. title="为企业用户跨平台集成PDF阅读器核心功能,实现文本编辑、表单填写、OCR等进阶功能。">
  77. SDK介绍
  78. </NuxtLink>
  79. <NuxtLink to="/pdf-reader/download" active-class="menu-active" class="inline-block mt-28px mr-0px md-0 ml-35px hover:text-[#E93636] hover:opacity-70">下载</NuxtLink>
  80. <NuxtLink to="/pdfreaderpro" active-class="menu-active" class="inline-block mt-28px mr-35px md-0 ml-35px hover:text-[#E93636] hover:opacity-70 relative">PDF Reader Pro <span class="icon">PC端</span></NuxtLink>
  81. </div>
  82. <div v-if="token">
  83. <client-only>
  84. <el-popover
  85. ref="popover"
  86. v-model="popover"
  87. placement="bottom-end"
  88. trigger="hover"
  89. :visible-arrow="false"
  90. :close-delay="800"
  91. :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
  92. >
  93. <div>
  94. <div class="px-24px pt-24px min-w-300px">
  95. <div class="flex pb-22px cursor-pointer" style="border-bottom: 1px solid #f0f0f0;">
  96. <a href="/members/me/expenses">
  97. <img v-if="userInfo?.subscriberType === 1" class="w-64px h-64px rounded-1/2 object-cover" :src="userInfo.avatarUrl" >
  98. <img v-else class="w-64px h-64px rounded-1/2 object-cover" :src="userInfo.avatarUrl" >
  99. </a>
  100. <a href="/members/me/expenses">
  101. <div class="pl-20px">
  102. <p class="mt-15px mb-10px text-[#333]">{{userInfo?.name}}</p>
  103. <p class="text-[#999]">{{userInfo?.email || userInfo?.phone}}</p>
  104. </div>
  105. </a>
  106. </div>
  107. <div class="flex py-14px mt-20px justify-between">
  108. <div>
  109. <p v-if="userInfo?.subscriberType === 1" class="text-18px text-[#333] leading-24px">17会员</p>
  110. <p v-else class="text-18px text-[#333] leading-24px">免费用户</p>
  111. <p v-if="userInfo?.subscriberType === 1" class="text-12px text-[#999] leading-17px">剩余<span class="text-bg-$btn-color-primary">{{userInfo?.day}}</span>天到期</p>
  112. <p v-else class="text-12px text-[#999] leading-17px">订阅会员免费格式转换</p>
  113. </div>
  114. <a href="/pricing">
  115. <button class="btn-renew">
  116. {{userInfo?.subscriberType === 1 ? '续费' : '订阅会员'}}
  117. </button>
  118. </a>
  119. </div>
  120. <div class="flex py-14px my-8px justify-between" style="border-bottom: 1px solid #f0f0f0;">
  121. <div>
  122. <p class="text-18px text-[#333] leading-24px"><span class="text-500 text-bg-$btn-color-primary text-22px leading-18px tracking-1px">{{userInfo?.points}} <span class="text-[14px]">张</span></span><span class="text-14px text-[rgba(0,0,0,0.8)] leading-18px">/{{userInfo?.totalPoints}} 张</span></p>
  123. <p class="text-12px text-[#999] leading-17px">转换券</p>
  124. </div>
  125. <button class="btn-recharge" @click="handlerOpenLogin('ticket')">充值</button>
  126. </div>
  127. <div class="w-full h-64px leading-64px text-[#666] cursor-pointer hover:text-bg-$btn-color-primary" style="border-bottom: 1px solid #f0f0f0;" @click="handlerOpenLogin('manage')">
  128. 账号管理
  129. </div>
  130. <div class="w-full h-64px leading-64px text-[#666] cursor-pointer hover:text-bg-$btn-color-primary" @click="handlerLogout">
  131. 退出
  132. </div>
  133. </div>
  134. </div>
  135. <a slot="reference" href="/members/me/expenses">
  136. <img class="w-36px h-36px rounded-full mt-23px mr-0 md-0 ml-90px cursor-pointer object-cover" :src="userInfo.avatarUrl" />
  137. </a>
  138. </el-popover>
  139. </client-only>
  140. </div>
  141. <div v-else class="flex items-center ml-30px">
  142. <button class="border-1 rounded-4px ml-9px text-$btn-color-primary border-$btn-color-primary border-solid w-70px h-42px leading-22px cursor-pointer hover:opacity-70" @click="handlerOpenLogin('login')">登录</button>
  143. <button class="bg-$btn-color-primary rounded-4px ml-25px text-[#fff] w-70px h-42px leading-22px cursor-pointer hover:bg-[#f34545]" @click="handlerOpenLogin('register')">注册</button>
  144. </div>
  145. </div>
  146. <client-only>
  147. <el-dialog
  148. :visible="visiable"
  149. :close-on-click-modal="true"
  150. :close-on-press-escape="false"
  151. :width="dialogWidth"
  152. append-to-body
  153. center
  154. :custom-class="interface === 'manage' ? 'manage-dialog': 'login-dialog'"
  155. @close="handlerCloseDialog"
  156. >
  157. <login v-if="interface === 'login'" ref="loginRef" @register="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></login>
  158. <register v-if="interface === 'register'" ref="registerRef" @login="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></register>
  159. <UserManage v-if="interface === 'manage'" ref="manageRef" @close="handlerCloseDialog" :dialogVisiable="dialogVisiable"></UserManage>
  160. <BuyVip v-if="interface === 'vip'" ref="vipRef" @close="handlerCloseDialog"></BuyVip>
  161. <BuyTicket v-if="interface === 'ticket'" ref="ticketRef" @close="handlerCloseDialog"></BuyTicket>
  162. </el-dialog>
  163. </client-only>
  164. </div>
  165. </template>
  166. <script>
  167. import { mapState } from 'vuex'
  168. import { removeToken } from '~/utils/cookie';
  169. import login from '~/components/LoginBar.vue'
  170. import register from '~/components/RegisterBar.vue'
  171. import userManage from '~/components/UserManage.vue'
  172. import BuyVip from '~/components/BuyVip.vue'
  173. import BuyTicket from '~/components/BuyTicket.vue'
  174. export default {
  175. components: {
  176. login,
  177. register,
  178. userManage,
  179. BuyVip,
  180. BuyTicket
  181. },
  182. data() {
  183. return {
  184. dialogVisiable: false,
  185. popover: false,
  186. }
  187. },
  188. computed: {
  189. ...mapState([
  190. 'token',
  191. 'userInfo',
  192. 'globalLoginVisiable',
  193. 'globalInterfaceType'
  194. ]),
  195. visiable() {
  196. return this.dialogVisiable || this.globalLoginVisiable
  197. },
  198. interface() {
  199. return this.globalInterfaceType || 'login'
  200. },
  201. dialogWidth() {
  202. if(this.interface === 'vip') {
  203. return '512px'
  204. }else if(this.interface === 'ticket') {
  205. return '558px'
  206. }else {
  207. return '480px'
  208. }
  209. }
  210. },
  211. methods: {
  212. handleLoginSucess() {
  213. this.$nextTick(()=> {
  214. this.popover = true
  215. this.$refs.popover.updatePopper()
  216. })
  217. setTimeout(() => {
  218. this.popover = false
  219. }, 2000);
  220. },
  221. handlerOpenLogin(type) {
  222. this.dialogVisiable = true
  223. this.$store.commit('OPEN_LOGIN', true)
  224. this.$store.commit('SET_INTERFACE', type)
  225. },
  226. handlerCloseDialog() {
  227. this.dialogVisiable = false
  228. this.$store.commit('OPEN_LOGIN',false)
  229. this.$refs[`${this.interface}Ref`].resetInterfaceStatus()
  230. },
  231. // 切换弹窗界面
  232. showChange(type) {
  233. this.$store.commit('SET_INTERFACE', type)
  234. },
  235. handlerLogout() {
  236. localStorage.removeItem('token')
  237. localStorage.removeItem('userInfo')
  238. localStorage.removeItem('file')
  239. this.$store.commit('setUser', {})
  240. removeToken('Token')
  241. this.$store.commit('DEL_TOKEN', '')
  242. this.$router.push('/')
  243. },
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .icon {
  249. position: absolute;
  250. top: -10px;
  251. right: -41px;
  252. background: #FF3030;
  253. font-size: 12px;
  254. font-weight: 500;
  255. line-height: 20px;
  256. padding: 0 6px;
  257. border-radius: 4px;
  258. color: #FFFFFF;
  259. &::after {
  260. position: absolute;
  261. left: 0;
  262. bottom: -4px;
  263. content: '';
  264. display: block;
  265. width: 0px;
  266. height: 0px;
  267. border: solid 5px transparent;
  268. border-right: none;
  269. border-left-color: #FF3030;
  270. border-top-color: #FF3030;
  271. border-radius: 1px;
  272. }
  273. }
  274. </style>
  275. <style lang="scss">
  276. .menu-active {
  277. color: #E93636;
  278. }
  279. .login-dialog {
  280. position: relative;
  281. border-radius: 6px;
  282. box-shadow: 0 5px 15px rgb(0 0 0 / 50%)
  283. }
  284. .manage-dialog {
  285. position: relative;
  286. border-radius: 6px;
  287. box-shadow: 0 5px 15px rgb(0 0 0 / 50%);
  288. .el-dialog__body {
  289. padding: unset !important;
  290. }
  291. }
  292. .btn-renew {
  293. font-size: 14px;
  294. color: white;
  295. height: 36px;
  296. width: 82px;
  297. background: linear-gradient(128deg, #cca166, #edd3b0);
  298. box-shadow: 0px 2px 6px 0px rgb(219 184 137 / 57%);
  299. border-radius: 4px;
  300. font-weight: 500;
  301. }
  302. .btn-recharge {
  303. width: 82px;
  304. height: 36px;
  305. background-color: #FF4F4F;
  306. box-shadow: 0px 2px 6px rgb(255 79 79 / 20%);
  307. border: none;
  308. border-radius: 4px;
  309. color: #fff;
  310. font-size: 14px;
  311. outline: none;
  312. }
  313. .clear {
  314. zoom: 1;
  315. }
  316. .showConverter{
  317. .more_menu {
  318. width: 800px;
  319. padding: 30px 40px;
  320. position: absolute;
  321. top: 70px;
  322. left: -132px;
  323. background: #fff;
  324. box-shadow: 0px 2px 12px rgb(0 0 0 / 12%);
  325. border-radius: 3px;
  326. z-index: 100;
  327. display: none;
  328. .horn {
  329. position: absolute;
  330. left: 135px;
  331. top: -16px;
  332. }
  333. .package_type{
  334. h3 {
  335. margin: 0 0 10px;
  336. color: #333333;
  337. font-size: 14px;
  338. font-weight: normal;
  339. line-height: 16px;
  340. }
  341. ul {
  342. display: flex;
  343. margin: 0;
  344. padding: 0;
  345. li {
  346. list-style: none;
  347. text-align: center;
  348. width: 130px;
  349. height: 120px;
  350. a {
  351. display: block;
  352. width: 100%;
  353. height: 100%;
  354. text-decoration: none;
  355. img {
  356. margin-top: 0;
  357. margin-left: 15px;
  358. vertical-align: middle;
  359. }
  360. span {
  361. color: #333333;
  362. font-size: 12px;
  363. margin-top: 5px;
  364. display: block;
  365. white-space: nowrap;
  366. transition: all .5s;
  367. }
  368. &:hover{
  369. img {
  370. box-shadow: 0px 0px 6px rgb(255 79 79 / 25%);
  371. }
  372. span {
  373. color: #ff4f4f;
  374. }
  375. }
  376. }
  377. }
  378. }
  379. }
  380. }
  381. &:hover{
  382. .more_menu{
  383. display: block;
  384. }
  385. }
  386. }
  387. </style>