This commit is contained in:
daihh
2022-06-08 17:27:07 +08:00
2 changed files with 68 additions and 14 deletions

View File

@@ -29,7 +29,7 @@
<el-input v-show="!hideSearch" placeholder="请输入关键词搜索" style="width: 260px;" @keyup.enter.native="searchJump()" clearable maxlength="20" v-model="keyword" class="input-with-select">
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px;" slot="prepend" placeholder="请选择">
<el-option label="课程" value="1"></el-option>
<!-- <el-option label="案例" value="2"></el-option> -->
<el-option label="案例" value="2"></el-option>
<el-option label="文章" value="3"></el-option>
<el-option label="问答" value="4"></el-option>
<!-- <el-option label="专区" value="5"></el-option> -->
@@ -51,7 +51,7 @@
<div v-else class="uavatar">
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../public/images/Avatarwoman.png" alt=""></div>
</div>
</a>
@@ -114,7 +114,7 @@ export default {
computed: {
...mapGetters(['userInfo', 'userMsg']),
avatarText(){
return userAvatarText(this.userInfo.name);
}
@@ -335,7 +335,7 @@ export default {
font-size: 25px !important;
margin: 0 !important;
padding: 0 !important
}
}
.message-count a {
color: #858d99;
font-size: 24px;
@@ -357,7 +357,7 @@ export default {
border-radius: 50%;
img{
border-radius: 50%;
width: 40px;
height: 40px;
}

View File

@@ -18,13 +18,14 @@
</el-row>
<el-tabs v-model="tabName" @tab-click="changeTab" style="margin-top:14px">
<!-- 全部 -->
<!-- <el-tab-pane label="全部" name="all">
<el-tab-pane label="全部" name="all">
<div v-for="(item, index) in dataList.list">
<course-items v-if="item.objType==1" :items="[item]" @confirm="confirm"></course-items>
<article-items v-if="item.objType==2" @confirm="confirm" :items="[item]"></article-items>
<qa-items v-if="item.objType==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
<course-items type="toMy" v-if="item.type==1" :items="[item]" @confirm="confirm"></course-items>
<case-items type="toMy" v-if="item.type==3" :items="[item]" @confirm="confirm" ></case-items>
<article-items type="toMy" v-if="item.type==2" @confirm="confirm" :items="[item]"></article-items>
<qa-items type="toMy" v-if="item.type==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
</div>
v-if="courseList.count>courseList.pageSize"
<!-- v-if="courseList.count>courseList.pageSize" -->
<div style="text-align: center;margin-top:57px">
<el-pagination
background
@@ -37,9 +38,7 @@
:total="dataList.count"
></el-pagination>
</div>
</el-tab-pane> -->
</el-tab-pane>
<el-tab-pane label="课程" name="course">
<div style="min-height: 500px;">
<course-items :keyword="keyword" type="toMy" @confirm="confirm" :items="courseList.list"></course-items>
@@ -155,7 +154,7 @@ export default {
return {
isSearh:false,
isRead: '',
tabName: 'course',
tabName: 'all',
keyword: '',
courseIndex: null,
qaIndex: null,
@@ -198,6 +197,7 @@ export default {
this.qaList.pageIndex = 1;
this.articleList.pageIndex = 1;
this.courseList.pageIndex = 1;
this.dataList.pageIndex = 1;
this.isSearh= true;
if (this.tabName == 'qa') {
this.findQa();
@@ -211,6 +211,9 @@ export default {
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'all') {
this.findAll();
}
},
resData() {
@@ -219,6 +222,7 @@ export default {
this.qaList.pageIndex = 1;
this.articleList.pageIndex = 1;
this.courseList.pageIndex = 1;
this.dataList.pageIndex = 1;
this.queryData();
this.isSearh= false;
},
@@ -249,6 +253,9 @@ export default {
if (tab.name == 'case') {
this.findCase();
}
if (tab.name == 'all') {
this.findAll();
}
},
//分页点击事件
handleSizeChange(value) {
@@ -268,6 +275,10 @@ export default {
this.caseList.pageSize = value;
this.findCase()
}
if (this.tabName == 'all') {
this.dataList.pageSize = value;
this.findAll()
}
},
//分页点击事件
handleCurrentChange(value) {
@@ -287,8 +298,39 @@ export default {
this.caseList.pageIndex = value;
this.findCase();
}
if (this.tabName == 'all') {
this.dataList.pageIndex = value;
this.findAll();
}
},
findAll(){
let { pageIndex, pageSize } = this.dataList;
let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead };
apiShares.findShareMe(query).then(res=>{
if(res.status == 200) {
this.dataList.count = res.result.count;
res.result.list.forEach(item => {
if(item.type == 4) {
item.question = {isResolve:false,title:'',content:'',bestAnswer:''};
item.question.isResolve=item.isResolve;
item.question.title=item.title;
item.question.content=item.content;
item.question.bestAnswer=item.bestAnswer;
}
if(item.type == 3){
item.cases = {title:'',summary:''};
item.cases.title=item.title;
item.cases.title=item.summary;
}
});
this.dataList.list = res.result.list;
} else {
this.$message.error(res.message);
}
})
},
// 案例
findCase(){
let { pageIndex, pageSize } = this.caseList;
@@ -396,6 +438,12 @@ export default {
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'all') {
this.findAll();
}
}
},
mounted() {
@@ -408,6 +456,12 @@ export default {
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'all') {
this.findAll();
}
}
};