shaogen1995 vor 2 Jahren
Ursprung
Commit
fd350fb39c

+ 8 - 0
houtai/src/apis/system.js

@@ -63,3 +63,11 @@ export const getStatistics = () => {
     url: '/cms/village/getStatistics'
     url: '/cms/village/getStatistics'
   })
   })
 }
 }
+
+// 获取场景打卡列表
+export const sceneGetList = () => {
+  return axios({
+    method: 'get',
+    url: '/cms/scene/getList'
+  })
+}

+ 1 - 2
houtai/src/utils/request.js

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

+ 18 - 11
houtai/src/views/tab3/index.vue

@@ -3,7 +3,7 @@
     <div class="insideTop">
     <div class="insideTop">
       数据统计
       数据统计
       <div class="addBtn">
       <div class="addBtn">
-        <el-button type="primary">导出</el-button>
+        <el-button type="primary" v-show="0">导出</el-button>
       </div>
       </div>
     </div>
     </div>
     <div class="obstruct"></div>
     <div class="obstruct"></div>
@@ -28,16 +28,19 @@
       </div>
       </div>
       <!-- 下面盒子 -->
       <!-- 下面盒子 -->
       <div class="bottom">
       <div class="bottom">
-        <span class="tit">VR景点打卡排行(等待开发)</span>
+        <span class="tit">VR景点打卡排行</span>
         <div class="botRowBox">
         <div class="botRowBox">
-          <div class="botRow" v-for="i in 10" :key="i">
+          <div class="botRow" v-for="(item, index) in dakaData" :key="item.id">
             <div class="botLeft">
             <div class="botLeft">
-              <h3>NO.1</h3>
-              <p>打卡数:321</p>
-              <p>宇宙卢工祠堂</p>
+              <h3>NO.{{ index + 1 }}</h3>
+              <p>打卡数:{{ item.visit }}</p>
+              <p>{{ item.name }}</p>
             </div>
             </div>
             <div class="botRight">
             <div class="botRight">
-              <img src="../../assets/img/bg.jpg" alt="" />
+              <img
+                :src="`/SWKK/local/4dkk/${item.sceneCode}/wwwroot/images/images${item.sceneCode}/thumbSmallImg.jpg?0.3393463684591038`"
+                alt=""
+              />
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -47,7 +50,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getStatistics } from '@/apis/system'
+import { getStatistics, sceneGetList } from '@/apis/system'
 import * as echarts from 'echarts/core'
 import * as echarts from 'echarts/core'
 import {
 import {
   TitleComponent,
   TitleComponent,
@@ -76,7 +79,8 @@ export default {
         { name: '今日访问量', num: '0', img: '2.png' },
         { name: '今日访问量', num: '0', img: '2.png' },
         { name: '累计点赞数', num: '0', img: '3.png' },
         { name: '累计点赞数', num: '0', img: '3.png' },
         { name: '页面分享数', num: '0', img: '4.png' }
         { name: '页面分享数', num: '0', img: '4.png' }
-      ]
+      ],
+      dakaData: []
     }
     }
   },
   },
   // 监听属性 类似于data概念
   // 监听属性 类似于data概念
@@ -86,7 +90,11 @@ export default {
   // 方法集合
   // 方法集合
   methods: {},
   methods: {},
   // 生命周期 - 创建完成(可以访问当前this实例)
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {},
+  async created () {
+    // 获取列表
+    const res = await sceneGetList()
+    this.dakaData = res.data
+  },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   // 生命周期 - 挂载完成(可以访问DOM元素)
   async mounted () {
   async mounted () {
     const res = await getStatistics()
     const res = await getStatistics()
@@ -296,7 +304,6 @@ export default {
             & > p {
             & > p {
               text-align: center;
               text-align: center;
               margin-top: 30px;
               margin-top: 30px;
-              cursor: pointer;
             }
             }
           }
           }
           .botRight {
           .botRight {

+ 16 - 0
webM/src/utils/api.js

@@ -51,4 +51,20 @@ export const addShareApi = (villageId) => {
     method: 'get',
     method: 'get',
     url: `/web/village/addShare/${villageId}`,
     url: `/web/village/addShare/${villageId}`,
   })
   })
+}
+
+// 获取访问量
+export const sceneGetList = () => {
+  return axios({
+    method: 'get',
+    url: '/web/scene/getList',
+  })
+}
+
+// 添加访问量
+export const addVisit = (sceneCode) => {
+  return axios({
+    method: 'get',
+    url: `/web/scene/addVisit/${sceneCode}`,
+  })
 }
 }

