提交 440b79be authored 作者: matian's avatar matian

updates

上级 7def746a
No preview for this file type
# projectId=1017
# newProjectId=25634964940156928
projectId: '6800242743894343680',
baseURL=https://project-api.ezijing.com
loginURL=https://login.ezijing.com/auth
\ No newline at end of file
# projectId=1017
# newProjectId=25634964940156928
projectId: '6800242743894343680',
baseURL=https://project-api2.ezijing.com
loginURL=https://login2.ezijing.com/auth
\ No newline at end of file
......@@ -12,10 +12,22 @@
alt=""
@click="goPage('/')"
/>
<!-- <div class="login-btn-box">
<div class="login">快速登录</div>
<!-- <div class="login-btn-box" v-if="$route.path === '/roadmap'">
<div class="login" @click="handleLogin">快速登录</div>
<div class="register">注册</div>
</div> -->
<template v-if="$route.path === '/roadmap'">
<div class="user" v-if="user.id">
<span>{{ user.realname || user.nickname }}</span
><em>|</em><span class="logout" @click="logout">退出</span>
</div>
<div class="login-btn-box" v-else>
<div class="login"><a :href="loginURL" :key="loginURL">登录</a></div>
<div class="register">
<a :href="registerURL">注册</a>
</div>
</div>
</template>
<div class="language">
<span @click="switchLocale('zh-CN')">中文</span
><span style="display:none" @click="switchLocale('en-US')">EN</span>
......@@ -429,8 +441,11 @@ export default {
},
mounted() {
this.isEn = this.$cookies.get('lang') === 'en-US'
this.$store.dispatch('checkLogin')
},
methods: {
// 登录
handleLogin() {},
switchLocale(locale) {
this.$cookies.set('lang', locale, { domain: 'ezijing.com' })
this.isEn = this.$cookies.get('lang') === 'en-US'
......@@ -502,6 +517,22 @@ export default {
return className
}
}
},
user() {
return this.$store.state.user || {}
},
loginURL() {
console.log('process.client', process.client, process.env, this)
return process.client
? `${process.env.loginURL}/login/index?redirect_uri=${encodeURIComponent(
location.origin + this.$route.fullPath
)}`
: ''
},
registerURL() {
return process.client
? `${process.env.loginURL}/register?redirect_uri=${encodeURIComponent(location.origin + this.$route.fullPath)}`
: ''
}
}
}
......
import path from 'path'
import fs from 'fs'
let config = {}
if (process.env.NODE_ENV === 'production') {
config = {
env: {
projectId: '6800242743894343680',
baseURL: 'https://project-api.ezijing.com'
},
server: { port: 2048, host: '0.0.0.0', timing: false }
}
} else {
config = {
env: {
projectId: '6800242743894343680',
baseURL: 'https://project-api.ezijing.com'
},
axios: {
proxy: true
},
export default {
env: process.env,
server: { port: 2048, host: '0.0.0.0' },
...(process.env.NODE_ENV === 'development' && {
server: {
port: 3000,
host: 'dev.ezijing.com',
timing: false,
https: {
key: fs.readFileSync(path.resolve(__dirname, 'dev.ezijing.com.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'dev.ezijing.com.pem'))
}
},
proxy: {
'/api': {
target: 'https://project-api.ezijing.com/api',
selfHandleResponse: false,
secure: false,
changeOrigin: true,
followRedirects: true,
logLevel: 'info',
headers: {
Referer: 'https://project-api.ezijing.com/api'
},
pathRewrite: {
'^/api': '/'
}
}
}
}
}
export default {
...config,
}),
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: '清控紫荆教育-在线学位,国际留学,数字经济产业学院',
......
......@@ -3,8 +3,9 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt --open",
"dev": "nuxt --open --dotenv .env.dev",
"build": "nuxt build",
"build:test": "nuxt build --dotenv .env.test",
"start": "nuxt start",
"generate": "nuxt generate"
},
......
<template>
<div>
<div class="banner"></div>
<div class="banner">
<div v-for="(item, index) in roadList" :key="index" class="banner_roadList">
<el-popover
title="我的项目"
width="340"
trigger="hover"
popper-class="popover"
:placement="item.position"
v-model="item.isShow"
visible-arrow="true"
>
<!-- <div> -->
<div v-for="(it, indexItem) in item.projectList" :key="indexItem" class="project_name">
<AppLink :data="it">
{{ it.name }}
</AppLink>
</div>
<div class="line"></div>
<div class="el-popover__title">未来可选目标:</div>
<div v-for="(itTwo, index) in item.checkList" :key="itTwo.name" class="project_name">
<AppLink :data="itTwo">
{{ itTwo.name }}
</AppLink>
</div>
<!-- </div> -->
<div slot="reference" class="banner_roadList_con">
<img :src="item.icon" alt="" />
<div class="item_title">{{ item.title }}</div>
</div>
</el-popover>
</div>
<div class="banner_homeList">
<div v-for="(itemRoad, indexRoad) in homeList" :key="indexRoad">
<el-popover trigger="hover" popper-class="popover" :placement="itemRoad.position" v-model="itemRoad.isShow">
<div>
<div v-for="(it, indexItem) in itemRoad.itemList" :key="indexItem" class="project_name">
{{ it.name }}
</div>
</div>
<div slot="reference" class="banner_homeList_con">
<img :src="itemRoad.icon" alt="" />
<div class="item_title">{{ itemRoad.title }}</div>
</div>
</el-popover>
</div>
</div>
</div>
<div class="w1200">
<ProjectCard
title="在线国际学位"
......@@ -13,12 +60,17 @@
</template>
<script>
import { roadMapList, homeList } from '@/utils/roadMap.js'
import ProjectCard from '@/components/ProjectCard.vue'
import AppLink from '@/components/Link.vue'
export default {
components: { ProjectCard },
components: { ProjectCard, AppLink },
computed: {},
data() {
return {
roadList: [],
homeList: [],
// 热门专业
internationalDegreeProjectList: [
{
......@@ -50,13 +102,120 @@ export default {
}
]
}
},
mounted() {
this.roadList = roadMapList
this.homeList = homeList
this.$nextTick(() => {
// 获取子元素的个数
this.roadList.map(item => {
console.log(item.title, 'title')
if (item.title === '职业教育') {
item.isShow = true
}
})
})
}
}
</script>
<style lang="scss" scoped>
<style lang="scss">
.el-popover.popover {
background: rgba(255, 255, 255, 0.39);
.el-popover__title {
font-weight: 400;
color: #ffffff;
font-size: 18px;
}
.project_name {
font-size: 22px;
font-weight: bold;
color: #ffffff;
cursor: pointer;
}
.line {
width: 281px;
border: 1px dashed #ccc;
margin: 20px 0 20px 0;
}
}
.banner {
width: 100%;
min-width: 1200px;
background: url(https://webapp-pub.oss-cn-beijing.aliyuncs.com/www/pc/lifeLearning/banner.jpg);
background-size: 100% 100%;
height: 650px;
position: relative;
.banner_roadList {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.banner_roadList_con {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
cursor: pointer;
.item_title {
font-size: 20px;
font-weight: bold;
color: #ffffff;
}
}
}
.banner_roadList:nth-child(1) {
position: absolute;
top: 325px;
left: 21.5%;
}
.banner_roadList:nth-child(2) {
position: absolute;
top: 270px;
left: 40%;
}
.banner_roadList:nth-child(3) {
position: absolute;
top: 250px;
left: 47%;
}
.banner_roadList:nth-child(4) {
position: absolute;
top: 140px;
left: 58%;
}
.banner_roadList:nth-child(5) {
position: absolute;
top: 105px;
left: 68%;
}
.banner_homeList {
width: 50%;
position: absolute;
left: 50%;
bottom: 52px;
transform: translate(-50%, -50%);
display: flex;
justify-content: space-around;
align-items: center;
.banner_homeList_con {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.item_title {
font-size: 20px;
font-weight: bold;
color: #ffffff;
}
}
}
}
.w1200 {
width: 1200px;
margin: 0 auto;
margin: 84px auto;
}
</style>
import { getUser, logout } from '@/api/my'
export const state = () => ({
user: {},
isMobile: false,
searchVisible: false,
menuVisible: false,
locales: ['zh-CN', 'en-US'],
locale: 'zh-CN'
})
export const mutations = {
setUser(state, user) {
state.user = user
},
removeUser(state) {
state.user = {}
},
setIsMobile(state, isMobile) {
state.isMobile = isMobile
},
toggleSearch(state, visible) {
state.searchVisible = visible
},
toggleMenu(state, visible) {
state.menuVisible = visible
},
setLocale(state, locale) {
if (state.locales.includes(locale)) {
state.locale = locale
......@@ -12,6 +33,31 @@ export const mutations = {
}
export const actions = {
getUser({ commit }) {
getUser().then(response => {
commit('setUser', response.data)
})
},
// 退出登录
logout({ commit }) {
logout().then(response => {
commit('setUser', {})
this.$router.replace('/')
})
},
// 检测登录状态
async checkLogin({ commit }) {
const isLogin = await getUser()
.then(response => {
commit('setUser', response.data)
return true
})
.catch(() => {
commit('setUser', {})
return false
})
return isLogin
},
switchLocale({ commit }, locale) {
commit('setLocale', locale)
this.app.i18n.locale = locale
......
export const roadMapList = [
{
isShow: false,
position: 'top',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon1.png',
title: '职业教育',
projectList: [
{
name: '紫荆数字经济产业学院',
href: 'https://www.baidu.com/'
}
],
checkList: [
{
name: '在线国际学位',
href: ''
},
{
name: '硕士(国际留学)',
href: ''
}
]
},
{
isShow: false,
position: 'top',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon2.png',
title: '本科',
projectList: [
{
name: '紫荆数字经济产业学院',
href: ''
},
{
name: '国际大一(1+3)即将推出',
href: ''
}
],
checkList: [
{
name: '在线国际学位',
href: ''
},
{
name: '硕士(国际留学)',
href: ''
}
]
},
{
position: 'right-start',
isShow: false,
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon3.png',
title: '在线国际学位',
projectList: [
{
name: '数字领导力方向MBA',
href: ''
},
{
name: '酒店和旅游方向MBA',
href: ''
},
{
name: '餐饮管理方向MBA',
href: ''
}
],
checkList: [
{
name: '工商管理博士DBA',
href: ''
}
]
},
{
position: 'right-start',
isShow: false,
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon4.png',
title: '硕士',
projectList: [
{
name: '金融硕士MSF',
href: ''
},
{
name: '教育学硕士MED',
href: ''
},
{
name: '应用心理学MAP',
href: ''
}
],
checkList: [
{
name: '在线国际学位',
href: ''
},
{
name: '工商管理博士DBA',
href: ''
}
]
},
{
position: 'bottom-start',
isShow: false,
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/icon5.png',
title: '博士',
projectList: [
{
name: '工商管理博士DBA',
href: ''
}
],
checkList: [
{
name: '暂无',
href: ''
}
]
}
]
export const homeList = [
{
position: 'left',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png',
isShow: false,
title: '职业证书',
itemList: [
{
name: '1+X',
href: ''
},
{
name: '私人财富风险管理顾问(PRP)',
href: ''
},
{
name: '高管培训-数字创新管理',
href: ''
},
{
name: '互联网营销师',
href: ''
},
{
name: '工业机器人系统操作员',
href: ''
},
{
name: '大数据技术人员',
href: ''
}
]
},
{
position: 'top-start',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png',
isShow: false,
title: '实习就业',
itemList: [
{
name: '敬请期待',
href: ''
}
]
},
{
position: 'top-start',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png',
isShow: false,
title: '企业培训',
itemList: [
{
name: '敬请期待',
href: ''
}
]
}
]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论