Commit 3b42bf33 by liimin

feat(界面交互): 优化工具框动画效果和样式

改进工具框的展开动画,使用更平滑的过渡效果和延迟动画
调整列表项的显示顺序和样式,提升用户体验
1 parent c94e1a73
......@@ -275,8 +275,8 @@ export default {
this.recordFailList = recordFailListAll.reverse();
},
async getPreRecordFail () {
await this.getPreRecordNum()
this.list[0] = this.preRecordFailList.map(i => {
await this.getPreRecordNum()
this.list[0] = this.preRecordFailList.reverse().map(i => {
return Object.assign(i, {
duration: 0,
})
......@@ -287,7 +287,7 @@ export default {
},
async getPreRecordNum () {
const preRecordList = await this.recorder.getRecords()
this.preRecordFailList = preRecordList.reverse()
this.preRecordFailList = preRecordList
},
getRecordFail () {
this.getRecordNum()
......@@ -335,9 +335,8 @@ export default {
result:orderFinishFlag===1?'完成':'未完成',
// bussinessType: sceneType == 0 ? 1 : 2,
})
// 3. 数据处理
records.forEach(e => {
records.reverse().forEach(e => {
e.duration = e.durationStr || this.formatSeconds(new Date(e.endTime).getTime() - new Date(e.startTime).getTime())
e.orderFinishFlag = e.result === '完成'?1:0
})
......
......@@ -8,7 +8,7 @@
<view class="title" @click="close">{{ folderName }}</view>
<view class="list-body">
<template v-for="(i, index) in data">
<view :class="['item', { active: i[idKey] == id }]" :key="index" @click="jump(i)">
<view :class="['item', { active: i[idKey] == id }]" :key="index" @click="jump(i)" :style="{'--i': index}">
<template v-if="i.shortTitleUrl">
<image class="icon" :src="i.shortTitleUrl" mode="scaleToFill" />
</template>
......@@ -22,7 +22,7 @@
</template>
</view>
<template v-if="showPayBtn">
<view class="item" @click="toPay">
<view class="item" @click="toPay" :style="{'--i': data.length}">
<view class="icon">
<view class="sprite-icon icon-tool-pay"></view>
</view>
......@@ -30,7 +30,7 @@
</view>
</template>
<template v-if="type != 'preview'">
<view class="item" @click="finish">
<view class="item" @click="finish" :style="{'--i': data.length + (showPayBtn ? 1 : 0)}">
<view class="icon">
<view class="sprite-icon icon-tool-finish"></view>
</view>
......@@ -125,60 +125,68 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
opacity: 1;
transform: scale(1);
overflow: hidden;
position: relative;
z-index: 2;
.icon {
width: toRpx(60);
height: toRpx(60);
margin-bottom: toRpx(8);
transition: all 0.05s;
transition: all 0.2s;
}
}
.hideIcon {
height: 0;
overflow: hidden;
opacity: 0;
.icon {
height: 0;
margin-bottom: 0;
}
transform: translateY(toRpx(10)) scale(0.95);
pointer-events: none;
}
.list {
width: 100%;
border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(8) toRpx(22) 0 #0000001a;
border-radius: toRpx(16);
display: flex;
flex-direction: column;
align-items: center;
transition: all 0.05s;
transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
overflow: hidden;
opacity: 0;
position: relative;
background: rgba(255, 255, 255, 0.6);
position: absolute;
top: 0;
left: 0;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
visibility: hidden;
height: 0;
&::after {
position: absolute;
content: '';
background: inherit;
top: 0;
left: 0;
right: 0;
bottom: 0;
filter: blur(toRpx(8));
z-index: -1;
}
max-height: toRpx(120); /* Same as button height initially */
transform: scale(0.98);
transform-origin: top center;
z-index: 1;
.title {
width: toRpx(120);
width: 100%;
height: toRpx(56);
background: #f4f4f5;
border: toRpx(2) solid #ffffff;
border-radius: toRpx(16) toRpx(16) 0 0;
background: #f8f9fb;
border-bottom: toRpx(1) solid rgba(0,0,0,0.05);
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(24);
font-weight: 500;
color: #333;
flex-shrink: 0;
}
.list-body {
width: 100%;
max-height: 60vh;
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(10);
}
.item {
display: flex;
......@@ -187,35 +195,42 @@ export default {
justify-content: center;
font-size: toRpx(20);
color: #666666;
// height: toRpx(120);
width: 100%;
padding-top: toRpx(16);
padding-bottom: toRpx(8);
/* Animation Setup */
opacity: 0;
transform: translateY(toRpx(-20));
transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth ease-out, no bounce */
.icon {
width: toRpx(60);
height: toRpx(60);
margin-bottom: toRpx(8);
}
&:active {
transform: scale(0.95) !important;
transition: transform 0.1s;
}
}
.active {
color: #2c66f7;
}
}
.showList {
display: flex;
opacity: 1;
padding-bottom: toRpx(16);
animation: scale-up-top-right 0.4s;
visibility: visible;
height: auto;
}
@keyframes scale-up-top-right {
0% {
transform: scale(0.5);
transform-origin: top right;
}
100% {
transform: scale(1);
transform-origin: top right;
max-height: 80vh;
transform: scale(1);
z-index: 3;
padding-bottom: toRpx(16);
.item {
opacity: 1;
transform: translateY(0);
transition-delay: calc(0.02s + var(--i) * 0.025s); /* Staggered delay */
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!