|
@@ -2,22 +2,21 @@
|
|
* @Author: wjc
|
|
* @Author: wjc
|
|
* @Date: 2024-07-03 10:35:44
|
|
* @Date: 2024-07-03 10:35:44
|
|
* @LastEditors: wjc
|
|
* @LastEditors: wjc
|
|
- * @LastEditTime: 2024-07-09 10:48:54
|
|
|
|
|
|
+ * @LastEditTime: 2024-07-10 16:12:32
|
|
* @Description:
|
|
* @Description:
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
- <up-navbar
|
|
|
|
- ref="mNavBarRef"
|
|
|
|
- v-bind="$attrs"
|
|
|
|
- class="m-navbar"
|
|
|
|
- :title="title"
|
|
|
|
- placeholder
|
|
|
|
- :bg-color="bgColor"
|
|
|
|
- auto-back
|
|
|
|
- >
|
|
|
|
|
|
+ <up-navbar ref="mNavBarRef" v-bind="$attrs" class="m-navbar" placeholder :bg-color="bgColor">
|
|
|
|
+ <template #left>
|
|
|
|
+ <view v-if="notBack"></view>
|
|
|
|
+ <view v-else class="i-ep-arrow-left wh-24px cursor-pointer" @click="goBack"></view>
|
|
|
|
+ </template>
|
|
|
|
+ <template #center>
|
|
|
|
+ <view class="m-navbar-title">{{ title }}</view>
|
|
|
|
+ </template>
|
|
<template #right>
|
|
<template #right>
|
|
<slot name="right">
|
|
<slot name="right">
|
|
- <view v-if="rightMenu" class="right-box">
|
|
|
|
|
|
+ <view v-if="rightMenu && rightMenu.length > 0" class="right-box">
|
|
<view class="i-ep-more-filled wh-24px cursor-pointer" @click="triggerMore"></view>
|
|
<view class="i-ep-more-filled wh-24px cursor-pointer" @click="triggerMore"></view>
|
|
<view v-if="showMore" class="overlay" @click="() => (showMore = false)"></view>
|
|
<view v-if="showMore" class="overlay" @click="() => (showMore = false)"></view>
|
|
<view v-if="showMore" class="menu-box">
|
|
<view v-if="showMore" class="menu-box">
|
|
@@ -51,10 +50,16 @@
|
|
defineProps<{
|
|
defineProps<{
|
|
title?: string
|
|
title?: string
|
|
placeholder?: boolean
|
|
placeholder?: boolean
|
|
|
|
+ notBack?: boolean
|
|
bgColor?: string
|
|
bgColor?: string
|
|
rightMenu?: RightMenuItem[]
|
|
rightMenu?: RightMenuItem[]
|
|
}>(),
|
|
}>(),
|
|
- { boolean: true, bgColor: '#fff' }
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '',
|
|
|
|
+ notBack: false,
|
|
|
|
+ bgColor: 'var(--bg-card)',
|
|
|
|
+ rightMenu: () => [],
|
|
|
|
+ }
|
|
)
|
|
)
|
|
const emits = defineEmits<{
|
|
const emits = defineEmits<{
|
|
(e: 'right-click', command: string): void
|
|
(e: 'right-click', command: string): void
|
|
@@ -63,6 +68,10 @@
|
|
const mNavBarRef = ref()
|
|
const mNavBarRef = ref()
|
|
const showMore = ref(false)
|
|
const showMore = ref(false)
|
|
|
|
|
|
|
|
+ const goBack = () => {
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ }
|
|
|
|
+
|
|
const triggerMore = () => {
|
|
const triggerMore = () => {
|
|
showMore.value = !showMore.value
|
|
showMore.value = !showMore.value
|
|
}
|
|
}
|
|
@@ -75,6 +84,9 @@
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
.m-navbar {
|
|
.m-navbar {
|
|
|
|
+ .m-navbar-title {
|
|
|
|
+ @apply text-16px color-text-1;
|
|
|
|
+ }
|
|
.right-box {
|
|
.right-box {
|
|
@apply relative w-full z-1;
|
|
@apply relative w-full z-1;
|
|
.overlay {
|
|
.overlay {
|
|
@@ -82,7 +94,7 @@
|
|
background: rgba(0, 0, 0, 0);
|
|
background: rgba(0, 0, 0, 0);
|
|
}
|
|
}
|
|
.menu-box {
|
|
.menu-box {
|
|
- @apply absolute right-0px z-10 flex flex-col gap-6px w-auto whitespace-nowrap rounded-6px bg-white;
|
|
|
|
|
|
+ @apply absolute right-0px z-10 flex flex-col gap-6px w-auto whitespace-nowrap rounded-6px bg-bg-card;
|
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 20%);
|
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 20%);
|
|
.menu-item {
|
|
.menu-item {
|
|
@apply flex items-center gap-8px h-full flex-1 px-16px py-8px text-left;
|
|
@apply flex items-center gap-8px h-full flex-1 px-16px py-8px text-left;
|