From 5f00696dfb25bc90034448ceb634ed1ef256681a Mon Sep 17 00:00:00 2001 From: qiyunfeng-create <1940665526@qq.com> Date: 星期四, 21 八月 2025 21:13:35 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website --- src/views/courseManage/index.vue | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 228 insertions(+), 0 deletions(-) diff --git a/src/views/courseManage/index.vue b/src/views/courseManage/index.vue new file mode 100644 index 0000000..087f50e --- /dev/null +++ b/src/views/courseManage/index.vue @@ -0,0 +1,228 @@ +<template> + <div class="courseManage" v-loading="loading"> + <div class="backBox"> + <span @click="router.back()">< 杩斿洖</span> + </div> + <div class="courseName"> + <div class="title" :title="detailData.name">{{ detailData.name }}</div> + <span class="courseId">ID锛歿{ detailData.id }}</span> + </div> + <div class="courseInfoBox"> + <div class="desc" :title="detailData.description"> + {{ detailData.description }} + </div> + <div class="textBookImg autoImgBox"> + <img + v-if="detailData?.linkProduct?.icon != 'default'" + :src=" + detailData.linkProduct?.icon ? getPublicImage(detailData.linkProduct.icon, 80) : defaultImg + " + /> + </div> + <div class="textBookInfo"> + <p class="title">{{ bookDetail?.name }}</p> + <p v-if="bookDetail?.author">浣滆�咃細 {{ bookDetail?.author }}</p> + <p>ISBN锛歿{ bookDetail?.isbn }}</p> + </div> + <div class="statisticsInfoBox"> + <p class="title">鐝骇鏁伴噺<span>锛堣繘琛屼腑/鍏ㄩ儴锛�</span></p> + <!-- <p class="num">0 / 0</p> --> + <p class="num">{{ numClass }}</p> + </div> + <!-- <div class="statisticsInfoBox"> + <p class="title">瀛︿範浜烘暟<span>锛堝涔犱腑/鍏ㄩ儴锛�</span></p> + <p class="num">0 / 0</p> + </div> --> + <!-- <div class="statisticsInfoBox"> + <p class="title" style="margin-bottom: 40px">鏁欏澶х翰</p> + <p class="num">25</p> + </div> --> + </div> + <el-tabs style="margin-top: 20px"> + <el-tab-pane label="鎴戠殑鐝骇"> + <classManage + v-if="detailData.id" + :courseId="detailData.id" + :bookInfo="bookDetail" + @refreshParent="refreshParent" + /> + </el-tab-pane> + <!-- <el-tab-pane label="鏁欏璁″垝">鏁欏璁″垝</el-tab-pane> --> + </el-tabs> + </div> +</template> + +<script setup lang="ts"> +import { reactive, ref, onMounted, inject, watch } from 'vue' +import { useRouter, useRoute } from 'vue-router' +import { Search } from '@element-plus/icons-vue' +import { ElMessage } from 'element-plus' +import { getPublicImage } from '@/assets/js/middleGround/tool.js' +import classManage from './components/class.vue' +import defaultImg from '@/assets/images/default-book-img.png' + +const MG: any = inject('MG') +const router = useRouter() +const route = useRoute() +const query = route.query +const bookDetail = ref() +const numClass = ref(0) + +onMounted(() => { + getData() +}) + +const loading = ref(true) + +const detailData: any = ref({}) + +// 鑾峰彇鐝骇 +const getDataClass = () => { + MG.edu + .getCourseClassList({ + courseId: detailData.value.id, + start: 0, + size: 999, + sort: { + type: 'Desc', + field: 'CreateDate' + }, + filterList: [], + searchList: [] + }) + .then((res: any) => { + numClass.value = res.datas.length + }) +} + +// 鑾峰彇璇剧▼淇℃伅 +const getData = () => { + MG.edu + .getCourseById({ + courseId: query.courseId + }) + .then((res: any) => { + detailData.value = res + loading.value = false + const shopId = res.linkProduct?.id + getBookDetail(shopId) + getDataClass() + }) +} + +// 鑾峰彇鏁欐潗璇︽儏 +const getBookDetail = (shopId: number) => { + let query = { + path: '*', + queryType: '*', + productId: String(shopId), + coverSize: { + height: 300, + width: 210 + }, + fields: { + seriesName: [], + author: [], + isbn: [], + publicationDate: [] + } + } + MG.store.getProductDetail(query).then(async (res: any) => { + bookDetail.value = res.datas + }) +} + +const refreshParent = (str: string) => { + if (str == 'del') getData() +} +</script> + +<style lang="less" scoped> +.courseManage { + padding: 0 20px; + .backBox { + border-bottom: 1px solid #efefef; + padding: 15px 0; + margin-bottom: 20px; + color: var(--el-color-primary); + span { + cursor: pointer; + } + } + .courseName { + margin-bottom: 20px; + font-size: 16px; + font-weight: bold; + display: flex; + justify-content: flex-start; + align-items: center; + .title { + max-width: 300px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + word-wrap: break-word; + } + .courseId { + margin-left: 40px; + font-size: 12px; + font-weight: normal; + } + } + .courseInfoBox { + font-size: 14px; + border: 1px solid #7ac1ec; + border-radius: 10px; + padding: 20px 10px; + display: flex; + background: #ebf7ff; + .desc { + width: 18%; + border-right: 1px solid #ccc; + padding-right: 20px; + margin-right: 20px; + font-size: 12px; + line-height: 30px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 4; + overflow: hidden; + text-overflow: ellipsis; + } + .textBookImg { + width: 100px; + height: 120px; + margin-right: 10px; + } + .textBookInfo { + flex: 1.5; + overflow: hidden; + line-height: 18px; + p { + margin-bottom: 10px; + } + } + .statisticsInfoBox { + flex: 1; + overflow: hidden; + text-align: center; + p { + margin-bottom: 20px; + } + .num { + font-size: 16px; + } + } + .title { + font-weight: bold; + font-size: 14px; + span { + display: inline-block; + font-weight: normal; + font-size: 12px; + margin-top: 6px; + } + } + } +} +</style> -- Gitblit v1.9.1