From ee213bf458d3961a0560ce3b68a3ad38322ece97 Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期一, 25 八月 2025 01:15:06 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website

---
 src/views/classManage/classHome.vue |  102 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 63 insertions(+), 39 deletions(-)

diff --git a/src/views/classManage/classHome.vue b/src/views/classManage/classHome.vue
index bb843b8..11842b1 100644
--- a/src/views/classManage/classHome.vue
+++ b/src/views/classManage/classHome.vue
@@ -26,8 +26,8 @@
               </div>
               <div class="infoBox">
                 <div class="main">{{ currentClass?.bookName }}</div>
-                <div class="job">浣滆�咃細{{ classInfo?.author ?? '-' }}</div>
-                <div class="job">ISBN锛歿{ classInfo?.isbn ?? '-' }}</div>
+                <div class="job">浣滆�咃細{{ currentClass?.author ?? '-' }}</div>
+                <div class="job">ISBN锛歿{ currentClass?.isbn ?? '-' }}</div>
               </div>
             </div>
             <div class="line"></div>
@@ -69,7 +69,7 @@
               <span>鐝骇閫氱煡</span>
               <el-icon
                 style="cursor: pointer"
-                color="#FF6D00"
+                color="#019e58"
                 v-if="noticeList.length > 0 && userInfo.role == 'Teacher'"
                 @click="toInfo"
               >
@@ -98,7 +98,7 @@
               <span>鐝粍璇濋</span>
               <el-icon
                 style="cursor: pointer"
-                color="#FF6D00"
+                color="#019e58"
                 v-if="messageList.length > 0"
                 @click="toTalk"
               >
@@ -131,7 +131,7 @@
               <span>鐝骇浣滀笟姒傝</span>
               <!-- <el-icon
                 style="cursor: pointer"
-                color="#FF6D00"
+                color="#019e58"
                 v-if="tableData.length > 0"
                 @click="toWorkList"
               >
@@ -155,7 +155,7 @@
               <span>鏁欏浜掑姩</span>
               <el-icon
                 style="cursor: pointer"
-                color="#FF6D00"
+                color="#019e58"
                 v-if="tableData.length > 0"
                 @click="toTeaching"
               >
@@ -255,7 +255,7 @@
 const Sloading = ref(false)
 
 onMounted(() => {
-  const userCache: any = localStorage.getItem('jesk-userInfo')
+  const userCache: any = localStorage.getItem(config.userInfoKey)
   if (userCache) {
     userInfo.value = JSON.parse(userCache)
   }
@@ -270,7 +270,7 @@
     await toClipboard(val.refCode)
     ElMessage({
       message: '澶嶅埗鎴愬姛',
-      type: 'success'
+      type: 'success',
     })
   } catch (e) {
     console.error(e)
@@ -281,12 +281,15 @@
 const getData = () => {
   MG.edu
     .getCourseClass({
-      ClassIdOrRefCode: String(classInfo.id)
+      ClassIdOrRefCode: String(classInfo.id),
     })
-    .then((res: any) => {
+    .then(async (res: any) => {
       if (res) {
+        const detail = await getBookDetail(res.linkProductDto.product.id)
         res.bookName = res.linkProductDto.product.name
-        res.bookIcon = getPublicImage(res.linkProductDto.product.icon, 100)
+        res.bookIcon = detail.icon ?? defaultImg
+        res.author = detail.author
+        res.isbn = detail.isbn
         res.classTime =
           moment(res.beginDate).format('YYYY.MM.DD') +
           '--' +
@@ -302,17 +305,17 @@
 const getTopicInfo = () => {
   const pramas = {
     classId: classInfo.id,
-    refCodes: [config.refCodes.message, config.refCodes.talk]
+    refCodes: [config.refCode.message, config.refCode.talk],
   }
   MG.edu.getClassTopic(pramas).then((res: any) => {
     const list = res
-    messageTopicInfo.value = list.find((item: any) => item.refCode == config.refCodes.message)
+    messageTopicInfo.value = list.find((item: any) => item.refCode == config.refCode.message)
     if (messageTopicInfo.value.id) {
       sessionStorage.messageId = messageTopicInfo.value.id
       noticeLoading.value = true
       getNotice()
     }
-    talkTopicInfo.value = list.find((item: any) => item.refCode == config.refCodes.talk)
+    talkTopicInfo.value = list.find((item: any) => item.refCode == config.refCode.talk)
     if (talkTopicInfo.value.id) {
       sessionStorage.talkId = talkTopicInfo.value.id
       messageLoading.value = true
@@ -331,8 +334,8 @@
     sort: {
       type: 'Desc',
       field: 'CreateDate',
-      subSorts: []
-    }
+      subSorts: [],
+    },
   }
   MG.ugc.getTopicMessageList(data).then((res: any) => {
     noticeLoading.value = false
@@ -340,7 +343,7 @@
     noticeList.value = list.map((item: any) => {
       return {
         ...item,
-        createDate: moment(item.createDate).format('YYYY-MM-DD')
+        createDate: moment(item.createDate).format('YYYY-MM-DD'),
       }
     })
   })
@@ -356,8 +359,8 @@
     sort: {
       type: 'Desc',
       field: 'CreateDate',
-      subSorts: []
-    }
+      subSorts: [],
+    },
   }
   MG.ugc.getTopicMessageList(data).then((res: any) => {
     messageLoading.value = false
@@ -374,7 +377,7 @@
         ...item,
         index: i + 1,
         createDate: moment(item.createDate).format('YYYY-MM-DD HH:mm:ss'),
-        updateDate: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss')
+        updateDate: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss'),
       }
     })
   })
@@ -391,9 +394,9 @@
       {
         value: 'Normal',
         field: 'State',
-        subFilters: []
-      }
-    ]
+        subFilters: [],
+      },
+    ],
   }
   MG.identity.getGroupUserList(data).then((res: any) => {
     const { datas } = res
@@ -424,7 +427,7 @@
         return {
           ...item,
           index: index + 1,
-          createDate: moment(item.createDate).format('YYYY-MM-DD')
+          createDate: moment(item.createDate).format('YYYY-MM-DD'),
         }
       })
     }
