NavBar.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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-100px md-0 ml-35px hover:text-[#E93636] hover:opacity-70">下载</NuxtLink>
  80. </div>
  81. <div v-if="token">
  82. <client-only>
  83. <el-popover
  84. ref="popover"
  85. v-model="popover"
  86. placement="bottom-end"
  87. trigger="hover"
  88. :close-delay="800"
  89. :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
  90. >
  91. <div>
  92. <div class="px-24px pt-24px min-w-300px">
  93. <div class="flex pb-22px cursor-pointer" style="border-bottom: 1px solid #f0f0f0;">
  94. <a href="/members/me/expenses">
  95. <img v-if="userInfo?.subscriberType === 1" class="w-64px h-64px rounded-1/2 object-cover" :src="userInfo.avatarUrl" >
  96. <img v-else class="w-64px h-64px rounded-1/2 object-cover" :src="userInfo.avatarUrl" >
  97. </a>
  98. <a href="/members/me/expenses">
  99. <div class="pl-20px">
  100. <p class="mt-15px mb-10px text-[#333]">{{userInfo?.name}}</p>
  101. <p class="text-[#999]">{{userInfo?.email || userInfo?.phone}}</p>
  102. </div>
  103. </a>
  104. </div>
  105. <div class="flex py-14px mt-20px justify-between">
  106. <div>
  107. <p v-if="userInfo?.subscriberType === 1" class="text-18px text-[#333] leading-24px">17会员</p>
  108. <p v-else class="text-18px text-[#333] leading-24px">免费用户</p>
  109. <p v-if="userInfo?.subscriberType === 1" class="text-12px text-[#999] leading-17px">剩余<span class="text-bg-$btn-color-primary">{{userInfo?.day}}</span>天到期</p>
  110. <p v-else class="text-12px text-[#999] leading-17px">订阅会员免费格式转换</p>
  111. </div>
  112. <a href="/pricing">
  113. <button class="btn-renew">
  114. {{userInfo?.subscriberType === 1 ? '续费' : '订阅会员'}}
  115. </button>
  116. </a>
  117. </div>
  118. <div class="flex py-14px my-8px justify-between" style="border-bottom: 1px solid #f0f0f0;">
  119. <div>
  120. <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>
  121. <p class="text-12px text-[#999] leading-17px">转换券</p>
  122. </div>
  123. <button class="btn-recharge" @click="handlerOpenLogin('ticket')">充值</button>
  124. </div>
  125. <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')">
  126. 账号管理
  127. </div>
  128. <div class="w-full h-64px leading-64px text-[#666] cursor-pointer hover:text-bg-$btn-color-primary" @click="handlerLogout">
  129. 退出
  130. </div>
  131. </div>
  132. </div>
  133. <img slot="reference" class="w-36px h-36px rounded-full mt-23px mr-0 md-0 ml-90px cursor-pointer object-cover" :src="userInfo.avatarUrl" @click="$router.push('/members/me/expenses')" />
  134. </el-popover>
  135. </client-only>
  136. </div>
  137. <div v-else class="flex items-center ml-30px">
  138. <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>
  139. <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>
  140. </div>
  141. </div>
  142. <client-only>
  143. <el-dialog
  144. :visible="visiable"
  145. :close-on-click-modal="true"
  146. :close-on-press-escape="false"
  147. :width="dialogWidth"
  148. append-to-body
  149. center
  150. :custom-class="interface === 'manage' ? 'manage-dialog': 'login-dialog'"
  151. @close="handlerCloseDialog"
  152. >
  153. <login v-if="interface === 'login'" ref="loginRef" @register="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></login>
  154. <register v-if="interface === 'register'" ref="registerRef" @login="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></register>
  155. <UserManage v-if="interface === 'manage'" ref="manageRef" @close="handlerCloseDialog" :dialogVisiable="dialogVisiable"></UserManage>
  156. <BuyVip v-if="interface === 'vip'" ref="vipRef" @close="handlerCloseDialog"></BuyVip>
  157. <BuyTicket v-if="interface === 'ticket'" ref="ticketRef" @close="handlerCloseDialog"></BuyTicket>
  158. </el-dialog>
  159. </client-only>
  160. </div>
  161. </template>
  162. <script>
  163. import { mapState } from 'vuex'
  164. import { removeToken } from '~/utils/cookie';
  165. import login from '~/components/LoginBar.vue'
  166. import register from '~/components/RegisterBar.vue'
  167. import userManage from '~/components/UserManage.vue'
  168. import BuyVip from '~/components/BuyVip.vue'
  169. import BuyTicket from '~/components/BuyTicket.vue'
  170. export default {
  171. components: {
  172. login,
  173. register,
  174. userManage,
  175. BuyVip,
  176. BuyTicket
  177. },
  178. data() {
  179. return {
  180. dialogVisiable: false,
  181. popover: false,
  182. }
  183. },
  184. computed: {
  185. ...mapState([
  186. 'token',
  187. 'userInfo',
  188. 'globalLoginVisiable',
  189. 'globalInterfaceType'
  190. ]),
  191. visiable() {
  192. return this.dialogVisiable || this.globalLoginVisiable
  193. },
  194. interface() {
  195. return this.globalInterfaceType || 'login'
  196. },
  197. dialogWidth() {
  198. if(this.interface === 'vip') {
  199. return '512px'
  200. }else if(this.interface === 'ticket') {
  201. return '558px'
  202. }else {
  203. return '480px'
  204. }
  205. }
  206. },
  207. methods: {
  208. handleLoginSucess() {
  209. this.$nextTick(()=> {
  210. this.popover = true
  211. this.$refs.popover.updatePopper()
  212. })
  213. setTimeout(() => {
  214. this.popover = false
  215. }, 2000);
  216. },
  217. handlerOpenLogin(type) {
  218. this.dialogVisiable = true
  219. this.$store.commit('OPEN_LOGIN', true)
  220. this.$store.commit('SET_INTERFACE', type)
  221. },
  222. handlerCloseDialog() {
  223. this.dialogVisiable = false
  224. this.$store.commit('OPEN_LOGIN',false)
  225. this.$refs[`${this.interface}Ref`].resetInterfaceStatus()
  226. },
  227. // 切换弹窗界面
  228. showChange(type) {
  229. this.$store.commit('SET_INTERFACE', type)
  230. },
  231. handlerLogout() {
  232. localStorage.removeItem('token')
  233. localStorage.removeItem('userInfo')
  234. localStorage.removeItem('file')
  235. this.$store.commit('setUser', {})
  236. removeToken('Token')
  237. this.$store.commit('DEL_TOKEN', '')
  238. this.$router.push('/')
  239. },
  240. }
  241. }
  242. </script>
  243. <style lang="scss">
  244. .menu-active {
  245. color: #E93636;
  246. opacity: 0.7;
  247. }
  248. .login-dialog {
  249. position: relative;
  250. border-radius: 6px;
  251. box-shadow: 0 5px 15px rgb(0 0 0 / 50%)
  252. }
  253. .manage-dialog {
  254. position: relative;
  255. border-radius: 6px;
  256. box-shadow: 0 5px 15px rgb(0 0 0 / 50%);
  257. .el-dialog__body {
  258. padding: unset !important;
  259. }
  260. }
  261. .btn-renew {
  262. font-size: 14px;
  263. color: white;
  264. height: 36px;
  265. width: 82px;
  266. background: linear-gradient(128deg, #cca166, #edd3b0);
  267. box-shadow: 0px 2px 6px 0px rgb(219 184 137 / 57%);
  268. border-radius: 4px;
  269. font-weight: 500;
  270. }
  271. .btn-recharge {
  272. width: 82px;
  273. height: 36px;
  274. background-color: #FF4F4F;
  275. box-shadow: 0px 2px 6px rgb(255 79 79 / 20%);
  276. border: none;
  277. border-radius: 4px;
  278. color: #fff;
  279. font-size: 14px;
  280. outline: none;
  281. }
  282. .clear {
  283. zoom: 1;
  284. }
  285. .showConverter{
  286. .more_menu {
  287. width: 800px;
  288. padding: 30px 40px;
  289. position: absolute;
  290. top: 70px;
  291. left: -132px;
  292. background: #fff;
  293. box-shadow: 0px 2px 12px rgb(0 0 0 / 12%);
  294. border-radius: 3px;
  295. z-index: 100;
  296. display: none;
  297. .horn {
  298. position: absolute;
  299. left: 135px;
  300. top: -16px;
  301. }
  302. .package_type{
  303. h3 {
  304. margin: 0 0 10px;
  305. color: #333333;
  306. font-size: 14px;
  307. font-weight: normal;
  308. line-height: 16px;
  309. }
  310. ul {
  311. display: flex;
  312. margin: 0;
  313. padding: 0;
  314. li {
  315. list-style: none;
  316. text-align: center;
  317. width: 130px;
  318. height: 120px;
  319. a {
  320. display: block;
  321. width: 100%;
  322. height: 100%;
  323. text-decoration: none;
  324. img {
  325. margin-top: 0;
  326. margin-left: 15px;
  327. vertical-align: middle;
  328. }
  329. span {
  330. color: #333333;
  331. font-size: 12px;
  332. margin-top: 5px;
  333. display: block;
  334. white-space: nowrap;
  335. transition: all .5s;
  336. }
  337. &:hover{
  338. img {
  339. box-shadow: 0px 0px 6px rgb(255 79 79 / 25%);
  340. }
  341. span {
  342. color: #ff4f4f;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }
  350. &:hover{
  351. .more_menu{
  352. display: block;
  353. }
  354. }
  355. }
  356. </style>