Explorar el Código

本地化SWKK

shaogen1995 hace 3 años
padre
commit
435299d58b

+ 3 - 3
houtai/src/views/tab1Main/five.vue

@@ -91,7 +91,7 @@
                 ></div>
               </div>
               <el-upload
-                v-if="item.imgList.length < 10"
+                v-if="item.imgList.length < 20"
                 accept=".png,.jpg,.jpeg"
                 :action="baseURL + '/cms/content/upload'"
                 :data="{
@@ -459,7 +459,7 @@ export default {
                 bottom: 0;
                 left: 0;
                 height: 30px;
-                background-color: rgba(163, 0, 20, 0.8);
+                background-color: rgba(0, 0, 0, 0.6);
               }
               .delImg {
                 cursor: pointer;
@@ -485,7 +485,7 @@ export default {
                 bottom: 0;
                 left: 0;
                 height: 30px;
-                background-color: rgba(0, 0, 0, 0.6);
+                background-color: rgba(163, 0, 20, 0.8);
               }
             }
           }

+ 3 - 3
houtai/src/views/tab1Main/four.vue

@@ -83,7 +83,7 @@
                 ></div>
               </div>
               <el-upload
-                v-if="item.imgList.length < 10"
+                v-if="item.imgList.length < 20"
                 accept=".png,.jpg,.jpeg"
                 :action="baseURL + '/cms/content/upload'"
                 :data="{
@@ -449,7 +449,7 @@ export default {
                 bottom: 0;
                 left: 0;
                 height: 30px;
-                background-color: rgba(163, 0, 20, 0.8);
+                background-color: rgba(0, 0, 0, 0.6);
               }
               .delImg {
                 cursor: pointer;
@@ -475,7 +475,7 @@ export default {
                 bottom: 0;
                 left: 0;
                 height: 30px;
-                background-color: rgba(0, 0, 0, 0.6);
+                background-color: rgba(163, 0, 20, 0.8);
               }
             }
           }

+ 2 - 2
houtai/src/views/tab1Main/one.vue

@@ -31,7 +31,7 @@
             }"
             :file-list="imgUpList"
             :headers="{ token }"
-            :limit="10"
+            :limit="20"
             :on-exceed="handleExceed"
             list-type="picture-card"
             :on-preview="handlePictureCardPreview"
@@ -216,7 +216,7 @@ export default {
       this.imgIdArr.push(data.data.id)
     },
     handleExceed (files, fileList) {
-      this.$message.warning('最多上传10张图片')
+      this.$message.warning('最多上传20张图片')
     },
 
     // -------------------上传视频

BIN
web/public/data/10.png


BIN
web/public/data/8.png


+ 5 - 5
web/src/components/five.vue

@@ -100,8 +100,8 @@ export default {
       margin-right: 20px;
       margin-bottom: 26px;
       position: relative;
-      width: 292px;
-      height: 208px;
+      width: 100%;
+      height: 90%;
       background-color: rgba(0, 0, 0, 0.6);
       & > video {
         width: 100%;
@@ -120,9 +120,9 @@ export default {
         color: #fff;
         font-size: 14px;
       }
-      &:nth-of-type(4n) {
-        margin-right: 0;
-      }
+      // &:nth-of-type(4n) {
+      //   margin-right: 0;
+      // }
     }
   }
 }

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

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

+ 1 - 1
web/src/views/stair/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="stair">
     <div class="ifrBox">
-      <iframe :src="ifrSrc[$route.params.id]" frameborder="0"></iframe>
+      <iframe id="preview" :src="ifrSrc[$route.params.id]" frameborder="0"></iframe>
     </div>
     <!-- 左上浏览量 -->
     <div class="upleft">

BIN
webM/src/assets/img/bg.png


+ 3 - 2
webM/src/views/Home.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="Home">
-    <div class="map">地图页面,等待开发...</div>
+    <div class="map"></div>
     <!-- 顶部 -->
     <div class="top" :class="{ topOpen: cutArrows }">
       <!-- 箭头 -->
