Browse Source

大场景改一波

shaogen1995 8 months ago
parent
commit
2ecf425a78

+ 1 - 0
scene/public/index.html

@@ -19,6 +19,7 @@
     </style>
     <script>
         var number ='SG-zjgb8W41spv'
+        // var number ='1359'
     </script>
 
     <script class="build keep">

+ 3 - 0
scene/src/App.vue

@@ -44,6 +44,9 @@ export default {
       }, 1000);
     },
   },
+  mounted(){
+    if(window.location.href.includes('?xxx')) this.videoShow=false
+  }
 };
 </script>
 <style lang="less">

BIN
scene/src/assets/img/expert.png


BIN
scene/src/assets/img/goods.png


BIN
scene/src/assets/img/like.png


BIN
scene/src/assets/img/likeAc.png


BIN
scene/src/assets/img/toHome.png


+ 6 - 5
scene/src/pages/Home.vue

@@ -32,7 +32,7 @@
         <v-title />
 
         <!-- 底部菜单 -->
-        <v-menu  />
+        <v-menu ref="myMenu"/>
 
         <!-- 导览 -->
         <v-guide />
@@ -110,7 +110,7 @@ import vError from "@/views/gui/error";
 import vrCon from "@/views/gui/vrcon";
 import vOther from "@/views/gui/other";
 
-import { getVisitAPI,addVisitAPI } from "../utils/api";
+import { addVisitAPI } from "../utils/api";
 
 export default {
   name: "Home",
@@ -133,7 +133,7 @@ export default {
       hotspots: "",
       loading: true,
       // 访问量
-      isVisNum:0
+      isVisNum:0,
     };
   },
 
@@ -177,8 +177,9 @@ export default {
     });
   },
   async created() {
-    const res =await addVisitAPI()
-    this.isVisNum=res.data
+    const res =await addVisitAPI('visit')
+    this.isVisNum=res.data.pcs
+    this.$refs.myMenu.baseLike(res.data.pcsStar)
     
   },
 };

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

@@ -1,8 +1,8 @@
 import axios from './request'
 // 访问量+1
