Explorar el Código

更新模型;网站信息tooltip,用假数据。

任一存 hace 1 año
padre
commit
62385eb984

+ 2 - 0
package.json

@@ -9,6 +9,8 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
+    "@floating-ui/dom": "^1.0.7",
+    "@vueuse/core": "^10.4.1",
     "axios": "^1.1.3",
     "core-js": "^3.8.3",
     "dayjs": "^1.11.7",

BIN
public/unity/Build/SHIndustryMuseum_2.10.framework.js.unityweb


BIN
public/unity/Build/SHIndustryMuseum_2.10.wasm.unityweb


BIN
public/unity/Build/SHIndustryMuseum_2.10.data.unityweb


BIN
public/unity/Build/SHIndustryMuseum_2.11.framework.js.unityweb


public/unity/Build/SHIndustryMuseum_2.10.loader.js → public/unity/Build/SHIndustryMuseum_2.11.loader.js


BIN
public/unity/Build/SHIndustryMuseum_2.11.wasm.unityweb


+ 203 - 13
src/App.vue

@@ -86,6 +86,46 @@
         >
       </button>
     </nav>
+
+    <button
+      v-show="!$route.meta.hideNavBar"
+      class="music-switch"
+      :style="{
+        backgroundImage: isShowNavBar ? `url(${require(`@/assets/images/icon_music_2_on.png`)})` : `url(${require(`@/assets/images/icon_music_2_off.png`)})`,
+      }"
+    />
+    <Teleport
+      to="body"
+    >
+      <div
+        v-show="isShowInfoTooltip"
+        ref="infoTooltip"
+        class="info-tooltip"
+      >
+        <p>
+          <span class="key">版本号:</span><span class="value">{{ versionNumber }}</span>
+        </p>
+        <p>
+          <span class="key">联系方式:</span><span class="value">{{ contactMethod }}</span>
+        </p>
+        <p>
+          <span class="key">电子邮箱:</span><span class="value">{{ email }}</span>
+        </p>
+        <div
+          ref="tooltipArrow"
+          class="arrow"
+        />
+      </div>
+    </Teleport>
+    <button
+      v-show="!$route.meta.hideNavBar"
+      ref="infoButton"
+      class="info"
+      :style="{
+        backgroundImage: `url(${require(`@/assets/images/icon_info.png`)})`,
+      }"
+      @click="onClickInfoButton"
+    />
     <button
       v-show="!$route.meta.hideNavBar"
       class="show-hide"
@@ -103,7 +143,7 @@
           :progress="progress"
         />
       </transition>
-    </Teleport>>
+    </Teleport>
 
     <Teleport to="body">
       <div class="screen-rotate-tip">
@@ -129,7 +169,10 @@ import {
   reactive,
   ref,
   getCurrentInstance,
+  nextTick,
 } from 'vue'
