|
|
@@ -193,7 +193,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, computed, onMounted, onUnmounted, watch } from "vue";
|
|
|
+import { ref, computed, onMounted, onUnmounted } from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
import MobileHeader from "@/components/MobileHeader.vue";
|
|
|
import MobilePdfViewer from "@/components/MobilePdfViewer.vue";
|
|
|
@@ -406,38 +406,10 @@ onMounted(() => {
|
|
|
fetchPolicyFiles();
|
|
|
});
|
|
|
|
|
|
-// 滚动位置存储
|
|
|
-let savedScrollPosition = 0;
|
|
|
-
|
|
|
-const lockBodyScroll = () => {
|
|
|
- savedScrollPosition = window.scrollY;
|
|
|
- document.body.style.position = 'fixed';
|
|
|
- document.body.style.top = `-${savedScrollPosition}px`;
|
|
|
- document.body.style.width = '100%';
|
|
|
- document.body.style.overflow = 'hidden';
|
|
|
-};
|
|
|
-
|
|
|
-const unlockBodyScroll = () => {
|
|
|
- document.body.style.position = '';
|
|
|
- document.body.style.top = '';
|
|
|
- document.body.style.width = '';
|
|
|
- document.body.style.overflow = '';
|
|
|
- window.scrollTo(0, savedScrollPosition);
|
|
|
-};
|
|
|
-
|
|
|
onUnmounted(() => {
|
|
|
- unlockBodyScroll();
|
|
|
if (scrollTimer) clearTimeout(scrollTimer);
|
|
|
if (searchTimer) clearTimeout(searchTimer);
|
|
|
});
|
|
|
-
|
|
|
-watch(previewVisible, (val) => {
|
|
|
- if (val) {
|
|
|
- lockBodyScroll();
|
|
|
- } else {
|
|
|
- unlockBodyScroll();
|
|
|
- }
|
|
|
-});
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
@@ -828,15 +800,18 @@ watch(previewVisible, (val) => {
|
|
|
.preview-body {
|
|
|
flex: 1;
|
|
|
background: #111827;
|
|
|
- position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
overflow: hidden;
|
|
|
+ /* 防止内容溢出 */
|
|
|
+ position: relative;
|
|
|
}
|
|
|
|
|
|
.preview-frame {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
border: none;
|
|
|
- display: block;
|
|
|
}
|
|
|
|
|
|
.preview-placeholder {
|