feat: 快速预定功能调整

This commit is contained in:
duanshuwen
2025-10-21 20:58:32 +08:00
parent 5e0ce0b3a4
commit 7a827e1d92
3 changed files with 85 additions and 50 deletions

View File

@@ -10,14 +10,24 @@
]"
@click="handleTabClick(index)"
>
<text
:class="[
'font-size-16 font-500 color-525866 absolute',
activeIndex === index && 'tab-text-active',
]"
>
{{ item.label }}
</text>
<view class="absolute flex flex-items-center">
<uni-icons
class="icon mr-4"
fontFamily="znicons"
size="20"
:color="activeIndex === index ? '#2D91FF' : '#525866'"
>
{{ zniconsMap[item.icon] }}
</uni-icons>
<text
:class="[
'font-size-16 font-500 color-525866 ',
activeIndex === index && 'tab-text-active',
]"
>
{{ item.label }}
</text>
</view>
</view>
</view>
@@ -45,6 +55,7 @@ import {
watch,
getCurrentInstance,
} from "vue";
import { zniconsMap } from "@/static/fonts/znicons";
// 获取组件实例
const instance = getCurrentInstance();
@@ -54,10 +65,10 @@ const props = defineProps({
tabs: {
type: Array,
default: () => [
{ label: "客房", value: "0" },
{ label: "门票", value: "1" },
{ label: "餐食", value: "2" },
{ label: "套餐", value: "3" },
{ label: "客房", value: "0", icon: "zn-nav-room" },
{ label: "门票", value: "1", icon: "zn-nav-ticket" },
{ label: "餐食", value: "2", icon: "zn-nav-meal" },
// { label: "套餐", value: "3", icon: "zn-package" },
],
},
defaultActive: {

View File

@@ -7,6 +7,11 @@
height: 100%;
}
.icon {
height: 20px;
width: 20px;
}
.tab-item-active {
&::before {
content: "";