Browse Source

feat: 萧山区博物馆 茅湾里的印纹博物馆

chenlei 1 week ago
parent
commit
c7d09a99c3
43 changed files with 1109 additions and 1 deletions
  1. 1 0
      components.d.ts
  2. 2 0
      package.json
  3. BIN
      public/images/xs/Volume btn_off.png
  4. BIN
      public/images/xs/Volume btn_on.png
  5. BIN
      public/images/xs/auto-suspend.png
  6. BIN
      public/images/xs/auto.png
  7. BIN
      public/images/xs/dollhouse.png
  8. BIN
      public/images/xs/enlarge_on.png
  9. BIN
      public/images/xs/floor.png
  10. BIN
      public/images/xs/hotlist.png
  11. BIN
      public/images/xs/inside.png
  12. BIN
      public/images/xs/like.png
  13. BIN
      public/images/xs/narrow_off.png
  14. BIN
      public/images/xs/pause.png
  15. BIN
      public/images/xs/play.png
  16. BIN
      public/images/xs/share.png
  17. BIN
      public/images/xs/unlike.png
  18. BIN
      public/images/xs/viewer.png
  19. 150 0
      src/hotspot/views/hotspot/index.xs.scss
  20. 298 0
      src/hotspot/views/hotspot/index.xs.vue
  21. 4 0
      src/index/api/home.ts
  22. 1 1
      src/index/app.scss
  23. 7 0
      src/index/assets/el.xs.scss
  24. 21 0
      src/index/router/index.xs.ts
  25. BIN
      src/index/views/cover/images/bg-min.jpg
  26. BIN
      src/index/views/cover/images/btn-min.png
  27. BIN
      src/index/views/cover/images/img-min.png
  28. BIN
      src/index/views/cover/images/logo-min.png
  29. BIN
      src/index/views/cover/images/m-bg-min.jpg
  30. BIN
      src/index/views/cover/images/m-title-min.png
  31. BIN
      src/index/views/cover/images/title-min.png
  32. 75 0
      src/index/views/cover/index.scss
  33. 35 0
      src/index/views/cover/index.vue
  34. BIN
      src/index/views/home/components/hot-spot-list/images/bg-min.jpg
  35. BIN
      src/index/views/home/components/hot-spot-list/images/close.png
  36. BIN
      src/index/views/home/components/hot-spot-list/images/m-bg-min.jpg
  37. 135 0
      src/index/views/home/components/hot-spot-list/index.xs.scss
  38. 24 0
      src/index/views/home/components/hot-spot-list/index.xs.tsx
  39. 119 0
      src/index/views/home/components/menu/index.xs.scss
  40. 175 0
      src/index/views/home/components/menu/index.xs.tsx
  41. BIN
      src/index/views/home/components/popup/images/close.png
  42. 46 0
      src/index/views/home/components/popup/index.xs.scss
  43. 16 0
      src/index/views/home/components/popup/index.xs.tsx

+ 1 - 0
components.d.ts

