QYF-GitLab1
1 天以前 49a435043b0b1a289a24606e35253365d7ab3956
src/layout/components/headerPage.vue
@@ -2,39 +2,29 @@
  <div class="pageHeader">
    <div class="contentBox logoBox">
      <div class="logo">
        <img
          @click="
            () => {
              $router.push({
                path: '/home',
              })
            }
          "
          src="@/assets/images/xiehe/home/Group_303.png"
        />
        <img @click="
          () => {
            $router.push({
              path: '/home',
            })
          }
        " src="@/assets/images/xiehe/home/logo.png" />
      </div>
      <div class="searchBox" v-show="!hideSerch">
        <el-input
          style="width: 500px; height: 36px"
          placeholder="请输入内容"
          v-model="searchKey"
          :suffix-icon="Search"
          @keyup.enter="gotoSearch"
        >
        <el-input style="width: 500px; height: 36px" placeholder="请输入关键词/书名/ISBN/作者" v-model="searchKey" :suffix-icon="Search"
          @keyup.enter="gotoSearch">
        </el-input>
        <div class="loginInfoBox">
          <div v-if="!userInfo" class="loginBtnBox" style="width: 200px">
            <div
              class="loginBtn"
              @click="
                () => {
                  console.log(loginRef.value)
                  loginRef.logIn()
                }
              "
            >
              <el-icon><UserFilled /></el-icon>
              注册/登录
            <div class="loginBtn" @click="
              () => {
                loginRef.logIn()
              }
            ">
              <el-icon style="margin-right: 5px;">
                <UserFilled />
              </el-icon>
              注册 / 登录
            </div>
          </div>
          <div v-else class="userInfoBox">
@@ -47,12 +37,8 @@
              </span>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item :icon="Avatar" command="gotoPersonalCenter"
                    >个人中心</el-dropdown-item
                  >
                  <el-dropdown-item :icon="SwitchButton" command="logout"
                    >退出登录</el-dropdown-item
                  >
                  <el-dropdown-item :icon="Avatar" command="gotoPersonalCenter">个人中心</el-dropdown-item>
                  <el-dropdown-item :icon="SwitchButton" command="logout">退出登录</el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
@@ -62,16 +48,11 @@
    </div>
    <login ref="loginRef"></login>
    <div class="contentBox navBox" v-show="!hideNav">
      <div
        :class="{
          navItem: true,
          // active: $route.fullPath.indexOf(item.path) > -1,
          active: item.pathList.findIndex((citem) => citem == $route.path) > -1,
        }"
        v-for="(item, index) in navData"
        :key="index"
        @click="gotoPage(item)"
      >
      <div :class="{
        navItem: true,
        // active: $route.fullPath.indexOf(item.path) > -1,
        active: item.pathList.findIndex((citem) => citem == $route.path) > -1,
      }" v-for="(item, index) in navData" :key="index" @click="gotoPage(item)">
        {{ item.name }}
      </div>
    </div>
@@ -172,11 +153,13 @@
.pageHeader {
  width: 100%;
  background-color: #fff;
  .topBar {
    background: #e6e6e6;
    color: #808080;
    overflow: hidden;
    padding: 14px 0;
    p {
      float: left;
    }
@@ -185,29 +168,39 @@
  .loginInfoBox {
    width: 200px;
    margin-left: 20px;
    .loginBtn {
      width: 100px;
      width: 125px;
      background-color: #144941;
      height: 36px;
      line-height: 36px;
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      padding: 12px 0;
      border-radius: 20px;
      color: #ffffff;
      cursor: pointer;
    }
  }
  .logoBox {
    padding: 25px 0;
    overflow: hidden;
    max-width: 1200px !important;
    max-width: 1369px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .logo {
      float: left;
      height: 66px;
      img {
        height: 100%;
        width: 100%;
        cursor: pointer;
      }
    }
    .searchBox {
      width: 670px;
      float: right;
@@ -215,10 +208,12 @@
      display: flex;
      justify-content: space-between;
      align-items: center;
      .searchItem {
        width: 120px;
        vertical-align: initial;
      }
      .searchBtn {
        width: auto;
        background: #144941;
@@ -228,6 +223,7 @@
      }
    }
  }
  .navBox {
    .navItem {
      display: inline-block;
@@ -237,6 +233,7 @@
      line-height: 50px;
      font-size: 16px;
      cursor: pointer;
      &.active {
        background: #144941;
        color: #fff;
@@ -250,6 +247,7 @@
  background: #fff;
  color: #444;
}
::v-deep(.el-input__wrapper) {
  border-radius: 50px !important;
  height: 36px;