提交 4e87b083 authored 作者: matian's avatar matian

updates

上级 6f0850bf
import Vue from 'vue'
import { Notify } from 'vant'
//挂载到Vue全局对象上
Vue.prototype.$notify = Notify
export const roadMapList = [
{
project_name: '项目名称:',
......@@ -19,12 +14,7 @@ export const roadMapList = [
href: 'https://cbu-plus.ezijing.com'
}
],
checkList: [
{
name: '暂无',
href: ''
}
]
checkList: []
},
{
project_name: '项目名称:',
......@@ -103,7 +93,9 @@ export const roadMapList = [
{
tenant: '',
name: '紫荆数字经济产业学院',
href: ''
onClick() {
Notify({ type: 'primary', message: '即将推出' })
}
},
{
tenant: '',
......@@ -134,7 +126,9 @@ export const roadMapList = [
{
tenant: '',
name: '紫荆数字经济产业学院',
href: 'https://www.baidu.com/'
onClick() {
Notify({ type: 'primary', message: '即将推出' })
}
}
],
checkList: [
......
......@@ -18,12 +18,12 @@
</div>
</client-only>
</template>
<div class="tool-box" @click="switchLocale">
<!-- <div class="tool-box" @click="switchLocale">
<div class="item">
<div class="icon"></div>
<div class="text">中文/EN</div>
</div>
</div>
</div> -->
</ul>
</nav>
</template>
......
......@@ -3,7 +3,7 @@
<div class="banner">
<div v-for="(item, index) in list" :key="index" class="roadList">
<el-popover
title="我的项目"
:title="item.project_name"
trigger="click"
popper-class="popover"
:placement="item.position"
......@@ -19,9 +19,11 @@
</AppLink>
</div>
<!-- 未来可选项目 -->
<div class="line"></div>
<div class="el-popover__title">未来可选目标:</div>
<div v-for="(it, indexItem) in item.checkList" :key="it.name" class="project_name">{{ it.name }}</div>
<template v-if="item.checkList.length">
<div class="line"></div>
<div class="el-popover__title">未来可选目标:</div>
<div v-for="(it, indexItem) in item.checkList" :key="it.name" class="project_name">{{ it.name }}</div>
</template>
</div>
<div slot="reference" class="roadList_con">
<img :src="item.icon" alt="" />
......@@ -67,16 +69,61 @@ import ProjectCard from '@/components/ProjectCard.vue'
export default {
components: { AppLink, ProjectCard },
computed: {
// 个人报名列表
learning() {
return this.$store.state.user.learning_info || []
},
// 在读
learningInfo() {
return this.learning.filter(item => item.status === '1')
if (this.learning.length) {
return this.learning.filter(item => item.status === '1')
} else {
return []
}
},
// 毕业
graduateInfo() {
if (this.learning.length) {
return this.learning.filter(item => item.status === '0')
} else {
return []
}
},
// 毕业 休学 在读
otherInfo() {
if (this.learning.length) {
return this.learning.filter(item => item.status !== '3' || item.status !== '4')
} else {
return []
}
},
// 展示信息
list() {
if (this.learningInfo.length) {
// status 状态(0:毕业,1:在读,2:休学,3:未开通,4:退学)
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 = '我的项目:'
item.projectList = item.projectList.filter(it => it.tenant === this.learningInfo[0].tenant)
} 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 => {
item.projectList.forEach(itP => {
if (itL.tenant === itP.tenant) {
arr.push(itP)
item.project_name = '我的项目:'
}
})
})
if (item.project_name === '我的项目:') {
item.projectList = arr
}
})
return this.roadList
......@@ -87,7 +134,6 @@ export default {
},
data() {
return {
learning: [],
roadList: roadMapList,
homeList: homeList,
internationalDegreeProjectList: [
......@@ -129,9 +175,6 @@ export default {
}
})
}
},
mounted() {
this.learning = JSON.parse(window.localStorage.getItem('learningList'))
}
}
</script>
......
......@@ -40,13 +40,9 @@ export const actions = {
},
// 检测登录状态
async checkLogin({ commit }) {
console.log('000')
const isLogin = await getUser()
.then(response => {
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
})
.catch(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论