@@ -7,6 +7,7 @@ export {}
 /* prettier-ignore */
 declare module 'vue' {
   export interface GlobalComponents {
+    ElDialog: typeof import('element-plus/es')['ElDialog']
     ElImage: typeof import('element-plus/es')['ElImage']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']

+ 2 - 0
package.json

@@ -7,6 +7,8 @@
     "serve": "cross-env VITE_APP_TITLE=大理洱海科普馆 VITE_APP_HOT_DOMAIN=./hotspot.html vite",
     "build:test": "cross-env VITE_APP_TITLE=大理洱海科普馆 VITE_APP_HOT_DOMAIN=./hotspot.html run-p type-check \"build-only {@}\" --",
     "build:offline": "cross-env VITE_APP_OFFLINE=1 npm run build:test && cross-env node ./scripts/generate-offline-config.js && replace-in-file --configFile ./scripts/offline-replace-config.json",
+    "serve:xs": "cross-env VITE_APP_SCENE=xs VITE_APP_TITLE=茅湾里印纹陶博物馆-越陶-越美 VITE_APP_HOT_DOMAIN=./hotspot.html vite",
+    "build:xs:test": "cross-env VITE_APP_SCENE=xs VITE_APP_TITLE=茅湾里印纹陶博物馆-越陶-越美 VITE_APP_HOT_DOMAIN=./hotspot.html run-p type-check \"build-only {@}\" --",
     "push:test": "cross-env node ./scripts/publish.js",
     "preview": "vite preview",
     "build-only": "vite build",

BIN
public/images/xs/Volume btn_off.png


BIN
public/images/xs/Volume btn_on.png


BIN
public/images/xs/auto-suspend.png


BIN
public/images/xs/auto.png


BIN
public/images/xs/dollhouse.png


BIN
public/images/xs/enlarge_on.png


BIN
public/images/xs/floor.png


BIN
public/images/xs/hotlist.png


BIN
public/images/xs/inside.png


BIN
public/images/xs/like.png


BIN
public/images/xs/narrow_off.png


BIN
public/images/xs/pause.png


BIN
public/images/xs/play.png


BIN
public/images/xs/share.png


BIN
public/images/xs/unlike.png


BIN
public/images/xs/viewer.png


+ 150 - 0
src/hotspot/views/hotspot/index.xs.scss

@@ -0,0 +1,150 @@
+.hotspot-page {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  padding: 20px;
+  display: flex;
+  align-items: center;
+  background: rgba(0, 0, 0, 0.8);
+  z-index: var(--z-index-popper);
+
+  &-container {
+    margin: 0 100px;
+    width: 580px;
+    height: 100%;
+
+    .swiper {
+      width: 100%;
+      height: 100%;
+    }
+    iframe {
+      width: 100%;
+      height: 100%;
+      border-radius: 14px;
+    }
+    video,
+    .el-image {
+      width: 100%;
+      max-height: 100%;
+      border-radius: 14px;
+      object-fit: contain;
+    }
+  }
+
+  &-scrollbar {
+    flex: 1;
+    color: #fff;
+
+    &.isTop {
+      max-height: 65%;
+      height: 65%;
+      padding: 50px 0;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+    }
+    h3 {
+      margin-bottom: 30px;
+      letter-spacing: 2px;
+      font-size: 48px;
+      font-family: 'SourceHanSerifCN-Bold';
+    }
+    div {
+      line-height: 1.5;
+      font-size: 24px;
+      text-indent: 32px;
+    }
+  }
+
+  .swiper-slide {
+    text-align: center;
+    font-size: 18px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    transition: 0.3s;
+    transform: scale(0.8);
+    position: relative;
+    opacity: 0.5;
+  }
+  .swiper-slide-active,
+  .swiper-slide-duplicate-active {
+    transform: scale(1);
+    opacity: 1;
+    z-index: 999;
+  }
+
+  &-nav {
+    position: absolute;
+    right: 30px;
+    bottom: calc(20% - 20px);
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    gap: 10px;
+    z-index: 1;
+
+    &__item {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      gap: 4px;
+      color: #fff;
+      white-space: nowrap;
+      font-size: 14px;
+      width: 90px;
+      height: 32px;
+      line-height: 32px;
+      cursor: pointer;
+      border-radius: 10px;
+      border: 1px solid #fff;
+
+      &.active {
+        background: #19bbed;
+        border: none;
+      }
+    }
+  }
+}
+
+@media only screen and (max-width: 600px) {
+  .hotspot-page {
+    flex-direction: column;
+    padding: 30px 30px 70px;
+
+    h3 {
+      margin-bottom: 20px;
+      font-size: 24px;
+    }
+    &-container {
+      width: 100%;
+      height: 300px;
+
+      video,
+      .el-image,
+      iframe {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    &-nav {
+      flex-wrap: wrap;
+      right: 10px;
+      bottom: 10px;
+
+      &__item {
+        width: 70px;
+      }
+    }
+    &-scrollbar {
+      margin-top: 30px;
+      width: 100%;
+
+      div {
+        font-size: 15px;
+      }
+    }
+  }
+}

+ 298 - 0
src/hotspot/views/hotspot/index.xs.vue

@@ -0,0 +1,298 @@
+<template>
+  <div class="hotspot-page">
+    <h3 v-if="isMobile">{{ myTitle }}</h3>
+
+    <div v-if="!isTextType" class="hotspot-page-container">
+      <!-- 音频播放器 -->
+      <audio
+        id="myAudio"
+        v-if="audio"
+        ref="volumeRef"
+        v-show="isOneAduio"
+        :src="audio"
+        controls
+      ></audio>
+
+      <!-- 模型页面 -->
+      <Swiper
+        :modules="modules"
+        class="hotspot-page-swiper"
+        :slides-per-view="1"
+        :centered-slides="true"
+        :navigation="Boolean(curList.length) && !isMobile"
+        :pagination="
+          isMobile
+            ? false
+            : {
+                clickable: true,
+              }
+        "
+        @swiper="initSwiper"
+        @slideChange="handleChange"
+      >
+        <SwiperSlide v-for="(item, index) in curList" :key="item.url">
+          <template v-if="swiperInited">
+            <template v-if="myType === 'model'">
+              <iframe v-if="index === myInd" :src="item" frameborder="0" />
+            </template>
+            <template v-else-if="myType === 'video'">
+              <video ref="videos" controls :src="item.url" />
+            </template>
+            <template v-else-if="myType === 'img'">
+              <el-image :src="item" fit="contain" @click="handlePreview(index)" />
+            </template>
+          </template>
+        </SwiperSlide>
+      </Swiper>
+    </div>
+
+    <!-- 底部的tab -->
+    <ul v-if="flooTab.length > 1" class="hotspot-page-nav">
+      <!-- 音频图标 -->
+      <li
+        v-if="audio && !isOneAduio"
+        :class="[
+          'hotspot-page-nav__item',
+          {
+            active: audioSta,
+          },
+        ]"
+        @click="audioSta = !audioSta"
+      >
+        <img :src="VolumeOn" :alt="audioSta ? '关闭音频' : '打开音频'" />
+        <span>音频</span>
+      </li>
+      <li
+        v-for="item in flooTab"
+        :key="item.id"
+        :class="[
+          'hotspot-page-nav__item',
+          {
+            active: myType === item.type,
+          },
+        ]"
+        @click="handleTab(item)"
+      >
+        <img :class="`${item.type}-icon`" :src="item.icon" />
+        <span>{{ item.name }}</span>
+      </li>
+    </ul>
+
+    <div class="hotspot-page-scrollbar" :class="{ isTop: !flooTab.length && !isMobile }">
+      <h3 v-if="!isMobile">{{ myTitle }}</h3>
+      <div v-html="myTxt" />
+    </div>
+  </div>
+</template>
+
+<script>
+  import { Swiper, SwiperSlide } from 'swiper/vue';
+  import { Navigation, Pagination } from 'swiper/modules';
+  import 'swiper/css';
+  import 'swiper/css/navigation';
+  import 'swiper/css/pagination';
+
+  import { parseUrlParams, judgeIsMobile } from '@/utils';
+  import { MESSAGE_KEY } from '@/types';
+
+  import ModelIcon from '@hotspot/assets/images/model-icon.png';
+  import ImageIcon from '@hotspot/assets/images/img-icon.png';
+  import VideoIcon from '@hotspot/assets/images/video-icon.png';
+  import VolumeOn from '@hotspot/assets/images/audio-icon.png';
+
+  const urlParams = parseUrlParams(window.location.href);
+  const isMobile = judgeIsMobile();
+
+  export default {
+    name: 'hotspot',
+    components: {
+      Swiper,
+      SwiperSlide,
+    },
+    data() {
+      return {
+        isMobile,
+        VolumeOn,
+        m: urlParams.m,
+        id: urlParams.id,
+        // 音频地址
+        audio: '',
+        // 如果只有单独的音频
+        isOneAduio: false,
+        // 音频状态
+        audioSta: false,
+        swiperInited: false,
+
+        data: {
+          // 模型数组
+          model: [],
+          // 视频数组
+          video: [],
+          // 图片数组
+          img: [],
+        },
+        // 当前 type
+        myType: '',
+
+        // 当前索引
+        myInd: 0,
+
+        // 底部的tab
+        flooTab: [],
+
+        // 标题
+        myTitle: '',
+        // 内容
+        myTxt: '',
+        // 视频内容
+        videoTxt: [],
+        imgTxt: [],
+
+        // 只有标题和文字(没有视频,没有模型,没有图片)
+        oneTxt: false,
+
+        modules: [Navigation, Pagination],
+      };
+    },
+    computed: {
+      curList() {
+        return this.data[this.myType] || [];
+      },
+      isTextType() {
+        return this.myType === 'text';
+      },
+    },
+    watch: {
+      audioSta(val) {
+        if (val) {
+          this.$refs.volumeRef.play();
+          this.$refs.volumeRef.onended = () => {
+            // console.log("----音频播放完毕");
+            this.audioSta = false;
+          };
+        } else this.$refs.volumeRef.pause();
+      },
+    },
+    mounted() {
+      this.getData();
+    },
+    methods: {
+      async getData() {
+        // https://www.4dmodel.com/
+        let url = `${
+          Boolean(Number(import.meta.env.VITE_APP_OFFLINE)) ? '.' : 'https://super.4dage.com'
+        }/data/${this.id}/hot/js/data.js?time=${Math.random()}`;
+        let result = await fetch(url).then((response) => response.json());
+        const resData = result[this.m];
+
+        if (resData) {
+          this.audio = resData.backgroundMusic;
+          // 只有单独的音频上传
+          if (resData.backgroundMusic && !resData.model && !resData.video && !resData.images) {
+            this.isOneAduio = true;
+          }
+          // 底部的tab
+          const arr = [];
+          const obj = {};
+          if (resData.images) {
+            obj.img = resData.images;
+            arr.push({ id: 3, type: 'img', name: '图片', icon: ImageIcon });
+          }
+          if (resData.video) {
+            obj.video = resData.video;
+            arr.push({ id: 2, type: 'video', name: '视频', icon: VideoIcon });
+          } else {
+            this.$nextTick(() => {
+              if (
+                !window.navigator.userAgent.match(
+                  /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
+                )
+              ) {
+                this.audioSta = true;
+                this.$refs.volumeRef.play();
+              }
+            });
+          }
+          if (resData.model) {
+            obj.model = resData.model;
+            arr.push({ id: 1, type: 'model', name: '模型', icon: ModelIcon });
+          }
+
+          this.flooTab = arr;
+          this.data = obj;
+
+          // 当前type的值 应该为
+          if (resData.images) this.myType = 'img';
+          else if (resData.model) this.myType = 'model';
+          else if (resData.video) {
+            this.myType = 'video';
+            this.$nextTick(() => {
+              this.handleVideoPlay(this.data.video[0].url);
+            });
+          } else this.myType = 'text';
+
+          this.myTitle = resData.title || '';
+          this.myTxt = resData.content || '';
+          this.videoTxt = resData.videosDesc || [];
+          this.imgTxt = resData.imagesDesc || [];
+
+          // 只有 标题和 文字介绍(没有视频,没有模型,没有图片)
+          if (!obj.model && !obj.video && !obj.img && !resData.backgroundMusic) {
+            this.oneTxt = true;
+          }
+        }
+      },
+
+      handleTab(item) {
+        this.myInd = 0;
+        this.myType = item.type;
+        this.swiper?.slideTo(0);
+
+        switch (this.myType) {
+          case 'video':
+            this.$nextTick(() => {
+              this.handleVideoPlay(this.data.video[0].url);
+            });
+            break;
+        }
+      },
+
+      initSwiper(swiper) {
+        this.swiper = swiper;
+        this.swiperInited = true;
+      },
+      handleChange({ activeIndex }) {
+        this.myInd = activeIndex;
+
+        switch (this.myType) {
+          case 'video':
+            this.handleVideoPlay(this.data.video[activeIndex].url);
+            break;
+        }
+      },
+      handleVideoPlay(url) {
+        const video = this.$refs.videos?.find((i) => i.src === url);
+
+        this.lastVideo?.pause();
+        if (!video) return;
+
+        video.play();
+        this.lastVideo = video;
+      },
+      handlePreview(idx) {
+        window.parent.postMessage(
+          { type: MESSAGE_KEY.SHOW_VIEWER, images: [this.curList[idx]] },
+          '*'
+        );
+      },
+    },
+  };
+</script>
+
+<style lang="scss">
+  @use './index.xs.scss';
+
+  .viewer-button.viewer-close {
+    display: none;
+  }
+</style>

+ 4 - 0
src/index/api/home.ts

@@ -16,6 +16,10 @@ export const homeApi = {
     );
   },
 
+  saveSceneVisit(sceneCode: string) {
+    return service.get(`${SCENE_BASE_URL}/count/saveVisit/${sceneCode}`);
+  },
+
   /**
    * 点赞
    */

+ 1 - 1
src/index/app.scss

@@ -47,7 +47,7 @@ body {
   margin: 0px;
   font-size: 14px;
   color: rgba(255, 255, 255, 0.9);
-  font-family: 'Source Han Sans CN-Medium';
+  font-family: 'SourceHanSerifCN-Regular';
   -webkit-tap-highlight-color: transparent;
 }
 a {

+ 7 - 0
src/index/assets/el.xs.scss

@@ -0,0 +1,7 @@
+@forward 'element-plus/theme-chalk/src/common/var.scss' with (
+  $colors: (
+    'primary': (
+      'base': #dcc987,
+    ),
+  )
+);

+ 21 - 0
src/index/router/index.xs.ts

@@ -0,0 +1,21 @@
+import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router';
+
+const routes: Array<RouteRecordRaw> = [
+  {
+    path: '/',
+    name: 'cover',
+    component: () => import('@/views/cover/index.vue'),
+  },
+  {
+    path: '/scene',
+    name: 'home',
+    component: () => import('@/views/home'),
+  },
+];
+
+const router = createRouter({
+  history: createWebHashHistory(import.meta.env.BASE_URL),
+  routes,
+});
+
+export default router;

BIN
src/index/views/cover/images/bg-min.jpg


BIN
src/index/views/cover/images/btn-min.png


BIN
src/index/views/cover/images/img-min.png


BIN
src/index/views/cover/images/logo-min.png


BIN
src/index/views/cover/images/m-bg-min.jpg


BIN
src/index/views/cover/images/m-title-min.png


BIN
src/index/views/cover/images/title-min.png


+ 75 - 0
src/index/views/cover/index.scss

@@ -0,0 +1,75 @@
+@use '@/assets/utils.scss';
+
+.cover {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: url('./images/bg-min.jpg') no-repeat top left / cover;
+
+  &::before {
+    content: '';
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 826px;
+    height: 100%;
+    background: url('./images/img-min.png') no-repeat center / cover;
+  }
+  &__logo {
+    position: absolute;
+    top: utils.vh-calc(33);
+    right: utils.vw-calc(69);
+    width: utils.vw-calc(190);
+    height: utils.vw-calc(104);
+  }
+  &__title {
+    position: absolute;
+    right: utils.vw-calc(267);
+    bottom: utils.vh-calc(111);
+    width: utils.vw-calc(306);
+    height: utils.vw-calc(665);
+  }
+  &__btn {
+    position: absolute;
+    right: utils.vw-calc(455);
+    bottom: utils.vh-calc(124);
+    width: utils.vw-calc(324);
+    height: utils.vw-calc(57);
+    cursor: pointer;
+  }
+}
+
+.m-cover {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: url('./images/m-bg-min.jpg') no-repeat top left / cover;
+
+  &__logo {
+    position: absolute;
+    top: utils.vh-calc(41);
+    right: utils.vw-calc(49);
+    width: utils.vw-calc(127);
+    height: utils.vw-calc(70);
+  }
+  &__title {
+    position: absolute;
+    top: utils.vh-calc(355);
+    right: utils.vw-calc(50);
+    width: utils.vw-calc(329);
+    height: utils.vw-calc(791);
+  }
+  &__btn {
+    position: absolute;
+    left: 50%;
+    bottom: utils.vh-calc(167);
+    width: utils.vw-calc(324);
+    height: utils.vw-calc(57);
+    transform: translateX(-50%);
+    cursor: pointer;
+  }
+}

+ 35 - 0
src/index/views/cover/index.vue

@@ -0,0 +1,35 @@
+<template>
+  <div :class="isMobile ? 'm-cover' : 'cover'">
+    <template v-if="!isMobile">
+      <img class="cover__logo" src="./images/logo-min.png" draggable="false" />
+      <img class="cover__title" src="./images/title-min.png" draggable="false" />
+      <img
+        class="cover__btn"
+        src="./images/btn-min.png"
+        draggable="false"
+        @click="$router.push({ name: 'home' })"
+      />
+    </template>
+
+    <template v-else>
+      <img class="m-cover__logo" src="./images/logo-min.png" draggable="false" />
+      <img class="m-cover__title" src="./images/m-title-min.png" draggable="false" />
+      <img
+        class="m-cover__btn"
+        src="./images/btn-min.png"
+        draggable="false"
+        @click="$router.push({ name: 'home' })"
+      />
+    </template>
+  </div>
+</template>
+
+<script setup>
+  import { judgeIsMobile } from '@/utils';
+
+  const isMobile = judgeIsMobile();
+</script>
+
+<style lang="scss" scoped>
+  @use './index.scss';
+</style>

BIN
src/index/views/home/components/hot-spot-list/images/bg-min.jpg


BIN
src/index/views/home/components/hot-spot-list/images/close.png


BIN
src/index/views/home/components/hot-spot-list/images/m-bg-min.jpg


+ 135 - 0
src/index/views/home/components/hot-spot-list/index.xs.scss

@@ -0,0 +1,135 @@
+#hotListWrap {
+  display: flex;
+  flex-direction: column;
+  position: absolute;
+  top: 0;
+  right: -400px;
+  width: 350px;
+  max-width: 350px;
+  height: 100%;
+  color: black;
+  transition: right 0.4s, width 0.5s;
+  background: url('./images/bg-min.jpg') no-repeat center bottom / cover;
+  z-index: var(--z-index-popper);
+}
+
+.hotListActive {
+  right: 0 !important;
+}
+
+#hotListTitle {
+  position: relative;
+  margin: 50px 0 30px;
+  width: 100%;
+  text-align: center;
+  font-size: 52px;
+  letter-spacing: 2px;
+  font-family: 'SourceHanSerifCN-Bold';
+}
+
+#hotListContent {
+  width: 100%;
+  flex-grow: 1;
+  height: 100%;
+  overflow-y: scroll;
+  overflow-x: hidden;
+}
+
+#hotListBottom {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin: 30px 0 97px;
+}
+
+#hotListClose {
+  width: 40px;
+  height: 40px;
+  cursor: pointer;
+}
+
+#hotListContent ul {
+  font-size: 18px;
+  letter-spacing: 3px;
+}
+
+#hotListContent ul li {
+  text-align: center;
+  padding: 15px 25px;
+  transition: color 0.3s, background 0.6s;
+  border-radius: 10px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  cursor: pointer;
+}
+
+#hotListContent ul li:hover {
+  opacity: 0.6;
+}
+
+#hotListContent ul li.active {
+  color: black;
+  background: #f3f5f9;
+}
+
+#hotListIcon {
+  width: 34px;
+  margin-left: 48px;
+}
+
+#hotListContent::-webkit-scrollbar {
+  width: 6px;
+}
+
+#hotListContent::-webkit-scrollbar-thumb {
+  border-radius: 10px;
+  background-color: #979cab;
+}
+
+#hotListContent::-webkit-scrollbar-track {
+  border-radius: 10px;
+}
+
+@media only screen and (max-width: 910px) {
+  #hotListWrap {
+    top: -120%;
+    left: 25px;
+    right: 25px !important;
+    width: unset;
+    max-width: calc(100% - 50px);
+    height: calc(100% - 30px);
+    transition: top 0.4s, width 0.5s;
+    background-image: url('./images/m-bg-min.jpg');
+  }
+  .hotListActive {
+    top: 15px !important;
+  }
+
+  #hotListTitle {
+    margin: 30px 0 20px;
+    font-size: 30px;
+  }
+  #hotListIcon {
+    width: 24px;
+    margin-left: 26px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(165%, -50%);
+  }
+  #hotListContent ul li {
+    padding: 0 25px;
+    text-align: center;
+    height: 50px;
+    line-height: 50px;
+    font-size: 18px;
+  }
+  #hotListBottom {
+    margin: 50px 0;
+  }
+  #hotListClose {
+    width: 20px;
+    height: 20px;
+  }
+}

