Procházet zdrojové kódy

feat: 新增15期展览

jinx před 2 týdny
rodič
revize
62575da2a0

+ 1 - 0
scene/public/index.html

@@ -63,6 +63,7 @@
     <script src="<%= VUE_APP_STATIC_DIR %>/js/lib/OBJLoader.js"></script>
     <!-- <script src="<%= VUE_APP_STATIC_DIR %>/js/CAD/bundle.js"></script> -->
     <script src="<%= VUE_APP_STATIC_DIR %>/js/loadCAD.js"></script>
+    <script src="./src/main.js"></script>
 
 </body>
 

+ 20 - 0
scene/public/view.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+ <meta charset="utf-8">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <title>众生百态——故宫博物院藏历代人物画特展(第三期)</title>
+    <meta name="description" content="四维时代">
+    <meta property="og:title" content="四维时代">
+    <meta property="og:description" content="四维时代">
+    <meta property="og:image:type" content="image/jpg">
+    <link rel="icon" type="image/png" sizes="32x32" href="./favicon.ico" class="keep">
+    <link rel="stylesheet" href="<%= BASE_URL %><%= VUE_APP_STATIC_DIR %>/css/animate.min.css" />
+    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/oldVer/main0.css" />
+    <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/css/main.css?v=2.25" />
+  </head>
+  <body>
+    <div id="app"></div>
+  </body>
+</html>

+ 86 - 0
scene/src/pages/View.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="view-body">
+    <div class="switch-btn">
+      <div
+        class="btn-item"
+        v-for="scene in sceneList"
+        :key="scene.num"
+        @click="changeScene(scene.num)"
+      >
+        {{ scene.name }}
+      </div>
+    </div>
+    <iframe
+      v-if="show"
+      :src="sceneUrl"
+      allowfullscreen
+      frameborder="0"
+      id="myIframe"
+    ></iframe>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "View",
+  components: {},
+
+  data() {
+    return {
+      show: true,
+      sceneNum: "KJ-t-tHpdpKvb0ew",
+
+      sceneList: [
+        { name: "场景1", num: "KJ-t-tHpdpKvb0ew" },
+        { name: "场景2", num: "KJ-t-tHpdpKvb0ew" },
+      ],
+    };
+  },
+  computed: {
+    sceneUrl() {
+      return `/index.html#/?m=${this.sceneNum}`;
+    },
+  },
+  methods: {
+    changeScene(num) {
+      this.sceneNum = num;
+
+      this.show = false;
+      setTimeout(() => {
+        this.show = true;
+      }, 0);
+    },
+  },
+  mounted() {},
+};
+</script>
+
+<style lang="less" scoped>
+.view-body {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  iframe {
+    width: 100%;
+    height: 100%;
+  }
+  .switch-btn {
+    position: absolute;
+    top: 50%;
+    transform: translateY(-50%);
+    left: 20px;
+    background: rgba(0, 0, 0, 0.5);
+    border-radius: 8px;
+    padding: 10px;
+    .btn-item {
+      width: auto;
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      color: #ff7900;
+      cursor: pointer;
+    }
+  }
+}
+</style>

+ 16 - 16
scene/src/router/index.js

@@ -1,24 +1,24 @@
-import Vue from 'vue'
-import VueRouter from 'vue-router'
-import Home from '../pages/Home.vue'
+import Vue from "vue";
+import VueRouter from "vue-router";
+import Home from "../pages/Home.vue";
 
-const originalPush = VueRouter.prototype.push
-VueRouter.prototype.push = function push (location) {
-  return originalPush.call(this, location).catch(err => err)
-}
+const originalPush = VueRouter.prototype.push;
+VueRouter.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch((err) => err);
+};
 
-Vue.use(VueRouter)
+Vue.use(VueRouter);
 
 const routes = [
   {
-    path: '/',
-    name: 'Home',
-    component: Home
-  }
-]
+    path: "/",
+    name: "Home",
+    component: Home,
+  },
+];
 
 const router = new VueRouter({
-  routes
-})
+  routes,
+});
 
-export default router
+export default router;

+ 11 - 0
scene/src/view.js

@@ -0,0 +1,11 @@
+import Vue from "vue";
+import ElementUI from "element-ui";
+import "element-ui/lib/theme-chalk/index.css";
+import  Viewer from './pages/View.vue'
+
+window.project_env = process.env.NODE_ENV
+Vue.use(ElementUI);
+
+new Vue({
+  render: (h) => h(Viewer),
+}).$mount("#app");

+ 14 - 11
scene/vue.config.js

@@ -8,23 +8,26 @@ module.exports = {
   css: {
     loaderOptions: {
       less: {
-        globalVars: getLessVariables(path.resolve(__dirname, "./src/assets/style/globalVars.less")),
+        globalVars: getLessVariables(
+          path.resolve(__dirname, "./src/assets/style/globalVars.less")
+        ),
       },
     },
   },
+  pages: { index: "src/main.js", view: "src/view.js" },
   devServer: {
     port: 8090,
     // proxy: {
-      // "/page": {
-      //   target: "http://192.168.0.12:8081",
-      //   changeOrigin: true,
-      //   rewrite: (path) => path.replace(/^\/page/, ""),
-      // },
-      // "/js": {
-      //   target: "http://192.168.0.12:8081",
-      //   changeOrigin: true,
-      //   // rewrite: (path) => path.replace(/^\/page/, ""),
-      // },
+    // "/page": {
+    //   target: "http://192.168.0.12:8081",
+    //   changeOrigin: true,
+    //   rewrite: (path) => path.replace(/^\/page/, ""),
+    // },
+    // "/js": {
+    //   target: "http://192.168.0.12:8081",
+    //   changeOrigin: true,
+    //   // rewrite: (path) => path.replace(/^\/page/, ""),
+    // },
     // },
   },
 };