|
@@ -1,16 +1,75 @@
|
|
|
<template>
|
|
|
<div class="show-case-container">
|
|
|
- <div class="show-case">
|
|
|
+ <div class="show-case" v-if="isModel">
|
|
|
<iframe
|
|
|
frameborder="0"
|
|
|
src="https://www.4dmodel.com/SuperTwo/index.html?m=TEST"
|
|
|
></iframe>
|
|
|
</div>
|
|
|
+ <div class="show-case" v-if="isVideo">
|
|
|
+ <video
|
|
|
+ src="https://4dscene.4dage.com/new4dkk/v2/video/homeVideoNew.mp4"
|
|
|
+ autoplay
|
|
|
+ playsinline
|
|
|
+ ></video>
|
|
|
+ </div>
|
|
|
+ <div class="show-case" v-if="isGallery">
|
|
|
+ <n-carousel draggable :show-dots="false" show-arrow>
|
|
|
+ <img
|
|
|
+ class="carousel-img"
|
|
|
+ src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ class="carousel-img"
|
|
|
+ src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ class="carousel-img"
|
|
|
+ src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel3.jpeg"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ class="carousel-img"
|
|
|
+ src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel4.jpeg"
|
|
|
+ />
|
|
|
+
|
|
|
+ <template #arrow="{ prev, next }">
|
|
|
+ <div class="custom-arrow">
|
|
|
+ <img class="btn-img" src="/img/arrow-left.png" @click="prev" />
|
|
|
+ <img class="btn-img" src="/img/arrow-right.png" @click="next" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </n-carousel>
|
|
|
+ </div>
|
|
|
<div class="tools">
|
|
|
<n-space class="group-type" :size="25">
|
|
|
- <n-button type="primary" round>模型</n-button>
|
|
|
- <n-button type="primary" round>视频</n-button>
|
|
|
- <n-button type="primary" round>图片</n-button>
|
|
|
+ <n-button
|
|
|
+ class="model btn"
|
|
|
+ :class="{
|
|
|
+ active: isModel,
|
|
|
+ }"
|
|
|
+ round
|
|
|
+ @click="handleSwitchType('model')"
|
|
|
+ >
|
|
|
+ <img src="/img/icon_model.png" /> 模型
|
|
|
+ </n-button>
|
|
|
+ <n-button
|
|
|
+ class="video btn"
|
|
|
+ :class="{
|
|
|
+ active: isVideo,
|
|
|
+ }"
|
|
|
+ round
|
|
|
+ @click="handleSwitchType('video')"
|
|
|
+ ><img src="/img/icon_video.png" />视频</n-button
|
|
|
+ >
|
|
|
+ <n-button
|
|
|
+ class="gallery btn"
|
|
|
+ :class="{
|
|
|
+ active: isGallery,
|
|
|
+ }"
|
|
|
+ round
|
|
|
+ @click="handleSwitchType('gallery')"
|
|
|
+ ><img src="/img/icon_photo.png" />图片</n-button
|
|
|
+ >
|
|
|
</n-space>
|
|
|
<div class="actions">
|
|
|
<div>
|
|
@@ -27,11 +86,21 @@
|
|
|
import { ref, computed } from "vue";
|
|
|
|
|
|
const type = ref("model");
|
|
|
+const defaultType = ref(["model", "video", "audio", "gallery"]);
|
|
|
|
|
|
const isModel = computed(() => type.value === "model");
|
|
|
const isVideo = computed(() => type.value === "video");
|
|
|
const isAudio = computed(() => type.value === "audio");
|
|
|
const isGallery = computed(() => type.value === "gallery");
|
|
|
+
|
|
|
+const handleSwitchType = (value) => {
|
|
|
+ if (defaultType.value.includes(value)) {
|
|
|
+ type.value = value;
|
|
|
+ } else {
|
|
|
+ type.value = "model";
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
defineOptions({
|
|
|
name: "show-case",
|
|
|
});
|
|
@@ -64,6 +133,12 @@ const props = defineProps({
|
|
|
--show-case-background: #c1b2b2;
|
|
|
--show-case-tools-padding: 1rem;
|
|
|
--show-case-btn-font-size: 1.125rem;
|
|
|
+ --show-case-btn-model-bg: url("/img/show_case_m_bg.png");
|
|
|
+ --show-case-btn-model-bg-active: url("/img/show_case_m_bg_active.png");
|
|
|
+ --show-case-btn-video-bg: url("/img/show_case_v_bg.png");
|
|
|
+ --show-case-btn-video-bg-active: url("/img/show_case_v_bg_active.png");
|
|
|
+ --show-case-btn-gallery-bg: url("/img/show_case_p_bg.png");
|
|
|
+ --show-case-btn-gallery-bg-active: url("/img/show_case_p_bg_active.png");
|
|
|
}
|
|
|
</style>
|
|
|
|
|
@@ -77,10 +152,40 @@ const props = defineProps({
|
|
|
.show-case {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- iframe {
|
|
|
+ iframe,
|
|
|
+ video,
|
|
|
+ :deep(.n-carousel) {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+ :deep(.n-carousel) {
|
|
|
+ .carousel-img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+ .custom-arrow {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ // background: red;
|
|
|
+ z-index: 111;
|
|
|
+ pointer-events: none;
|
|
|
+ display: inline-flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ .btn-img {
|
|
|
+ width: 61px;
|
|
|
+ height: 61px;
|
|
|
+ pointer-events: all;
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 0 1.25rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.tools {
|
|
@@ -106,9 +211,27 @@ const props = defineProps({
|
|
|
}
|
|
|
.group-type {
|
|
|
:deep(.n-button) {
|
|
|
+ background-color: #ababab;
|
|
|
+ color: white;
|
|
|
pointer-events: all;
|
|
|
font-size: var(--show-case-btn-font-size);
|
|
|
padding: 10px 40px;
|
|
|
+ img {
|
|
|
+ height: 1.25rem;
|
|
|
+ margin-right: 0.5rem;
|
|
|
+ width: auto;
|
|
|
+ }
|
|
|
+ &.btn {
|
|
|
+ background-size: cover;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ }
|
|
|
+ &.model {
|
|
|
+ // background-image: var(--show-case-btn-model-bg);
|
|
|
+ }
|
|
|
+ &.active {
|
|
|
+ background-color: var(--main-primary-color);
|
|
|
+ border-color: var(--main-primary-color);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|