mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
课程和案例本地存储
This commit is contained in:
@@ -153,6 +153,10 @@ export default {
|
|||||||
goSearch:{
|
goSearch:{
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
|
},
|
||||||
|
keywords:{
|
||||||
|
type:String,
|
||||||
|
default:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -170,6 +174,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
keywords(newval){
|
||||||
|
console.log(newval,9999);
|
||||||
|
if(this.findType == '1'){
|
||||||
|
this.keyword = newval
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupConfig:{},
|
popupConfig:{},
|
||||||
|
|||||||
@@ -1073,7 +1073,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getCaseData() {
|
async getCaseData() {
|
||||||
// this.saveLocalFilters();//存储本地刷新有记录
|
this.saveLocalFilters();//存储本地刷新有记录
|
||||||
let majorTypeList = [];
|
let majorTypeList = [];
|
||||||
let allFielclass = JSON.parse(JSON.stringify(this.getAllFielclass()));
|
let allFielclass = JSON.parse(JSON.stringify(this.getAllFielclass()));
|
||||||
// 获取树状id
|
// 获取树状id
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="couser-list-content" class="couser-list-content">
|
<div id="couser-list-content" class="couser-list-content">
|
||||||
<div class="course-banner">
|
<div class="course-banner">
|
||||||
<portal-header current="course" textColor="#fff" @emitInput="emitInput" @showClass="showClass"></portal-header>
|
<portal-header current="course" textColor="#fff" :keywords="keyword" @emitInput="emitInput" @showClass="showClass"></portal-header>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top:30px">
|
<div style="padding-top:30px">
|
||||||
<div class="xcontent2">
|
<div class="xcontent2">
|
||||||
@@ -714,38 +714,38 @@ export default {
|
|||||||
// this.toCourseDetail(item);
|
// this.toCourseDetail(item);
|
||||||
// this.orderChange(id);
|
// this.orderChange(id);
|
||||||
//查询排行榜,页面打开只查询一次
|
//查询排行榜,页面打开只查询一次
|
||||||
let localKey = "user_" + this.userInfo.sysId + "_gids";
|
// let localKey = "user_" + this.userInfo.sysId + "_gids";
|
||||||
if (this.audiences.length == 0) {
|
// if (this.audiences.length == 0) {
|
||||||
//let hasIds;
|
// //let hasIds;
|
||||||
let hasIds = sessionStorage.getItem(localKey);
|
// let hasIds = sessionStorage.getItem(localKey);
|
||||||
if (hasIds && hasIds.length > 0) {
|
// if (hasIds && hasIds.length > 0) {
|
||||||
this.audiences = hasIds.split(",");
|
// this.audiences = hasIds.split(",");
|
||||||
this.search();
|
|
||||||
} else {
|
|
||||||
apiUserbasic.getInAudienceIds().then(rs => {
|
|
||||||
if (rs.status == 200) {
|
|
||||||
this.audiences = rs.result;
|
|
||||||
sessionStorage.setItem(localKey, this.audiences);
|
|
||||||
} else {
|
|
||||||
console.log(rs.message);
|
|
||||||
}
|
|
||||||
this.search();
|
|
||||||
})
|
|
||||||
// Promise.all([apiOldCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
|
||||||
// //console.log(rs,'rs');
|
|
||||||
// let aids=[];
|
|
||||||
// if(rs[0].status==200){
|
|
||||||
// aids.push(rs[0].result);
|
|
||||||
// }
|
|
||||||
// if(rs[1].status==200){
|
|
||||||
// aids.push(rs[1].result);
|
|
||||||
// }
|
|
||||||
// this.audiences=aids;
|
|
||||||
// sessionStorage.setItem(localKey,this.audiences);
|
|
||||||
// this.search();
|
// this.search();
|
||||||
|
// } else {
|
||||||
|
// apiUserbasic.getInAudienceIds().then(rs => {
|
||||||
|
// if (rs.status == 200) {
|
||||||
|
// this.audiences = rs.result;
|
||||||
|
// sessionStorage.setItem(localKey, this.audiences);
|
||||||
|
// } else {
|
||||||
|
// console.log(rs.message);
|
||||||
|
// }
|
||||||
|
// // this.search();
|
||||||
// })
|
// })
|
||||||
}
|
// // Promise.all([apiOldCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
||||||
}
|
// // //console.log(rs,'rs');
|
||||||
|
// // let aids=[];
|
||||||
|
// // if(rs[0].status==200){
|
||||||
|
// // aids.push(rs[0].result);
|
||||||
|
// // }
|
||||||
|
// // if(rs[1].status==200){
|
||||||
|
// // aids.push(rs[1].result);
|
||||||
|
// // }
|
||||||
|
// // this.audiences=aids;
|
||||||
|
// // sessionStorage.setItem(localKey,this.audiences);
|
||||||
|
// // this.search();
|
||||||
|
// // })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//this.searchterm();//搜索词已经没有了
|
//this.searchterm();//搜索词已经没有了
|
||||||
this.couresreso();//广告位
|
this.couresreso();//广告位
|
||||||
@@ -799,22 +799,39 @@ export default {
|
|||||||
let hasData = sessionStorage.getItem(this.localSessionKey);
|
let hasData = sessionStorage.getItem(this.localSessionKey);
|
||||||
let $this = this;
|
let $this = this;
|
||||||
if (hasData) {
|
if (hasData) {
|
||||||
// let typeCodeList=JSON.parse(hasData);
|
let typeCodeList=JSON.parse(hasData);
|
||||||
// typeCodeList.forEach(item=>{
|
typeCodeList.forEach(item=>{
|
||||||
// if(item.type==0){
|
if(item.type==0){
|
||||||
// this.keyword=item.name;
|
this.keyword=item.name;
|
||||||
// }else if(item.type==1){
|
}else if(item.type==1){
|
||||||
// if(item.id==20){
|
if(item.id==20){
|
||||||
// $this.ctypeList[0].checked=true;
|
$this.ctypeList[0].checked=true;
|
||||||
// }else if(item.id==30){
|
}else if(item.id==30){
|
||||||
// $this.ctypeList[1].checked=true;
|
$this.ctypeList[1].checked=true;
|
||||||
// }else if(item.id==40){
|
}else if(item.id==40){
|
||||||
// $this.ctypeList[2].checked=true;
|
$this.ctypeList[2].checked=true;
|
||||||
// }
|
}
|
||||||
// }else{ //三级分类的处理,如果一个分类选中多个,显示哪个,显示第一个,是否可以
|
}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
|
||||||
|
}
|
||||||
|
two.children.forEach(three => {
|
||||||
|
if(three.id == item.id && item.type == '13'){
|
||||||
|
this.navTitle = [{ ...one }, { ...two }, { ...three }]
|
||||||
|
three.checked = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//搜索条件
|
//搜索条件
|
||||||
@@ -880,6 +897,7 @@ export default {
|
|||||||
this.threeList = [];
|
this.threeList = [];
|
||||||
this.navTitle = [];
|
this.navTitle = [];
|
||||||
this.newData = false;
|
this.newData = false;
|
||||||
|
sessionStorage.removeItem(this.localSessionKey)
|
||||||
this.searchData();
|
this.searchData();
|
||||||
},
|
},
|
||||||
// 导航切换(录播课,线下课,学习项目)
|
// 导航切换(录播课,线下课,学习项目)
|
||||||
@@ -1057,11 +1075,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
$this.oneList.push(newItem);
|
$this.oneList.push(newItem);
|
||||||
console.log(newItem);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.loadLocalFilters();
|
this.loadLocalFilters();
|
||||||
|
this.search()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user