|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="custom-nav">
|
|
|
+ <view class="custom-nav" :style="navStyle">
|
|
|
<view class="status_bar"></view>
|
|
|
<view class="nav-content">
|
|
|
<view class="nav-left" @click="leftTypeComputed !== 'none' && handleLeft()">
|
|
|
@@ -33,14 +33,20 @@ interface Props {
|
|
|
title: string
|
|
|
// leftType: 'back' | 'home' | 'none' | 'scan',默认 'back'
|
|
|
leftType?: 'back' | 'home' | 'none' | 'scan'
|
|
|
+ opacity?: number
|
|
|
}
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
- leftType: 'back'
|
|
|
+ leftType: 'back',
|
|
|
+ opacity: 0.9
|
|
|
})
|
|
|
|
|
|
const leftTypeComputed = computed(() => props.leftType || 'back')
|
|
|
|
|
|
+const navStyle = computed(() => ({
|
|
|
+ backgroundColor: `rgba(255, 255, 255, ${props.opacity})`
|
|
|
+}))
|
|
|
+
|
|
|
const emit = defineEmits<{
|
|
|
(e: 'scan', payload: any): void
|
|
|
(e: 'scanError', err: any): void
|
|
|
@@ -104,7 +110,6 @@ const handleLeft = () => {
|
|
|
right: 0;
|
|
|
z-index: 1000;
|
|
|
height: calc(var(--status-bar-height) + 44px);
|
|
|
- background-color: #ffffffe7;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
|