提交 47fdd782 authored 作者: matian's avatar matian

updates

上级 10217077
<template> <template>
<div> <div>
<div class="banner"> <div class="banner">
<div v-if="roadList && roadList.length">
<div v-for="(item, index) in list" :key="index" class="roadList"> <div v-for="(item, index) in list" :key="index" class="roadList">
<el-popover <el-popover
title="我的项目" title="我的项目"
...@@ -30,7 +29,6 @@ ...@@ -30,7 +29,6 @@
</div> </div>
</el-popover> </el-popover>
</div> </div>
</div>
<div class="homeList" v-if="homeList && homeList.length"> <div class="homeList" v-if="homeList && homeList.length">
<div class="homeList_con" v-for="(itemRoad, index) in homeList" :key="index"> <div class="homeList_con" v-for="(itemRoad, index) in homeList" :key="index">
<el-popover trigger="click" popper-class="popover" :placement="itemRoad.position" v-model="itemRoad.isShow"> <el-popover trigger="click" popper-class="popover" :placement="itemRoad.position" v-model="itemRoad.isShow">
...@@ -69,17 +67,16 @@ import ProjectCard from '@/components/ProjectCard.vue' ...@@ -69,17 +67,16 @@ import ProjectCard from '@/components/ProjectCard.vue'
export default { export default {
components: { AppLink, ProjectCard }, components: { AppLink, ProjectCard },
computed: { computed: {
learning() { learningInfo() {
return this.$store.state.user.learning_info.filter(item => item.status === '1') return this.learning.filter(item => item.status === '1')
}, },
list() { list() {
if (this.learning.length) { if (this.learningInfo.length) {
this.roadList.forEach(item => { this.roadList.forEach(item => {
console.log(item, '000') if (item.projectList.find(it => it.tenant === this.learningInfo[0].tenant)) {
if (item.projectList.find(it => it.tenant === this.learning[0].tenant)) {
item.isShow = true item.isShow = true
item.project_name = '我的项目:' item.project_name = '我的项目:'
item.projectList = item.projectList.filter(it => it.tenant === this.learning[0].tenant) item.projectList = item.projectList.filter(it => it.tenant === this.learningInfo[0].tenant)
} }
}) })
return this.roadList return this.roadList
...@@ -90,6 +87,7 @@ export default { ...@@ -90,6 +87,7 @@ export default {
}, },
data() { data() {
return { return {
learning: [],
roadList: roadMapList, roadList: roadMapList,
homeList: homeList, homeList: homeList,
internationalDegreeProjectList: [ internationalDegreeProjectList: [
...@@ -131,6 +129,9 @@ export default { ...@@ -131,6 +129,9 @@ export default {
} }
}) })
} }
},
mounted() {
this.learning = JSON.parse(window.localStorage.getItem('learningList'))
} }
} }
</script> </script>
......
...@@ -197,7 +197,7 @@ export const homeList = [ ...@@ -197,7 +197,7 @@ export const homeList = [
] ]
}, },
{ {
position: 'top-start', position: 'top',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png', icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png',
isShow: false, isShow: false,
title: '企业培训', title: '企业培训',
......
...@@ -44,6 +44,9 @@ export const actions = { ...@@ -44,6 +44,9 @@ export const actions = {
const isLogin = await getUser() const isLogin = await getUser()
.then(response => { .then(response => {
commit('setUser', response.data) commit('setUser', response.data)
console.log(response.data.learning_info, 'data')
window.localStorage.setItem('learningList', JSON.stringify(response.data.learning_info))
console.log(JSON.parse(window.localStorage.getItem('learningList')))
return true return true
}) })
.catch(() => { .catch(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论