+ 43 - 29
webM/src/views/stair/component/card.vue

@@ -9,7 +9,7 @@
               class="swiper-slide"
               class="swiper-slide"
               v-for="item in data"
               v-for="item in data"
               :key="item.id"
               :key="item.id"
-              @click="$emit('daka', [item.id, item.ind])"
+              @click="sonDaka(item)"
             >
             >
               <img
               <img
                 :src="`${textUrl}/local/4dkk/${item.id}/wwwroot/images/images${item.id}/thumbSmallImg.jpg?0.3393463684591038`"
                 :src="`${textUrl}/local/4dkk/${item.id}/wwwroot/images/images${item.id}/thumbSmallImg.jpg?0.3393463684591038`"
@@ -18,7 +18,7 @@
               <!-- 底部文字 -->
               <!-- 底部文字 -->
               <div class="swTxt">
               <div class="swTxt">
                 <h4>{{ item.name }}</h4>
                 <h4>{{ item.name }}</h4>
-                <p>访问量:20</p>
+                <p>访问量:{{ item.num }}</p>
               </div>
               </div>
               <!-- 已打卡标记 -->
               <!-- 已打卡标记 -->
               <div class="playCard" v-if="item.done"></div>
               <div class="playCard" v-if="item.done"></div>
@@ -35,6 +35,7 @@
 
 
 <script>
 <script>
 import Swiper from "@/assets/swiper/swiper.js";
 import Swiper from "@/assets/swiper/swiper.js";
