fix(cp排行榜): 处理页面margin结合fixed 遮罩导致的遮罩层偏移的问题

This commit is contained in:
hzj 2026-06-02 10:31:12 +08:00
parent 52a8bbba12
commit b5f0770112
2 changed files with 8 additions and 2 deletions

View File

@ -26,6 +26,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
lockScroll: {
type: Boolean,
default: true,
},
}) })
let lockCount = 0 let lockCount = 0
@ -95,6 +99,8 @@ const unlockPageScroll = () => {
watch( watch(
() => props.maskLayerShow, () => props.maskLayerShow,
(newVal) => { (newVal) => {
if (!props.lockScroll) return
if (newVal) { if (newVal) {
lockPageScroll() lockPageScroll()
} else { } else {
@ -105,7 +111,7 @@ watch(
) )
onUnmounted(() => { onUnmounted(() => {
if (props.maskLayerShow) { if (props.lockScroll && props.maskLayerShow) {
unlockPageScroll() unlockPageScroll()
} }
}) })

View File

@ -393,7 +393,7 @@
</div> </div>
<!-- 弹窗遮罩层 --> <!-- 弹窗遮罩层 -->
<maskLayer class="couple-popup-mask" :maskLayerShow="maskLayerShow"> <maskLayer class="couple-popup-mask" :maskLayerShow="maskLayerShow" :lockScroll="false">
<div class="couple-popup-content" @click.self="closedPopup"> <div class="couple-popup-content" @click.self="closedPopup">
<!-- 我的伴侣弹窗 --> <!-- 我的伴侣弹窗 -->
<div v-show="myCoupleShow" style="position: fixed; bottom: 0; width: 100%"> <div v-show="myCoupleShow" style="position: fixed; bottom: 0; width: 100%">