+ 24 - 0
src/index/views/home/components/hot-spot-list/index.xs.tsx

@@ -0,0 +1,24 @@
+import { defineComponent } from 'vue';
+import CloseIcon from './images/close.png';
+import './index.xs.scss';
+
+export default defineComponent({
+  name: 'HomeHotSpotList',
+  render() {
+    return (
+      <div id="hotListWrap">
+        <div id="hotListTitle">
+          <div>
+            <span id="hotListText">热点列表</span>
+          </div>
+        </div>
+        <div id="hotListContent">
+          <ul></ul>
+        </div>
+        <div id="hotListBottom">
+          <img id="hotListClose" src={CloseIcon} alt="" />
+        </div>
+      </div>
+    );
+  },
+});

+ 119 - 0
src/index/views/home/components/menu/index.xs.scss

@@ -0,0 +1,119 @@
+.pinBottom-container {
+  position: absolute;
+  bottom: 15px;
+  width: 100%;
+  transition: all 0.5s;
+  z-index: var(--z-index-top);
+
+  &.open {
+    bottom: 145px;
+
+    &.playing {
+      bottom: 165px;
+    }
+    &.noScroll {
+      bottom: 125px;
+
+      &.playing {
+        bottom: 145px;
+      }
+    }
+  }
+  &.playing:not(.open) {
+    bottom: 35px;
+  }
+}
+
+.pinBottom {
+  position: absolute;
+  bottom: 0;
+  display: flex;
+  align-items: center;
+  gap: 36px;
+  line-height: 1;
+  transition: all 0.5s;
+
+  &.left {
+    left: 38px;
+    bottom: 0;
+    overflow: hidden;
+  }
+  &.right {
+    right: 38px;
+    bottom: 0;
+    text-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
+  }
+  > div {
+    display: inline-flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    cursor: pointer;
+
+    &.active,
+    &:hover,
+    &.opened {
+      color: var(--el-color-primary);
+    }
+    img,
+    .icon {
+      margin-bottom: 7px;
+      width: 55px;
+      height: 55px;
+    }
+  }
+}
+
+#thumb {
+  .icon-slot {
+    transition: background ease-in 0.2s;
+    background: url('/images/xs/unlike.png') no-repeat center / contain;
+  }
+
+  &.active .icon-slot {
+    background-image: url('/images/xs/like.png');
+  }
+}
+
+@media only screen and (max-width: 600px) {
+  .pinBottom-container {
+    bottom: 15px;
+
+    &.open {
+      bottom: 115px;
+
+      &.noScroll {
+        bottom: 105px;
+
+        &.playing {
+          bottom: 125px;
+        }
+      }
+    }
+    &.playing:not(.open) {
+      bottom: 35px;
+    }
+  }
+  .pinBottom {
+    gap: 10px;
+
+    &.left {
+      flex-direction: column;
+      left: 10px;
+    }
+    &.right {
+      flex-direction: column;
+      right: 10px;
+    }
+    > div {
+      font-size: 10px;
+
+      img,
+      .icon {
+        margin-bottom: 0;
+        width: 28px;
+        height: 28px;
+      }
+    }
+  }
+}

