From cf7e71c6d0fb64eeb6b5deac540da843b4bb465c Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期二, 26 八月 2025 10:41:52 +0800
Subject: [PATCH] 关于我们-理念与品牌文化

---
 src/views/classManage/index.vue |  164 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 94 insertions(+), 70 deletions(-)

diff --git a/src/views/classManage/index.vue b/src/views/classManage/index.vue
index 9a0405a..71e6c84 100644
--- a/src/views/classManage/index.vue
+++ b/src/views/classManage/index.vue
@@ -1,6 +1,5 @@
 <template>
-  <div class="layoutBox">
-    <Header class="header"></Header>
+  <div class="layoutBoxClass">
     <div class="layoutContentBox clear">
       <div class="classContentBox clear">
         <div class="leftList fl">
@@ -50,132 +49,151 @@
 </template>
 
 <script setup lang="ts">
-import { ref, watch, provide, onMounted, inject } from "vue";
-import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
-import Header from "./components/headerPage.vue";
-import { menu } from "./config";
-import { getPublicImage } from "@/assets/js/middleGround/tool.js";
-import defaultImg from "@/assets/images/default-book-img.png";
+import { ref, watch, provide, onMounted, inject } from 'vue'
+import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router'
+import { menu } from './config'
+import defaultImg from '@/assets/images/default-book-img.png'
 
-const router: any = useRouter();
-const route: any = useRoute();
-const MG: any = inject("MG");
-const config: any = inject("config");
-const routerVal = router.currentRoute.value;
-const path = ref(routerVal.path);
-const label = ref("");
-const classInfo: any = ref();
-const classIcon: any = ref();
-const listMenu = ref([]);
-const activeIndex = ref(0);
-const userData = ref();
+const router: any = useRouter()
+const route: any = useRoute()
+const MG: any = inject('MG')
+const config: any = inject('config')
+const routerVal = router.currentRoute.value
+const path = ref(routerVal.path)
+const label = ref('')
+const classInfo: any = ref()
+const classIcon: any = ref()
+const listMenu = ref([])
+const activeIndex = ref(0)
+const userData = ref()
 
 watch(router.currentRoute, (val) => {
-  path.value = val.path;
+  path.value = val.path
   if (val.query.classInfo) {
-    const data: any = val.query.classInfo;
-    const routerInfo: any = JSON.parse(data);
-    activeIndex.value = routerInfo.index;
+    const data: any = val.query.classInfo
+    const routerInfo: any = JSON.parse(data)
+    activeIndex.value = routerInfo.index
   }
-});
+})
 
 watch(classInfo, (val) => {
   if (val) {
-    activeIndex.value = val.index;
+    activeIndex.value = val.index
   }
   if (!val.index) {
-    activeIndex.value = 0;
+    activeIndex.value = 0
   }
-});
+})
 
 onBeforeRouteUpdate(async (to, from) => {
-  path.value = to.path;
-});
+  path.value = to.path
+})
 
