Commit aa0953d6 by liimin

fix(组件): 修复浮层z-index冲突并优化工具箱样式与交互

- 调整 FinishStep 和 ToolBox 组件的 un-popup z-index 值,避免层级覆盖问题
- 优化 ToolBox 浮层样式,改为毛玻璃效果并移除冗余标题栏代码
- 改进浮动按钮的视觉设计,使用蓝色主题并添加触摸事件处理
- 调整面板内按钮布局与样式,提升视觉一致性和操作反馈
1 parent 0cbf48ae
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:mode="isLandscapeMode ? 'right' : 'bottom'" :mode="isLandscapeMode ? 'right' : 'bottom'"
:round="isLandscapeMode ? 0 : 20" :round="isLandscapeMode ? 0 : 20"
:closeable="true" :closeable="true"
:z-index="10074" :z-index="10075"
@close="close"> @close="close">
<view class="popup-wrapper" :class="isLandscapeMode ? 'landscape-wrapper' : 'portrait-wrapper'"> <view class="popup-wrapper" :class="isLandscapeMode ? 'landscape-wrapper' : 'portrait-wrapper'">
<!-- 标题栏 --> <!-- 标题栏 -->
......
<template> <template>
<view class="tool-box" :style="toolBoxVars"> <view class="tool-box" :style="toolBoxVars">
<un-popup :show="show" :mode="isLandscapeMode ? 'right' : 'bottom'" :round="isLandscapeMode ? 0 : 20" @close="hide" :closeable="true" > <un-popup :z-index="10073" :show="show" :mode="isLandscapeMode ? 'right' : 'bottom'" :round="isLandscapeMode ? 0 : 20" @close="hide" :closeable="true" bg-color="transparent">
<view class="list-wrapper" :class="isLandscapeMode ? 'landscape-wrapper' : 'portrait-wrapper'"> <view class="list-wrapper" :class="isLandscapeMode ? 'landscape-wrapper' : 'portrait-wrapper'">
<!-- <view class="panel-head">
<view class="panel-close" @click="hide">
<text class="panel-close-text">×</text>
</view>
</view> -->
<view class="panel-body"> <view class="panel-body">
<view class="section-title-row section-title-row--mt"> <view class="section-title-row section-title-row--mt">
<text class="section-title">快捷操作</text> <text class="section-title">快捷操作</text>
...@@ -66,12 +61,16 @@ ...@@ -66,12 +61,16 @@
inactive-icon="folder" inactive-icon="folder"
:offset-right="20" :offset-right="20"
:offset-top="120" :offset-top="120"
position="top-center" position="right-center"
:size="56" :size="56"
type="primary" type="primary"
@click="handleFabClick"> @click="handleFabClick">
<template #trigger> <template #trigger>
<view class="custom-trigger"> <view class="custom-trigger"
@touchstart="handleTriggerTouchStart"
@touchmove="handleTriggerTouchMove"
@touchend="handleTriggerTouchEnd"
@touchcancel="handleTriggerTouchEnd">
<un-icon name="folder" size="24" color="#fff"></un-icon> <un-icon name="folder" size="24" color="#fff"></un-icon>
<text class="trigger-text">文件夹</text> <text class="trigger-text">文件夹</text>
</view> </view>
...@@ -397,8 +396,10 @@ const handleTriggerTouchMove = (event: TouchEvent): void => { ...@@ -397,8 +396,10 @@ const handleTriggerTouchMove = (event: TouchEvent): void => {
return; return;
} }
const point = readTouchPoint(event); const point = readTouchPoint(event);
const deltaX = point[0] - dragStartX.value;
const deltaY = point[1] - dragStartY.value; const deltaY = point[1] - dragStartY.value;
if (Math.abs(deltaY) > 2) { // 只要 x 或 y 方向滑动超过 2px,就认为是拖动,阻止点击
if (Math.abs(deltaY) > 2 || Math.abs(deltaX) > 2) {
triggerMoved.value = true; triggerMoved.value = true;
} }
const fabSize = visualFabSize.value; const fabSize = visualFabSize.value;
...@@ -492,20 +493,20 @@ defineExpose({ ...@@ -492,20 +493,20 @@ defineExpose({
.custom-trigger { .custom-trigger {
width: 56px; width: 56px;
height: 56px; height: 56px;
background: linear-gradient(145deg, rgba(38, 45, 59, 0.95), rgba(52, 62, 82, 0.9)); background: rgba(22, 119, 255, 0.85);
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: -4px 8px 24px rgba(0, 0, 0, 0.25), inset 1px 1px 2px rgba(255, 255, 255, 0.15); box-shadow: 0 4px 16px rgba(22, 119, 255, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
flex-direction: column; flex-direction: column;
transition: transform 0.22s ease, box-shadow 0.22s ease; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
.trigger-text { .trigger-text {
position: relative; position: relative;
font-size: 11px; font-size: 11px;
color: #e2e8f0; color: #ffffff;
text-align: center; text-align: center;
white-space: normal; white-space: normal;
width: 34px; width: 34px;
...@@ -517,8 +518,8 @@ defineExpose({ ...@@ -517,8 +518,8 @@ defineExpose({
} }
.custom-trigger-active { .custom-trigger-active {
transform: scale(0.96); transform: scale(0.92);
box-shadow: -2px 4px 12px rgba(0, 0, 0, 0.3), inset 1px 1px 4px rgba(255, 255, 255, 0.05); box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
} }
.list-wrapper { .list-wrapper {
...@@ -528,45 +529,19 @@ defineExpose({ ...@@ -528,45 +529,19 @@ defineExpose({
padding: var(--fab-panel-padding-v) var(--fab-panel-padding-h); padding: var(--fab-panel-padding-v) var(--fab-panel-padding-h);
margin-bottom: 0; margin-bottom: 0;
align-items: stretch; align-items: stretch;
// border-radius: 10px 0 0 10px; background: rgba(255, 255, 255, 0.8);
background: linear-gradient(145deg, rgba(30, 36, 48, 0.95), rgba(42, 50, 66, 0.92)); backdrop-filter: blur(20px);
width: var(--panel-width);
height: 100%; /* 撑满侧边栏高度 */
}
.panel-head {
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
height: 32px;
padding: 0 4px 0 8px;
margin-bottom: 4px;
}
.panel-title {
font-size: 13px;
font-weight: 600;
color: #e2e8f0;
letter-spacing: 0.5px;
} }
.panel-close { .landscape-wrapper {
width: 24px; width: var(--panel-width);
height: 24px; height: 100%;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.05);
} }
.panel-close-text { .portrait-wrapper {
font-size: 16px; width: 100%;
font-weight: 400; min-height: 100%;
color: #94a3b8; padding-bottom: env(safe-area-inset-bottom, 24px);
line-height: 16px;
} }
.panel-body { .panel-body {
...@@ -591,7 +566,7 @@ defineExpose({ ...@@ -591,7 +566,7 @@ defineExpose({
font-size: 11px; font-size: 11px;
font-weight: bold; font-weight: bold;
letter-spacing: 0.5px; letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.45); color: rgba(0, 0, 0, 0.45);
} }
.dynamic-group { .dynamic-group {
...@@ -605,7 +580,7 @@ defineExpose({ ...@@ -605,7 +580,7 @@ defineExpose({
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 8px 0 4px; padding: 8px 0 4px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06); border-bottom: 1px solid rgba(0, 0, 0, 0.06);
width: 100%; width: 100%;
} }
...@@ -621,7 +596,7 @@ defineExpose({ ...@@ -621,7 +596,7 @@ defineExpose({
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 12px; margin-bottom: 12px;
width: 33.33%; /* 统一为 3个一行 */ width: 33.33%;
} }
.fab-item { .fab-item {
...@@ -641,18 +616,19 @@ defineExpose({ ...@@ -641,18 +616,19 @@ defineExpose({
.icon-box { .icon-box {
position: relative; position: relative;
width: 38px; width: 44px;
height: 38px; height: 44px;
border-radius: 12px; border-radius: 14px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8);
background: linear-gradient(180deg, rgba(240, 244, 255, 0.96), rgba(220, 230, 248, 0.92)); background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(8px);
border: 1px solid rgba(255, 255, 255, 0.5);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
/* image 上禁止 flex 对齐属性,由外层 .icon-box 居中 */
.btn-icon { .btn-icon {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -676,19 +652,15 @@ defineExpose({ ...@@ -676,19 +652,15 @@ defineExpose({
justify-content: center; justify-content: center;
z-index: 1; z-index: 1;
} }
.item-text {
display: none;
}
} }
.item-text { .item-text {
margin-left: 0; margin-left: 0;
margin-top: 6px; margin-top: 8px;
font-size: 10px; font-size: 11px;
color: rgba(255, 255, 255, 0.85); color: #333333;
font-weight: 500; font-weight: 500;
line-height: 12px; line-height: 14px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -703,11 +675,13 @@ defineExpose({ ...@@ -703,11 +675,13 @@ defineExpose({
} }
.fixed-pay { .fixed-pay {
background: linear-gradient(180deg, #f3f7ff, #cedcf1); background: linear-gradient(135deg, rgba(230, 240, 255, 0.8), rgba(200, 220, 255, 0.6));
border-color: rgba(255, 255, 255, 0.8);
} }
.fixed-finish { .fixed-finish {
background: linear-gradient(180deg, #fff7ee, #e7d7c6); background: linear-gradient(135deg, rgba(255, 240, 230, 0.8), rgba(255, 220, 200, 0.6));
border-color: rgba(255, 255, 255, 0.8);
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!