+import { computePosition, offset, shift, arrow } from '@floating-ui/dom'
+import { onClickOutside } from '@vueuse/core'
 
 export default {
   components: {
@@ -138,7 +181,7 @@ export default {
   setup () {
     const internalInstance = getCurrentInstance()
 
-    const isShowFadeInMask = ref(true)
+    const isShowFadeInMask = ref(false)
     const progress = ref(0)
 
     onMounted(() => {
@@ -154,11 +197,11 @@ export default {
       var canvas = document.querySelector("#unity-canvas")
 
       var buildUrl = "unity/Build"
-      var loaderUrl = buildUrl + "/SHIndustryMuseum_2.10.loader.js"
+      var loaderUrl = buildUrl + "/SHIndustryMuseum_2.11.loader.js"
       var config = {
-        dataUrl: buildUrl + "/SHIndustryMuseum_2.10.data.unityweb",
-        frameworkUrl: buildUrl + "/SHIndustryMuseum_2.10.framework.js.unityweb",
-        codeUrl: buildUrl + "/SHIndustryMuseum_2.10.wasm.unityweb",
+        dataUrl: buildUrl + "/SHIndustryMuseum_2.11.data.unityweb",
+        frameworkUrl: buildUrl + "/SHIndustryMuseum_2.11.framework.js.unityweb",
+        codeUrl: buildUrl + "/SHIndustryMuseum_2.11.wasm.unityweb",
         streamingAssetsUrl: "StreamingAssets",
         companyName: "DefaultCompany",
         productName: "SHIndustryMuseum",
@@ -220,13 +263,98 @@ export default {
     const isShowNavBar = ref(true)
     const activeNavItemIdx = ref(0)
     const navBarHeight = internalInstance.appContext.config.globalProperties.$isMobile ? `${90 / 1080 * window.innerHeight}px` : '90px'
+
+    /**
+     *  信息展示弹框tooltip相关
+     */
+    const infoButton = ref(null)
+    const infoTooltip = ref(null)
+    const tooltipArrow = ref(null)
+    const isShowInfoTooltip = ref(false)
+    const versionNumber = ref('v1.4.5')
+    const contactMethod = ref('135-7826-7133')
+    const email = ref('y.ddzyyagf@igbp.hk')
+
+    // onMounted(() => {
+    //   api.getSiteInfo().then((res) => {
+    //     console.log(res, 'salfklsfljsdlf')
+    //     versionNumber.value = res.
+    //     contactMethod.value = res.phone
+    //     email.value = res.email
+
+    //   })
+    // })
+
+    function onClickInfoButton() {
+      isShowInfoTooltip.value = true
+      nextTick(() => {
+        computePosition(infoButton.value, infoTooltip.value, {
+          placement: 'top',
+          middleware: [
+            offset(10),
+            shift({
+              padding: 10,
+            }),
+            arrow({
+              element: tooltipArrow.value,
+              padding: 3,
+            }),
+          ],
+        }).then(({ x, y, placement, middlewareData }) => {
+          Object.assign(infoTooltip.value.style, {
+            left: `${x}px`,
+            top: `${y}px`,
+          })
+
+          const { x: arrowX, y: arrowY } = middlewareData.arrow
+          console.log(arrowX, 'sdfkjsdlkfjl;ksdjf')
+          const arrowPlacement = {
+            top: 'bottom',
+            right: 'left',
+            bottom: 'top',
+            left: 'right',
+          }[placement.split('-')[0]]
+          const dialogPlacement2arrowRotate = {
+            top: '-135deg',
+            right: '-45deg',
+            bottom: '45deg',
+            left: '135deg',
+          }
+          Object.assign(tooltipArrow.value.style, {
+            top: 'initial',
+            bottom: 'initial',
+            left: 'initial',
+            right: 'initial',
+          })
+          Object.assign(tooltipArrow.value.style, {
+            left: arrowX != null ? `${arrowX}px` : '',
+            [arrowPlacement]: '0',
+            transform: ` translateY(50%) rotate(${dialogPlacement2arrowRotate[placement]})`,
+          })
+        })
+      })
+    }
+
+    onClickOutside(infoTooltip, (event) => {
+      if (isShowInfoTooltip.value) {
+        isShowInfoTooltip.value = false
+      }
+    })
+
     return {
+      activeNavItemIdx,
+      contactMethod,
+      email,
+      infoButton,
+      infoTooltip,
       isShowFadeInMask,
-      progress,
-
+      isShowInfoTooltip,
       isShowNavBar,
-      activeNavItemIdx,
       navBarHeight,
+      onClickInfoButton,
+      progress,
+      tooltipArrow,
+      versionNumber,
     }
   },
 }
@@ -317,6 +445,40 @@ html, body {
 //   background-color: rgba(0, 0, 0, 90%) !important;
 // }
 
+.info-tooltip {
+  position: absolute;
+  padding: 8px;
+  z-index: 50;
+  background: rgba(32,52,75,0.3);
+  box-shadow: inset 1px 0px 1px 0px rgba(255,236,188,0.5);
+  backdrop-filter: blur(10px);
+  padding: 8px;
+  font-size: 11px;
+  font-family: Source Han Sans CN-Regular, Source Han Sans CN;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 1.5;
+  white-space: pre;
+  opacity: 0.8;
+  >p{
+    >.key{
+
+    }
+    >.value{
+
+    }
+  }
+  >.arrow {
+    position: absolute;
+    background-color: inherit;
+    width: 10px;
+    height: 10px;
+    border: 1px solid transparent;
+    border-left: inherit;
+    border-top: inherit;
+  }
+}
+
 .screen-rotate-tip {
   position: fixed;
   left: 0;
@@ -363,9 +525,6 @@ html, body {
   &.higher {
     height: 100%;
   }
-  >.fade-in-mask {
-    z-index: 2005;
-  }
   >#unity-container {
     position: absolute;
     width: 100%;
@@ -429,6 +588,37 @@ html, body {
       }
     }
   }
+
+  >button.music-switch {
+    position: fixed;
+    right: calc(82px + (36px + 30px) * 2);
+    bottom: 28px;
+    width: 36px;
+    height: 36px;
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-position: center center;
+  }
+  @media only screen and (max-width: 1670px) {
+    >button.music-switch {
+      right: calc(10px + (36px + 10px) * 2);
+    }
+  }
+  >button.info {
+    position: fixed;
+    right: calc(82px + (36px + 30px) * 1);
+    bottom: 28px;
+    width: 36px;
+    height: 36px;
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-position: center center;
+  }
+  @media only screen and (max-width: 1670px) {
+    >button.info {
+      right: calc(10px + (36px + 10px) * 1);
+    }
+  }
   >button.show-hide {
     position: fixed;
     right: 82px;
@@ -439,7 +629,7 @@ html, body {
     background-repeat: no-repeat;
     background-position: center center;
   }
-  @media only screen and (max-width: 1400px) {
+  @media only screen and (max-width: 1670px) {
     >button.show-hide {
       right: 10px;
     }

+ 11 - 0
src/api.js

@@ -30,6 +30,17 @@ export default {
   //   })
   //   return Promise.resolve(listKeyNameCorrected)
   // },
+  getSiteInfo() {
+    return axios({
+      method: 'get',
+      url: `${process.env.VUE_APP_API_ORIGIN}/api/show/site/getInfo`,
+      headers: {
+        "Content-Type": "application/json",
+      },
+    }).then((res) => {
+      return JSON.parse(res.data.data)
+    })
+  },
   getGeneralList({
     endTime = '',
     pageNum = 0,

BIN
src/assets/images/icon_info.png


BIN
src/assets/images/icon_music_2_off.png


BIN
src/assets/images/icon_music_2_on.png


+ 12 - 4
src/views/TreasureDetail.vue

@@ -95,7 +95,7 @@
               playsinline="true"
             />
             <iframe
-              :src="`${prefix}/web-model/index.html#/relic-detail?model-path=${encodeURIComponent(item.filePath)}`"
+              :src="`${prefix}web-model/index.html#/relic-detail?model-path=${encodeURIComponent(item.filePath)}`"
               frameborder="0"
             />
             <button
@@ -130,7 +130,9 @@
               playsinline="true"
             />
             <video
-              :src="item.filePath"
+              :src="`${prefix}${item.filePath}`"
+              controls
+              class="treasure-detail-video"
             />
             <button
               v-show="fullScreenStatus"
@@ -165,7 +167,7 @@
             />
             <img
               draggable="false"
-              :src="`${prefix}/${item.filePath}`"
+              :src="`${prefix}${item.filePath}`"
             >
             <button
               v-show="fullScreenStatus"
@@ -225,7 +227,7 @@
       <button
         v-if="canRecord && activeTabIndex === 0"
         @click="$router.push({name: 'RecordView', query: {
-          url: encodeURI(`${prefix}/web-model/index.html#/relic-detail?model-path=${encodeURIComponent(modelUrlList[activeSwiperItemIndex].filePath)}`)
+          url: encodeURI(`${prefix}web-model/index.html#/relic-detail?model-path=${encodeURIComponent(modelUrlList[activeSwiperItemIndex].filePath)}`)
         }})"
       >
         <img
@@ -326,6 +328,12 @@ export default {
           },
           slideChange: function(e) {
             activeSwiperItemIndex.value = e.activeIndex
+            // 停止视频播放
+            if (activeTabIndex.value === 1) {
+              for (const iterator of document.getElementsByClassName('treasure-detail-video')) {
+                iterator.pause()
+              }
+            }
           }
         }
       })

+ 52 - 0
yarn.lock

@@ -996,6 +996,13 @@
   resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-1.3.1.tgz#4d795b649cc3b1cbb760d191c80dcb4353c9a366"
   integrity sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==
 
+"@floating-ui/core@^1.4.2":
+  version "1.5.0"
+  resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-1.5.0.tgz#5c05c60d5ae2d05101c3021c1a2a350ddc027f8c"
+  integrity sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==
+  dependencies:
+    "@floating-ui/utils" "^0.1.3"
+
 "@floating-ui/dom@^1.0.1":
   version "1.4.5"
   resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.4.5.tgz#336dfb9870c98b471ff5802002982e489b8bd1c5"
@@ -1003,6 +1010,19 @@
   dependencies:
     "@floating-ui/core" "^1.3.1"
 
+"@floating-ui/dom@^1.0.7":
+  version "1.5.3"
+  resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.5.3.tgz#54e50efcb432c06c23cd33de2b575102005436fa"
+  integrity sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==
+  dependencies:
+    "@floating-ui/core" "^1.4.2"
+    "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/utils@^0.1.3":
+  version "0.1.3"
+  resolved "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.1.3.tgz#6ee493102b45d796d69f1f472d4bf64e5244500a"
+  integrity sha512-uvnFKtPgzLnpzzTRfhDlvXX0kLYi9lDRQbcDmT8iXl71Rx+uwSuaUIQl3DNC7w5OweAQ7XQMDObML+KaYDQfng==
+
 "@hapi/hoek@^9.0.0":
   version "9.3.0"
   resolved "https://registry.npmmirror.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
@@ -1335,6 +1355,11 @@
   resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz#1d12873a8e49567371f2a75fe3e7f7edca6662d8"
   integrity sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==
 
+"@types/web-bluetooth@^0.0.17":
+  version "0.0.17"
+  resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz#5c9f3c617f64a9735d7b72a7cc671e166d900c40"
+  integrity sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==
+
 "@types/ws@^8.5.1":
   version "8.5.4"
   resolved "https://registry.npmmirror.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5"
@@ -1710,6 +1735,16 @@
   resolved "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz#b6b40a7625429d2bd7c2281ddba601ed05dc7f1a"
   integrity sha512-Iu8Tbg3f+emIIMmI2ycSI8QcEuAUgPTgHwesDU1eKMLE4YC/c/sFbGc70QgMq31ijRftV0R7vCm9co6rldCeOA==
 
+"@vueuse/core@^10.4.1":
+  version "10.4.1"
+  resolved "https://registry.npmmirror.com/@vueuse/core/-/core-10.4.1.tgz#fc2c8a83a571c207aaedbe393b22daa6d35123f2"
+  integrity sha512-DkHIfMIoSIBjMgRRvdIvxsyboRZQmImofLyOHADqiVbQVilP8VVHDhBX2ZqoItOgu7dWa8oXiNnScOdPLhdEXg==
+  dependencies:
+    "@types/web-bluetooth" "^0.0.17"
+    "@vueuse/metadata" "10.4.1"
+    "@vueuse/shared" "10.4.1"
+    vue-demi ">=0.14.5"
+
 "@vueuse/core@^9.1.0":
   version "9.13.0"
   resolved "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz#2f69e66d1905c1e4eebc249a01759cf88ea00cf4"
@@ -1720,11 +1755,23 @@
     "@vueuse/shared" "9.13.0"
     vue-demi "*"
 
+"@vueuse/metadata@10.4.1":
+  version "10.4.1"
+  resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.4.1.tgz#9d2ff5c67abf17a8c07865c2413fbd0e92f7b7d7"
+  integrity sha512-2Sc8X+iVzeuMGHr6O2j4gv/zxvQGGOYETYXEc41h0iZXIRnRbJZGmY/QP8dvzqUelf8vg0p/yEA5VpCEu+WpZg==
+
 "@vueuse/metadata@9.13.0":
   version "9.13.0"
   resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz#bc25a6cdad1b1a93c36ce30191124da6520539ff"
   integrity sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==
 
+"@vueuse/shared@10.4.1":
+  version "10.4.1"
+  resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.4.1.tgz#d5ce33033c156efb60664b5d6034d6cd4e2f530c"
+  integrity sha512-vz5hbAM4qA0lDKmcr2y3pPdU+2EVw/yzfRsBdu+6+USGa4PxqSQRYIUC9/NcT06y+ZgaTsyURw2I9qOFaaXHAg==
+  dependencies:
+    vue-demi ">=0.14.5"
+
 "@vueuse/shared@9.13.0":
   version "9.13.0"
   resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz#089ff4cc4e2e7a4015e57a8f32e4b39d096353b9"
@@ -6125,6 +6172,11 @@ vue-demi@*:
   resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.5.tgz#676d0463d1a1266d5ab5cba932e043d8f5f2fbd9"
   integrity sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==
 
+vue-demi@>=0.14.5:
+  version "0.14.6"
+  resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.6.tgz#dc706582851dc1cdc17a0054f4fec2eb6df74c92"
+  integrity sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==
+
 vue-eslint-parser@^8.0.1:
   version "8.3.0"
   resolved "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz#5d31129a1b3dd89c0069ca0a1c88f970c360bd0d"