This commit is contained in:
daihh
2022-06-15 15:03:39 +08:00
3 changed files with 6 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
<template><!--pdf连接分页处理-->
<div class="pdf-perView" id="pdf-perView">
<div class="pdf-perView" id="pdf-perView" v-loading="loading" element-loading-text="加载中">
<div class="pdf-box">
<transition name="progress">
<el-progress v-if="showProgress" :percentage="Math.floor(loadedRatio * 100)" :text-inside="true" :show-text="false"></el-progress>
@@ -30,16 +30,6 @@
<!-- <el-button type="primary" @click="clickMore()" >加载更多</el-button> -->
<span class="pag-text" @click="clickMore()" style="cursor: pointer;">加载更多</span>
</div>
<!-- <div v-if="likeBox" class="xcontent postfixt-bot">
<div class="postfixt-bot-box">
<div style="display:inline-block">
<interactBar :data="data" :type="3" :comments="false" :shares="true"></interactBar>
</div>
<div style="display:inline-block;margin: 0 20px;">
<el-button type="primary" @click="goTop()">返回顶部</el-button>
</div>
</div>
</div> -->
</div>
</template>
@@ -64,6 +54,7 @@ export default {
},
data() {
return {
loading:false,
src: "",
showPages: undefined,
totalPages:0,
@@ -79,6 +70,7 @@ export default {
mounted() {
// /case/demo.pdf
if(this.filePath){
this.loading = true;
this.loadInitPdf(this.filePath);
}
window.addEventListener(
@@ -129,6 +121,7 @@ export default {
let loadingTask = pdf.createLoadingTask(url);
this.src=loadingTask;
loadingTask.promise.then((pdf) =>{
this.loading = false;
this.totalPages=pdf.numPages;
if(pdf.numPages>this.initNum){
this.showPages = this.initNum;
@@ -136,6 +129,7 @@ export default {
this.showPages =pdf.numPages;
}
}).catch((err) =>{
this.loading = false;
this.$message.error("加载内容失败,请联系管理员");
});
},
@@ -157,15 +151,7 @@ export default {
if(this.isscroll){
this.showPages++
this.moreState = 2;
// this.debounce(this.loadInitPdf($this.filePath),5000);
// this.debounce(,200000);
}
// if(scrollTop > 400) {
// document.querySelector('#articleAnking').style.cssText = "position: fixed;top: 0;width:242.5px";
// } else {
// document.querySelector('#articleAnking').style.cssText = "position: static";
// }
},
debounce(func, wait) {// 非立即执行
let timeout;

View File

@@ -459,7 +459,6 @@ export default {
}
},
submitShare(){
if(this.shareUsers.length==0){
this.$message.error('请选择分享人');
return;
@@ -472,7 +471,7 @@ export default {
let postData={
objType:this.type,
objId:this.data.id,
content:'',
content:this.data.title,
isRead:false,
toAid:'',
toAname:'',

View File

@@ -369,7 +369,6 @@ export default {
};
},
mounted() {
//console.log(this.$Constants.fileBaseUrl,'fileBaseUrl地址');
this.getCourseData(1);
this.getCaseData();
this.getArticleData();
@@ -380,7 +379,6 @@ export default {
window.open('https://m.qingxuetang.com/x/?appId=qxtcorp306130','_blank');
},
toCourseDetail(item) {
if (item.type == 10) {
return this.webBaseUrl + '/course/micro?id=' + item.id;
} else if (item.type == 20) {