|
@@ -1,9 +1,12 @@
|
|
|
-
|
|
|
<script setup>
|
|
|
-import { ref, computed, watch, onMounted, inject } from "vue"
|
|
|
+import { ref, inject } from "vue"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
|
import { useStore } from "vuex"
|
|
|
import Startup from "@/views/StartupView.vue"
|
|
|
+import useRollFu from "../rollFu.js"
|
|
|
+
|
|
|
+import HotspotDetail3 from "@/views/HotspotDetail3.vue"
|
|
|
+import HotspotDetail1 from "@/views/HotspotDetail1.vue"
|
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
@@ -12,11 +15,39 @@ const store = useStore()
|
|
|
|
|
|
const $env = inject("$env")
|
|
|
|
|
|
+const { handleScroll } = useRollFu()
|
|
|
+
|
|
|
+const isShowOperationTip = ref(true)
|
|
|
+
|
|
|
+const isShowHotspotDetail1 = ref(false)
|
|
|
+const isShowHotspotDetail3 = ref(false)
|
|
|
+
|
|
|
+// 滑动逻辑
|
|
|
+const scrollFu = (val) => {
|
|
|
+
|
|
|
+ if (val == -1) {
|
|
|
+ // 上滚
|
|
|
+ console.log("上滚")
|
|
|
+ } else if (val == 1) {
|
|
|
+ // 下滚
|
|
|
+ console.log("下滚")
|
|
|
+ isShowOperationTip.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const curPageIndex = ref(0)
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="home">
|
|
|
+ <!-- 滚动区域 -->
|
|
|
+ <div
|
|
|
+ ref="scroller"
|
|
|
+ class="scroller"
|
|
|
+ @wheel="($event) => handleScroll($event, (val) => scrollFu(val))"
|
|
|
+ >
|
|
|
+ <div class="scroller-content" />
|
|
|
+ </div>
|
|
|
<!-- 背景 -->
|
|
|
<div
|
|
|
class="bg-mask"
|
|
@@ -80,15 +111,130 @@ const curPageIndex = ref(0)
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- 画作 -->
|
|
|
+ <div
|
|
|
+ class="painting-wrap"
|
|
|
+ :class="{
|
|
|
+ 'painting-wrap1': curPageIndex == 0,
|
|
|
+ 'painting-wrap2': curPageIndex == 1,
|
|
|
+ 'painting-wrap3': curPageIndex == 2 || curPageIndex == 3,
|
|
|
+ 'painting-wrap4': curPageIndex == 4,
|
|
|
+ 'painting-wrap5': curPageIndex == 5,
|
|
|
+ }"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ curPageIndex == 1 ? (curPageIndex = 2) : '';
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="painting-border"
|
|
|
+ src="@/assets/images/painting-border-new.png"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="painting-stem"
|
|
|
+ src="@/assets/images/home-painting1.jpg"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="painting-stem"
|
|
|
+ src="@/assets/images/home-painting2.jpg"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :style="{ opacity: curPageIndex == 3 ? 1 : 0, zIndex: 3 }"
|
|
|
+ class="painting-stem"
|
|
|
+ src="@/assets/images/home-painting-stem.png"
|
|
|
+ alt=""
|
|
|
+ >
|
|
|
+
|
|
|
+ <img
|
|
|
+ class="painting-stem"
|
|
|
+ src="@/assets/images/img_zhuye-min2.png"
|
|
|
+ alt=""
|
|
|
+ :style="{
|
|
|
+ opacity: curPageIndex == 4 ? 1 : 0,
|
|
|
+ zIndex: 2,
|
|
|
+ }"
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+
|
|
|
+ <img
|
|
|
+ class="painting-stem"
|
|
|
+ src="@/assets/images/img_stone_all-min.png"
|
|
|
+ :style="{
|
|
|
+ opacity: curPageIndex == 5 ? 1 : 0,
|
|
|
+ zIndex: 2,
|
|
|
+ }"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 热点层1 -->
|
|
|
+ <div class="hotspot-wrap">
|
|
|
+ <HotspotForHomepage
|
|
|
+ v-show="curPageIndex == 0"
|
|
|
+ class="hotspot-1"
|
|
|
+ @click="isShowHotspotDetail1 = true"
|
|
|
+ />
|
|
|
+ <HotspotForHomepage
|
|
|
+ v-show="curPageIndex == 0"
|
|
|
+ class="hotspot-3"
|
|
|
+ @click="isShowHotspotDetail3 = true"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 轴/卷/册热点详情 -->
|
|
|
+ <Transition name="fade-in-out">
|
|
|
+ <HotspotDetail3
|
|
|
+ v-if="isShowHotspotDetail3"
|
|
|
+ class="hotspot-detail"
|
|
|
+ @close="isShowHotspotDetail3 = false"
|
|
|
+ />
|
|
|
+ </Transition>
|
|
|
+
|
|
|
+ <!-- 材质热点详情 -->
|
|
|
+ <Transition name="fade-in-out">
|
|
|
+ <HotspotDetail1
|
|
|
+ v-if="isShowHotspotDetail1"
|
|
|
+ class="hotspot-detail"
|
|
|
+ @close="isShowHotspotDetail1 = false"
|
|
|
+ />
|
|
|
+ </Transition>
|
|
|
+
|
|
|
<!-- 滑动提示 -->
|
|
|
+ <OperationTip
|
|
|
+ v-show="curPageIndex == 0"
|
|
|
+ class="operation-tip"
|
|
|
+ text="向下滑动"
|
|
|
+ :is-show="isShowOperationTip"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<style lang="less" scoped>
|
|
|
.home {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ > .scroller {
|
|
|
+ width: 100vw;
|
|
|
+ max-height: 100vh;
|
|
|
+ overflow: auto;
|
|
|
+ background: rgba(255, 255, 0, 0);
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ z-index: 10;
|
|
|
+ opacity: 0;
|
|
|
+ .scroller-content {
|
|
|
+ width: 100%;
|
|
|
+ height: 200vh;
|
|
|
+ }
|
|
|
+ }
|
|
|
> .bg-mask {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
@@ -112,7 +258,7 @@ const curPageIndex = ref(0)
|
|
|
|
|
|
> .title-wrap {
|
|
|
position: absolute;
|
|
|
- right: 20%;
|
|
|
+ right: 25%;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
width: 100px;
|
|
@@ -137,7 +283,7 @@ const curPageIndex = ref(0)
|
|
|
font-weight: 400;
|
|
|
font-size: 20px;
|
|
|
color: #ffffff;
|
|
|
- line-height:30px;
|
|
|
+ line-height: 30px;
|
|
|
white-space: pre;
|
|
|
letter-spacing: 0.2em;
|
|
|
text-align: center;
|
|
@@ -155,7 +301,7 @@ const curPageIndex = ref(0)
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-between;
|
|
|
- z-index: 2;
|
|
|
+ z-index: 10;
|
|
|
|
|
|
> .page2-box {
|
|
|
display: flex;
|
|
@@ -178,6 +324,84 @@ const curPageIndex = ref(0)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ > .painting-wrap {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ width: 551.84px;
|
|
|
+ height: 937.05px;
|
|
|
+ // background: green;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ z-index: 1;
|
|
|
|
|
|
+ > .painting-border {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: absolute;
|
|
|
+ }
|
|
|
+
|
|
|
+ > .painting-stem {
|
|
|
+ width: 80%;
|
|
|
+ height: calc(
|
|
|
+ 371 / v-bind("windowSizeWhenDesignForRef") *
|
|
|
+ v-bind("windowSizeInCssForRef")
|
|
|
+ );
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, 26%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ > .hotspot-wrap {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-46%, -50%);
|
|
|
+ width: 551.84px;
|
|
|
+ height: 937.05px;
|
|
|
+ z-index: 7;
|
|
|
+ pointer-events: none;
|
|
|
+ will-change: transform;
|
|
|
+ backface-visibility: hidden;
|
|
|
+ z-index: 10;
|
|
|
+
|
|
|
+ & > div {
|
|
|
+ z-index: 100;
|
|
|
+ transition: all 1.5s ease-in-out;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ > .hotspot-1 {
|
|
|
+ position: absolute;
|
|
|
+ top: 100px;
|
|
|
+ right: 25px;
|
|
|
+ pointer-events: initial;
|
|
|
+ }
|
|
|
+
|
|
|
+ // > .hotspot-2 {
|
|
|
+ // position: absolute;
|
|
|
+ // left: 60px;
|
|
|
+ // top: 60px;
|
|
|
+ // pointer-events: initial;
|
|
|
+ // }
|
|
|
+
|
|
|
+ > .hotspot-3 {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0px;
|
|
|
+ right: 25px;
|
|
|
+ pointer-events: initial;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > .hotspot-detail {
|
|
|
+ z-index: 21;
|
|
|
+ }
|
|
|
+
|
|
|
+ > .operation-tip {
|
|
|
+ position: absolute;
|
|
|
+ right: 30px;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|