|
@@ -1,23 +1,40 @@
|
|
|
<template>
|
|
|
- <div class="header">
|
|
|
- <router-link :to="{name: 'home'}">
|
|
|
- <div class="logo-title">
|
|
|
- <picture>
|
|
|
- <source type="image/png" media="(min-width: 430px)" srcset="../../../static/images/common/logo@2x.png">
|
|
|
- <source type="image/png" media="(max-width: 429px)" srcset="../../../static/images/common/logo.png">
|
|
|
- <img src="../../../static/images/common/logo@2x.png" alt="logo">
|
|
|
- </picture>
|
|
|
- <span>ComPDFKit API</span>
|
|
|
+ <div class="header" :class="show && 'active'">
|
|
|
+ <div class="nav-content">
|
|
|
+ <div class="nav-left">
|
|
|
+ <router-link :to="{name: 'home'}">
|
|
|
+ <div class="logo-title">
|
|
|
+ <picture>
|
|
|
+ <source type="image/png" media="(min-width: 430px)" srcset="../../../static/images/common/logo@2x.png">
|
|
|
+ <source type="image/png" media="(max-width: 429px)" srcset="../../../static/images/common/logo.png">
|
|
|
+ <img src="../../../static/images/common/logo@2x.png" alt="logo">
|
|
|
+ </picture>
|
|
|
+ <span>ComPDFKit API</span>
|
|
|
+ </div>
|
|
|
+ </router-link>
|
|
|
+ <div class="line-container" :class="show && 'active'" @click="toggleMenu">
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="line"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </router-link>
|
|
|
- <div v-if="$route.name !== 'login'">
|
|
|
- <el-popover ref="popover" placement="bottom-end" trigger="hover">
|
|
|
- <div class="login-out" @click="loginOut">
|
|
|
- <div></div>
|
|
|
- <span>Log out</span>
|
|
|
+ <nav>
|
|
|
+ <a class="link" href="http://test-pdf-pro.kdan.cn:3034">API Tools</a>
|
|
|
+ <a class="link" href="http://test-pdf-pro.kdan.cn:3034/api/docs/introduction">Documentation</a>
|
|
|
+ <a class="link" href="http://test-pdf-pro.kdan.cn:3034/api/contact">Pricing</a>
|
|
|
+ <a class="link btn" href="http://test-pdf-pro.kdan.cn:3034/api/contact">Contact Us</a>
|
|
|
+ </nav>
|
|
|
+ </div>
|
|
|
+ <div class=""></div>
|
|
|
+ <div v-if="$route.name !== 'login'" class="nav-right">
|
|
|
+ <el-popover ref="popover" placement="bottom-start" popper-class="dropdown-content" trigger="hover" :visible-arrow="false">
|
|
|
+ <router-link class="dropdown-item" to="/dashboard"><Dashboard /><span>Dashboard</span></router-link>
|
|
|
+ <div class="dropdown-item login-out" @click="loginOut">
|
|
|
+ <Logout /><span>Log out</span>
|
|
|
</div>
|
|
|
</el-popover>
|
|
|
<div class="user-photo" v-popover:popover><p>{{ user && user.name.slice(0, 1) }}</p></div>
|
|
|
+ <a class="link btn" href="http://test-pdf-pro.kdan.cn:3034/api/contact">Contact Us</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -28,8 +45,14 @@ import Cookie from 'js-cookie'
|
|
|
import { loginStore } from '@/store/loginStore'
|
|
|
import { apiLoginOut } from '@/request/api'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
+import Dashboard from '@/components/icon/dashboard.vue'
|
|
|
+import Logout from '@/components/icon/logout.vue'
|
|
|
|
|
|
export default Vue.extend({
|
|
|
+ components: {
|
|
|
+ Dashboard,
|
|
|
+ Logout
|
|
|
+ },
|
|
|
setup () {
|
|
|
const store = loginStore()
|
|
|
const { user } = storeToRefs(store)
|
|
@@ -37,12 +60,22 @@ export default Vue.extend({
|
|
|
user
|
|
|
}
|
|
|
},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ show: false,
|
|
|
+ dropdownShow: false
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ toggleMenu () {
|
|
|
+ this.show = !this.show
|
|
|
+ this.dropdownShow = false
|
|
|
+ },
|
|
|
loginOut () {
|
|
|
apiLoginOut({}).then(res => {
|
|
|
loginStore().setAuth(false)
|
|
|
Cookie.remove('access_token')
|
|
|
- this.$router.push('/login')
|
|
|
+ window.location.href = 'http://test-pdf-pro.kdan.cn:3034'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -51,12 +84,8 @@ export default Vue.extend({
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.header {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
width: 100%;
|
|
|
height: 80px;
|
|
|
- padding: 20px 40px;
|
|
|
background-color: #fff;
|
|
|
box-shadow: 0px 4px 10px rgba(78, 89, 105, 0.06);
|
|
|
position: fixed;
|
|
@@ -78,6 +107,7 @@ export default Vue.extend({
|
|
|
}
|
|
|
}
|
|
|
.user-photo {
|
|
|
+ flex: none;
|
|
|
width: 42px;
|
|
|
height: 42px;
|
|
|
border-radius: 50%;
|
|
@@ -91,6 +121,135 @@ export default Vue.extend({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.nav-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .nav-left {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .link {
|
|
|
+ padding: 28px 0;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #18191B;
|
|
|
+ &:hover {
|
|
|
+ color: #1460F3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.nav-right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 138px;
|
|
|
+ height: 42px;
|
|
|
+ margin-left: 24px;
|
|
|
+ color: #1460F3;
|
|
|
+ border: 1px solid #1460F3;
|
|
|
+ border-radius: 6px;
|
|
|
+}
|
|
|
+@media screen and (max-width: 929.9px) {
|
|
|
+ .nav-right {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .header {
|
|
|
+ &.active {
|
|
|
+ height: 100vh;
|
|
|
+ background-color: #000;
|
|
|
+ nav {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .logo-title span {
|
|
|
+ color: #FFF;
|
|
|
+ }
|
|
|
+ .nav-left {
|
|
|
+ border-bottom: 1px solid rgba(47, 47, 47, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .logo-title {
|
|
|
+ img {
|
|
|
+ width: 18px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ margin-left: 10px;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .nav-content {
|
|
|
+ .nav-left {
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 100%;
|
|
|
+ padding: 17px 20px;
|
|
|
+ }
|
|
|
+ nav {
|
|
|
+ position: fixed;
|
|
|
+ top: 74px;
|
|
|
+ display: none;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .link {
|
|
|
+ color: #FFF;
|
|
|
+ padding: 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ border-bottom: 1px solid rgba(47, 47, 47, 1);
|
|
|
+ text-align: left;
|
|
|
+ &.btn {
|
|
|
+ width: 100%;
|
|
|
+ max-width: 242px;
|
|
|
+ margin: 50px auto 0;
|
|
|
+ height: 42px;
|
|
|
+ border: 1px solid #1460F3;
|
|
|
+ color: #1460F3;
|
|
|
+ &:active {
|
|
|
+ color: #FFF;
|
|
|
+ background-color: #1460F3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .line-container {
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ .line {
|
|
|
+ position: relative;
|
|
|
+ width: 14px;
|
|
|
+ height: 2px;
|
|
|
+ background-color: #000;
|
|
|
+ transition: transform 0.2s linear 0s, top 0.2s linear 0s;
|
|
|
+ &:nth-child(2) {
|
|
|
+ top: 4px;
|
|
|
+ }
|
|
|
+ &:nth-child(3) {
|
|
|
+ top: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.active {
|
|
|
+ .line {
|
|
|
+ background-color: #FFF;
|
|
|
+ &:first-child {
|
|
|
+ transform: rotate(45deg);
|
|
|
+ top: 6px;
|
|
|
+ }
|
|
|
+ &:nth-child(2) {
|
|
|
+ opacity: 0;
|
|
|
+ }
|
|
|
+ &:nth-child(3) {
|
|
|
+ top: 2px;
|
|
|
+ transform: rotate(-45deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
@media screen and (max-width: 767px) {
|
|
|
.header {
|
|
|
height: 66px;
|
|
@@ -120,4 +279,32 @@ export default Vue.extend({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+@media screen and (min-width: 930px) {
|
|
|
+ .header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20px 40px;
|
|
|
+ }
|
|
|
+ .line-container {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .nav-content {
|
|
|
+ nav {
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
+ a {
|
|
|
+ margin-right: 28px;
|
|
|
+ }
|
|
|
+ .link.btn {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ &:hover {
|
|
|
+ background-color: #1460F3;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|