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

updates

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