wangchenguang 2 years ago
commit a41da6de4d
  1. 8
      src/components/menuTree/index.vue
  2. 25
      src/layouts/header/index.vue
  3. 8
      src/layouts/home/index.vue
  4. 4
      src/layouts/navbar/index.vue
  5. 7
      src/libs/util.js
  6. 2
      src/pages/estate/event/index.vue
  7. 25
      src/pages/estate/index/index.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="menu-child"> <div class="menu-child">
<template v-for="item in this.menuList"> <template v-for="item in this.menuList">
<el-submenu :popper-class="$route.path === '/home' || $route.path === '/sfel' ? 'home-menu-popup' : ''" :class="{active: $route.query.id == item.id}" :key="item.id" :index="String(item.id)" :id="item.id" v-if="item.children && item.children.length"> <el-submenu :popper-class="isHome ? 'home-menu-popup' : ''" :class="{active: $route.query.id == item.id}" :key="item.id" :index="String(item.id)" :id="item.id" v-if="item.children && item.children.length">
<template slot="title"> <template slot="title">
<span slot="title" :id="item.id">{{item.columnName}}</span> <span slot="title" :id="item.id">{{item.columnName}}</span>
</template> </template>
@ -15,6 +15,7 @@
</template> </template>
<script> <script>
import Util from '@/libs/util'
export default { export default {
name: 'menuTree', name: 'menuTree',
props: { props: {
@ -23,6 +24,11 @@ export default {
default: [] default: []
} }
}, },
computed: {
isHome() {
return Util.isIndex()
},
},
data () { data () {
return {} return {}
}, },

@ -1,5 +1,5 @@
<template> <template>
<div :class="['header', { channel: isHome }]"> <div :class="['header', { channel: isHome, estate: isEstate }]">
<a class="logo" @click="toIndex"> <a class="logo" @click="toIndex">
<template v-if="!$store.getters.getModelType"> <template v-if="!$store.getters.getModelType">
<img :src="require('@/assets/images/logo2.png')" alt=""> <img :src="require('@/assets/images/logo2.png')" alt="">
@ -11,7 +11,7 @@
</a> </a>
<!-- pc端 --> <!-- pc端 -->
<template v-if="$store.getters.getModelType"> <template v-if="$store.getters.getModelType">
<navbar ref="nav" :isHome.sync="isHome"></navbar> <navbar ref="nav" :isHome.sync="isHome" :isEstate.sync="isEstate"></navbar>
<div class="tools"> <div class="tools">
<img class="search" :src="require('@/assets/images/search' + (isHome ? '-white' : '') + '.png')" alt="" @click.stop="toggleSearch"> <img class="search" :src="require('@/assets/images/search' + (isHome ? '-white' : '') + '.png')" alt="" @click.stop="toggleSearch">
<img :src="require('@/assets/images/cn' + (isHome ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang"> <img :src="require('@/assets/images/cn' + (isHome ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang">
@ -42,12 +42,14 @@
</div> </div>
</template> </template>
<script> <script>
import Util from '@/libs/util'
import { mapMutations } from 'vuex' import { mapMutations } from 'vuex'
import navbar from '../navbar' import navbar from '../navbar'
export default { export default {
data() { data() {
return { return {
isHome: this.$route.path === '/home' || this.$route.path === '/sfel', isHome: true,
isEstate: false,
showSearch: false, showSearch: false,
title: '', title: '',
searchTimer: null, searchTimer: null,
@ -63,9 +65,14 @@ export default {
}, },
}, },
watch: { watch: {
'$route'() { '$route.path': {
this.isHome = this.$route.path === '/home' || this.$route.path === '/sfel' handler() {
}, this.isHome = Util.isIndex()
this.isEstate = this.$route.path === '/estate/index'
},
deep: true,
immediate: true
}
}, },
beforeDestroy () { beforeDestroy () {
window.removeEventListener('scroll', this.handleScroll) window.removeEventListener('scroll', this.handleScroll)
@ -86,10 +93,11 @@ export default {
}, },
// (home) // (home)
handleScroll () { handleScroll () {
if (this.$route.path === '/home' || this.$route.path === '/sfel') { if (Util.isIndex()) {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
if (this.isHome == scrollTop > 907) { if (this.isHome == scrollTop > 907) {
this.isHome = !(scrollTop > 907) this.isHome = !(scrollTop > 907)
this.isEstate = !(scrollTop > 907) && this.$route.path === '/estate/index'
} }
} }
}, },
@ -143,6 +151,9 @@ $height: 90px;
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #f7f7f7; border-bottom: 1px solid #f7f7f7;
} }
&.estate {
background-color: rgba(0, 0, 0, .15);
}
.logo{ .logo{
position: absolute; position: absolute;
top: 0; top: 0;

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import vHead from '../header' import vHead from '../header'
import vFooter from '../footer' import vFooter from '../footer'
@ -29,7 +29,7 @@ export default {
}, },
computed: { computed: {
isHome() { isHome() {
return this.$route.path === '/home' || this.$route.path === '/sfel' return Util.isIndex()
}, },
}, },
mounted() { mounted() {
@ -54,8 +54,8 @@ export default {
}; };
setInterval(() => { setInterval(() => {
if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { if (Util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
util.errorMsg("用户登录过期,请重新登录"); Util.errorMsg("用户登录过期,请重新登录");
setTimeout(this.logout, 1500); setTimeout(this.logout, 1500);
} }
}, 1000); }, 1000);

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-menu :class="['nav', {home: isHome}]" ref="elMenu" :key="menuRefresh" :mode="$store.getters.getModelType ? 'horizontal' : 'vertical' " :background-color="bgColor" :text-color="textColor" :active-text-color="activeTextColor" @open="jump" @select="jump" :default-active="String(active)"> <el-menu :class="['nav', {home: isHome, estate: isEstate}]" ref="elMenu" :key="menuRefresh" :mode="$store.getters.getModelType ? 'horizontal' : 'vertical' " :background-color="bgColor" :text-color="textColor" :active-text-color="activeTextColor" @open="jump" @select="jump" :default-active="String(active)">
<menuTree :menuList="menus"/> <menuTree :menuList="menus"/>
</el-menu> </el-menu>
</div> </div>
@ -11,7 +11,7 @@ import menuTree from '@/components/menuTree'
import mixins from '@/mixins/article' import mixins from '@/mixins/article'
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
export default { export default {
props: ['isHome','updateModelType'], props: ['isHome', 'isEstate', 'updateModelType'],
mixins: [mixins], mixins: [mixins],
data() { data() {
return { return {

@ -1,5 +1,6 @@
import { _local } from "./util.db"; import { _local } from "./util.db";
import { Message } from "element-ui"; import { Message } from "element-ui";
import Router from '@/router'
// 文件后缀集合 // 文件后缀集合
const exts = { const exts = {
@ -8,6 +9,8 @@ const exts = {
img: 'jpg,jpeg,png,gif,svg,psd', img: 'jpg,jpeg,png,gif,svg,psd',
doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx' doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx'
} }
// 各个站点首页的路径
const indexPath = ['/home', '/sfel', '/estate/index']
const util = { const util = {
local: _local, local: _local,
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
@ -133,6 +136,10 @@ const util = {
} }
} }
return param[name] || null return param[name] || null
},
// 是否是各个站点的首页,首页的导航样式不一样,所以要单独判断
isIndex() {
return indexPath.includes(Router.app.$route.path)
} }
}; };

@ -189,7 +189,7 @@ export default {
} }
} }
.pic { .pic {
width: 350px; width: 300px;
height: 195px; height: 195px;
} }
} }

@ -612,12 +612,7 @@ export default {
} }
} }
@media (max-width: 1520px) { @media (max-width: 1520px) {
.conference .card-list {
width: 734px;
.texts {
width: 460px;
}
}
} }
@media (max-width: 1200px) { @media (max-width: 1200px) {
.sfel-banner{ .sfel-banner{
@ -668,6 +663,17 @@ export default {
} }
} }
} }
.talent {
.shows {
.left {
width: 100%;
margin-bottom: 20px;
}
.pic {
width: 100%;
}
}
}
.media-wrap{ .media-wrap{
flex-direction: column; flex-direction: column;
.left{ .left{
@ -701,6 +707,13 @@ export default {
flex: 1; flex: 1;
} }
} }
.program {
.list {
li {
background-size: cover;
}
}
}
#part6 { #part6 {
.slide{ .slide{
.texts{ .texts{

Loading…
Cancel
Save