-
-
{{ toScore(cinfo.score) }}分
+
+ {{ toScore(cinfo.courseScore) }}分
未评分
@@ -207,7 +216,7 @@
暂无课程,请优先学习其它课程吧~
@@ -271,14 +280,10 @@ import portalFooter from "@/components/PortalFooter.vue";
import portalFloatTools from "@/components/PortalFloatTools.vue";
import authorInfo from "@/components/Portal/authorInfo.vue";
import courseItem from "@/components/Portal/course/courseItem.vue";
-import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiCourseStudy from "@/api/modules/courseStudy.js";
import courseForm from "@/components/Course/courseForm.vue";
import apiType from "@/api/modules/type.js";
import apiCourse from "@/api/modules/coursePortal.js";
-import apiOldCourse from "@/api/boe/course.js";
-import apiTeacher from "@/api/modules/teacher.js";
-import apiUser from "@/api/system/user.js";
import scene from "@/api/modules/scene.js";
import apiUserbasic from "@/api/boe/userbasic.js";
import interactBar from "@/components/Portal/interactBar.vue";
@@ -287,6 +292,7 @@ import { courseType, getType, toScore, formatDate, formatUserNumber, formatDateB
import { deepClone, param } from "../../../utils";
import apiSearchterm from "@/api/modules/searchterm.js";
import apiPlace from "@/api/phase2/place.js"
+import {qualityCourseTimeMark, qualityPageList} from "@/api/phase2"
export default {
name: "index",
components: {
@@ -387,6 +393,8 @@ export default {
},
data() {
return {
+ yearChosen: [],
+ years: [],
newData: false,//线上品牌系列隐藏
navTitle: [],
// 设置高亮
@@ -394,9 +402,9 @@ export default {
count: 0,//分页总条条数
showUClass: false,
ctypeList: [
- { type: 1, id: 20, name: '录播课', checked: false },
- { type: 1, id: 30, name: '线下课', checked: false },
- { type: 1, id: 40, name: '学习项目', checked: false },
+ { type: 1, id: 0, name: '全部', checked: true },
+ { type: 1, id: 1, name: '内部专享', checked: false },
+ { type: 1, id: 2, name: '外部精选', checked: false },
],
id: '',
oneList: [], //一级分类{type:11}
@@ -417,7 +425,7 @@ export default {
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
// 查询信息
course: {
- orderField: "studys",
+ orderField: "DEFAULT",
companyId: '',
keyword: '',//关键词
topOrder: true,
@@ -463,6 +471,11 @@ export default {
})
},
mounted() {
+
+ qualityCourseTimeMark().then(response=>{
+ console.log(`qualityCourseTimeMark`, response)
+ this.years = response.data.result
+ })
let screenWidth = window.screen.availWidth;
// if (screenWidth < 1280) {
// this.course.pageSize = 9;
@@ -691,13 +704,12 @@ export default {
},
// 导航切换(录播课,线下课,学习项目)
handleTypeClick(item, list) {
- item.checked = !item.checked;
+ // item.checked = !item.checked;
//使用上面一行是可以多选,使用下面是单选
- // list.forEach(row=>{
- // row.checked=false;
- // })
- // item.checked=true;
-
+ list.forEach(row=>{
+ row.checked=false;
+ })
+ item.checked=true;
this.searchData();
},
//三级分类
@@ -1105,7 +1117,7 @@ export default {
return list;
},
// 查询
- async search() {
+ async search () {
//
if (this.searching) {
this.$message.warning("正在搜索中,请待搜索完成后再重新搜索");
@@ -1160,40 +1172,51 @@ export default {
// 隐藏loadMore
this.moreState = 2;
this.course.userId = this.userInfo.aid
- await apiCoursePortal.courseSearch(this.course).then(res => {
- this.searching = false;
- if (res.status == 200) {
- this.totalPages = res.result.totalPages;
- res.result.list.forEach(item => {
- if (item.startTime != '') {
- item.startTime = formatDateByFmt(new Date(item.startTime * 1000), 'yyyy-MM-dd hh:mm')
- //let time = item.startTime.split('-');
- //item.startTime = `${time[0]}年${time[1]}月${time[2]}日`
- }
- //教师转化
- if (item.teacher) {
- item.teacher = item.teacher.split(',').filter(itemValue => itemValue !== 'BOE教师').join(',');
- // if (dotIdx > 0) {
- // item.teacher = item.teacher.substring(0, dotIdx);
- // }
- }
- if (item.teacher && item.teacher == 'BOE教师') {
- item.teacher = '';
- }
- //转化标红显示
- item.title = item.name;
- if (that.course.keyword) {
- item.name = that.brightenKeyword(item.name, that.course.keyword);
- item.keywordsActive = that.brightenKeywords(item.keywordsList, that.course.keyword)
- console.log(item.keywordsActive);
- } else {
- item.name = item.name;
- }
- });
-console.log(res.result.list,'data')
- this.courseList = res?.result?.list ?? []
- console.log(this.courseList);
+ // 请求参数预处理
+ const params = JSON.parse(JSON.stringify(this.course))
+ // 清除多余的参数
+ const {pageIndex, orderField} = params
+ params.pageNum = pageIndex
+ params.orderByType = orderField
+ params.courseSource = this.ctypeList.findIndex(e=>e.checked)
+ this.yearChosen.length && (params.years = this.yearChosen)
+ params.courseName = this.keyword
+
+ await qualityPageList(params).then(res=>{
+ this.searching = false;
+ console.log(res.status)
+ if (res.status === 200) {
+ this.totalPages = res.data.result.pages;
+ // res.result.list.forEach(item => {
+ // if (item.startTime != '') {
+ // item.startTime = formatDateByFmt(new Date(item.startTime * 1000), 'yyyy-MM-dd hh:mm')
+ // //let time = item.startTime.split('-');
+ // //item.startTime = `${time[0]}年${time[1]}月${time[2]}日`
+ // }
+ // //教师转化
+ // if (item.teacher) {
+ // item.teacher = item.teacher.split(',').filter(itemValue => itemValue !== 'BOE教师').join(',');
+ // // if (dotIdx > 0) {
+ // // item.teacher = item.teacher.substring(0, dotIdx);
+ // // }
+ // }
+ // if (item.teacher && item.teacher == 'BOE教师') {
+ // item.teacher = '';
+ // }
+ //
+ // //转化标红显示
+ // item.title = item.name;
+ // if (that.course.keyword) {
+ // item.name = that.brightenKeyword(item.name, that.course.keyword);
+ // item.keywordsActive = that.brightenKeywords(item.keywordsList, that.course.keyword)
+ // console.log(item.keywordsActive);
+ // } else {
+ // item.name = item.name;
+ // }
+ // });
+
+ this.courseList = res.data.result.records ?? []
if (this.newData) {
this.courseList = [
{
@@ -1238,7 +1261,7 @@ console.log(res.result.list,'data')
},
]
}
- this.count = res?.result?.count
+ this.count = res.data.result.total
if (this.newData) {
this.count = 1
}
@@ -1338,6 +1361,11 @@ console.log(res.result.list,'data')
// this.$router.push(`/course/micro?id=${id}`);
// }
}
+ },
+ watch:{
+ yearChosen(){
+ this.searchData()
+ }
}
};