@@ -132,7 +132,8 @@ export default {
     display: flex;
     justify-content: center;
     align-items: center;
-    background: url("../assets/img/homeBg.png");
+    background: url("../assets/img/bg.png");
+    background-size: cover;
   }
   .top {
     transition: all 0.3s;

+ 95 - 16
webM/src/views/stair/component/card.vue

@@ -5,15 +5,23 @@
       <div class="swImg">
         <div class="swiper-container">
           <div class="swiper-wrapper">
-            <div class="swiper-slide" v-for="i in 5" :key="i">
-              <img src="@/assets/img/cCj/1.png" alt="" />
+            <div
+              class="swiper-slide"
+              v-for="item in data"
+              :key="item.id"
+              @click="$emit('daka', [item.id, item.ind])"
+            >
+              <img
+                :src="`${textUrl}/local/4dkk/${item.id}/wwwroot/images/images${item.id}/thumbSmallImg.jpg?0.3393463684591038`"
+                alt=""
+              />
               <!-- 底部文字 -->
               <div class="swTxt">
-                <h4>开平碉楼</h4>
-                <p>2022.04.13</p>
+                <h4>{{ item.name }}</h4>
+                <p>访问量:20</p>
               </div>
               <!-- 已打卡标记 -->
-              <div class="playCard" v-if="i===2"></div>
+              <div class="playCard" v-if="item.done"></div>
             </div>
           </div>
         </div>
@@ -32,7 +40,64 @@ export default {
   components: {},
   data() {
     //这里存放数据
-    return {};
+    return {
+      // 测试url
+      // textUrl: "http://192.168.20.48:8080/", //本地
+      textUrl: "/SWKK", //打包
+
+      // 打卡相关匹配数据
+      dakaData: {
+        1: [
+          { id: "KJ-rDI8nxEzY7", name: "图书馆", ind: 0 },
+          { id: "KJ-l6umbreveh", name: "住宅", ind: 1 },
+        ],
+        2: [
+          { id: "KJ-DGrs9gsN5f", name: "罗氏大宗祠", ind: 0 },
+          { id: "KJ-TlLriX28UR", name: "五部堂", ind: 1 },
+        ],
+        3: [
+          { id: "KJ-XOBeWcv7zo", name: "名官家廟", ind: 0 },
+          { id: "KJ-ASW6c4Dn2c", name: "毅斋卢公祠", ind: 1 },
+        ],
+        4: [
+          { id: "KK-mJd0HnVE0e", name: "祠堂", ind: 0 },
+          { id: "KK-uptTQv9BYC", name: "四新楼", ind: 1 },
+        ],
+        5: [
+          { id: "KJ-OQtw9EMLaP", name: "仓东村秉文谢", ind: 0 },
+          { id: "KJ-uce7ck7XWB", name: "仓东村-侯成谢公祠", ind: 1 },
+        ],
+        6: [
+          { id: "KJ-AZ11Fpmquy", name: "霄南村-尧階", ind: 0 },
+          { id: "KJ-DyMG5hLNEs", name: "霄南村-樂隐源公祠", ind: 1 },
+        ],
+        7: [
+          { id: "KJ-O8r726fnie", name: "振韬祖祠", ind: 0 },
+          { id: "KJ-BQFE4jJMyU", name: "缉熙堂祠堂", ind: 1 },
+        ],
+        8: [
+          { id: "KJ-q2pOJb3igE", name: "碉楼", ind: 0 },
+          { id: "KJ-qvIOZguVBQ", name: "澜生居庐", ind: 1 },
+        ],
+        9: [
+          { id: "KJ-qKWxTrHUMd", name: "骏庐", ind: 0 },
+          { id: "KJ-e6wGbcLwtP", name: "林庐", ind: 1 },
+        ],
+        10: [
+          { id: "KK-qO3teGzkJK", name: "南津赵公祠", ind: 0 },
+          { id: "KJ-JgLPL8Y1Ue", name: "凌云阁", ind: 1 },
+        ],
+        11: [
+          { id: "KJ-fqXrFPJYOg", name: "贤安庐", ind: 0 },
+          { id: "KJ-eh6NxoBf9l", name: "民居", ind: 1 },
+        ],
+        12: [
+          { id: "KJ-Dx5YGcSZlx", name: "礼仪书室", ind: 0 },
+          { id: "KJ-qGS7oKvuZa", name: "胡氏别墅", ind: 1 },
+        ],
+      },
+      data: [],
+    };
   },
   //监听属性 类似于data概念
   computed: {},
@@ -41,12 +106,26 @@ export default {
   //方法集合
   methods: {},
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+    let id = Number(this.$route.params.id);
+
+    // 筛选打卡的数据
+    this.data = this.dakaData[id];
+    // 存在本地
+    let temp = localStorage.getItem("JMData_daka") || [];
+    if (temp.length > 0) {
+      temp = JSON.parse(temp);
+    }
+    temp.forEach((v) => {
+      if (v.name == this.data[0].id) this.data[0].done = true;
+      if (v.name == this.data[1].id) this.data[1].done = true;
+    });
+  },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     this.$nextTick(() => {
       new Swiper(".card .swiper-container", {
-        slidesPerView: 1.4,
+        slidesPerView: 1.2,
         spaceBetween: 20,
       });
     });
@@ -101,34 +180,34 @@ export default {
         width: calc(100% - 24px);
         margin: 0 auto;
         height: 100%;
-        .swiper-slide{
+        .swiper-slide {
           position: relative;
           padding: 8px 12px;
-          background: url('../../../assets/img/btn_record.png');
+          background: url("../../../assets/img/btn_record.png");
           background-size: 100% 100%;
           img {
             width: 100%;
             height: calc(100% - 66px);
             object-fit: cover;
           }
-          .swTxt{
+          .swTxt {
             padding-top: 10px;
             height: 50px;
-            color: #887B67;
+            color: #887b67;
             font-size: 16px;
-            h4{
+            h4 {
               margin-bottom: 3px;
-              font-family: 'SYST';
+              font-family: "SYST";
               font-size: 18px;
             }
           }
-          .playCard{
+          .playCard {
             position: absolute;
             bottom: 20px;
             right: 15px;
             width: 135px;
             height: 90px;
-            background: url('../../../assets/img/playCard.png');
+            background: url("../../../assets/img/playCard.png");
             background-size: 100% 100%;
           }
         }

+ 58 - 16
webM/src/views/stair/index.vue

@@ -1,7 +1,11 @@
 <template>
   <div class="stair" :style="`height:${maxHei}px;`">
     <div class="ifrBox">
-      <iframe :src="ifrSrc[$route.params.id]" frameborder="0"></iframe>
+      <iframe
+        id="preview"
+        :src="textUrl + ifrSrc[$route.params.id]"
+        frameborder="0"
+      ></iframe>
     </div>
 
     <!-- 左上浏览量 -->
@@ -51,7 +55,7 @@
     <!-- 简介组件 -->
     <StairIntro v-if="btnDataAc === 1" @close="btnDataAc = null" />
     <!-- 打卡组件 -->
-    <StairCard v-if="btnDataAc === 2" @close="btnDataAc = null" />
+    <StairCard v-if="btnDataAc === 2" @close="btnDataAc = null" @daka="daka" />
     <!-- 分享组件 -->
     <StairShare v-if="btnDataAc === 3" @close="btnDataAc = null" />
   </div>
@@ -68,6 +72,10 @@ export default {
   data() {
     //这里存放数据
     return {
+      // 测试url
+      // textUrl: "http://192.168.20.48:8081", //本地
+      textUrl: "/SWKK", //打包
+
       lookNum: 0,
       likeNum: 0,
       btnData: [
@@ -82,18 +90,18 @@ export default {
       maxHei: 0,
       // 场景地址
       ifrSrc: {
-        1: "https://www.4dkankan.com/panorama/show.html?id=WK1526481420019593216",
-        2: "https://www.4dkankan.com/panorama/show.html?id=WK1526504857790345216",
-        3: "https://www.4dkankan.com/panorama/show.html?id=WK1526492643662524416",
-        4: "https://www.4dkankan.com/panorama/show.html?id=WK1534388525183561728",
-        5: "https://www.4dkankan.com/panorama/show.html?id=WK1526467526949629952",
-        6: "https://www.4dkankan.com/panorama/show.html?id=WK1534416074647302144",
-        7: "https://www.4dkankan.com/panorama/show.html?id=WK1534702347710656512",
-        8: "https://www.4dkankan.com/panorama/show.html?id=WK1534781968695259136",
-        9: "https://www.4dkankan.com/panorama/show.html?id=WK1534383548646060032",
-        10: "https://www.4dkankan.com/panorama/show.html?id=WK1526490922810896384",
-        11: "https://www.4dkankan.com/panorama/show.html?id=WK1526504177180635136",
-        12: "https://www.4dkankan.com/panorama/show.html?id=WK1526461619335360512",
+        1: "/show.html?id=WK1526481420019593216",
+        2: "/show.html?id=WK1526504857790345216",
+        3: "/show.html?id=WK1526492643662524416",
+        4: "/show.html?id=WK1534388525183561728",
+        5: "/show.html?id=WK1526467526949629952",
+        6: "/show.html?id=WK1534416074647302144",
+        7: "/show.html?id=WK1534702347710656512",
+        8: "/show.html?id=WK1534781968695259136",
+        9: "/show.html?id=WK1534383548646060032",
+        10: "/show.html?id=WK1526490922810896384",
+        11: "/show.html?id=WK1526504177180635136",
+        12: "/show.html?id=WK1526461619335360512",
       },
     };
   },
@@ -103,6 +111,22 @@ export default {
   watch: {},
   //方法集合
   methods: {
+    // 通知子组件跳转页面
+    daka(arr) {
+      // 存在本地
+      let temp = localStorage.getItem("JMData_daka") || [];
+      if (temp.length > 0) {
+        temp = JSON.parse(temp);
+      }
+      if (temp.every((v) => v.name != arr[0])) {
+        temp.push({ name: arr[0] });
+        localStorage.setItem("JMData_daka", JSON.stringify(temp));
+      }
+
+      this.btnDataAc = null;
+      let ifrDom = document.querySelector("#preview");
+      ifrDom.contentWindow.postMessage(arr, "*");
+    },
     async cutPage(id) {
       // 点赞
       if (id === 4) {
@@ -129,6 +153,24 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     this.maxHei = document.documentElement.clientHeight;
+
+    window.addEventListener(
+      "message",
+      (e) => {
+        if (typeof e.data === "string" && e.data.length > 0) {
+          // 存在本地
+          let temp = localStorage.getItem("JMData_daka") || [];
+          if (temp.length > 0) {
+            temp = JSON.parse(temp);
+          }
+          if (temp.every((v) => v.name != e.data)) {
+            temp.push({ name: e.data });
+            localStorage.setItem("JMData_daka", JSON.stringify(temp));
+          }
+        }
+      },
+      false
+    );
   },
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
@@ -161,8 +203,8 @@ export default {
   }
   .upleft {
     position: absolute;
-    right: 5px;
-    top: 3px;
+    left: 5px;
+    bottom: 86px;
     display: flex;
     align-items: center;
     color: #fff;