-export const addVisitAPI = () => {
+export const addVisitAPI = (type) => {
   return axios({
     method: 'get',
-    url: `show/visit/add`,
+    url: `show/visit/add/${type}`,
   })
 }

+ 101 - 21
scene/src/views/gui/menu.vue

@@ -209,11 +209,25 @@
           <a>{[{ TERMS }]}</a>
         </div>
 
-        <!--(首页) -->
-        <div class="toHomeBox" @click="toHomeFu">
+        <!--专家风采 -->
+        <div class="toHomeBox" @click="toPage('/expert')">
           <!-- 鼠标移入的显示 -->
-          <div class="hoverTit">回到首页</div>
-          <img src="../../assets/img/toHome.png" alt="" />
+          <div class="hoverTit">专家风采</div>
+          <img src="../../assets/img/expert.png" alt="" />
+        </div>
+
+        <!--精品典藏 -->
+        <div class="toHomeBox" @click="toPage('/goods')">
+          <!-- 鼠标移入的显示 -->
+          <div class="hoverTit">精品典藏</div>
+          <img src="../../assets/img/goods.png" alt="" />
+        </div>
+
+        <!-- 分享 -->
+        <div class="toHomeBox" @click="openInd = 2">
+          <!-- 鼠标移入的显示 -->
+          <div class="hoverTit">分享</div>
+          <img src="../../assets/img/share.png" alt="" />
         </div>
 
         <!-- 音乐 -->
@@ -237,11 +251,17 @@
             />
           </div>
         </div>
-        <!-- 分享 -->
-        <div class="toHomeBox" @click="openInd = 2">
+
+        <!-- 点赞 -->
+        <div class="toHomeBox" @click="likeFu">
           <!-- 鼠标移入的显示 -->
-          <div class="hoverTit">分享</div>
-          <img src="../../assets/img/share.png" alt="" />
+          <div class="hoverTit">点赞</div>
+          <img
+            :src="require(`@/assets/img/like${isLike ? 'Ac' : ''}.png`)"
+            alt=""
+          />
+          <div class="likeNum">{{ isLikeNum }}</div>
+          <div :class="`likeMove ${isLike ? 'likeMoveShow' : ''}`">+1</div>
         </div>
       </div>
     </div>
@@ -257,10 +277,11 @@
 <script>
 import HotList from "./components/hotList.vue";
 import Share from "./components/share.vue";
+import { addVisitAPI } from "@/utils/api";
 
 export default {
   components: { HotList, Share },
-  props: {},
+  props: [],
   data() {
     return {
       isGuide: true,
@@ -270,6 +291,9 @@ export default {
 
       // 播放音乐的定时器id
       musicTime: -1,
+      // 点赞
+      isLike: false,
+      isLikeNum: 0,
     };
   },
   watch: {},
@@ -287,19 +311,28 @@ export default {
     }
   },
   methods: {
-    // 回到首页
-    toHomeFu() {
-
-      if(window.location.href.includes("?h=1")){
-        window.parent.toHomeFu()
-      }else {
-        window.location.href = window.location.href.replace("scene", "web");
-      setTimeout(() => {
-        location.reload();
-      }, 200);
+    // 初始点赞赋值
+    baseLike(num) {
+      this.isLikeNum = num;
+    },
+
+    // 点击点赞
+    async likeFu() {
+      if (this.isLike) return;
+
+      const res = await addVisitAPI("star");
+      if (res.code === 0) {
+        this.isLike = true;
+        setTimeout(() => {
+          this.isLike = false;
+          this.isLikeNum = res.data.pcsStar;
+        }, 2000);
       }
+    },
 
-  
+    // 精品典藏和专家风采
+    toPage(url) {
+      window.parent.toPage(url);
     },
 
     switchBGM(flag) {
@@ -358,6 +391,7 @@ export default {
   background-size: 100% 100%;
   font-size: 14px;
   color: #fff;
+  text-shadow: 1px 1px 1px black;
 }
 #play:hover {
   .hoverTit {
@@ -467,6 +501,44 @@ export default {
       opacity: 1;
     }
   }
+  .likeNum {
+    position: absolute;
+    bottom: -18px;
+    width: 100%;
+    text-align: center;
+    text-shadow: 1px 1px 1px #fcda99;
+  }
+  .likeMove {
+    position: absolute;
+    z-index: 100;
+    left: -18px;
+    bottom: 0;
+    text-shadow: 1px 1px 1px #fcda99;
+    opacity: 0;
+    pointer-events: none;
+  }
+
+  .likeMoveShow {
+    animation: likeMoveShow 2s linear forwards;
+  }
+
+  @keyframes likeMoveShow {
+    0% {
+      opacity: 1;
+      bottom: 0;
+      transform: scale(1);
+    }
+
+    100% {
+      opacity: 0;
+      bottom: 50px;
+      transform: scale(1.5);
+    }
+  }
+
+  .likeMoveShow {
+    opacity: 1;
+  }
 }
 
 .pinBottom-container {
@@ -500,6 +572,13 @@ export default {
 
 // 移动端
 @media screen and (max-width: 1000px) {
+
+  .toHomeBox .likeNum{
+    left: 50%;
+    transform: translateX(-50%);
+    width: 33px;
+  }
+
   .hoverTit {
     opacity: 0 !important;
   }
@@ -519,7 +598,8 @@ export default {
   .pinBottom-container {
     .pinBottom.right.hideTarget {
       position: fixed;
-      top: 200px;
+      top: 50%;
+      transform: translateY(-50%);
       right: 10px;
       .rightViewContainer {
         flex-direction: column;

+ 4 - 3
web/src/components/RouterOrder.tsx

@@ -4,8 +4,8 @@ import { Route, Router, Switch } from 'react-router-dom'
 import SpinLoding from './SpinLoding'
 import NotFound from '@/components/NotFound'
 
-const A1home = React.lazy(() => import('@/pages/A1home'))
-const A1homeM = React.lazy(() => import('@/pages/A1homeM'))
+// const A1home = React.lazy(() => import('@/pages/A1home'))
+// const A1homeM = React.lazy(() => import('@/pages/A1homeM'))
 
 const A2scene = React.lazy(() => import('@/pages/A2scene'))
 
@@ -21,7 +21,8 @@ const routerArr = [
     name: '首页',
     path: '/',
     exact: true,
-    Com: isMobileFu() ? A1homeM : A1home
+    // Com: isMobileFu() ? A1homeM : A1home
+    Com: A2scene
   },
   {
     id: 2,

+ 3 - 3
web/src/pages/A2scene/index.tsx

@@ -7,14 +7,14 @@ declare global {
   //设置全局属性
   interface Window {
     //window对象属性
-    toHomeFu: () => void
+    toPage: (url: string) => void
   }
 }
 
 function A2scene() {
   useEffect(() => {
-    window.toHomeFu = () => {
-      history.replace('/')
+    window.toPage = url => {
+      history.push(url)
     }
   }, [])