school_website/ruoyi-ui/src/views/officialWebsite/Components/header.vue

139 lines
3.2 KiB
Vue
Raw Normal View History

2024-07-29 11:08:00 +08:00
<template>
<div class="tab-box">
<!-- left -->
2024-08-04 17:31:55 +08:00
<div class="d-s" @click="toHome">
2024-07-29 11:08:00 +08:00
<div class="logo-box">
<img :src="baseInfo.webImg" />
</div>
<div class="logo-size">
{{ this.baseInfo.webName }}
</div>
</div>
<!-- tab -->
<div class="d-s">
2024-07-29 14:30:06 +08:00
<div class="x-x" v-for="(item, index) in tablist " :key="index" @click="tabClick(item.jumpUrl, item.id)" >
2024-07-29 11:08:00 +08:00
{{ item.label }}
</div>
</div>
<!-- right -->
<div class="d-s" style="font-size: 20px; color: #fff;cursor: pointer;width: 170px;justify-content: flex-end">
2024-08-01 19:19:11 +08:00
<!-- <i class="el-icon-search" v-if="show_search"></i>-->
<!-- <div style="font-size: 18px; margin-left: 15px; " v-if="show_search" @click="show_search = !show_search">搜索-->
<!-- </div>-->
<!-- <el-input placeholder="输入关键词" v-model="input" style="width: 150px;height: 35px" v-if="!show_search">-->
<!-- <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
<!-- </el-input>-->
<!-- <i class="el-icon-circle-close" v-if="!show_search" style="margin-left: 10px;"-->
<!-- @click="show_search = true"></i>-->
2024-07-29 11:08:00 +08:00
</div>
</div>
</template>
<script>
import { getbanner, getBaseInfo, getTab } from '@/api/gw/home'
export default {
data() {
return {
baseInfo:"",
input:'',
show_search: true,
2024-07-29 16:50:33 +08:00
categoryQuery:{},
2024-07-29 11:08:00 +08:00
tablist: [
{name: '首页'},
{name: '中心概括'},
{name: '教学资源'},
{name: '教学平台'},
{name: '教学团队'},
{name: '专业委员会'},
{name: '教学研讨活动'},
{name: '虚仿专业频道'},
{name: '大赛风采'},
{name: '实践平台'},
{name: '合作企业'},
{name: '联系我们'},
],
}
},
2024-08-01 13:44:32 +08:00
props: {
msg: String
},
2024-07-29 11:08:00 +08:00
mounted() {
// 页面加载完毕调用
this.tabLsit();
this.getWebBaseInfo()
},
methods:{
2024-07-29 14:30:06 +08:00
tabClick(url,id){
2024-07-31 18:04:00 +08:00
if (url === 'home') url = "gw";
2024-07-29 14:30:06 +08:00
this.$router.push({
name: url,
2024-07-29 16:15:31 +08:00
query:{ id: id }
2024-07-29 14:30:06 +08:00
});
2024-07-29 11:08:00 +08:00
},
tabLsit() {
getTab().then(response => {
if (response.code == 200) {
this.tablist = response.data;
this.categoryQuery.categoryId = this.tablist[0].id
}
})
},
getWebBaseInfo() {
getBaseInfo().then(res => {
this.baseInfo = res.data
this.baseInfo.webImg = process.env.VUE_APP_BASE_API + this.baseInfo.webImg
})
2024-08-04 17:31:55 +08:00
},
toHome(){
this.$router.push("/virtually")
2024-07-29 11:08:00 +08:00
}
}
}
</script>
<style scoped lang="scss">
.tab-box {
width: 100%;
box-sizing: border-box;
padding: 20px 50px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);;
font-weight: bold;
font-size: 18px;
color: #FFFFFF;
position: absolute;
z-index: 3;
}
.d-s {
display: flex;
align-items: center;
2024-08-04 17:31:55 +08:00
cursor: pointer;
2024-07-29 11:08:00 +08:00
}
.logo-box {
width: 50px;
height: 50px;
background: #fff;
}
.logo-box img{
width: 50px;
height: 50px;
}
.logo-size {
font-weight: 800;
font-size: 24px;
color: #FFFFFF;
margin-left: 20px;
}
.x-x {
margin-right: 10px;
cursor: pointer;
}
</style>