|
@@ -3,7 +3,7 @@
|
|
|
<div
|
|
|
class="promotion-portal-top"
|
|
|
ref="topRef"
|
|
|
- :style="{ height: topHeight + 'px', backgroundImage: `url(${AiBgImage})` }"
|
|
|
+ :style="{ backgroundImage: `url(${AiBgImage})` }"
|
|
|
>
|
|
|
<div class="promotion-portal-top__wrapper">
|
|
|
<TopContent></TopContent>
|
|
@@ -12,12 +12,12 @@
|
|
|
<div
|
|
|
class="promotion-portal-tab record"
|
|
|
ref="tab1Ref"
|
|
|
- :style="{ height: tab1Height + 'px', backgroundImage: `url(${Tab1Image})` }"
|
|
|
+ :style="{ backgroundImage: `url(${Tab1Image})` }"
|
|
|
></div>
|
|
|
<div
|
|
|
class="promotion-portal-tab cando"
|
|
|
ref="tab2Ref"
|
|
|
- :style="{ height: tab2Height + 'px', backgroundImage: `url(${Tab2Image})` }"
|
|
|
+ :style="{ backgroundImage: `url(${Tab2Image})` }"
|
|
|
></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -29,54 +29,55 @@ import AiBgImage from '@/assets/images/ai-bg.png';
|
|
|
import Tab1Image from '@/assets/images/record.png';
|
|
|
import Tab2Image from '@/assets/images/cando.png';
|
|
|
|
|
|
-const topRef = ref<HTMLElement | null>(null);
|
|
|
-const tab1Ref = ref<HTMLElement | null>(null);
|
|
|
-const tab2Ref = ref<HTMLElement | null>(null);
|
|
|
+// const topRef = ref<HTMLElement | null>(null);
|
|
|
+// const tab1Ref = ref<HTMLElement | null>(null);
|
|
|
+// const tab2Ref = ref<HTMLElement | null>(null);
|
|
|
|
|
|
-const topHeight = ref(0);
|
|
|
-const tab1Height = ref(0);
|
|
|
-const tab2Height = ref(0);
|
|
|
+// const topHeight = ref(0);
|
|
|
+// const tab1Height = ref(0);
|
|
|
+// const tab2Height = ref(0);
|
|
|
|
|
|
-function setHeight(refEl: HTMLElement | null, imgUrl: string, heightRef: typeof topHeight) {
|
|
|
- if (!refEl) return;
|
|
|
- const img = new Image();
|
|
|
- img.src = imgUrl;
|
|
|
- img.onload = () => {
|
|
|
- const ratio = img.height / img.width;
|
|
|
- heightRef.value = refEl.offsetWidth * ratio;
|
|
|
- };
|
|
|
-}
|
|
|
+// function setHeight(refEl: HTMLElement | null, imgUrl: string, heightRef: typeof topHeight) {
|
|
|
+// if (!refEl) return;
|
|
|
+// const img = new Image();
|
|
|
+// img.src = imgUrl;
|
|
|
+// img.onload = () => {
|
|
|
+// const ratio = img.height / img.width;
|
|
|
+// heightRef.value = refEl.offsetWidth * ratio;
|
|
|
+// };
|
|
|
+// }
|
|
|
|
|
|
-function setRem() {
|
|
|
- const baseSize = 16; // 基准字体大小
|
|
|
- const designWidth = 1920; // 设计稿宽度
|
|
|
- const scale = window.innerWidth / designWidth;
|
|
|
- document.documentElement.style.fontSize = baseSize * scale + 'px';
|
|
|
-}
|
|
|
+// function setRem() {
|
|
|
+// const baseSize = 16; // 基准字体大小
|
|
|
+// const designWidth = 1920; // 设计稿宽度
|
|
|
+// const scale = window.innerWidth / designWidth;
|
|
|
+// document.documentElement.style.fontSize = baseSize * scale + 'px';
|
|
|
+// }
|
|
|
|
|
|
-setRem();
|
|
|
+// setRem();
|
|
|
|
|
|
-function updateAllHeights() {
|
|
|
- setHeight(topRef.value, AiBgImage, topHeight);
|
|
|
- setHeight(tab1Ref.value, Tab1Image, tab1Height);
|
|
|
- setHeight(tab2Ref.value, Tab2Image, tab2Height);
|
|
|
-}
|
|
|
+// function updateAllHeights() {
|
|
|
+// setHeight(topRef.value, AiBgImage, topHeight);
|
|
|
+// setHeight(tab1Ref.value, Tab1Image, tab1Height);
|
|
|
+// setHeight(tab2Ref.value, Tab2Image, tab2Height);
|
|
|
+// }
|
|
|
|
|
|
onMounted(() => {
|
|
|
- updateAllHeights();
|
|
|
- window.addEventListener('resize', updateAllHeights);
|
|
|
- window.addEventListener('resize', setRem);
|
|
|
+ // updateAllHeights();
|
|
|
+ // window.addEventListener('resize', updateAllHeights);
|
|
|
+ // window.addEventListener('resize', setRem);
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
- window.removeEventListener('resize', updateAllHeights);
|
|
|
- window.addEventListener('resize', setRem);
|
|
|
+ // window.removeEventListener('resize', updateAllHeights);
|
|
|
+ // window.addEventListener('resize', setRem);
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.promotion-portal {
|
|
|
- width: 100%;
|
|
|
+ width: 1920px;
|
|
|
+ height: 2250px;
|
|
|
overflow: auto;
|
|
|
|
|
|
&-top,
|
|
@@ -89,14 +90,10 @@ onUnmounted(() => {
|
|
|
}
|
|
|
|
|
|
&-top {
|
|
|
- position: relative;
|
|
|
+ height: 750px;
|
|
|
&__wrapper {
|
|
|
- position: absolute;
|
|
|
- top: 2rem;
|
|
|
- left: 16.25rem;
|
|
|
- width: 41rem;
|
|
|
- height: 34rem;
|
|
|
- overflow: auto;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
}
|
|
|
|