|
@@ -1,22 +1,111 @@
|
|
|
<script setup lang="ts">
|
|
|
import dataList from "@/data/data";
|
|
|
+const getAssetsFile = (image: string) => {
|
|
|
+ const url = `../../../../assets/img/home/scenes/${image}`;
|
|
|
+ return new URL(url, import.meta.url).href;
|
|
|
+};
|
|
|
+
|
|
|
+const emit = defineEmits(["close"]);
|
|
|
+const close = () => {
|
|
|
+ emit("close");
|
|
|
+};
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const goDetail = (name: string) => {
|
|
|
+ console.log(name);
|
|
|
+ router.push({
|
|
|
+ name: "sceneDetail",
|
|
|
+ query: {
|
|
|
+ name: name,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="list">
|
|
|
- <div class="list-item">
|
|
|
-
|
|
|
+ <div class="scene-box">
|
|
|
+ <div class="list">
|
|
|
+ <div
|
|
|
+ class="list-item"
|
|
|
+ v-for="(item, index) in dataList.scene"
|
|
|
+ :style="{
|
|
|
+ backgroundImage: 'url(' + getAssetsFile(item.bgImg) + ')',
|
|
|
+ }"
|
|
|
+ @click="goDetail(item.name)"
|
|
|
+ >
|
|
|
+ <div class="item-con">
|
|
|
+ <img class="thumbnail-box" :src="getAssetsFile(item.img)" alt="" />
|
|
|
+ <img class="name-box" :src="getAssetsFile(item.titleImg)" alt="" />
|
|
|
+ <div class="disc-box">{{ item.disc }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="close" @click="close">
|
|
|
+ <img src="../../../../assets/img/home/scenes/close.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.list {
|
|
|
+.scene-box {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background: rgba(0, 0, 0, 0.466);
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 3;
|
|
|
+
|
|
|
+ .list {
|
|
|
+ width: 100%;
|
|
|
+ height: 90%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding: 5% 5% 0 5%;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .list-item {
|
|
|
+ width: 20%;
|
|
|
+ height: 100%;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ .item-con {
|
|
|
+ width: 92%;
|
|
|
+ height: 95%;
|
|
|
+ // background: #05cb63a6;
|
|
|
+ position: absolute;
|
|
|
+ left: 0.5%;
|
|
|
+ top: 2.5%;
|
|
|
+ padding: 3%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .thumbnail-box {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .name-box {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+ .disc-box {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: "SourceHanSerifCN-Medium";
|
|
|
+ line-height: 28px;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .close {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ img {
|
|
|
+ width: 40px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|