301 lines
7.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="layout-header-warp">
<div class="layout-header">
<div class="layout-header-top">
<div class="layout-header-top-left">
<span class="welcome-msg">您好欢迎来到农业产业运营平台</span>
<div class="left-link">
<div class="iconfont icon-bigScreen"></div>
<span>数据大屏</span>
</div>
<div class="left-link">
<div class="iconfont icon-operation" style="font-size: 12px"></div>
<span>产业运营管理</span>
</div>
</div>
<div class="layout-header-top-right">
<span class="block-icon" @click="toCart">
<div class="iconfont icon-shopcar" style="font-size: 12px"></div>
<span>购物车</span>
</span>
<span>商家中心</span>
<span @click="toUserCenter">个人中心</span>
<span class="block-icon" @click="toHome">
<div class="iconfont icon-home" style="font-size: 12px"></div>
<span>返回首页</span>
</span>
</div>
</div>
<div class="layout-header-bottom">
<div class="layout-header-bottom-left">
<div class="layout-header-bottom-search">
<div class="title">
<img :src="getAssetsFile('images/logo.png')" />
</div>
<div class="search-warp">
<el-input v-model="keyword" placeholder="请输入关键词进行搜索"></el-input>
<el-button type="primary" @click="Search">搜索</el-button>
</div>
</div>
</div>
<div class="layout-header-bottom-right">
<div class="layout-header-bottom-right-qr">
<div class="layout-header-bottom-right-qr-img">
<img :src="qrImg" alt="" />
<p>下载数农App</p>
</div>
<div class="layout-header-bottom-right-qr-img">
<img :src="qrImg" alt="" />
<p>打开数农小程序</p>
</div>
</div>
</div>
</div>
<div class="layout-header-menu">
<el-menu ellipsis class="layout-header-bottom-menu" mode="horizontal">
<app-link v-for="(item, index) in meuns" :key="index" :to="item.path">
<el-menu-item active-text-color="#25BF82">{{ item.label }}</el-menu-item>
</app-link>
</el-menu>
</div>
</div>
</div>
</template>
<script setup name="layout-header">
import { ref } from 'vue';
import { qrImg } from './base64img';
import AppLink from '../Menu/Link.vue';
import { useRouter } from 'vue-router';
import { getAssetsFile } from '@/utils';
const router = useRouter();
const keyword = ref('');
const meuns = ref([
// {
// label: '综合看板',
// path: '/sub-operation-service/dashboard',
// },
{
label: '智慧种植',
path: '/sub-operation-service/smartFarm',
},
{
label: '电商交易',
path: '/sub-operation-service/ecommerce',
},
{
label: '涉农金融',
path: '/sub-operation-service/ruralFinance',
},
{
label: '分拣包装',
path: '/sub-operation-service/packaging',
},
{
label: '仓储物流',
path: '/sub-operation-service/warehouseLogistics',
},
{
label: '公共品牌',
path: '/sub-operation-service/brand',
},
]);
function Search() {
console.log(keyword.value, 'search');
}
const toHome = () => {
console.info('toHome', router);
router.push('/sub-operation-service/home');
};
const toUserCenter = () => {
console.info('toUserCenter', router);
router.push('/sub-operation-service/userCenter');
};
const toCart = () => {
router.push('/sub-operation-service/userCenter');
};
</script>
<style lang="scss" scoped>
.layout-header-warp {
width: 100%;
text-align: center;
background: $color-fff;
.layout-header-menu {
width: 100%;
::v-deep() {
.el-menu {
justify-content: space-around;
border: none !important;
}
.el-menu-item {
font-size: 20px;
}
.el-menu-item:hover {
color: $color-main;
background: none !important;
}
.el-menu-item:active {
color: $color-main;
background: none !important;
}
}
}
}
.layout {
// width: 100%;
// height: 100%;
// box-sizing: border-box;
&-header {
overflow: hidden;
margin: auto;
width: 1200px;
height: 206px;
&-top {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 32px;
height: 44px;
&-left {
line-height: 36px;
.welcome-msg {
font-size: 12px;
color: $color-5a;
}
.left-link {
display: inline-block;
margin: 0 10px;
font-size: 12px;
color: $color-main;
cursor: pointer;
.iconfont {
display: inline-block;
margin-right: 2px;
color: $color-main;
}
.iconfont,
span {
vertical-align: middle;
}
}
}
&-right {
span {
margin-left: 25px;
font-size: 12px;
text-align: center;
color: $color-000;
line-height: 36px;
cursor: pointer;
&:nth-child(1) {
margin-left: 0;
}
&.block-icon {
.iconfont {
display: inline-block;
vertical-align: middle;
color: $color-main;
&.icon-shopcar {
font-size: 16px !important;
font-weight: bold;
}
}
span {
display: inline-block;
margin-left: 6px;
vertical-align: middle;
}
color: $color-main;
}
}
}
}
&-bottom {
display: flex;
padding: 20px 32px 0;
&-left {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
width: calc(100% - 300px);
.layout-header-bottom-search {
display: flex;
align-items: center;
.title {
font-size: 45px;
white-space: nowrap;
}
.search-warp {
position: relative;
padding-left: 36px;
width: 100%;
.el-input {
width: 100%;
height: 50px;
font-size: 18px;
flex-grow: 1;
:deep(.el-input__wrapper) {
padding-right: 100px;
}
}
.el-button {
position: absolute;
top: 50%;
right: 8px;
padding: 0 24px;
height: 42px;
font-size: 18px;
transform: translateY(-50%);
}
}
}
.layout-header-bottom-menu {
justify-content: space-around;
border: none;
.el-menu-item {
font-size: 20px;
}
}
}
&-right {
margin-top: -10px;
padding-left: 20px;
width: 240px;
p {
text-align: center;
}
&-qr {
display: flex;
justify-content: space-between;
&-img {
img {
width: 48px;
height: 48px;
}
p {
text-align: center;
}
}
}
}
}
}
&-main {
width: 100%;
height: calc(100% - 206px);
background-color: #f8f8f8;
}
}
</style>