diff --git a/.env.development b/.env.development index dd15e68b..89df411e 100644 --- a/.env.development +++ b/.env.development @@ -14,7 +14,7 @@ VUE_APP_BOE_WEB_URL = 'https://u.boe.com' VUE_APP_BOE_MOBILE_URL = 'http://192.168.0.10:8082/mobile' # File路径的基础url -VUE_APP_FILE_BASE_URL = 'http://localhost:8091/upload' +VUE_APP_FILE_BASE_URL = 'http://192.168.0.10:9090/cdn/upload' # File路径的基础url的相对路径,加此项是为了不影响之前的路径配置 VUE_APP_FILE_RELATIVE_PATH = '/upload' diff --git a/.gitignore b/.gitignore index acd58038..07e6e472 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -node_modules -node_modules -/dist +/node_modules diff --git a/src/api/modules/cases.js b/src/api/modules/cases.js index 0023e0c5..874fd257 100644 --- a/src/api/modules/cases.js +++ b/src/api/modules/cases.js @@ -3,7 +3,7 @@ import ajax from '@/utils/xajax.js' /**首页查询 * pageSize - * orderField + * orderField * orderAsc */ const indexList = function(query) { diff --git a/src/api/modules/dict.js b/src/api/modules/dict.js index b1252481..6e2b05bb 100644 --- a/src/api/modules/dict.js +++ b/src/api/modules/dict.js @@ -8,7 +8,7 @@ const items=function(key){ return ajax.get('/xboe/m/dictionary/items?key='+key); } -// 修改 +// 修改 //@param key 对应字段后缀 // // 案例的组织机构字典 org_domain key diff --git a/src/api/modules/favorites.js b/src/api/modules/favorites.js index 1273fcf2..165bc5c1 100644 --- a/src/api/modules/favorites.js +++ b/src/api/modules/favorites.js @@ -34,7 +34,7 @@ const casePageList=function(query){ /*分页查询 收藏的文章信息 *@param {Object} query @param Integer type 根据什么类型搜索,这块暂时不传 - @param pageIndex 第几页 pageSize 每页展示多少行 + @param pageIndex 第几页 pageSize 每页展示多少行 keyword:对应关键字查询 */ const articlePageList=function(query){ @@ -45,7 +45,7 @@ const articlePageList=function(query){ @param Integer type 根据什么类型搜索,暂时不传 @param pageIndex 第几页 pageSize 每页展示多少行 keyword:对应关键字查询 - + */ const coursePageList=function(query){ return ajax.post('/xboe/m/favorite/mycourselist',query); @@ -85,16 +85,23 @@ const has=function(objType,objId){ */ const findAll=function(query){ return ajax.post('/xboe/m/favorite/findAll',query); -} +} /* 我的收藏 全部 @param pageIndex 第几页 @param pageSize 每页行数 -@param keyword 关键字 +@param keyword 关键字 */ const queryAll=function(query){ return ajax.post('/xboe/m/favorite/queryAll',query); } +/** + * 查看是否已收藏 批量 + * @param {问答或者文章或者课程的id数组} data + * */ +const isNoFavorite=function(date){ + return ajax.postJson('/xboe/m/favorite/isNoFavorite',data); +} export default{ has, @@ -107,5 +114,6 @@ export default{ articlePageList, coursePageList, findAll, - queryAll + queryAll, + isNoFavorite } diff --git a/src/api/modules/shares.js b/src/api/modules/shares.js index 9af4635a..2dad7837 100644 --- a/src/api/modules/shares.js +++ b/src/api/modules/shares.js @@ -33,7 +33,7 @@ const remove=function(objId,objType){ // toAname 分享给人的名称 // const querylist=function(query){ - return ajax.post('/xboe/m/share/list',data); + return ajax.post('/xboe/m/share/list',query); } // 当前用户是否已分享 // // objType,点赞对象类型,, 1课程 2文章,3案例, 4问答 @@ -112,7 +112,7 @@ const mymearticlelist=function(query){ */ const updateIsRead=function(id){ return ajax.get(`/xboe/m/share/updateIsRead?id=${id}`); -} +} /* 撤回分享 @@ -121,6 +121,49 @@ const updateIsRead=function(id){ const deleteshares=function(id){ return ajax.get(`/xboe/m/share/delete-shares?id=${id}`); } +/** + * 我分享的全部 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param keyword 关键字搜索 + * @param isRead 是否已读 + * */ +const findMeShare=function (query){ + return ajax.post('/xboe/m/share/findMeShare',query); +} +/** + * 分享给我的全部 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param keyword 关键字搜索 + * @param isRead 是否已读 + * */ +const findShareMe=function (query){ + return ajax.post('/xboe/m/share/findShareMe',query); +} + +/** + * 我分享的案例 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param isRead 是否已读 + * @param keyword 关键字搜索 + * */ +const myCaseList=function (query){ + return ajax.post('/xboe/m/share/myCaseList',query); +} +/** + * 分享给我的案例 + * @param pageIndex 第几页 + * @param pageSize 每页多少行 + * @param isRead 是否已读 + * @param keyword 关键字搜索 + * */ +const myMeCaseList=function (query){ + return ajax.post('/xboe/m/share/myMeCaseList',query); +} +/** + * */ export default{ save, has, @@ -134,5 +177,9 @@ const deleteshares=function(id){ mymecourselist, mymearticlelist, updateIsRead, - deleteshares + deleteshares, + findMeShare, + findShareMe, + myCaseList, + myMeCaseList } diff --git a/src/components/Case/caseItems.vue b/src/components/Case/caseItems.vue new file mode 100644 index 00000000..8290103a --- /dev/null +++ b/src/components/Case/caseItems.vue @@ -0,0 +1,168 @@ + + + \ No newline at end of file diff --git a/src/components/Course/collectItem.vue b/src/components/Course/collectItem.vue index 1facdb19..80bbe847 100644 --- a/src/components/Course/collectItem.vue +++ b/src/components/Course/collectItem.vue @@ -135,7 +135,7 @@ export default { .one-line-ellipsis{ display: -webkit-box; white-space:pre-wrap; - word-wrap: break-word; + // word-wrap: break-word; word-break:break-all; overflow: hidden; text-overflow:ellipsis; diff --git a/src/components/PdfPreview/view.vue b/src/components/PdfPreview/view.vue index a038f5fa..6f25b874 100644 --- a/src/components/PdfPreview/view.vue +++ b/src/components/PdfPreview/view.vue @@ -26,12 +26,12 @@ @link-clicked="currentPage = $event"> --> - @@ -59,21 +59,33 @@ export default { src: "", showPages: undefined, totalPages:0, + initNum:3, scale: 100, //放大系数 loadedRatio:0,// 加载进度 showProgress:true, + moreState:1,// 1 加载更多 2 加载中 3无数据 + isscroll:false, + pdfpage:0, }; }, mounted() { // /case/demo.pdf - let pdfPath=this.$Constants.fileBaseUrl+'/case/demo.pdf'; - this.loadInitPdf(pdfPath); - //this.initSrc(this.filePath); + if(this.filePath){ + this.loadInitPdf(this.filePath); + } + window.addEventListener( + "scroll", + this.handleScroll + ); + }, + beforeDestroy(){ + window.removeEventListener("scroll",this.handleScroll); }, watch:{ filePath(newVal){ - //this.getNumPages(newVal); - this.initSrc(newVal); + if(newVal){ + this.loadInitPdf(newVal); + } }, loadedRatio(newVal){ // 直接使用loadedRatio控制进度条没有加载效果 @@ -87,41 +99,88 @@ export default { }, methods: { loadProgress(e){ - console.log(e,'loadProgress'); + console.log(e,'loadProgress'); }, loadedPageHandle(e){ - console.log(e,'loadedPageHandle'); + console.log(e,'loadedPageHandle'); + this.pdfpage = e; + }, loadPdfHandle(e){ - console.log(e,'loadPdfHandle'); + console.log(e,'loadPdfHandle'); }, clickMore(){ if(this.totalPages>this.showPages){ - this.showPages++; + this.showPages++; } - }, + this.isscroll = true; + + }, //加载页面 loadInitPdf(url) { + if(url && url.indexOf('.pdf')>-1){ let loadingTask = pdf.createLoadingTask(url); this.src=loadingTask; + loadingTask.promise.then((pdf) =>{ + console.log(pdf) this.totalPages=pdf.numPages; - if(pdf.numPages>3){ - this.showPages = 3; - }else{ + + + if(pdf.numPages>this.initNum){ + this.showPages = this.initNum; + + } else{ this.showPages =pdf.numPages; + } + + }).catch((err) =>{ this.$message.error("加载内容失败,请联系管理员"); }); + } }, - initSrc(url){ - if(url && url.indexOf('.pdf')>-1){ - //this.src = url; + + handleScroll() { + let el_anking = document.querySelector('#case-list-content'); + let innerHeight = document.querySelector('#pdf-perView').clientHeight + let outerHeight = document.documentElement.clientHeight + let scrollTop = document.documentElement.scrollTop + + if(this.isscroll){ + this.showPages++; + this.debounce(this.loadInitPdf(),5000); + } - }, + // console.log(this.pdfpage,'000') + // console.log(this.totalPages,this.pdfpage) + if(this.pdfpage >= this.totalPages){ + this.isscroll = false + this.moreState = 3 + // console.log('hcuewhf') + } + // 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; + return function () { + let context = this; + let args = arguments; + if (timeout) clearTimeout(timeout); + timeout = setTimeout(() => { + func.apply(context, args) + }, wait); + } +}, prePage(type) { if (this.currentPage > 1) { this.currentPage--; diff --git a/src/components/Portal/comments.vue b/src/components/Portal/comments.vue index 4c271309..cdfcdc6c 100644 --- a/src/components/Portal/comments.vue +++ b/src/components/Portal/comments.vue @@ -4,12 +4,12 @@
评论 {{total}}条 只看作者 - {{value?'查看所有':'只看案主'}} + {{value?'查看所有':'只看案主 @案主可以给他发私信哦'}}
-
+
@@ -320,6 +320,7 @@ this.loadData(); }, inputValue(val,oldVal) { + console.log("333333"); let fu = val.substr(-1); if(fu == '@'&&!oldVal) { this.toUserId = ''; diff --git a/src/components/Portal/interactBar.vue b/src/components/Portal/interactBar.vue index 64933aca..1956870d 100644 --- a/src/components/Portal/interactBar.vue +++ b/src/components/Portal/interactBar.vue @@ -43,7 +43,7 @@
- + {{ data.views}}
@@ -238,21 +238,25 @@ export default { }) }, checkHas(){ - if(this.type>0){ - apiPraises.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isPraise=true; - }else{ - this.isPraise=false; - } - }); - apiFavorites.has(this.type,this.data.id).then(rs=>{ - if(rs.status==200 && rs.result){ - this.isFavorite=true; - }else{ - this.isFavorite=false; - } - }) + if(this.type>0 && !this.readonly && this.data.id){ + if(this.favorites){ + apiFavorites.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isFavorite=true; + }else{ + this.isFavorite=false; + } + }) + } + if(this.praises){ + apiPraises.has(this.type,this.data.id).then(rs=>{ + if(rs.status==200 && rs.result){ + this.isPraise=true; + }else{ + this.isPraise=false; + } + }); + } } }, addShare(){ diff --git a/src/components/UserCenter/menu.vue b/src/components/UserCenter/menu.vue index 26cb9bba..8ce03334 100644 --- a/src/components/UserCenter/menu.vue +++ b/src/components/UserCenter/menu.vue @@ -78,10 +78,10 @@ 教师管理 - + 受众管理 diff --git a/src/icons/svg/browse.svg b/src/icons/svg/browse.svg new file mode 100644 index 00000000..e941b0b0 --- /dev/null +++ b/src/icons/svg/browse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layout/components/TopNav/Index.vue b/src/layout/components/TopNav/Index.vue index 5b473688..e7c7bfc0 100644 --- a/src/layout/components/TopNav/Index.vue +++ b/src/layout/components/TopNav/Index.vue @@ -9,7 +9,7 @@
- +
diff --git a/src/views/Index.vue b/src/views/Index.vue index 786fb40c..10370e6f 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -105,6 +105,47 @@
+
+ +
+
+ + 推荐案例 + + 最热 + 最新 + + 更多 > +
+
+
+
+ +
+
+ {{ca.sysCreateTime.substring(0,10)}} +
+ + + {{ca.title}} + +
+ {{ca.summary}} +
+
+
+ + +
+
+
+
+
+ +
+ +
+
+
@@ -313,7 +355,7 @@ export default { list: [] }, caseList: { - num: 4, + num: 6, orderType: 2, list: [] }, @@ -430,6 +472,7 @@ export default { let userIds = []; res.result.forEach(item => { item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null }; + if (item.authorId && item.authorId != '') { userIds.push(item.authorId); } @@ -583,6 +626,61 @@ export default {