lanxin 2 天之前
父節點
當前提交
12e40eb4e2
共有 3 個文件被更改,包括 29 次插入1 次删除
  1. 二進制
      scene/src/assets/img/viewBG.png
  2. 15 0
      scene/src/pages/A2main/index.module.scss
  3. 14 1
      scene/src/pages/A2main/index.tsx

二進制
scene/src/assets/img/viewBG.png


文件差異過大導致無法顯示
+ 15 - 0
scene/src/pages/A2main/index.module.scss


+ 14 - 1
scene/src/pages/A2main/index.tsx

@@ -14,10 +14,19 @@ const imgArrTemp = ['like.png', 'likeAc.png']
 const imgArr = imgArrTemp.map(item => require(`@/assets/img/${item}`))
 
 function A2main() {
-  const SCENE_CODE = 'SG-Eq6bs2vVKv3'
+  const SCENE_CODE = (window as Window & { number?: string }).number ?? ''
+  // console.log(SCENE_CODE, '-------------------------')
   // 漫游的状态
   const { state3d } = useSelector((state: RootState) => state.three)
 
+  // 浏览量
+  const [viewCount, setViewCount] = useState(0)
+  useEffect(() => {
+    http.get(`https://count.4dage.com/api/count/saveVisit/${SCENE_CODE}`).then(res => {
+      setViewCount(res.data.visitSum!)
+    })
+  }, [SCENE_CODE])
+
   // 点击热点列表
   const [hotListShow, setHotListShow] = useState(false)
 
@@ -325,6 +334,10 @@ function A2main() {
         <div className={`bei ${beisuIndex === 3 ? 'beiAc' : ''}`} onClick={() => handleBeisuClick(3, 0.5, 0.6)}>2x</div>
       </div>
 
+      <div className="viewwwww">
+        浏览量{viewCount}
+      </div>
+
       {/* 底部导览列表 */}
       <A24drawerList />