feat(home): 优化直播间展开效果
- 修改直播间展开逻辑,点击后始终展开 - 添加淡入淡出动画效果 - 优化直播间样式,增加自定义 CSS 类
This commit is contained in:
parent
8c57db5764
commit
03d22960f0
@ -107,7 +107,7 @@ const openShow = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const changeLive=()=>{
|
const changeLive=()=>{
|
||||||
fullLive.value= !fullLive.value
|
fullLive.value=true
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -116,14 +116,15 @@ const changeLive=()=>{
|
|||||||
<div
|
<div
|
||||||
@click="changeLive"
|
@click="changeLive"
|
||||||
:class="[
|
:class="[
|
||||||
'transform transition-all duration-500 ease-out ',
|
'changeLive',
|
||||||
fullLive ? 'absolute top-[var(--van-nav-bar-height)] bottom-0px left-0px right-0px h-[calc(100vh-var(--van-nav-bar-height))]' : 'h-188px'
|
fullLive ? 'expanded' : 'collapsed'
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<client-only>
|
<client-only>
|
||||||
<LiveRoom ref="liveRef" :fullLive="fullLive" />
|
<LiveRoom ref="liveRef" :fullLive="fullLive" />
|
||||||
</client-only>
|
</client-only>
|
||||||
</div>
|
</div>
|
||||||
|
<transition name="fade">
|
||||||
<div v-show="!fullLive" class="bg-#fff" >
|
<div v-show="!fullLive" class="bg-#fff" >
|
||||||
<van-tabs sticky animated>
|
<van-tabs sticky animated>
|
||||||
<van-tab title="拍品列表">
|
<van-tab title="拍品列表">
|
||||||
@ -227,6 +228,7 @@ const changeLive=()=>{
|
|||||||
</div>
|
</div>
|
||||||
</van-action-sheet>
|
</van-action-sheet>
|
||||||
</div>
|
</div>
|
||||||
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -241,11 +243,27 @@ const changeLive=()=>{
|
|||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
}
|
}
|
||||||
|
.fade-enter-active, .fade-leave-active {
|
||||||
|
transition: opacity 1s;
|
||||||
|
}
|
||||||
|
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
:deep(.van-swipe__indicator:not(.van-swipe__indicator--active) ) {
|
:deep(.van-swipe__indicator:not(.van-swipe__indicator--active) ) {
|
||||||
background: rgba(0, 0, 0, 0.8);
|
background: rgba(0, 0, 0, 0.8);
|
||||||
}
|
}
|
||||||
</style>
|
.changeLive {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: height 0.5s ease, transform 0.5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
<style scoped>
|
.changeLive.collapsed {
|
||||||
</style>
|
height: 188px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.changeLive.expanded {
|
||||||
|
height: calc(100vh - var(--van-nav-bar-height));
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user