| | |
| | | ><VideoCamera |
| | | /></el-icon> --> |
| | | <!-- <el-icon v-else-if="activeClassify == 'other'" size="30"><Files /></el-icon> --> |
| | | <img src="@/assets/images/resource/yp-mr.png" v-else-if="activeClassify == 'audio'" /> |
| | | <img src="@/assets/images/resource/sp-mr.png" v-else-if="activeClassify == 'video'" /> |
| | | <img src="@/assets/images/resource/qt-mr.png" v-else-if="activeClassify == 'other'" /> |
| | | <img |
| | | src="@/assets/images/resource/yp-mr.png" |
| | | v-else-if="activeClassify == 'audio'" |
| | | /> |
| | | <img |
| | | src="@/assets/images/resource/sp-mr.png" |
| | | v-else-if="activeClassify == 'video'" |
| | | /> |
| | | <img |
| | | src="@/assets/images/resource/qt-mr.png" |
| | | v-else-if="activeClassify == 'other'" |
| | | /> |
| | | <div class="handleBox" v-if="showHandle == index"> |
| | | <div class="delImg"> |
| | | <el-icon |
| | |
| | | ><Download |
| | | /></el-icon> |
| | | <!-- 收藏按钮 --> |
| | | <img |
| | | :src="collectResourceList.findIndex(citem => citem.id == item.id) > -1 ? isHeart : heart " |
| | | class="icon hover" |
| | | style="width: 15px;" |
| | | @click="handleCollectResource(item.id,item.md5 ? item.md5 : '',item.resourcePath ? item.resourcePath : '',item.resourceType,item.resourceType == '视频' || '音频' ? 'bits' : 'json',item.resourceName)" /> |
| | | <img |
| | | :src=" |
| | | collectResourceList.findIndex((citem) => citem.id == item.id) > -1 |
| | | ? isHeart |
| | | : heart |
| | | " |
| | | class="icon hover" |
| | | style="width: 15px" |
| | | @click=" |
| | | handleCollectResource( |
| | | item.id, |
| | | item.md5 ? item.md5 : '', |
| | | item.resourcePath ? item.resourcePath : '', |
| | | item.resourceType, |
| | | item.resourceType == '视频' || '音频' ? 'bits' : 'json', |
| | | item.resourceName |
| | | ) |
| | | " |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <!-- 题库底部收藏夹和错题集 --> |
| | | <ul class="question-bottom" v-if="activeMenu == '题库'"> |
| | | <li @click="selectExercisesType('collection')">收藏夹</li> |
| | | <li @click="selectExercisesType('wrong')">错题本</li> |
| | | </ul> |
| | | <li @click="selectExercisesType('collection')">收藏夹</li> |
| | | <li @click="selectExercisesType('wrong')">错题本</li> |
| | | </ul> |
| | | <!-- 菜单内容收起 --> |
| | | <div class="menuStateBox" v-if="menuState.open"> |
| | | <svg |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 语音阅读组件 --> |
| | | <!-- <div class="voice-reader"> |
| | | <voiceReader /> |
| | | </div> --> |
| | | </div> |
| | | <!-- 教学组件 --> |
| | | <div class="toolBox"> |
| | |
| | | :type="examinationData.type" |
| | | :infoType="examinationData.infoType" |
| | | /> |
| | | <!-- 计算器 --> |
| | | <el-dialog |
| | | title="计算器" |
| | | align-center |
| | | v-model="calculatorVisble" |
| | | width="550" |
| | | style="height: 548px" |
| | | > |
| | | <calculator /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | import useClipboard from 'vue-clipboard3' |
| | | import examination from '../examination/index.vue' |
| | | import calculator from '../components/calculator.vue' |
| | | const { toClipboard } = useClipboard() |
| | | const MG: any = inject('MG') |
| | | const toolClass = inject('toolClass') |
| | |
| | | import dictionary from '@/views/components/dictionary.vue' |
| | | import newWord from '@/views/components/newWord.vue' |
| | | import wrongQuestion from '@/views/components/wrongQuestion.vue' |
| | | import voiceReader from '@/views/components/voiceReader.vue' |
| | | import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' |
| | | import logo from '@/assets/images/header/logo.png' |
| | | import mulu from '@/assets/images/menu/mulu.png' |
| | |
| | | const bookConfig = ref({}) |
| | | const activeCatalog = ref() |
| | | const reMarResult = ref() |
| | | const bookInfo = ref() |
| | | const isBuy = ref(false) |
| | | const tryPageCount = ref(0) |
| | | onMounted(() => { |
| | | if (token) { |
| | | getUserInfo() |
| | | } |
| | | if (localStorage.getItem('bookId')) { |
| | | getBookInfo() |
| | | } |
| | | setTimeout(() => { |
| | | canvasWith.value = document.querySelector('.content-box').offsetWidth |
| | |
| | | window.qiankunActions.onGlobalStateChange((state, prev) => { |
| | | console.log('父层state变化', state) |
| | | window.qiankunState = state |
| | | |
| | | if (window.qiankunState && window.qiankunState.initTestBook) { |
| | | window.qiankunState.initTestBook( |
| | | localStorage.getItem('bookId') + '', |
| | | localStorage.getItem('tryPageCount') |
| | | ) |
| | | if (isBuy.value) { |
| | | if (window.qiankunState && window.qiankunState.initTestBook) { |
| | | window.qiankunState.initTestBook(localStorage.getItem('bookId') + '') |
| | | } |
| | | } else { |
| | | if (window.qiankunState && window.qiankunState.initTestBook) { |
| | | window.qiankunState.initTestBook(localStorage.getItem('bookId') + '', tryPageCount.value) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | // } |
| | | // } |
| | | // ) |
| | | |
| | | //根据refcode获取图书信息 |
| | | |
| | | const getBookInfo = () => { |
| | | const obj = { |
| | | storeInfo: 'jsek_digitalTextbooks', |
| | | path: '*', |
| | | queryType: '*', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | fields: { |
| | | author: [], |
| | | RefCodes: [localStorage.getItem('bookId')], |
| | | probationPage: [] |
| | | } |
| | | } |
| | | MG.store.getProductList(obj).then((res) => { |
| | | console.log(res.datas, '图书信息') |
| | | bookInfo.value = res.datas[0] |
| | | if (res.datas[0].purchasedSaleMethodIdList.includes(res.datas[0].defaultSaleMethodId)) { |
| | | isBuy.value = true |
| | | } else { |
| | | isBuy.value = false |
| | | } |
| | | tryPageCount.value = Number(res.datas[0].probationPage) |
| | | }) |
| | | } |
| | | |
| | | const getUserInfo = () => { |
| | | MG.identity.getCurrentAppUser().then((res) => { |
| | |
| | | { |
| | | icon: huabi, |
| | | name: '画笔', |
| | | isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 |
| | | // isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 |
| | | isShow:true |
| | | }, |
| | | { |
| | | icon: baiban, |
| | |
| | | |
| | | const handleNodeClick = (data) => { |
| | | console.log(data) |
| | | if (localStorage.getItem('tryPageCount')) { |
| | | if (data.start < localStorage.getItem('tryPageCount')) { |
| | | if (!isBuy.value) { |
| | | if (data.start < tryPageCount.value) { |
| | | headerData.process = data.start |
| | | if (window.qiankunState && window.qiankunState.gotoPage) |
| | | window.qiankunState.gotoPage(data.chapter, data.start) |
| | |
| | | activeClassify.value = item.key |
| | | resourceDataList.value = [] |
| | | searchText.value = '' |
| | | if(resourceType.value == 'collect') { |
| | | if (resourceType.value == 'collect') { |
| | | getCollectResource() |
| | | } else { |
| | | getResourceData() |
| | | } |
| | | |
| | | } |
| | | const searchBtn = () => { |
| | | if (searchShow.value) { |
| | |
| | | |
| | | // 获取收藏的资源 |
| | | const getCollectResource = () => { |
| | | if(token) { |
| | | if (token) { |
| | | MG.identity |
| | | .getUserKey({ |
| | | domain: 'collectResource', |
| | | keys: [bookConfig.value.bookId] |
| | | }) |
| | | .then((res) => { |
| | | if (res.length) { |
| | | collectResourceList.value = JSON.parse(res[0].value) |
| | | console.log('收藏资源列表', collectResourceList.value) |
| | | if(collectResourceList.value.length > 0) { |
| | | .getUserKey({ |
| | | domain: 'collectResource', |
| | | keys: [bookConfig.value.bookId] |
| | | }) |
| | | .then((res) => { |
| | | if (res.length) { |
| | | collectResourceList.value = JSON.parse(res[0].value) |
| | | console.log('收藏资源列表', collectResourceList.value) |
| | | if (collectResourceList.value.length > 0) { |
| | | let imgCount = 0 |
| | | let audioCount = 0 |
| | | let videoCount = 0 |
| | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | resourceDataList.value = [] |
| | | } |
| | | } else { |
| | | resourceDataList.value = [] |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | ElMessageBox.confirm('请先登录!', { |
| | | confirmButtonText: '去登录', |
| | |
| | | } |
| | | } |
| | | // 收藏按钮 |
| | | const handleCollectResource = (id,md5,resourcePath,resourceType,source,resourceName) => { |
| | | if(collectResourceList.value.findIndex(item => item.id == id) > -1) { |
| | | collectResourceList.value = collectResourceList.value.filter(item => item.id != id) |
| | | } else { |
| | | collectResourceList.value.push({ |
| | | id, |
| | | md5, |
| | | resourcePath:resourcePath.replace(bookConfig.value.resourceUrl + '/',''), |
| | | resourceType, |
| | | source, |
| | | resourceName |
| | | }) |
| | | } |
| | | MG.identity.setUserKey({ |
| | | const handleCollectResource = (id, md5, resourcePath, resourceType, source, resourceName) => { |
| | | if (collectResourceList.value.findIndex((item) => item.id == id) > -1) { |
| | | collectResourceList.value = collectResourceList.value.filter((item) => item.id != id) |
| | | } else { |
| | | collectResourceList.value.push({ |
| | | id, |
| | | md5, |
| | | resourcePath: resourcePath.replace(bookConfig.value.resourceUrl + '/', ''), |
| | | resourceType, |
| | | source, |
| | | resourceName |
| | | }) |
| | | } |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: "collectResource", |
| | | key:bookConfig.value.bookId, |
| | | value: JSON.stringify(collectResourceList.value), |
| | | }, |
| | | ], |
| | | domain: 'collectResource', |
| | | key: bookConfig.value.bookId, |
| | | value: JSON.stringify(collectResourceList.value) |
| | | } |
| | | ] |
| | | }) |
| | | } |
| | | |
| | |
| | | //错题本 |
| | | const wrongQuestionVisble = ref(false) |
| | | const selectExercisesType = (type) => { |
| | | |
| | | if (type == 'exercises') { |
| | | getExercisesList() |
| | | exercisesType.value = type |
| | | searchText.value = '' |
| | | exercisesType.value = type |
| | | searchText.value = '' |
| | | } else if (type == 'additional') { |
| | | getAdditionalList() |
| | | exercisesType.value = type |
| | | searchText.value = '' |
| | | exercisesType.value = type |
| | | searchText.value = '' |
| | | } else if (type == 'wrong') { |
| | | openExaminationDialog(true, {}, 'errorQuestion') |
| | | } else { |
| | |
| | | const siweiVisble = ref(false) |
| | | const modelToolVisble = ref(false) |
| | | const shengciVisble = ref(false) |
| | | const calculatorVisble = ref(false) |
| | | const activeTool = ref(0) |
| | | const toolState = reactive({ |
| | | open: true |
| | |
| | | case '生词卡片': |
| | | resourceUrl.value = bookConfig.value.resourceUrl |
| | | shengciVisble.value = true |
| | | break |
| | | case '计算器': |
| | | calculatorVisble.value = true |
| | | break |
| | | } |
| | | } else { |
| | | ElMessageBox.confirm('请先登录!', { |
| | |
| | | overflow-y: auto; |
| | | } |
| | | .questionList { |
| | | height:83% |
| | | height: 83%; |
| | | } |
| | | .question-bottom { |
| | | position: absolute; |
| | | bottom: 0; |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | width:300px; |
| | | padding:20px 0; |
| | | background-color:#fff; |
| | | width: 300px; |
| | | padding: 20px 0; |
| | | background-color: #fff; |
| | | li { |
| | | cursor: pointer; |
| | | width: 65px; |
| | | height:65px; |
| | | border:1px solid #cfcfcf; |
| | | border-radius:10px; |
| | | background-color:#f9f9f9; |
| | | display:flex; |
| | | height: 65px; |
| | | border: 1px solid #cfcfcf; |
| | | border-radius: 10px; |
| | | background-color: #f9f9f9; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | .voice-reader { |
| | | position: absolute; |
| | | bottom: 30px; |
| | | left: 50px; |
| | | } |
| | | </style> |