@@ -442,8 +445,8 @@
   router.push({
     path: '/talkingPoint',
     query: {
-      classInfo: JSON.stringify(classInfo)
-    }
+      classInfo: JSON.stringify(classInfo),
+    },
   })
 }
 
@@ -453,8 +456,8 @@
   router.push({
     path: '/info',
     query: {
-      classInfo: JSON.stringify(classInfo)
-    }
+      classInfo: JSON.stringify(classInfo),
+    },
   })
 }
 
@@ -469,7 +472,7 @@
     sort: {
       type: 'Desc',
       field: 'CreateDate',
-      subSorts: []
+      subSorts: [],
     },
     filterList: [
       // {
@@ -480,10 +483,10 @@
       {
         value: config.taskType.homeWork,
         field: 'Type',
-        subFilters: []
-      }
+        subFilters: [],
+      },
     ],
-    groupId: classInfo?.id
+    groupId: classInfo?.id,
   }
   MG.edu
     .getTaskList(data)
@@ -495,7 +498,7 @@
             return {
               ...item,
               beginDate: moment(item.beginDate).format('YYYY-MM-DD'),
-              endDate: moment(item.endDate).format('YYYY-MM-DD')
+              endDate: moment(item.endDate).format('YYYY-MM-DD'),
             }
           })
           .slice(0, 3)
@@ -507,9 +510,30 @@
       console.log(e)
     })
 }
+// 鑾峰彇鏁欐潗璇︽儏
+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
+}
 </script>
 
 <style lang="less" scoped>
+.main {
+  color: #019e58;
+}
 .nullBox {
   width: 100%;
   display: flex;
@@ -517,6 +541,7 @@
 }
 .classManagePage-box {
   padding: 20px;
+  box-sizing: border-box;
   .classManagePage-nav {
     padding-bottom: 20px;
     border-bottom: 1px solid #e6e8ed;
@@ -531,6 +556,7 @@
         height: 190px;
         margin-top: 30px;
         border-radius: 10px;
+        border: 1px solid #019e58;
         .title {
           width: 80px;
           text-align: center;
@@ -625,8 +651,6 @@
       .titleBox {
         display: flex;
         align-items: center;
-        margin: 20px 0;
-        font-size: 16px;
         .title {
           width: 100%;
           display: flex;
@@ -664,7 +688,6 @@
       .titleBox {
         display: flex;
         align-items: center;
-        margin: 10px 0;
         .border {
           width: 4px;
           height: 23px;
@@ -675,7 +698,7 @@
     }
     .notBox {
       width: 100%;
-      height: 100px;
+      height: 120px;
       display: flex;
       align-items: center;
       justify-content: center;
@@ -694,11 +717,11 @@
     }
     .copyIdBtn {
       background-color: #fff;
-      color: #3b93fe;
-      padding: 0 6px;
+      padding: 10px;
       border-radius: 50px;
       overflow: hidden;
       cursor: pointer;
+      font-size: 14px;
     }
   }
   .avatarList {
@@ -746,6 +769,7 @@
     width: 100%;
     height: calc(100% - 63px);
     padding: 5px 25px;
+    box-sizing: border-box;
     overflow: auto;
     .noticeItem {
       display: flex;

--
Gitblit v1.9.1