顶部

parent 37e37bf9
<template> <template>
<!-- <Header backgroundBox="#f8f8f8" :show="false"></Header> --> <!-- <Header backgroundBox="#f8f8f8" :show="false"></Header> -->
<div class="header" :style="{height: contentHeight + 'px'}"></div>
<div class="container" v-if="userStore.isLogin"> <div class="container" v-if="userStore.isLogin">
<div class="userinfo"> <div class="userinfo">
<img class="avatar" mode="aspectFill" <img class="avatar" mode="aspectFill"
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<van-tabs v-model:active="active" background="#f8f8f8" animated swipeable sticky offset-top="50"> <van-tabs v-model:active="active" background="#f8f8f8" animated swipeable sticky :offset-top="contentHeight">
<van-tab title="待发布"> <van-tab title="待发布">
<picture-list ref="waitingPublishPicture" :active="0" @total="setTotal" @refresh="handleRefreshPublishPicture" @publish="handlePublishPicture"></picture-list> <picture-list ref="waitingPublishPicture" :active="0" @total="setTotal" @refresh="handleRefreshPublishPicture" @publish="handlePublishPicture"></picture-list>
</van-tab> </van-tab>
...@@ -72,6 +73,15 @@ import MoreOperations from './components/MoreOperations/index.vue' ...@@ -72,6 +73,15 @@ import MoreOperations from './components/MoreOperations/index.vue'
import Publish from './components/Publish/index.vue' import Publish from './components/Publish/index.vue'
useInitScroll() useInitScroll()
const contentHeight = ref(50)
onLoad(() => {
xma.xh.getMenuButtonBoundingClientRect({
success(res) {
contentHeight.value = (res.top + res.bottom) / 2 + 25;
},
});
})
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const active = ref(0) const active = ref(0)
...@@ -133,6 +143,12 @@ const handleOperation = (e) => { ...@@ -133,6 +143,12 @@ const handleOperation = (e) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header {
position: sticky;
top: 0;
background-color: #f8f8f8;
z-index: 999;
}
.container { .container {
background-color: #f8f8f8; background-color: #f8f8f8;
padding: 38px 12px 0 12px; padding: 38px 12px 0 12px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment