提交 3e6fc956 authored 作者: matian's avatar matian

updates

上级 5b738007
<template> <template>
<div> <div>
<div class="banner"> <div class="banner">
<div v-for="(item, index) in roadList" :key="index" class="banner_roadList"> <div v-for="(item, index) in list" :key="index" class="banner_roadList">
<el-popover <el-popover
title="我的项目" :title="item.project_name"
width="340" width="340"
trigger="hover" trigger="hover"
popper-class="popover" popper-class="popover"
:placement="item.position" :placement="item.position"
v-model="item.isShow" v-model="item.isShow"
visible-arrow="true" visible-arrow="true"
@show="handleShow(item)"
> >
<!-- <div> -->
<div v-for="(it, indexItem) in item.projectList" :key="indexItem" class="project_name"> <div v-for="(it, indexItem) in item.projectList" :key="indexItem" class="project_name">
<AppLink :data="it"> <AppLink :data="it">
{{ it.name }} {{ it.name }}
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
{{ itTwo.name }} {{ itTwo.name }}
</AppLink> </AppLink>
</div> </div>
<!-- </div> -->
<div slot="reference" class="banner_roadList_con"> <div slot="reference" class="banner_roadList_con">
<img :src="item.icon" alt="" /> <img :src="item.icon" alt="" />
...@@ -60,17 +59,37 @@ ...@@ -60,17 +59,37 @@
</template> </template>
<script> <script>
import { getUser } from '@/api/my'
import { roadMapList, homeList } from '@/utils/roadMap.js' import { roadMapList, homeList } from '@/utils/roadMap.js'
import ProjectCard from '@/components/ProjectCard.vue' import ProjectCard from '@/components/ProjectCard.vue'
import AppLink from '@/components/Link.vue' import AppLink from '@/components/Link.vue'
export default { export default {
components: { ProjectCard, AppLink }, components: { ProjectCard, AppLink },
computed: {}, computed: {
learning() {
return this.learningInfo.filter(item => item.status === '1')
},
list() {
if (this.learningInfo.length) {
this.roadList.forEach(item => {
if (item.projectList.find(it => it.tenant === this.learning[0].tenant)) {
item.isShow = true
item.project_name = '我的项目'
item.projectList = item.projectList.filter(it => it.tenant === this.learning[0].tenant)
}
})
return this.roadList
} else {
return this.roadList
}
}
},
data() { data() {
return { return {
roadList: [], learningInfo: [],
homeList: [], roadList: roadMapList,
homeList: homeList,
// 热门专业 // 热门专业
internationalDegreeProjectList: [ internationalDegreeProjectList: [
{ {
...@@ -103,18 +122,21 @@ export default { ...@@ -103,18 +122,21 @@ export default {
] ]
} }
}, },
mounted() { methods: {
console.log(this.$store.state.user, 'user') handleShow(val) {
this.roadList = roadMapList this.list.map(item => {
this.homeList = homeList if (item.title !== val.title) {
this.$nextTick(() => { item.isShow = false
// 获取子元素的个数
this.roadList.map(item => {
console.log(item.title, 'title')
if (item.title === '职业教育') {
item.isShow = true
} }
}) })
}
},
created() {
getUser().then(res => {
if (res.code === 0) {
this.learningInfo = res.data.learning_info
console.log(this.learningInfo)
}
}) })
} }
} }
...@@ -123,6 +145,8 @@ export default { ...@@ -123,6 +145,8 @@ export default {
<style lang="scss"> <style lang="scss">
.el-popover.popover { .el-popover.popover {
background: rgba(255, 255, 255, 0.39); background: rgba(255, 255, 255, 0.39);
border-radius: 20px;
padding: 26px 0 40px 27px;
.el-popover__title { .el-popover__title {
font-weight: 400; font-weight: 400;
color: #ffffff; color: #ffffff;
...@@ -134,6 +158,9 @@ export default { ...@@ -134,6 +158,9 @@ export default {
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
} }
.project_name:hover {
text-shadow: 2px 2px 5px rgb(143, 141, 141);
}
.line { .line {
width: 281px; width: 281px;
border: 1px dashed #ccc; border: 1px dashed #ccc;
......
...@@ -50,7 +50,6 @@ export const actions = { ...@@ -50,7 +50,6 @@ export const actions = {
console.log('000') console.log('000')
const isLogin = await getUser() const isLogin = await getUser()
.then(response => { .then(response => {
console.log(response, 'response')
commit('setUser', response.data) commit('setUser', response.data)
return true return true
}) })
......
export const roadMapList = [ export const roadMapList = [
{ {
project_name: '项目名称',
isShow: false, isShow: false,
position: 'top', position: 'top',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon1.png', icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon1.png',
title: '职业教育', title: '职业教育',
projectList: [ projectList: [
{ {
tenant: '', tenant: 'x1',
name: '紫荆数字经济产业学院', name: '紫荆数字经济产业学院',
href: 'https://www.baidu.com/' href: 'https://www.baidu.com/'
} }
...@@ -23,8 +24,10 @@ export const roadMapList = [ ...@@ -23,8 +24,10 @@ export const roadMapList = [
] ]
}, },
{ {
project_name: '项目名称',
isShow: false, isShow: false,
position: 'top', position: 'left-end',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon2.png', icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon2.png',
title: '本科', title: '本科',
projectList: [ projectList: [
...@@ -34,7 +37,9 @@ export const roadMapList = [ ...@@ -34,7 +37,9 @@ export const roadMapList = [
}, },
{ {
name: '国际大一(1+3)即将推出', name: '国际大一(1+3)即将推出',
onClick: '' onClick() {
alert('即将推出')
}
} }
], ],
checkList: [ checkList: [
...@@ -49,6 +54,8 @@ export const roadMapList = [ ...@@ -49,6 +54,8 @@ export const roadMapList = [
] ]
}, },
{ {
project_name: '项目名称',
position: 'right-start', position: 'right-start',
isShow: false, isShow: false,
...@@ -80,6 +87,8 @@ export const roadMapList = [ ...@@ -80,6 +87,8 @@ export const roadMapList = [
] ]
}, },
{ {
project_name: '项目名称',
position: 'right-start', position: 'right-start',
isShow: false, isShow: false,
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon4.png', icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon4.png',
...@@ -114,6 +123,8 @@ export const roadMapList = [ ...@@ -114,6 +123,8 @@ export const roadMapList = [
] ]
}, },
{ {
project_name: '项目名称',
position: 'bottom-start', position: 'bottom-start',
isShow: false, isShow: false,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论