提交 d8fa73c9 authored 作者: matian's avatar matian

updates

上级 56813392
import Vue from 'vue'
import { Message } from 'element-ui'
//挂载到Vue全局对象上
Vue.prototype.$message = Message
export const roadMapList = [
{
project_name: '项目名称:',
......
......@@ -27,10 +27,10 @@
</div>
</client-only>
</template>
<div class="language">
<!-- <div class="language">
<span @click="switchLocale('zh-CN')">中文</span
><span style="display:none" @click="switchLocale('en-US')">EN</span>
</div>
</div> -->
</div>
</div>
<div class="head-nav-content max-width-content">
......
......@@ -4,7 +4,6 @@
<div v-for="(item, index) in list" :key="index" class="banner_roadList">
<el-popover
:title="item.project_name"
width="340"
trigger="hover"
popper-class="popover"
:placement="item.position"
......@@ -70,6 +69,10 @@ import AppLink from '@/components/Link.vue'
export default {
components: { ProjectCard, AppLink },
computed: {
// 个人报名列表
learning() {
return this.$store.state.user.learning_info || []
},
// 在读
learningInfo() {
if (this.learning.length) {
......@@ -78,19 +81,37 @@ export default {
return []
}
},
// 毕业 休学
// 毕业
graduateInfo() {
if (this.learning.length) {
return this.learning.filter(item => item.status === '0')
} else {
return []
}
},
// 毕业 休学 在读
otherInfo() {
return this.learning.filter(item => item.status !== '3' || item.status !== '4')
if (this.learning.length) {
return this.learning.filter(item => item.status !== '3' || item.status !== '4')
} else {
return []
}
},
// 展示信息
list() {
// status 状态(0:毕业,1:在读,2:休学,3:未开通,4:退学)
if (this.learningInfo.length > 0) {
if (this.learning.length > 0) {
this.roadList.forEach(item => {
// 最新在读显示 弹框 显示我的项目
if (item.projectList.find(it => it.tenant === this.learningInfo[0].tenant)) {
item.isShow = true
item.project_name = '我的项目:'
} else if (
!this.otherInfo.find(item => item.status === '1') &&
this.otherInfo.find(item => item.status === '0')
) {
this.graduateInfo[0].isShow = true
this.graduateInfo[0].project_name = '我的项目:'
}
const arr = []
this.otherInfo.forEach(itL => {
......@@ -113,7 +134,6 @@ export default {
},
data() {
return {
learning: [],
roadList: roadMapList,
homeList: homeList,
// 热门专业
......@@ -149,6 +169,7 @@ export default {
}
},
methods: {
// 展示时触发 ,只显示一个
handleShow(val) {
if (this.list) {
this.list.map(item => {
......@@ -158,9 +179,6 @@ export default {
})
}
}
},
mounted() {
this.learning = JSON.parse(window.localStorage.getItem('learningList')) || ''
}
}
</script>
......
......@@ -42,14 +42,13 @@ export const actions = {
commit('setUser', response.data)
commit('setLearning', response.data.learning_info)
this.$store.commit('setUserId', item.id)
window.localStorage.setItem('learning', JSON.stringify(response.data.learning_info))
})
},
// 退出登录
logout({ commit }) {
logout().then(response => {
commit('setUser', {})
this.$router.replace('/')
this.$router.replace('/roadmap')
})
},
// 检测登录状态
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论