lanxin 9 месяцев назад
Родитель
Сommit
b98f60cc8c

BIN
web/src/assets/img/swiper.png


web/src/assets/img/swiper6.jpg → web/src/assets/img/swiper1.jpg


web/src/assets/img/swiper7.jpg → web/src/assets/img/swiper2.jpg


BIN
web/src/assets/img/swiper2.png


web/src/assets/img/swiper8.jpg → web/src/assets/img/swiper3.jpg


BIN
web/src/assets/img/swiper3.png


web/src/assets/img/swiper9.jpg → web/src/assets/img/swiper4.jpg


BIN
web/src/assets/img/swiper4.png


web/src/assets/img/swiper10.jpg → web/src/assets/img/swiper5.jpg


BIN
web/src/assets/img/swiper5.png


+ 12 - 6
web/src/router/index.js

@@ -1,6 +1,6 @@
 import Vue from 'vue'
 import VueRouter from 'vue-router'
-import Home from '../pages/Home.vue'
+// import Home from '../pages/Home.vue'
 
 const originalPush = VueRouter.prototype.push
 VueRouter.prototype.push = function push(location) {
@@ -10,11 +10,11 @@ VueRouter.prototype.push = function push(location) {
 Vue.use(VueRouter)
 
 const routes = [
-  {
-    path: '/index',
-    name: 'index',
-    component: Home
-  },
+  // {
+  //   path: '/index',
+  //   name: 'index',
+  //   component: Home
+  // },
   {
     path: '/',
     name: 'layout',
@@ -27,6 +27,12 @@ const routes = [
         component: () => import('../views/home/index.vue')
       },
       {
+        path: 'tab1',
+        name: 'tab1',
+        meta: { myInd: 1 },
+        component: () => import('../views/tab1/index.vue')
+      },
+      {
         path: 'tab2',
         name: 'tab2',
         meta: { myInd: 2 },

+ 2 - 2
web/src/utils/request.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 const service = axios.create({
   // baseURL: 'http://192.168.20.135:8005/', // 本地调试
-  baseURL: 'http://192.168.20.245:8005/', // 线上调试
-  // baseURL: '', // build
+  // baseURL: 'http://192.168.20.245:8005/', // 线上调试
+  baseURL: '', // build
   timeout: 5000
 })
 // 请求拦截器

+ 18 - 17
web/src/views/home/index.vue

@@ -13,7 +13,7 @@ export default {
   components: {},
   data() {
     // 这里存放数据
-    return {};
+    return {}
   },
   // 监听属性 类似于data概念
   computed: {},
@@ -22,26 +22,27 @@ export default {
   // 方法集合
   methods: {
     goIndex() {
-      this.$router.replace("/index?m=TEST");
-      this.$nextTick(() => {
-        setTimeout(() => {
-          location.reload(true);
-        }, 300);
-      });
+      this.$router.replace('tab1').catch(() => { })
+      // this.$router.replace("/index?m=TEST");
+      // this.$nextTick(() => {
+      //   setTimeout(() => {
+      //     location.reload(true);
+      //   }, 300);
+      // });
     },
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() { },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeCreate() {}, // 生命周期 - 创建之前
-  beforeMount() {}, // 生命周期 - 挂载之前
-  beforeUpdate() {}, // 生命周期 - 更新之前
-  updated() {}, // 生命周期 - 更新之后
-  beforeDestroy() {}, // 生命周期 - 销毁之前
-  destroyed() {}, // 生命周期 - 销毁完成
-  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
-};
+  mounted() { },
+  beforeCreate() { }, // 生命周期 - 创建之前
+  beforeMount() { }, // 生命周期 - 挂载之前
+  beforeUpdate() { }, // 生命周期 - 更新之前
+  updated() { }, // 生命周期 - 更新之后
+  beforeDestroy() { }, // 生命周期 - 销毁之前
+  destroyed() { }, // 生命周期 - 销毁完成
+  activated() { }, // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang='less' scoped>
 .home {

+ 24 - 32
web/src/views/layout/index.vue

@@ -15,20 +15,11 @@
         </div>
         <!-- tab栏 -->
         <div class="tab">
-          <div
-            class="tab_row"
-            v-for="item in tabArr"
-            :key="item.id"
-            @click="jump(item.url)"
-          >
+          <div class="tab_row" v-for="item in tabArr" :key="item.id" @click="jump(item.url)">
             <div :class="{ active: $route.meta.myInd === item.id }">
               {{ item.name }}
             </div>
-            <img
-              v-show="$route.meta.myInd === item.id"
-              src="@/assets/img/active.png"
-              alt=""
-            />
+            <img v-show="$route.meta.myInd === item.id" src="@/assets/img/active.png" alt="" />
           </div>
         </div>
       </div>
@@ -53,7 +44,7 @@ export default {
         { url: "tab3", id: 3, name: "文物典藏" },
         { url: "tab4", id: 4, name: "信息检索" }
       ],
-    };
+    }
   },
   // 监听属性 类似于data概念
   computed: {},
@@ -63,29 +54,30 @@ export default {
   methods: {
     // 点击tab栏
     jump(url) {
-      if (url === "tab1") url = "/index?m=TEST";
-      this.$router.replace(url).catch(() => {});
-      if (url === "/index?m=TEST") {
-        this.$nextTick(() => {
-          setTimeout(() => {
-            location.reload(true);
-          }, 300);
-        });
-      }
+      this.$router.replace(url).catch(() => { })
+      // if (url === "tab1") url = "/index?m=TEST";
+      // this.$router.replace(url).catch(() => {});
+      // if (url === "/index?m=TEST") {
+      //   this.$nextTick(() => {
+      //     setTimeout(() => {
+      //       location.reload(true);
+      //     }, 300);
+      //   });
+      // }
     },
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() { },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeCreate() {}, // 生命周期 - 创建之前
-  beforeMount() {}, // 生命周期 - 挂载之前
-  beforeUpdate() {}, // 生命周期 - 更新之前
-  updated() {}, // 生命周期 - 更新之后
-  beforeDestroy() {}, // 生命周期 - 销毁之前
-  destroyed() {}, // 生命周期 - 销毁完成
-  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
-};
+  mounted() { },
+  beforeCreate() { }, // 生命周期 - 创建之前
+  beforeMount() { }, // 生命周期 - 挂载之前
+  beforeUpdate() { }, // 生命周期 - 更新之前
+  updated() { }, // 生命周期 - 更新之后
+  beforeDestroy() { }, // 生命周期 - 销毁之前
+  destroyed() { }, // 生命周期 - 销毁完成
+  activated() { }, // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang='less' scoped>
 .layout {
@@ -154,7 +146,7 @@ export default {
             width: 53px;
             height: 19px;
           }
-          &:hover div{
+          &:hover div {
             color: #f2cd83;
           }
         }

+ 9 - 1
web/src/views/tab1/index.vue

@@ -1,7 +1,7 @@
 <!--  -->
 <template>
   <div class='tab1'>
-    <iframe :src="`http://192.168.20.245:8005/scene/index.html?m=TEST`" frameborder="0"></iframe>
+    <iframe :src="`/scene/index.html?m=1564`" frameborder="0"></iframe>
   </div>
 </template>
 
@@ -25,7 +25,15 @@ export default {
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
+    window.aaaaa = (flag) => {
+      console.log(123, flag)
+      if (flag) {
+        // 隐藏顶部
+      } else {
+        // 显示顶部
+      }
 
+    }
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {

+ 10 - 30
web/src/views/tab2/index.vue

@@ -4,44 +4,24 @@
       <div class="swiper-container">
         <div class="swiper-wrapper">
           <div class="swiper-slide">
-            <img src="../../assets/img/swiper.png" alt="" />
-            <p class="imgName">11111111</p>
+            <img src="../../assets/img/swiper1.jpg" alt="" />
+            <p class="imgName"></p>
           </div>
           <div class="swiper-slide">
-            <img src="../../assets/img/swiper2.png" alt="" />
-            <p class="imgName">222222222222222</p>
+            <img src="../../assets/img/swiper2.jpg" alt="" />
+            <p class="imgName"></p>
           </div>
           <div class="swiper-slide">
-            <img src="../../assets/img/swiper3.png" alt="" />
-            <p class="imgName">333333333</p>
+            <img src="../../assets/img/swiper3.jpg" alt="" />
+            <p class="imgName"></p>
           </div>
           <div class="swiper-slide">
-            <img src="../../assets/img/swiper4.png" alt="" />
-            <p class="imgName">4444444444</p>
+            <img src="../../assets/img/swiper4.jpg" alt="" />
+            <p class="imgName"></p>
           </div>
           <div class="swiper-slide">
-            <img src="../../assets/img/swiper5.png" alt="" />
-            <p class="imgName">5555555555</p>
-          </div>
-          <div class="swiper-slide">
-            <img src="../../assets/img/swiper6.jpg" alt="" />
-            <p class="imgName">222222222222222</p>
-          </div>
-          <div class="swiper-slide">
-            <img src="../../assets/img/swiper7.jpg" alt="" />
-            <p class="imgName">222222222222222</p>
-          </div>
-          <div class="swiper-slide">
-            <img src="../../assets/img/swiper8.jpg" alt="" />
-            <p class="imgName">222222222222222</p>
-          </div>
-          <div class="swiper-slide">
-            <img src="../../assets/img/swiper9.jpg" alt="" />
-            <p class="imgName">222222222222222</p>
-          </div>
-          <div class="swiper-slide">
-            <img src="../../assets/img/swiper10.jpg" alt="" />
-            <p class="imgName">222222222222222</p>
+            <img src="../../assets/img/swiper5.jpg" alt="" />
+            <p class="imgName"></p>
           </div>
         </div>
       </div>