src/books/sportsAndHealth/css/default.less | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/books/sportsAndHealth/view/components/chapter003.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/books/sportsAndHealth/view/components/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/pdfview/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/books/sportsAndHealth/css/default.less
@@ -20,79 +20,6 @@ font-size: 18px; .chapter { //new .fl { display: flex; } .fd-c { flex-direction: column; } .al-c { align-items: center; } .w50 { width: 50%; } .w56 { width: 56%; } .w13 { width: 13%; } .w24 { width: 24%; } .w22 { width: 22%; } .w32 { width: 32%; } .w34 { width: 34%; } .span-P { font-family: 'FZLTXIHJW'; font-size: 14px; color: #f79447; } .span-S { color: #f79447; } .tl { text-align: left !important; } .tw-no { text-wrap: nowrap; } .table-p { margin: 0%; text-indent: 0; font-size: 14px; line-height: 25px; font-family: 'FZLTXIHJW'; } .imgBox { display: flex; flex-direction: column-reverse; position: relative; .img { position: absolute; left: 40%; bottom: -10%; } } .table-text { border: none; background-color: transparent; resize: none; &:focus { outline: none; } } //over textarea { width: 100%; font-family: 'FZLTXIHJW'; @@ -300,7 +227,6 @@ video { width: 100%; height: 150px; } video::-webkit-media-text-track-display { @@ -563,6 +489,7 @@ display: flex; justify-content: flex-start; } .bj-byb { width: 100%; padding: 20px 10px; @@ -653,21 +580,6 @@ margin: 0; } } .img-rights { width: 250px; float: right; height: auto; margin: auto; margin-left: 20px; img { width: 100%; } p { margin: 0; } } .qjdrIocn { display: flex !important; @@ -721,7 +633,7 @@ .pdf-con { display: flex; justify-content: flex-start; flex-direction: column; align-items: center; padding: 10px 0; box-sizing: border-box; border-radius: 10px; @@ -730,9 +642,9 @@ min-width: 160px; display: flex; justify-content: center; align-items: center; border: 0.15em dashed #b898c7; margin-right: 15px; margin-top: 5%; padding: 0 15px; border-radius: 5px; @@ -1052,21 +964,12 @@ font-family: 'FZLTXIHJW'; text-align: center; font-size: 0.8em; color: #f79447; color: #5d78bb; margin-left: 0%; margin-right: 0%; text-indent: 0em; } .img-2 { font-family: 'FZLTXIHJW'; text-align: center; font-size: 0.8em; color: #457eba; margin-left: 0%; margin-right: 0%; text-indent: 0em; } .img1 { font-family: 'FZLTXIHJW'; text-align: right; @@ -1883,72 +1786,11 @@ .zt-ls { color: #99b4df; font-weight: bold; text-indent: 1em; } .zt-cs { color: #e99a4f; font-weight: bold; } } .custom-dialog { overflow: hidden !important; :deep(.el-dialog__body) { padding: 0; } :deep(.el-dialog__header) { background-color: rgba(0, 0, 0, 0.8); .header_title { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 900; font-size: 16px; font-family: 'FZLTXIHJW'; span:nth-child(2):hover { cursor: pointer; } } /deep/.el-dialog__title, /deep/ .el-dialog__headerbtn .el-dialog__close { color: #fff; font-weight: 900; font-size: 16px; font-family: 'FZLTXIHJW'; } } } @media screen and (max-width: 1024px) { .pdfModal { width: 100%; height: 80vh; } .custom-dialog { /deep/ .el-dialog { width: 90vw !important; } } } @media screen and (max-width: 800px) { .pdfModal { width: 100%; height: 60vh; } .custom-dialog { /deep/ .el-dialog { width: 90vw !important; } } } @@ -2163,37 +2005,45 @@ } } .tablePublic input[type='checkbox']:checked + .checkmark { background: #000 !important; /* 选中时的背景色 */ } .pdfModal { width: 100%; height: 90vh; .pdfBox-component { width: 100%; height: 100%; position: relative; .preview { width: 100%; height: 100%; .imageBox { height: calc(100% - 30px); overflow-x: hidden; overflow-y: auto; background: #ccc; box-sizing: border-box; } .imageBox:hover { cursor: zoom-in !important; @media screen and (max-width: 1024px) { .pdfModal { width: 100%; height: 80vh; } ::v-deep .el-dialog__header { .custom-dialog { .el-dialog { width: 90vw !important; } } } @media screen and (max-width: 800px) { .pdfModal { width: 100%; height: 60vh; } .custom-dialog { .el-dialog { width: 90vw !important; } } } .custom-dialog { overflow: hidden !important; .el-dialog__body { padding: 0; } .el-dialog__header { background-color: rgba(0, 0, 0, 0.8); .header_title { @@ -2210,43 +2060,19 @@ } } ::v-deep .el-dialog__title, ::v-deep .el-dialog__headerbtn .el-dialog__close { .el-dialog__title, .el-dialog__headerbtn .el-dialog__close { color: #fff; font-weight: 900; font-size: 16px; font-family: 'FZLTXIHJW'; } } .bottom_tool { height: 30px; background-color: rgba(0, 0, 0, 0.8); display: flex; justify-content: flex-end; align-items: center; svg { margin-right: 15px; fill: #d1d1d1; } svg:hover { fill: #fff; cursor: pointer; } } } .notBox { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% - 30px); min-height: 300px; } } .tablePublic input[type='checkbox']:checked + .checkmark { background: #000 !important; /* 选中时的背景色 */ } @font-face { src/books/sportsAndHealth/view/components/chapter003.vue
@@ -1391,6 +1391,7 @@ x5-video-player-fullscreen="true" x5-playsinline="" controls class="video-border w100" :src="chapter003.videoUrl.v2"></video> <span>{{ chapter003.videoMd5.v2.name }}</span> </div> <div class="videoItem" v-if="chapter003.videoShow1"> <video webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-orientation="h5" @@ -7520,8 +7521,19 @@ </div> </div> </div> <el-dialog :visible.sync="dialogVisible" width="60vw" top="2vh" append-to-body lock-scroll :show-close="false" class="custom-dialog"> <el-dialog :visible.sync="dialogVisible" width="60vw" top="2vh" append-to-body lock-scroll :show-close="false" class="custom-dialog" > <div slot="title" class="header_title"> <span>{{ pdfTitle }}</span> <span @click="closeDialog"> x </span> @@ -7530,6 +7542,7 @@ <preView :isClear="dialogVisible" :md5="p_md5"></preView> </div> </el-dialog> </div> </template> <script> @@ -7582,12 +7595,10 @@ isShowXyx12: false, isShowXyx13: false, isShowXyx14: false, isShowXyx15: false, isShowXyx16: false, isShowXyx17: false, isShowXyx18: false, score1: 0, score2: 0, score3: 0, @@ -8584,8 +8595,8 @@ } </script> <style lang="less" scoped> // .pdfModal { <!-- <style lang="less" scoped> --> <!-- // .pdfModal { // width: 100%; // height: 90vh; // } @@ -8648,27 +8659,6 @@ // width: 90vw !important; // } // } // } </style> <style lang="less" scoped> // b { // color: #F79447; // } // } --> .imgBox { display: flex !important; flex-direction: column-reverse !important; position: relative !important; .img { position: absolute !important; left: 40% !important; bottom: -10% !important; } img { height: 80%; } } </style> <!-- </style> --> src/books/sportsAndHealth/view/components/index.vue
@@ -167,8 +167,8 @@ }, 500) // 测试页面跳转 // setTimeout(() => { // this.gotoPage(4, 134) setTimeout(() => { this.gotoPage(4, 134) // setTimeout(() => { // this.renderSign("Highlight", { // id: "2ACA9359", @@ -196,7 +196,7 @@ // txt: " 运动系统是由骨、骨连结和骨骼肌三部分组成的。全身的骨通过骨连结组成人体骨骼(见图1-1)。骨骼是人体的支架,具有保护内脏器官、供肌肉附着和作为肌肉运动的杠杆等作用。在神经系统的支配下,肌肉收缩牵动所附着的骨绕着关节转动,使身体产生各种动作。所以,运动系统具有运动、支持和保护等功能,幼年时期的骨骼还具有造血功能。 ", // txtIndex: 57 // }); // }, 500) }, 500) }, methods: { swdtChange(data) { src/components/pdfview/index.vue
@@ -1,7 +1,4 @@ <!-- @format --> <template> <div class="pdfBox-component"> <div class="preview" v-if="this.preViewMd5"> <div id="imageParent" class="imageBox"></div> <div class="bottom_tool"> @@ -23,18 +20,13 @@ </svg> --> </div> </div> <div class="notBox" v-if="totalPage == 0 && !loading"> <el-empty description="暂无数据"></el-empty> </div> <div class="notBox" v-if="loading" v-loading="loading"></div> </div> </template> <script> import Viewer from 'viewerjs' import 'viewerjs/dist/viewer.css' import { getResourcePath } from '@/assets/methods/resources' import Viewer from "viewerjs"; import "viewerjs/dist/viewer.css"; import { getResourcePath } from "@/assets/methods/resources"; export default { name: 'pdf_view', name: "pdf_view", props: { md5: { type: String, @@ -49,117 +41,160 @@ }, data() { return { currentPageSrc: '', currentPageSrc: "", currentPage: 1, totalPage: 1, viewerCon: null, preViewMd5: '', loading: false, } preViewMd5: "", }; }, watch: { isClear: { immediate: true, handler(val) { if (val == true) this.preViewMd5 = '' if (val == true) this.preViewMd5 = ""; }, }, md5: { immediate: true, handler(val) { if (val) { this.preViewMd5 = val this.currentPage = 1 this.currentPageSrc = '' this.totalPage = 1 this.viewerCon?.destroy() this.preViewMd5 = val; this.currentPage = 1; this.currentPageSrc = ""; this.totalPage = 1; this.viewerCon?.destroy(); } }, }, }, mounted() { this.scrollBottom() this.clearDom() this.getFileInfo() this.scrollBottom(); this.clearDom(); this.getFileInfo(); }, methods: { async downloadPdf() { window.open(await getResourcePath(this.preViewMd5)) window.open(await getResourcePath(this.preViewMd5)); }, domViewer() { let ele = document.getElementById('imageParent') let ele = (this.container ? this.container : document).getElementById( "imageParent" ); this.viewerCon = new Viewer(ele, { inline: false, container: this.container ? this.container.querySelector('#app') : 'body', ? this.container.querySelector("#app") : "body", navbar: true, // 显示导航栏 toolbar: true, // 显示工具栏 title: true, // 显示标题 }) }); }, clearDom() { let ele = document.getElementById('imageParent') ele.innerHtml = '' let ele = document.getElementById("imageParent"); ele.innerHtml = ""; }, createDom(page) { var that = this let ele = document.getElementById('imageParent') const img = document.createElement('img') img.src = this.getPageImage(page) img.alt = '' img.style.maxWidth = '90%' img.style.padding = '30px 5%' img.className = 'imgHover' var that = this; let ele = document.getElementById("imageParent"); const img = document.createElement("img"); img.src = this.getPageImage(page); img.alt = ""; img.style.maxWidth = "90%"; img.style.padding = "30px 5%"; img.className = "imgHover"; img.onclick = () => { that.viewerCon?.destroy() that.domViewer() } ele.appendChild(img) that.viewerCon?.destroy(); that.domViewer(); }; ele.appendChild(img); }, scrollBottom() { var that = this var ele = document.getElementById('imageParent') ele.addEventListener('scroll', function () { var that = this; var ele = document.getElementById("imageParent"); ele.addEventListener("scroll", function () { // 计算滚动条距离底部的位置 const scrollBottom = ele.scrollHeight - ele.scrollTop - ele.clientHeight const scrollBottom = ele.scrollHeight - ele.scrollTop - ele.clientHeight; if (scrollBottom <= 10) { that.currentPage++ that.currentPage++; if (that.currentPage <= that.totalPage) { that.createDom(that.currentPage, ele) that.createDom(that.currentPage, ele); } } }) }); }, getFileInfo() { // 获取目录 this.loading = true; this.MG.file .getPdfInfo({ md5: this.preViewMd5 }) .then((res) => { this.totalPage = res.totalPages this.createDom(this.currentPage) this.loading = false this.totalPage = res.totalPages; this.createDom(this.currentPage); }) .catch((err) => { this.totalPage = 0 this.createDom(this.currentPage) console.error(err) this.loading = false }) this.totalPage = 1; this.createDom(this.currentPage); console.error(err); }); }, getPageImage(page) { const ctx = process.env.VUE_APP_API_URL const ctx = process.env.VUE_APP_API_URL; console.log(this.preViewMd5); return ( ctx + '/file/GetPdfPageImage' + '?md5=' + "/file/GetPdfPageImage" + "?md5=" + this.preViewMd5 + '&index=' + "&index=" + page + '&dpi=200' ) "&dpi=200" ); }, }, } }; </script> <style scoped lang="less"> .preview { width: 100%; height: 100%; .imageBox { height: calc(100% - 30px); overflow-x: hidden; overflow-y: auto; background: #ccc; box-sizing: border-box; } .imageBox:hover { cursor: zoom-in !important; } .bottom_tool { height: 30px; background-color: rgba(0, 0, 0, 0.8); display: flex; justify-content: flex-end; align-items: center; svg { margin-right: 15px; fill: #d1d1d1; } svg:hover { fill: #fff; cursor: pointer; } } } </style>