+ 175 - 0
src/index/views/home/components/menu/index.xs.tsx

@@ -0,0 +1,175 @@
+import { defineComponent, ref, onMounted } from 'vue';
+import SharePopup from '../share-popup/index.vue';
+import { homeApi } from '@/api';
+import './index.xs.scss';
+
+export default defineComponent({
+  name: 'HomeMenu',
+  setup() {
+    const shareVisible = ref(false);
+    const animationThumb = ref(false);
+    const visitCount = ref(0);
+    const likeCount = ref(0);
+
+    const getSceneDetail = async () => {
+      const { data } = await homeApi.getSceneDetail(window.number);
+      if (!data) return;
+      visitCount.value = data.visitSum;
+      likeCount.value = data.starSum;
+    };
+
+    const handleThumb = () => {
+      if (animationThumb.value) return;
+
+      animationThumb.value = true;
+      likeCount.value++;
+      homeApi.saveStar(window.number);
+
+      setTimeout(() => {
+        animationThumb.value = false;
+      }, 200);
+    };
+
+    onMounted(() => {
+      getSceneDetail();
+
+      homeApi.saveSceneVisit(window.number);
+    });
+
+    return {
+      shareVisible,
+      animationThumb,
+      visitCount,
+      likeCount,
+      handleThumb,
+    };
+  },
+  render() {
+    return (
+      <div class="pinBottom-container">
+        <div class="pinBottom left">
+          <div id="previous" class="previous desktop-only ui-icon" style="display: none;">
+            <a>
+              <img src="images/xs/play.png" width="24" height="24" data-original-title="播放" />
+            </a>
+          </div>
+          <div id="play" class="ui-icon" data-original-title="播放">
+            <a>
+              <img src="images/xs/play.png" width="24" height="24" />
+            </a>
+            <span>自动漫游</span>
+          </div>
+          <div id="pause" class="ui-icon" style="display: none;">
+            <a>
+              <img title="暂停" src="images/xs/pause.png" width="24" height="24" />
+            </a>
+            <span>自动漫游</span>
+          </div>
+          <div id="next" class="next desktop-only ui-icon wide" style="display: none;">
+            <a>
+              <i title="" class="icon icon-dpad-right" data-original-title="下一个"></i>
+            </a>
+          </div>
+          <div data-original-title="场景导览" id="pullTab" title="">
+            <img
+              class="icon icon-inside"
+              src="images/xs/auto.png"
+              title="场景导览"
+              data-default-url="images/xs/auto.png"
+              data-active-url="images/xs/auto-suspend.png"
+            />
+            <span>场景导览</span>
+          </div>
+          <div data-original-title="热点列表" id="hotList" title="" style="display: none">
+            <img class="icon icon-inside" src="images/xs/hotlist.png" title="热点列表" />
+            <span>热点列表</span>
+          </div>
+          <div data-original-title="全景漫游" id="gui-modes-inside" title="" class="">
+            <img class="icon icon-inside" src="images/xs/inside.png" title="全景漫游" />
+            <span>全景漫游</span>
+          </div>
+          <div data-original-title="迷你模型" id="gui-modes-dollhouse" title="" class="">
+            <img class="icon icon-inside" src="images/xs/dollhouse.png" title="迷你模型" />
+            <span>迷你模型</span>
+          </div>
+          <div data-original-title="俯视图" id="gui-modes-floorplan" title="">
+            <img class="icon icon-inside" src="images/xs/floor.png" title="俯视图" />
+            <span>俯视图</span>
+          </div>
+          <div data-original-title="VR" id="vr" title="" style="display: none;">
+            <img class="icon icon-inside" src="images/xs/VR.png" title="VR" />
+          </div>
+          <div
+            data-original-title="消除外壳"
+            id="gui-remove-face"
+            title=""
+            style="display: none; float: left;"
+          >
+            <img class="icon icon-inside" src="images/xs/face.jpg" />
+          </div>
+        </div>
+        <div class="pinBottom right">
+          <div id="thumb" class={{ active: this.animationThumb }} onClick={this.handleThumb}>
+            <div class="icon icon-slot" />
+            <span>{this.likeCount > 0 ? `${this.likeCount} ` : ''}点赞</span>
+          </div>
+          <div id="sharing" onClick={() => (this.shareVisible = true)}>
+            <img class="icon icon-inside" src="images/xs/share.png" title="分享" />
+            <span>分享</span>
+          </div>
+          <div id="volume" class="ui-icon wide" style="display: none">
+            <a>
+              <img
+                src="images/xs/Volume btn_on.png"
+                width="24"
+                height="24"
+                data-default-url="images/xs/Volume btn_on.png"
+                data-active-url="images/xs/Volume btn_off.png"
+              />
+            </a>
+            <span>音乐</span>
+          </div>
+          <div id="vr" class="ui-icon wide hidden">
+            <a>
+              <i title="{[{ VIEW_IN_VR }]}" class="icon icon-webvr"></i>
+            </a>
+          </div>
+          <div id="sharing" class="ui-icon wide hidden">
+            <a>
+              <i title="{[{ SOCIAL_SHARING }]}" class="icon icon-share"></i>
+            </a>
+          </div>
+          <div id="viewer" class="ui-icon wide">
+            <img class="icon icon-inside" src="images/xs/viewer.png" title="浏览量" />
+            <p>{this.visitCount}</p>
+          </div>
+          <div
+            id="gui-fullscreen"
+            class="ui-icon wide"
+            data-placement="top"
+            title="{[{ VIEW_FULLSCREEN }]}"
+          >
+            <a>
+              <img class="icon icon-fullscreen" src="images/xs/enlarge_on.png" />
+            </a>
+            <span>全屏</span>
+          </div>
+          <div
+            id="gui-fullscreen-exit"
+            class="ui-icon wide"
+            data-placement="top"
+            title="{[{ EXIT_FULLSCREEN }]}"
+            style="display: none;"
+          >
+            <a>
+              <img class="icon icon-fullscreen-exit" src="images/xs/narrow_off.png" />
+            </a>
+            <span>全屏</span>
+          </div>
+        </div>
+
+        <SharePopup visible={this.shareVisible} onUpdate:visible={(v) => (this.shareVisible = v)} />
+      </div>
+    );
+  },
+});

