aamin 1 рік тому
батько
коміт
86a9712f02

+ 2 - 2
scene/package-lock.json

@@ -3123,7 +3123,7 @@
     },
     "node_modules/axios": {
       "version": "0.27.2",
-      "resolved": "https://registry.npmmirror.com/axios/-/axios-0.27.2.tgz",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
       "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
       "dependencies": {
         "follow-redirects": "^1.14.9",
@@ -19668,7 +19668,7 @@
     },
     "axios": {
       "version": "0.27.2",
-      "resolved": "https://registry.npmmirror.com/axios/-/axios-0.27.2.tgz",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
       "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
       "requires": {
         "follow-redirects": "^1.14.9",

+ 2 - 2
scene/package.json

@@ -11,9 +11,9 @@
   },
   "dependencies": {
     "axios": "^0.27.2",
-    "html2canvas": "^1.4.1",
     "core-js": "^3.6.5",
     "element-ui": "^2.15.6",
+    "html2canvas": "^1.4.1",
     "install": "^0.13.0",
     "npm": "^8.10.0",
     "swiper": "^5.3.8",
@@ -34,4 +34,4 @@
     "less-loader": "^5.0.0",
     "vue-template-compiler": "^2.6.11"
   }
-}
+}

+ 1 - 1
scene/src/assets/style/myBase.css

@@ -18,7 +18,7 @@
 }
 
 #thumb-container {
-  width: auto !important;
+  /* width: auto !important; */
 }
 
 #thumb-container .thumbImg .overlay {

+ 20 - 2
scene/src/utils/api.js

@@ -7,10 +7,28 @@ export const addVisitAPI = () => {
   })
 }
 
+
 // 获取访问量
