Files
Road_roller/src/components/home/homeNav.vue
2026-09-01 10:03:38 +08:00

97 lines
1.9 KiB
Vue

<script setup lang="ts">
function onIconClick(name: string) {
if (name === '通知') {
uni.navigateTo({
url: '/pages/message/index',
})
}
else if (name === '设置') {
// 处理设置
console.log(`点击了${name}图标`)
}
else if (name === '蓝牙') {
// 处理蓝牙
console.log(`点击了${name}图标`)
}
else {
console.log(`点击了${name}图标`)
}
}
</script>
<template>
<view class="custom-nav">
<view class="nav-left">
<image class="nav-logo" src="/static/logo.png" mode="aspectFit" @tap="onIconClick('logo')" />
<view class="nav-info">
<text class="nav-title">
G6高速改扩建测试测试项目
</text>
<text class="nav-subtitle">
K1+200-K1+800
</text>
</view>
</view>
<view class="nav-right">
<image class="nav-icon" src="/static/seting.png" mode="aspectFit" @tap="onIconClick('设置')" />
<image class="nav-icon" src="/static/Bluetooth.png" mode="aspectFit" @tap="onIconClick('蓝牙')" />
<image class="nav-icon" src="/static/message.png" mode="aspectFit" @tap="onIconClick('通知')" />
</view>
</view>
</template>
<style scoped>
.custom-nav {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: space-between;
height: 88px;
padding-left: 16px;
padding-right: 16px;
background-color: #ffffff;
z-index: 999;
}
.nav-left {
display: flex;
align-items: center;
}
.nav-logo {
width: 270rpx;
height: 810rpx;
margin-right: 12px;
}
.nav-info {
display: flex;
flex-direction: column;
}
.nav-title {
font-size: 18px;
font-weight: bold;
color: #333333;
}
.nav-subtitle {
font-size: 12px;
color: #999999;
}
.nav-right {
display: flex;
align-items: center;
gap: 12px;
}
.nav-icon {
width: 32px;
height: 32px;
}
</style>