| | |
| | | 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() |
| | |
| | | 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 |
| | |
| | | flex: 1; |
| | | height: auto; |
| | | } |
| | | .main { |
| | | color: #019e58; |
| | | } |
| | | .classContentBox { |
| | | padding: 10px 40px; |
| | | display: flex; |
| | |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | .iconBox { |
| | | width: 90px; |
| | | width: 100px; |
| | | height: 120px; |
| | | img { |
| | | width: 100%; |
| | |
| | | .main { |
| | | font-size: 16px; |
| | | line-height: 20px; |
| | | color: #019e58; |
| | | } |
| | | .job { |
| | | // padding:10px; |