QYF-GitLab1
2 天以前 9cad6a832c786989be620573b09badccfe7e3b51
src/views/classManage/index.vue
@@ -52,7 +52,6 @@
import { ref, watch, provide, onMounted, inject } from 'vue'
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router'
import { menu } from './config'
import { getPublicImage } from '@/assets/js/middleGround/tool'
import defaultImg from '@/assets/images/default-book-img.png'
const router: any = useRouter()
@@ -90,9 +89,29 @@
  path.value = to.path
})
onMounted(() => {
// 获取教材详情
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)
  classIcon.value = classInfo.value.icon ?? defaultImg
  const detail = await getBookDetail(classInfo.value.bookId)
  classIcon.value = detail.icon ?? defaultImg
  menu.forEach((item) => {
    if ('/' + item.path === path.value) {
      label.value = item.label
@@ -173,6 +192,9 @@
    flex: 1;
    height: auto;
  }
  .main {
    color: #019e58;
  }
  .classContentBox {
    padding: 10px 40px;
    display: flex;
@@ -198,7 +220,7 @@
        margin-bottom: 10px;
        display: flex;
        .iconBox {
          width: 90px;
          width: 100px;
          height: 120px;
          img {
            width: 100%;
@@ -212,6 +234,7 @@
          .main {
            font-size: 16px;
            line-height: 20px;
            color: #019e58;
          }
          .job {
            // padding:10px;