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

updates

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