|
|
|
@ -1,55 +1,108 @@ |
|
|
|
|
<template> |
|
|
|
|
<div :class="['header', { channel: isHome, estate: isEstate }]"> |
|
|
|
|
<a class="logo" @click="toIndex"> |
|
|
|
|
<a class="logo" |
|
|
|
|
@click="toIndex"> |
|
|
|
|
<template v-if="!$store.getters.getModelType"> |
|
|
|
|
<img :src="require('@/assets/images/logo2.png')" alt=""> |
|
|
|
|
<img :src="require('@/assets/images/logo2.png')" |
|
|
|
|
alt=""> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
|
|
|
|
|
<img :src="require('@/assets/images/' + (isSfel ? 'logo2' : isHome ? 'logo' : 'logo2') + '.png')" alt=""> |
|
|
|
|
<img :src="require('@/assets/images/' + (isSfel ? 'logo2' : isHome ? 'logo' : 'logo2') + '.png')" |
|
|
|
|
alt=""> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
</a> |
|
|
|
|
<!-- pc端 --> |
|
|
|
|
<template v-if="$store.getters.getModelType"> |
|
|
|
|
<navbar v-if="navShow" ref="nav" :isHome.sync="isHome" :isEstate.sync="isEstate" @showMoreBtns="updateBtnsType"></navbar> |
|
|
|
|
<navbar v-if="navShow" |
|
|
|
|
ref="nav" |
|
|
|
|
:isHome.sync="isHome" |
|
|
|
|
:isEstate.sync="isEstate" |
|
|
|
|
@showMoreBtns="updateBtnsType"></navbar> |
|
|
|
|
<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"> |
|
|
|
|
<template v-if="site == 2"> |
|
|
|
|
<img class="search" |
|
|
|
|
:src="require('@/assets/images/email' + (isHome ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toMail"> |
|
|
|
|
<img class="search" |
|
|
|
|
:src="require('@/assets/images/oa' + (isHome ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toMail"> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="$i18n.locale == 'en'"> |
|
|
|
|
<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"> |
|
|
|
|
</template> |
|
|
|
|
<template v-else-if="$i18n.locale == 'zh'"> |
|
|
|
|
<img :src="require('@/assets/images/en' + (isHome ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang"> |
|
|
|
|
<img :src="require('@/assets/images/en' + (isHome ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toggleLang"> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="showSearch" class="search-wrap" @click.stop="stop"> |
|
|
|
|
<input ref="search" type="text" :placeholder="$t('column.titlePlaceholder')" v-model="title"> |
|
|
|
|
<img class="search-icon" src="@/assets/images/search.png" alt="" @click="handleSearch"> |
|
|
|
|
<i class="el-icon-close close-icon" @click="showSearch = false"></i> |
|
|
|
|
<div v-if="showSearch" |
|
|
|
|
class="search-wrap" |
|
|
|
|
@click.stop="stop"> |
|
|
|
|
<input ref="search" |
|
|
|
|
type="text" |
|
|
|
|
:placeholder="$t('column.titlePlaceholder')" |
|
|
|
|
v-model="title"> |
|
|
|
|
<img class="search-icon" |
|
|
|
|
src="@/assets/images/search.png" |
|
|
|
|
alt="" |
|
|
|
|
@click="handleSearch"> |
|
|
|
|
<i class="el-icon-close close-icon" |
|
|
|
|
@click="showSearch = false"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<!-- 手机端 --> |
|
|
|
|
<template v-else> |
|
|
|
|
<i class="rightBox" :class="modelType ? 'el-icon-s-fold': 'el-icon-s-unfold' " @click="updateModelType"></i> |
|
|
|
|
<div class="contentBox" v-show="modelType"> |
|
|
|
|
<navbar ref="nav" :isHome.sync="isHome" :updateModelType="updateType"></navbar> |
|
|
|
|
<i class="rightBox" |
|
|
|
|
:class="modelType ? 'el-icon-s-fold': 'el-icon-s-unfold' " |
|
|
|
|
@click="updateModelType"></i> |
|
|
|
|
<div class="contentBox" |
|
|
|
|
v-show="modelType"> |
|
|
|
|
<navbar ref="nav" |
|
|
|
|
:isHome.sync="isHome" |
|
|
|
|
:updateModelType="updateType"></navbar> |
|
|
|
|
<div class="modelBox"> |
|
|
|
|
<div class="searchBox"><img class="search" :src="require('@/assets/images/search' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" alt="" @click.stop="toggleSearch"></div> |
|
|
|
|
<div class="searchBox"><img class="search" |
|
|
|
|
:src="require('@/assets/images/search' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toggleSearch"></div> |
|
|
|
|
<div class="languageBox"> |
|
|
|
|
<!-- <img :src="require('@/assets/images/cn' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang"> --> |
|
|
|
|
<template v-if="$i18n.locale == 'en'"> |
|
|
|
|
<img :src="require('@/assets/images/cn' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang"> |
|
|
|
|
<img :src="require('@/assets/images/cn' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toggleLang"> |
|
|
|
|
</template> |
|
|
|
|
<template v-else-if="$i18n.locale == 'zh'"> |
|
|
|
|
<img :src="require('@/assets/images/en' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" alt="" @click.stop="toggleLang"> |
|
|
|
|
<img :src="require('@/assets/images/en' + (isHome && $store.getters.getModelType ? '-white' : '') + '.png')" |
|
|
|
|
alt="" |
|
|
|
|
@click.stop="toggleLang"> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="showSearch" class="search-wrap" @click.stop="stop"> |
|
|
|
|
<input ref="search" type="text" :placeholder="$t('column.titlePlaceholder')" v-model="title"> |
|
|
|
|
<img class="search-icon" src="@/assets/images/search.png" alt="" @click="handleSearch"> |
|
|
|
|
<i class="el-icon-close close-icon" @click="showSearch = false"></i> |
|
|
|
|
<div v-if="showSearch" |
|
|
|
|
class="search-wrap" |
|
|
|
|
@click.stop="stop"> |
|
|
|
|
<input ref="search" |
|
|
|
|
type="text" |
|
|
|
|
:placeholder="$t('column.titlePlaceholder')" |
|
|
|
|
v-model="title"> |
|
|
|
|
<img class="search-icon" |
|
|
|
|
src="@/assets/images/search.png" |
|
|
|
|
alt="" |
|
|
|
|
@click="handleSearch"> |
|
|
|
|
<i class="el-icon-close close-icon" |
|
|
|
|
@click="showSearch = false"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -62,7 +115,7 @@ import Util from '@/libs/util' |
|
|
|
|
import { mapMutations } from 'vuex' |
|
|
|
|
import navbar from '../navbar' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
isHome: true, |
|
|
|
|
isEstate: false, |
|
|
|
@ -78,13 +131,16 @@ export default { |
|
|
|
|
navbar |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
isSfel() { |
|
|
|
|
isSfel () { |
|
|
|
|
return this.$route.path === '/sfel' |
|
|
|
|
}, |
|
|
|
|
site () { |
|
|
|
|
return this.$route.query.siteId || this.$store.state.content.site |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
'$route.path': { |
|
|
|
|
handler() { |
|
|
|
|
handler () { |
|
|
|
|
this.isHome = Util.isIndex() |
|
|
|
|
this.isEstate = this.$route.path === '/estate/index' |
|
|
|
|
}, |
|
|
|
@ -95,7 +151,7 @@ export default { |
|
|
|
|
beforeDestroy () { |
|
|
|
|
window.removeEventListener('scroll', this.handleScroll) |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.setKeyword('') |
|
|
|
|
window.addEventListener('scroll', this.handleScroll) // 监听页面滚动 |
|
|
|
|
}, |
|
|
|
@ -103,17 +159,17 @@ export default { |
|
|
|
|
...mapMutations('content', [ |
|
|
|
|
'setKeyword' |
|
|
|
|
]), |
|
|
|
|
toIndex() { |
|
|
|
|
toIndex () { |
|
|
|
|
this.$refs.nav.jump() |
|
|
|
|
}, |
|
|
|
|
stop() { |
|
|
|
|
stop () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* pc端下,当导航栏条目大于10的情况下,显示更多按钮 |
|
|
|
|
* type : true显示,false隐藏 |
|
|
|
|
*/ |
|
|
|
|
updateBtnsType(type) { |
|
|
|
|
updateBtnsType (type) { |
|
|
|
|
this.showMoreBtns = type |
|
|
|
|
}, |
|
|
|
|
// 获取页面滚动距离(home长页专用) |
|
|
|
@ -132,14 +188,22 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 切换显示搜索 |
|
|
|
|
toggleSearch() { |
|
|
|
|
toggleSearch () { |
|
|
|
|
this.showSearch = !this.showSearch |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.search.focus() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// mail点击 |
|
|
|
|
toMail () { |
|
|
|
|
window.open('https://qiye.aliyun.com/alimail/auth/login?custom_login_flag=1&reurl=%2Falimail%2F') |
|
|
|
|
}, |
|
|
|
|
// oa点击 |
|
|
|
|
toOa () { |
|
|
|
|
window.open('http://oa.iasf.ac.cn/sys/portal/page.jsp') |
|
|
|
|
}, |
|
|
|
|
// 切换语言 |
|
|
|
|
toggleLang() { |
|
|
|
|
toggleLang () { |
|
|
|
|
let id = +(this.$route.query.siteId || this.$store.state.content.site) |
|
|
|
|
// 中英文站点的id是相邻的,有6个站点,1/2 3/4 5/6 |
|
|
|
|
id % 2 ? id++ : id-- |
|
|
|
@ -147,7 +211,7 @@ export default { |
|
|
|
|
location.reload() |
|
|
|
|
}, |
|
|
|
|
// 全局搜索 |
|
|
|
|
handleSearch() { |
|
|
|
|
handleSearch () { |
|
|
|
|
this.setKeyword(this.title) |
|
|
|
|
this.modelType = !this.modelType |
|
|
|
|
if (this.title) { |
|
|
|
@ -156,10 +220,10 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 更改右侧盒子样式 |
|
|
|
|
updateModelType() { |
|
|
|
|
updateModelType () { |
|
|
|
|
this.modelType = !this.modelType |
|
|
|
|
}, |
|
|
|
|
updateType(type) { |
|
|
|
|
updateType (type) { |
|
|
|
|
this.modelType = type |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -182,9 +246,9 @@ $height: 90px; |
|
|
|
|
border-bottom: 1px solid #f7f7f7; |
|
|
|
|
} |
|
|
|
|
&.estate { |
|
|
|
|
background-color: rgba(0, 0, 0, .15); |
|
|
|
|
background-color: rgba(0, 0, 0, 0.15); |
|
|
|
|
} |
|
|
|
|
.logo{ |
|
|
|
|
.logo { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 0; |
|
|
|
|
left: 5%; |
|
|
|
@ -216,7 +280,7 @@ $height: 90px; |
|
|
|
|
align-items: center; |
|
|
|
|
padding: 10px 15px 10px 10px; |
|
|
|
|
background-color: #fff; |
|
|
|
|
box-shadow: 0px 6px 9px 0px rgba(0,0,0,0.3); |
|
|
|
|
box-shadow: 0px 6px 9px 0px rgba(0, 0, 0, 0.3); |
|
|
|
|
input { |
|
|
|
|
width: 300px; |
|
|
|
|
height: 40px; |
|
|
|
@ -240,17 +304,17 @@ $height: 90px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.menu-child { |
|
|
|
|
/deep/ .el-submenu__title{ |
|
|
|
|
/deep/ .el-submenu__title { |
|
|
|
|
font-size: 1rem; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.rightBox{ |
|
|
|
|
.rightBox { |
|
|
|
|
font-size: 2.57rem; |
|
|
|
|
position: absolute; |
|
|
|
|
right: 10px; |
|
|
|
|
top: 2rem; |
|
|
|
|
} |
|
|
|
|
.contentBox{ |
|
|
|
|
.contentBox { |
|
|
|
|
width: 100%; |
|
|
|
|
position: absolute; |
|
|
|
|
top: 90px; |
|
|
|
@ -260,15 +324,16 @@ $height: 90px; |
|
|
|
|
max-height: 30rem; |
|
|
|
|
overflow-y: scroll; |
|
|
|
|
} |
|
|
|
|
.searchBox, .languageBox{ |
|
|
|
|
.searchBox, |
|
|
|
|
.languageBox { |
|
|
|
|
padding-left: 20px; |
|
|
|
|
height: 56px; |
|
|
|
|
line-height: 56px; |
|
|
|
|
} |
|
|
|
|
.modelBox{ |
|
|
|
|
.modelBox { |
|
|
|
|
position: relative; |
|
|
|
|
padding-bottom: 20px; |
|
|
|
|
.search-wrap{ |
|
|
|
|
.search-wrap { |
|
|
|
|
top: 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -281,18 +346,19 @@ $height: 90px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
.tools { |
|
|
|
|
right: 30px |
|
|
|
|
right: 30px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@media (min-width: 280px) and (max-width: 1200px) { |
|
|
|
|
.header{ |
|
|
|
|
.header { |
|
|
|
|
color: black !important; |
|
|
|
|
background-color: #fff; |
|
|
|
|
} |
|
|
|
|
.contentBox{ |
|
|
|
|
.searchBox, .languageBox{ |
|
|
|
|
.contentBox { |
|
|
|
|
.searchBox, |
|
|
|
|
.languageBox { |
|
|
|
|
padding-left: 20px; |
|
|
|
|
height: 40px; |
|
|
|
|
line-height: 40px; |
|
|
|
@ -304,10 +370,8 @@ $height: 90px; |
|
|
|
|
width: 70%; |
|
|
|
|
input { |
|
|
|
|
width: 15rem; |
|
|
|
|
padding: 0 .5rem 0 .1rem; |
|
|
|
|
padding: 0 0.5rem 0 0.1rem; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
|