-export const getVisitAPI = () => {
+export const getVisitAPI = (id) => {
+  return axios({
+    method: 'get',
+    url: `show/village/getVisit/${id}`,
+  })
+}
+
+// 留言反馈
+export const feedBack = (data) => {
+  return axios({
+    method: 'post',
+    url: 'show/message',
+    data
+  })
+}
+
+// 打卡、增加点赞、访问量、分享数
+export const addViewDataAPI =(data) => {
   return axios({
     method: 'get',
-    url: 'show/share/detail',
+    url: `show/village/addVisit/${data.id}/${data.type}`
   })
 }

+ 1 - 1
scene/src/utils/request.js

@@ -1,6 +1,6 @@
 import axios from 'axios'
 
-export const baseURL = process.env.NODE_ENV === "development" ? "https://leifengbwg.4dage.com" : "";
+export const baseURL = process.env.NODE_ENV === "development" ? "https://sit-shibadong.4dage.com" : "";
 
 const service = axios.create({
   baseURL: baseURL + "/api/",

+ 17 - 8
scene/src/views/gui/components/FeedBack.vue

@@ -8,7 +8,7 @@
         <div class="name-box"><input type="text" placeholder="请输入称呼(必填,1-6个字)" v-model="name"></div>
         <div class="number-box"><input type="text" placeholder="请输入联系方式(必填,1-11个字)" v-model="number"></div>
         <div class="code-box"><input type="text" placeholder="请输入图形验证码" v-model="code"></div>
-        <img src="https://sit-cnzhengquan.4dage.com/api/show/getRandCode?0" alt="">
+        <img @click="() => { refreshCount = refreshCount + 1 }" :src="`${codeUrl + refreshCount}`" alt="">
       </div>
 
       <div class="btns">
@@ -20,6 +20,7 @@
 </template>
 
 <script>
+import { feedBack } from '@/utils/api'
 
 export default {
   components: {},
@@ -28,8 +29,10 @@ export default {
       content: '',
       name: '',
       number: '',
-      code: ''
-
+      code: '',
+      codeUrl: 'https://sit-shibadong.4dage.com/api/show/getRandCode?',
+      refreshCount: 0
+      // codeUrl: '/api/show/getRandCode'
     };
   },
   computed: {},
@@ -37,10 +40,10 @@ export default {
   methods: {
     submit() {
       const data = {
-        contetn: this.content,
+        content: this.content,
         name: this.name,
-        number: this.number,
-        code: this.code
+        phone: this.number,
+        randCode: this.code
       }
       if (this.content.length < 4 || this.content.length > 500) {
         alert('请输入内容,4-500个字符')
@@ -59,8 +62,14 @@ export default {
         alert('请输入验证码')
         return
       }
-      console.log(data)
-      alert('提交成功')
+      feedBack(data).then((res) => {
+        if(res.code === 0){
+          alert('提交成功')
+        // this.$emit('close')
+        }else {
+          alert(res.msg)
+        }
+      })
     }
   },
   created() {

+ 64 - 9
scene/src/views/gui/menu.vue

@@ -154,23 +154,22 @@
 
         <!-- 音乐 -->
         <!-- <div id="volume" class="ui-icon bgandshare wide"> -->
-        <div id="volume" class="toHomeBox" style="margin-right: '10px'">
+        <!-- <div id="volume" class="toHomeBox" style="margin-right: '10px'">
           <img id="openMusic" style="display: block" @click="switchBGM(true)" src="../../assets/img/musicAc.png"
             alt="" />
           <img id="closeMusic" style="display: none" @click="switchBGM(false)" src="../../assets/img/music.png"
             alt="" />
           <div class="btmText">讲解</div>
-        </div>
-
+        </div> -->
         <div class="toHomeBox">
           <img src="../../assets/img/viewer.png" alt="" />
-          <div class="btmText">1206</div>
+          <div class="btmText">{{ viewerNumber }}</div>
         </div>
 
         <!-- 分享 -->
-        <div id="volume" class="toHomeBox" style="margin-right: '10px'" @click="() => { isLike = true }">
+        <div id="volume" class="toHomeBox" style="margin-right: '10px'" @click="liking()">
           <img :src="require(`../../assets/img/like${isLike ? '_active' : ''}.png`)" alt="">
-          <div class="btmText">112</div>
+          <div class="btmText">{{ likeNumber }}</div>
         </div>
 
         <!-- 分享 -->
@@ -213,7 +212,7 @@ import HotList from "./components/hotList.vue";
 import FeedBack from "./components/FeedBack.vue";
 import PunchCard from "./components/PunchCard.vue";
 import html2canvas from "html2canvas";
-
+import { addViewDataAPI, getVisitAPI } from '@/utils/api'
 
 
 
@@ -227,13 +226,57 @@ export default {
       openInd: 0,
       isFull: false,
       isLike: false,
-      isOk: ''
+      isOk: '',
+      likeNumber: 0,
+      viewerNumber: 0,
+      keyValueById: {
+        'KJ-7w6beohW0SV': 20,
+        'KJ-n861OZCBj9g': 21,
+        'KJ-0NKXh1TsRoF': 22,
+        'KJ-LGeMazpL33X': 23,
+        'KJ-FdfCowgsJsq': 24,
+        'KJ-Ofi7O1dMuRv': 25,
+        'KJ-Z0bljPCpxNe': 29,
+        'KJ-YDu2r2dJkfK': 30,
+        'KJ-zeUY8SIudGo': 31,
+        'KJ-NDyJKVNPO3j': 32
+      }
     };
   },
   watch: {},
   computed: {},
-  mounted() { },
+  mounted() {
+   
+  },
+  created () {
+    addViewDataAPI({
+      id: this.keyValueById[this.$route.query.m],
+      type: 'visit'
+    })
+    this.getViewAndLike()
+  },
   methods: {
+    getViewAndLike() {
+      getVisitAPI(this.keyValueById[this.$route.query.m]).then((res) => {
+        this.viewerNumber = res.data.pcsVisit
+        this.likeNumber = res.data.pcsStar
+      })
+    },
+
+    liking() {
+      if (!this.isLike) {
+        addViewDataAPI({
+          id: this.keyValueById[this.$route.query.m],
+          type: 'star'
+        }).then((res) => {
+          if (res.code === 0) {
+            this.isLike = true
+            this.getViewAndLike()
+          }
+        })
+
+      }
+    },
 
     punchCardFu() {
       window.setTimeout(() => {
@@ -246,6 +289,13 @@ export default {
           const link = canvas.toDataURL("image/jpeg");
           this.isOk = link;
           this.openInd = 4
+
+          // 打卡
+          const data = {
+            id: this.keyValueById[this.$route.query.m],
+            type: 'check'
+          }
+          addViewDataAPI(data).then(() => { })
         });
       }, 100);
     },
@@ -312,6 +362,11 @@ export default {
       if (document.execCommand("copy")) {
         document.execCommand("copy");
         alert("链接已复制");
+
+        addViewDataAPI({
+          id: this.keyValueById[this.$route.query.m],
+          type: 'share'
+        })
       }
       document.body.removeChild(input);
     },