BIN
src/index/views/home/components/popup/images/close.png


+ 46 - 0
src/index/views/home/components/popup/index.xs.scss

@@ -0,0 +1,46 @@
+#popup {
+  display: none;
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.6);
+  z-index: var(--z-hot-popper);
+
+  &.wait {
+    opacity: 0.1;
+  }
+}
+#id1 {
+  width: 100%;
+  height: 100%;
+}
+.popup-content {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+}
+#closepop {
+  position: absolute;
+  top: 60px;
+  right: 56px;
+  width: 40px;
+  height: 40px;
+  cursor: pointer;
+  text-indent: -999em;
+  background: url('./images/close.png') no-repeat center / contain;
+}
+
+@media only screen and (max-width: 600px) {
+  #closepop {
+    width: 20px;
+    height: 20px;
+    top: unset;
+    left: 50%;
+    right: unset;
+    bottom: 35px;
+    transform: translateX(-50%);
+  }
+}

+ 16 - 0
src/index/views/home/components/popup/index.xs.tsx

@@ -0,0 +1,16 @@
+import { defineComponent } from 'vue';
+import './index.xs.scss';
+
+export default defineComponent({
+  name: 'HomePopup',
+  render() {
+    return (
+      <div id="popup">
+        <div class="popup-wrap">
+          <div class="popup-content"></div>
+          <div id="closepop">close</div>
+        </div>
+      </div>
+    );
+  },
+});