代码提交
This commit is contained in:
@ -12,7 +12,7 @@ import { useRouter } from "@/hooks/useRouter";
|
||||
import { createAnimation } from "@/utils/utils";
|
||||
import { useScroll } from "@/hooks/useScroll";
|
||||
|
||||
const HEADER_HEIGHT = 40 // header高度
|
||||
const HEADER_HEIGHT = 60 // header高度
|
||||
|
||||
const {goBack} = useRouter()
|
||||
/**
|
||||
@ -31,6 +31,10 @@ const {goBack} = useRouter()
|
||||
*
|
||||
*/
|
||||
const props = defineProps({
|
||||
scrollTop:{
|
||||
type:Number,
|
||||
default:()=>0
|
||||
},
|
||||
systemBarAreaBg: {
|
||||
type: String,
|
||||
default: () => '#FFFFFF00' // 透明 #FFFFFF00
|
||||
@ -93,7 +97,8 @@ const {
|
||||
bgChangeColor,
|
||||
propUp,
|
||||
showRight,
|
||||
leftWidth
|
||||
leftWidth,
|
||||
scrollTop
|
||||
} = toRefs(props)
|
||||
|
||||
const emits = defineEmits(['getSystemInfo', 'animation'])
|
||||
@ -198,7 +203,8 @@ const scrollMaskStyle = computed(() => {
|
||||
|
||||
// 总高度
|
||||
const containerHeight = computed(() => {
|
||||
return (unref(heightInfo).statusBarHeight + HEADER_HEIGHT)
|
||||
const marginTop = unref(menuInfo).height > 0 ? `${((HEADER_HEIGHT - unref(menuInfo).height))/2}` : 0
|
||||
return (unref(heightInfo).statusBarHeight + HEADER_HEIGHT - marginTop)
|
||||
})
|
||||
|
||||
let animation
|
||||
@ -208,7 +214,6 @@ function doCreateAnimation() {
|
||||
animation = createAnimation(0, scrollEnd, 0, 1)
|
||||
}
|
||||
|
||||
const {scrollTop} = useScroll();
|
||||
watch(scrollTop, () => {
|
||||
if (!bgChangeByScroll.value) return
|
||||
if (!animation) doCreateAnimation()
|
||||
|
Reference in New Issue
Block a user