This commit is contained in:
nisen
2023-09-04 15:25:51 +08:00
parent e8469b0a34
commit fbf2b7e4b8
9 changed files with 396 additions and 317 deletions

View File

@@ -1,7 +1,8 @@
<template>
<div id="couser-list-content" class="couser-list-content">
<div class="course-banner">
<portal-header current="course" textColor="#fff" :keywords="keyword" @emitInput="emitInput" @showClass="showClass"></portal-header>
<portal-header current="course" textColor="#fff" :keywords="keyword" @emitInput="emitInput"
@showClass="showClass"></portal-header>
</div>
<div style="padding-top:30px">
<div class="xcontent2">
@@ -394,7 +395,7 @@
</template>
<!-- 线上品牌系列课程 -->
<template v-if="newData">
<div class="xcourse-card" style="margin-bottom: 0;margin-top: 36px;" v-for="(cinfo, cidx) in courseList" :key="cinfo.id">
<div class="xcourse-card" v-for="cinfo in courseList" :key="cinfo.id" style="margin-bottom: 0;margin-top: 36px;">
<div class="course-card" style="padding: 10px;">
<a @click="() => $message.success('如需了解详情请联系BOEU')">
<div class="course-img-box">
@@ -615,7 +616,7 @@ export default {
oneList: [], //一级分类{type:11}
twoList: [], //二级分类{type:12}
threeList: [],//三级分类{type:13}
searching:false,//是否正在搜索中
searching: false,//是否正在搜索中
resonimg: {},
formatDate,
@@ -631,7 +632,7 @@ export default {
// 查询信息
course: {
orderField: "studys",
companyId:'',
companyId: '',
keyword: '',//关键词
topOrder: true,
orderAsc: false,
@@ -666,12 +667,12 @@ export default {
created() {
let localKey = "user_" + this.userInfo.sysId + "_gids";
apiUserbasic.getInAudienceIds().then(rs => {
if (rs.status == 200) {
this.audiences = rs.result;
sessionStorage.setItem(localKey, this.audiences);
} else {
console.log(rs.message);
}
if (rs.status == 200) {
this.audiences = rs.result;
sessionStorage.setItem(localKey, this.audiences);
} else {
console.log(rs.message);
}
})
},
mounted() {
@@ -799,37 +800,37 @@ export default {
let hasData = sessionStorage.getItem(this.localSessionKey);
let $this = this;
if (hasData) {
let typeCodeList=JSON.parse(hasData);
typeCodeList.forEach(item=>{
if(item.type==0){
this.keyword=item.name;
}else if(item.type==1){
if(item.id==20){
$this.ctypeList[0].checked=true;
}else if(item.id==30){
$this.ctypeList[1].checked=true;
}else if(item.id==40){
$this.ctypeList[2].checked=true;
let typeCodeList = JSON.parse(hasData);
typeCodeList.forEach(item => {
if (item.type == 0) {
this.keyword = item.name;
} else if (item.type == 1) {
if (item.id == 20) {
$this.ctypeList[0].checked = true;
} else if (item.id == 30) {
$this.ctypeList[1].checked = true;
} else if (item.id == 40) {
$this.ctypeList[2].checked = true;
}
} else { //三级分类的处理,如果一个分类选中多个,显示哪个,显示第一个,是否可以
this.oneList.forEach(one => {
if (one.id == item.id && item.type == '11') {
this.navTitle = [{ ...one }]
one.checked = true
}
}else{ //三级分类的处理,如果一个分类选中多个,显示哪个,显示第一个,是否可以
this.oneList.forEach(one => {
if(one.id == item.id && item.type == '11'){
this.navTitle = [{ ...one }]
one.checked = true
one.children.forEach(two => {
if (two.id == item.id && item.type == '12') {
this.navTitle = [{ ...one }, { ...two }]
two.checked = true
}
one.children.forEach(two => {
if(two.id == item.id && item.type == '12'){
this.navTitle = [{ ...one }, { ...two }]
two.checked = true
}
two.children.forEach(three => {
if(three.id == item.id && item.type == '13'){
this.navTitle = [{ ...one }, { ...two }, { ...three }]
three.checked = true
}
})
two.children.forEach(three => {
if (three.id == item.id && item.type == '13') {
this.navTitle = [{ ...one }, { ...two }, { ...three }]
three.checked = true
}
})
})
})
}
})
}
@@ -1010,16 +1011,16 @@ export default {
// });
// }
// })
this.oneList.forEach(one=>{
if(one.checked){
one.children.forEach(two=>{
$this.twoList.push(two);
if(two.checked){
two.children.forEach(three=>{
$this.threeList.push(three);
})
}
});
this.oneList.forEach(one => {
if (one.checked) {
one.children.forEach(two => {
$this.twoList.push(two);
if (two.checked) {
two.children.forEach(three => {
$this.threeList.push(three);
})
}
});
}
})
},
@@ -1318,11 +1319,11 @@ export default {
// 查询
async search() {
//
if(this.searching){
if (this.searching) {
this.$message.warning("正在搜索中,请待搜索完成后再重新搜索");
return;
}
this.searching=true;
this.searching = true;
//测试时间格式化
// let s=1650973801;
// var d = new Date(1650973801*1000);
@@ -1370,11 +1371,11 @@ export default {
let isTopList = [];
// 隐藏loadMore
this.moreState = 2;
await apiCoursePortal.courseSearch(this.course).then(res => {
this.searching=false;
if (res.status == 200) {
this.totalPages = res.result.totalPages;
res.result.list.forEach(item => {
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('-');
@@ -1407,50 +1408,50 @@ export default {
if (this.newData) {
this.courseList = [
{
audiences: "",
companyId: "",
coverImg: "",
createdAt: "",
device: 3,
domainIds: "",
duration: 7,
endTime: "",
esId: "Z4LAbYkBfn0lSHQ9acXX",
id: "1091051270927183872",
isSetAudience: 0,
isTop: 0,
keywords: "回归,新建,在线,课程",
keywordsList: ['回归', '新建', '在线', '课程'],
maxDuration: "",
name: "人力资源知识技能晋升(人力资源总监空降现场,为各位答疑解惑",
openCourse: 0,
openEnroll: 0,
orderType: "",
publishTime: 1689748779,
resOwner: "",
score: 5,
source: 2,
startTime: "",
studies: 2,
studiesFormat: "",
summary: "",
sysType1: "966458733088919552",
sysType2: "966459050400600064",
sysType3: "1060578278816509959",
tags: "",
teacher: "张学智",
teacherCode: "",
title: "BOE",
topTime: "",
type: 20,
types: "",
remark: '备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备'
audiences: "",
companyId: "",
coverImg: "",
createdAt: "",
device: 3,
domainIds: "",
duration: 7,
endTime: "",
esId: "Z4LAbYkBfn0lSHQ9acXX",
id: "1091051270927183872",
isSetAudience: 0,
isTop: 0,
keywords: "回归,新建,在线,课程",
keywordsList: ['回归', '新建', '在线', '课程'],
maxDuration: "",
name: "人力资源知识技能晋升(人力资源总监空降现场,为各位答疑解惑",
openCourse: 0,
openEnroll: 0,
orderType: "",
publishTime: 1689748779,
resOwner: "",
score: 5,
source: 2,
startTime: "",
studies: 2,
studiesFormat: "",
summary: "",
sysType1: "966458733088919552",
sysType2: "966459050400600064",
sysType3: "1060578278816509959",
tags: "",
teacher: "张学智",
teacherCode: "",
title: "BOE",
topTime: "",
type: 20,
types: "",
remark: '备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备'
},
]
}
this.count = res?.result?.count
if(this.newData) {
this.count = 1
if (this.newData) {
this.count = 1
}
this.moreState = 3
} else {
@@ -1553,9 +1554,10 @@ export default {
</script>
<style scoped lang="scss">
.couser-list-content{
.couser-list-content {
min-height: 110%;
}
// 标题
.navTitle {
margin-bottom: 20px;
@@ -2388,5 +2390,4 @@ export default {
.option-active {
color: #387DF7;
}
</style>
}</style>