-onMounted(() => {
-  classInfo.value = JSON.parse(route.query.classInfo);
-  classIcon.value = classInfo.value.icon
-    ? getPublicImage(classInfo.value.icon, 200)
-    : defaultImg;
+// 鑾峰彇鏁欐潗璇︽儏
+const getBookDetail = async (id: string) => {
+  const query = {
+    path: '*',
+    queryType: '*',
+    productId: id,
+    coverSize: {
+      height: 300,
+      width: 210,
+    },
+    fields: {
+      author: [],
+      isbn: [],
+    },
+  }
+  const res = await MG.store.getProductDetail(query)
+  return res.datas ?? null
+}
+
+onMounted(async () => {
+  classInfo.value = JSON.parse(route.query.classInfo)
+  const detail = await getBookDetail(classInfo.value.bookId)
+  classIcon.value = detail.icon ?? defaultImg
   menu.forEach((item) => {
-    if ("/" + item.path === path.value) {
-      label.value = item.label;
+    if ('/' + item.path === path.value) {
+      label.value = item.label
     }
-  });
-  const userCache: any = localStorage.getItem(config.userInfoKey);
-  const userInfo = JSON.parse(userCache);
-  userData.value = userInfo;
+  })
+  const userCache: any = localStorage.getItem(config.userInfoKey)
+  const userInfo = JSON.parse(userCache)
+  userData.value = userInfo
   if (!userInfo) {
     router.push({
-      path: "/",
-    });
-    return false;
+      path: '/',
+    })
+    return false
   }
-  if (userInfo.role != "Teacher") {
+  if (userInfo.role != 'Teacher') {
     const data: any = menu.filter(
-      (item: any) => item.path != "studentManage" && item.path != "jobAnalysis"
-    );
-    listMenu.value = data;
+      (item: any) => item.path != 'studentManage' && item.path != 'jobAnalysis',
+    )
+    listMenu.value = data
   } else {
-    const data: any = menu;
+    const data: any = menu
     // if (!classInfo.bookRefCode) {
     //   // 铻嶅獟浣撳浘涔︼紝鏃犳暟瀛楅槄璇伙紝鏃犳硶璺宠浆
     //   const list: any = menu.filter((item: any) => item.path != 'teachingPlan')
     //   listMenu.value = list;
     //   return false
     // }
-    listMenu.value = data;
+    listMenu.value = data
   }
-});
+})
 
 const goRouter = (item: any, index: number) => {
-  activeIndex.value = index;
-  if (
-    !localStorage.getItem(config.tokenKey) ||
-    localStorage.getItem(config.tokenKey) == null
-  ) {
+  activeIndex.value = index
+  if (!localStorage.getItem(config.tokenKey) || localStorage.getItem(config.tokenKey) == null) {
     router.push({
-      path: "/home",
+      path: '/home',
       query: {
-        showLogin: "1",
+        showLogin: '1',
       },
-    });
+    })
   } else {
-    label.value = item.label;
-    classInfo.value.index = index;
+    label.value = item.label
+    classInfo.value.index = index
     if (item.key == 5) {
       router.push({
-        path: userData.value.role != "Teacher" ? "/studentJob" : "/jobManage",
+        path: userData.value.role != 'Teacher' ? '/studentJob' : '/jobManage',
         query: {
           classInfo: JSON.stringify(classInfo.value),
         },
-      });
+      })
     } else {
       router.push({
         path: item.path,
         query: {
           classInfo: JSON.stringify(classInfo.value),
         },
-      });
+      })
     }
   }
-};
+}
 
 const goBack = () => {
-  router.go(-1);
-};
+  router.go(-1)
+}
 </script>
 
 <style lang="less" scoped>
-.layoutBox {
+.layoutBoxClass {
   width: 100%;
-  height: 100vh;
   display: flex;
   flex-direction: column;
   background-color: #fff;
+  .mainbg {
+    background: #019e58;
+    color: #fff;
+  }
   .layoutContentBox {
     flex: 1;
     height: auto;
+  }
+  .main {
+    color: #019e58;
   }
   .classContentBox {
     padding: 10px 40px;
@@ -202,7 +220,7 @@
         margin-bottom: 10px;
         display: flex;
         .iconBox {
-          width: 90px;
+          width: 100px;
           height: 120px;
           img {
             width: 100%;
@@ -216,6 +234,7 @@
           .main {
             font-size: 16px;
             line-height: 20px;
+            color: #019e58;
           }
           .job {
             // padding:10px;
@@ -255,7 +274,12 @@
         }
 
         .activeItem {
+          background: linear-gradient(90deg, #019e58 0%, #144941 100%);
           background-size: 100% 100%;
+          color: #fff;
+          svg {
+            fill: #fff;
+          }
         }
       }
     }

--
Gitblit v1.9.1