feat: 为 SwitchTab 组件添加返回按钮并将其封装为全屏 van-popup 弹窗。

This commit is contained in:
li 2026-01-19 22:18:07 +08:00
parent f988f91b3c
commit 211d66e4c2
2 changed files with 44 additions and 8 deletions

View File

@ -1,6 +1,10 @@
<template> <template>
<div class="switchtab"> <div class="switchtab">
<div class="nav"> <div class="nav">
<div class="back-btn" @click="close">
<span class="icon"></span>
<span class="text">返回</span>
</div>
<div <div
class="li good" class="li good"
:class="{ active: active == 0 }" :class="{ active: active == 0 }"
@ -94,6 +98,32 @@ $text-secondary: #888;
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
flex-shrink: 0; flex-shrink: 0;
.back-btn {
display: flex;
align-items: center;
gap: 4px;
padding: 0 16px;
height: 100%;
color: $gold;
font-weight: 600;
cursor: pointer;
border-right: 1px solid $border-color;
transition: all 0.3s;
.icon {
font-size: 18px;
}
&:hover {
background: $dark-bg-secondary;
color: lighten($gold, 10%);
}
&:active {
opacity: 0.7;
}
}
.li { .li {
flex: 1; flex: 1;
height: 100%; height: 100%;

View File

@ -184,7 +184,14 @@
</div> </div>
<!-- Moved Switch Views to Root View Level for Full Height Overlay --> <!-- Moved Switch Views to Root View Level for Full Height Overlay -->
<div class="switchView animate__fadeIn animated0" v-if="switchtabshow" @click.stop> <van-popup
v-model:show="switchtabshow"
position="bottom"
:style="{ height: '100%' }"
:overlay="true"
:close-on-click-overlay="false"
@click.stop
>
<SwitchTab <SwitchTab
@showSwitchtab="showSwitchtab" @showSwitchtab="showSwitchtab"
:tabInfo="{ :tabInfo="{
@ -192,7 +199,7 @@
table_id: tableData && tableData.id table_id: tableData && tableData.id
}" }"
></SwitchTab> ></SwitchTab>
</div> </van-popup>
<div <div
class="switchView camera animate__fadeIn animated0" class="switchView camera animate__fadeIn animated0"
v-if="switchCameraShow" v-if="switchCameraShow"
@ -1363,15 +1370,14 @@ $gold: #c5a059;
/* Switch Views (Camera/Tables)Overlay */ /* Switch Views (Camera/Tables)Overlay */
.switchView { .switchView {
position: absolute; position: fixed;
width: 60%; width: 100%;
height: 100%; height: 100%;
bottom: 0; top: 0;
right: 0; left: 0;
z-index: 2010; z-index: 2010;
background: $dark-bg-secondary; background: $dark-bg-secondary;
border-top-left-radius: 0.3rem; &.camera { width: 40%; position: absolute; bottom: 0; right: 0; border-top-left-radius: 0.3rem; }
&.camera { width: 40%; }
} }
/* Separated Video Controls */ /* Separated Video Controls */