Commit 3b42bf33 by liimin

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

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