From 87d2fac9c381de99f75ce6c6c39b7d638b980d7e Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期四, 21 八月 2025 17:52:14 +0800
Subject: [PATCH] 1111

---
 src/layout/components/headerPage.vue |   61 ++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/src/layout/components/headerPage.vue b/src/layout/components/headerPage.vue
index c1664cb..b4ec4ec 100644
--- a/src/layout/components/headerPage.vue
+++ b/src/layout/components/headerPage.vue
@@ -15,7 +15,7 @@
       </div>
       <div class="searchBox" v-show="!hideSerch">
         <el-input
-          style="width: 500px"
+          style="width: 500px; height: 50px"
           placeholder="璇疯緭鍏ュ唴瀹�"
           @change="gotoSearch"
           v-model="searchKey"
@@ -27,31 +27,16 @@
             <a
               @click="
                 () => {
-                  $router.push({
-                    path: '/register',
-                  })
+                  console.log(loginRef.value)
+                  loginRef.logIn()
                 }
               "
-              >娉ㄥ唽</a
-            >
-            |
-            <a
-              @click="
-                () => {
-                  $router.push({
-                    path: '/login',
-                    query: {
-                      redirectPath: $route.fullPath,
-                    },
-                  })
-                }
-              "
-              >鐧诲綍</a
+              >娉ㄥ唽/鐧诲綍</a
             >
           </div>
           <div v-else class="userInfoBox">
             <el-dropdown @command="handleCommand">
-              <span style="cursor: pointer">娆㈣繋鎮紝{{ userInfo.name }}锛�</span>
+              <span style="cursor: pointer">娆㈣繋鎮紝{{ userStore?.userInfo.name }}锛�</span>
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item icon="el-icon-user" command="gotoPersonalCenter"
                   >涓汉涓績</el-dropdown-item
@@ -65,6 +50,7 @@
         </div>
       </div>
     </div>
+    <login ref="loginRef"></login>
     <div class="contentBox navBox" v-show="!hideNav">
       <div
         :class="{
@@ -82,8 +68,15 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import login from './login.vue'
+import { onMounted, ref } from 'vue'
+import { Search } from '@element-plus/icons-vue'
+import { useUserStore } from '@/stores'
+import { useRouter } from 'vue-router'
+const userStore = useUserStore()
+const router = useRouter()
 
+const loginRef = ref()
 const props = defineProps({
   hideSerch: {
     type: Boolean,
@@ -97,9 +90,35 @@
 
 let searchKey = ref('')
 let userInfo = ref('')
+const navData = ref([
+  {
+    name: '棣栭〉',
+    path: '/home',
+  },
+  {
+    name: '鏁欒偛鍑虹増',
+    path: '/bookStore',
+  },
+  {
+    name: '璇昏�呮湇鍔�',
+    path: '/teachingServices',
+  },
+  {
+    name: '鍏充簬鎴戜滑',
+    path: '/aboutUs',
+  },
+])
+
+onMounted(() => {
+  userInfo.value = userStore.userInfo
+  console.log(userInfo.value, 'userInfo')
+})
 
 const gotoSearch = () => {}
 const handleCommand = () => {}
+const gotoPage = (item) => {
+  router.push(item.path)
+}
 </script>
 
 <style lang="less" scoped>

--
Gitblit v1.9.1