From 4ea2cc39fab35eae917962edf983c0e9c7ac03ec Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Tue, 7 Jun 2022 18:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/case/Index.vue | 48 ++++++++++++++++++++++-------- src/views/share/ToList.vue | 52 ++++++++++++++++++++++++++++++++- 2 files changed, 87 insertions(+), 13 deletions(-) diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index 189cc36d..e960fb8b 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -25,7 +25,7 @@
-
+
组织领域
@@ -45,7 +45,7 @@
-
+
专业分类
@@ -123,12 +123,17 @@
+
+ 加载更多 + 数据加载中 + 没有更多数据了 + 没有查询到相关内容 +
+
+
-
- 加载更多 - 没有更多数据了 -
+
@@ -268,6 +273,8 @@ export default { }, data() { return { + moreState:1,// 1 加载更多 2 加载中 3无数据 + isSeach:false, searchwd:true, showAll:true,//是否展开全部 searchRecords:[], @@ -312,13 +319,17 @@ export default { this.protocolDialogVisible = true; } this.keyWord = this.$route.query.keyword; + if(this.keyWord != '') { + this.isSeach = true; + } this.getAnkingData(); this.getPopularity(); this.searchterm(); this.getPositive(); this.getProfess(); this.getdomain(); - this.getCaseData(); + // this.getCaseData(); + this.search(); window.addEventListener( "scroll", this.handleScroll @@ -393,7 +404,6 @@ export default { let key ='org_domain' apiDict.items(key).then(res =>{ if(res.status==200){ - // console.log(res) this.domain = res.result } }) @@ -408,10 +418,11 @@ export default { }, emitInput(val) { this.keyWord=val; + this.isSeach =true; + this.queryCondition.pageIndex = 1 this.search() }, searchData(num) { - this.queryCondition.orderField = num; this.getCaseData(); }, @@ -473,9 +484,14 @@ export default { this.getTags(); let isTopList = []; let caseList = []; + if(this.queryCondition.pageIndex == 1) { + this.caseList.list =[]; + } + this.moreState = 2; await apiCase.queryList(this.queryCondition).then(res=>{ if(res.status==200){ if(res.result.list.length>0){ + this.isSeach =false; res.result.list.forEach(item=>{ item.isAll=false; item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null}; @@ -485,12 +501,17 @@ export default { caseList.push(item) } }) - if(this.queryCondition.pageIndex == 1) { - this.caseList.list =[]; - } + this.caseList.list.push(...isTopList,...caseList); this.caseList.count=res.result.count; this.getCaseUserData(res.result.list) + this.moreState = 1; + if(res.result.count === res.result.list.length) { + this.moreState = 3; + } + } else { + this.moreState = 3; + } }else{ this.$message.error(res.message); @@ -732,6 +753,9 @@ export default { .pagination-div { text-align: center; padding: 10px 0; + .pag-text{ + + } } .order-div { padding: 12px 15px; diff --git a/src/views/share/ToList.vue b/src/views/share/ToList.vue index 6878033f..8906d798 100644 --- a/src/views/share/ToList.vue +++ b/src/views/share/ToList.vue @@ -64,6 +64,30 @@
+ +
+ + +
+ +
+
+
+
没有查询到相关内容
+
暂无数据
+
+
+
+
@@ -180,6 +204,9 @@ export default { if (this.tabName == 'course') { this.findCourse(); } + if (this.tabName == 'case') { + this.findCase(); + } }, resData() { @@ -212,6 +239,9 @@ export default { if (tab.name == 'course') { this.findCourse(); } + if (tab.name == 'case') { + this.findCase(); + } }, //分页点击事件 handleSizeChange(value) { @@ -227,7 +257,10 @@ export default { this.courseList.pageSize = value; this.findCourse(); } - + if (this.tabName == 'case') { + this.caseList.pageSize = value; + this.findCase() + } }, //分页点击事件 handleCurrentChange(value) { @@ -243,8 +276,25 @@ export default { this.courseList.pageIndex = value; this.findCourse(); } + if (this.tabName == 'case') { + this.caseList.pageIndex = value; + this.findCase(); + } }, + // 案例 + findCase(){ + let { pageIndex, pageSize } = this.caseList; + let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead }; + apiShares.myCaseList(query).then(res=>{ + if(res.status == 200) { + this.caseList.count = res.result.count; + this.caseList.list = res.result.list; + } else { + this.$message.error(res.message); + } + }) + }, //问答数据查询 findQa() { let { pageIndex, pageSize } = this.qaList;