+import { sceneGetList, addVisit } from "@/utils/api";
 export default {
 export default {
   name: "card",
   name: "card",
   components: {},
   components: {},
@@ -48,52 +49,52 @@ export default {
       // 打卡相关匹配数据
       // 打卡相关匹配数据
       dakaData: {
       dakaData: {
         1: [
         1: [
-          { id: "KJ-rDI8nxEzY7", name: "图书馆", ind: 0 },
-          { id: "KJ-l6umbreveh", name: "住宅", ind: 1 },
+          { num: 0, id: "KJ-rDI8nxEzY7", name: "图书馆", ind: 0 },
+          { num: 0, id: "KJ-l6umbreveh", name: "住宅", ind: 1 },
         ],
         ],
         2: [
         2: [
-          { id: "KJ-DGrs9gsN5f", name: "罗氏大宗祠", ind: 0 },
-          { id: "KJ-TlLriX28UR", name: "五部堂", ind: 1 },
+          { num: 0, id: "KJ-DGrs9gsN5f", name: "罗氏大宗祠", ind: 0 },
+          { num: 0, id: "KJ-TlLriX28UR", name: "五部堂", ind: 1 },
         ],
         ],
         3: [
         3: [
-          { id: "KJ-XOBeWcv7zo", name: "名官家廟", ind: 0 },
-          { id: "KJ-ASW6c4Dn2c", name: "毅斋卢公祠", ind: 1 },
+          { num: 0, id: "KJ-XOBeWcv7zo", name: "名官家廟", ind: 0 },
+          { num: 0, id: "KJ-ASW6c4Dn2c", name: "毅斋卢公祠", ind: 1 },
         ],
         ],
         4: [
         4: [
-          { id: "KK-mJd0HnVE0e", name: "祠堂", ind: 0 },
-          { id: "KK-uptTQv9BYC", name: "四新楼", ind: 1 },
+          { num: 0, id: "KK-mJd0HnVE0e", name: "祠堂", ind: 0 },
+          { num: 0, id: "KK-uptTQv9BYC", name: "四新楼", ind: 1 },
         ],
         ],
         5: [
         5: [
-          { id: "KJ-OQtw9EMLaP", name: "仓东村秉文谢", ind: 0 },
-          { id: "KJ-uce7ck7XWB", name: "仓东村-侯成谢公祠", ind: 1 },
+          { num: 0, id: "KJ-OQtw9EMLaP", name: "仓东村秉文谢", ind: 0 },
+          { num: 0, id: "KJ-uce7ck7XWB", name: "仓东村-侯成谢公祠", ind: 1 },
         ],
         ],
         6: [
         6: [
-          { id: "KJ-AZ11Fpmquy", name: "霄南村-尧階", ind: 0 },
-          { id: "KJ-DyMG5hLNEs", name: "霄南村-樂隐源公祠", ind: 1 },
+          { num: 0, id: "KJ-AZ11Fpmquy", name: "霄南村-尧階", ind: 0 },
+          { num: 0, id: "KJ-DyMG5hLNEs", name: "霄南村-樂隐源公祠", ind: 1 },
         ],
         ],
         7: [
         7: [
-          { id: "KJ-O8r726fnie", name: "振韬祖祠", ind: 0 },
-          { id: "KJ-BQFE4jJMyU", name: "缉熙堂祠堂", ind: 1 },
+          { num: 0, id: "KJ-O8r726fnie", name: "振韬祖祠", ind: 0 },
+          { num: 0, id: "KJ-BQFE4jJMyU", name: "缉熙堂祠堂", ind: 1 },
         ],
         ],
         8: [
         8: [
-          { id: "KJ-q2pOJb3igE", name: "碉楼", ind: 0 },
-          { id: "KJ-qvIOZguVBQ", name: "澜生居庐", ind: 1 },
+          { num: 0, id: "KJ-q2pOJb3igE", name: "碉楼", ind: 0 },
+          { num: 0, id: "KJ-qvIOZguVBQ", name: "澜生居庐", ind: 1 },
         ],
         ],
         9: [
         9: [
-          { id: "KJ-qKWxTrHUMd", name: "骏庐", ind: 0 },
-          { id: "KJ-e6wGbcLwtP", name: "林庐", ind: 1 },
+          { num: 0, id: "KJ-qKWxTrHUMd", name: "骏庐", ind: 0 },
+          { num: 0, id: "KJ-e6wGbcLwtP", name: "林庐", ind: 1 },
         ],
         ],
         10: [
         10: [
-          { id: "KK-qO3teGzkJK", name: "南津赵公祠", ind: 0 },
-          { id: "KJ-JgLPL8Y1Ue", name: "凌云阁", ind: 1 },
+          { num: 0, id: "KK-qO3teGzkJK", name: "南津赵公祠", ind: 0 },
+          { num: 0, id: "KJ-JgLPL8Y1Ue", name: "凌云阁", ind: 1 },
         ],
         ],
         11: [
         11: [
-          { id: "KJ-fqXrFPJYOg", name: "贤安庐", ind: 0 },
-          { id: "KJ-eh6NxoBf9l", name: "民居", ind: 1 },
+          { num: 0, id: "KJ-fqXrFPJYOg", name: "贤安庐", ind: 0 },
+          { num: 0, id: "KJ-eh6NxoBf9l", name: "民居", ind: 1 },
         ],
         ],
         12: [
         12: [
-          { id: "KJ-Dx5YGcSZlx", name: "礼仪书室", ind: 0 },
-          { id: "KJ-qGS7oKvuZa", name: "胡氏别墅", ind: 1 },
+          { num: 0, id: "KJ-Dx5YGcSZlx", name: "礼仪书室", ind: 0 },
+          { num: 0, id: "KJ-qGS7oKvuZa", name: "胡氏别墅", ind: 1 },
         ],
         ],
       },
       },
       data: [],
       data: [],
@@ -104,11 +105,15 @@ export default {
   //监控data中的数据变化
   //监控data中的数据变化
   watch: {},
   watch: {},
   //方法集合
   //方法集合
-  methods: {},
+  methods: {
+    async sonDaka(item) {
+      await addVisit(item.id);
+      this.$emit("daka", [item.id, item.ind]);
+    },
+  },
   //生命周期 - 创建完成(可以访问当前this实例)
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {
+  async created() {
     let id = Number(this.$route.params.id);
     let id = Number(this.$route.params.id);
-
     // 筛选打卡的数据
     // 筛选打卡的数据
     this.data = this.dakaData[id];
     this.data = this.dakaData[id];
     // 存在本地
     // 存在本地
@@ -120,6 +125,13 @@ export default {
       if (v.name == this.data[0].id) this.data[0].done = true;
       if (v.name == this.data[0].id) this.data[0].done = true;
       if (v.name == this.data[1].id) this.data[1].done = true;
       if (v.name == this.data[1].id) this.data[1].done = true;
     });
     });
+
+    // 获取访问量
+    let res = await sceneGetList();
+    res.data.forEach((v) => {
+      if (v.sceneCode === this.data[0].id) this.data[0].num = v.visit;
+      if (v.sceneCode === this.data[1].id) this.data[1].num = v.visit;
+    });
   },
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
   mounted() {
@@ -191,6 +203,8 @@ export default {
             object-fit: cover;
             object-fit: cover;
           }
           }
           .swTxt {
           .swTxt {
+            position: relative;
+            z-index: 10;
             padding-top: 10px;
             padding-top: 10px;
             height: 50px;
             height: 50px;
             color: #887b67;
             color: #887b67;