| | |
| | | <calculatorNew></calculatorNew> |
| | | </el-dialog> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import heart from '@/assets/images/examination/collectIcon.png' |
| | | import isHeart from '@/assets/images/examination/collectClickIcon.png' |
| | | import { ref, reactive, watch, onMounted, onBeforeMount, onBeforeUnmount, inject, defineComponent } from 'vue' |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | import useClipboard from 'vue-clipboard3' |
| | | import examination from '../examination/index.vue' |
| | | import calculator from '../components/calculator.vue' |
| | | import calculatorNew from '../components/calculatorNew.vue' |
| | | const { toClipboard } = useClipboard() |
| | | const MG: any = inject('MG') |
| | | const toolClass = inject('toolClass') |
| | | const qiankunActions = inject('qiankunActions') |
| | | //获取路由器 |
| | | let router = useRouter() |
| | | //获取当前路由的信息 |
| | |
| | | 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) |
| | |
| | | } else { |
| | | getResourceData() |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 |
| | | } |
| | | const searchBtn = () => { |
| | | if (searchShow.value) { |
| | |
| | | } |
| | | // 收藏按钮 |
| | | const handleCollectResource = (id, md5, resourcePath, resourceType, source, resourceName) => { |
| | | <<<<<<< HEAD |
| | | if (collectResourceList.value.findIndex((item) => item.id == id) > -1) { |
| | | collectResourceList.value = collectResourceList.value.filter((item) => item.id != id) |
| | | ======= |
| | | if (collectResourceList.value.findIndex(item => item.id == id) > -1) { |
| | | collectResourceList.value = collectResourceList.value.filter(item => item.id != id) |
| | | >>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 |
| | | } else { |
| | | collectResourceList.value.push({ |
| | | id, |
| | |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: "collectResource", |
| | | <<<<<<< HEAD |
| | | domain: 'collectResource', |
| | | key: bookConfig.value.bookId, |
| | | value: JSON.stringify(collectResourceList.value), |
| | | value: JSON.stringify(collectResourceList.value) |
| | | } |
| | | ] |
| | | }, |
| | | ], |
| | | }) |
| | |
| | | //错题本 |
| | | const wrongQuestionVisble = ref(false) |
| | | const selectExercisesType = (type) => { |
| | | |
| | | if (type == 'exercises') { |
| | | getExercisesList() |
| | | exercisesType.value = type |
| | |
| | | } |
| | | |
| | | .questionList { |
| | | <<<<<<< HEAD |
| | | height: 83%; |
| | | ======= |
| | | height: 83% |
| | | >>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 |
| | | } |
| | | |
| | | .question-bottom { |
| | |
| | | width: 300px; |
| | | padding: 20px 0; |
| | | background-color: #fff; |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 |
| | | li { |
| | | cursor: pointer; |
| | | width: 65px; |