shaogen1995 2 роки тому
батько
коміт
3832b92aef

+ 2 - 2
pc/public/model.html

@@ -18,9 +18,9 @@
   <div id="ui"></div>
   <script>
     let url = getQueryVariable("m");
-    fdage.embed(url, {
+    // fdage.embed(url, {
       // fdage.embed('https://hnbwg.4dage.com' + url, {
-      // fdage.embed('http://192.168.20.55:8041/api' + url, {
+      fdage.embed('http://192.168.20.55:8041/api' + url, {
       transparentBackground: true,
       width: 800,
       height: 600,

+ 4 - 1
pc/src/pages/A2Main/GoodsInfo/Left3/index.tsx

@@ -3,6 +3,7 @@ import styles from "./index.module.scss";
 import { A2QuestionResType, A2QuestionType } from "@/types";
 import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
 import classNames from "classnames";
+import { A2_APIgoodsSaveAnswer } from "@/store/action/A2Main";
 const objC = {
   0: "A",
   1: "B",
@@ -37,7 +38,7 @@ function Left3({ list }: Props) {
 
   // 选择答案
   const selecttFu = useCallback(
-    (item: A2QuestionResType, val: string) => {
+    async (item: A2QuestionResType, val: string) => {
       if (!item.done) {
         const arr = listRes.map((v) => {
           return {
@@ -47,6 +48,8 @@ function Left3({ list }: Props) {
           };
         });
         setListRes(arr);
+        // 发送请求
+        await A2_APIgoodsSaveAnswer(item.id, val === item.ok ? 1 : 0);
       }
     },
     [listRes]

+ 1 - 1
pc/src/pages/A2Main/GoodsInfo/Left4/index.tsx

@@ -16,7 +16,7 @@ function Left4({ list }: Props) {
           <div className="left4Row" key={v.id}>
             <div className="left4_Title">
               <div className="left4_Title_l">{v.authorName}</div>
-              <div className="left4_Title_r">{v.updateTime}</div>
+              <div className="left4_Title_r">{v.createTime}</div>
             </div>
             <div className="left4_Txt">{v.name}</div>
           </div>

+ 5 - 3
pc/src/pages/A2Main/GoodsInfo/index.module.scss

@@ -7,7 +7,7 @@
   :global {
     .G_close {
       padding: 15px 20px 0 20px;
-      height: 90px;
+      height: 80px;
       text-align: right;
 
       &>img {
@@ -23,7 +23,7 @@
 
     .G_Main {
       width: 100%;
-      height: calc(100% - 100px);
+      height: calc(100% - 90px);
       padding: 0px 140px 0 180px;
 
       .G_title {
@@ -36,7 +36,7 @@
         width: 100%;
         height: calc(100% - 160px);
         padding: 30px 0;
-        margin-top: 15px;
+        margin-top: 25px;
         display: flex;
 
         .G_leftMain {
@@ -103,6 +103,8 @@
         height: 60px;
         display: flex;
         align-items: center;
+        position: relative;
+        z-index: 12;
 
         .G_bottom_left {
           width: 46%;

+ 24 - 12
pc/src/pages/A2Main/GoodsInfo/index.tsx

@@ -138,20 +138,32 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
         const endNum = -window.innerWidth - width - 200;
         barrMoveRefKill.current?.kill();
         // 开始动画
-        barrMoveRefKill.current = gsap.fromTo(
-          barrMoveRef.current,
-          { x: 0 },
-          {
+
+        // 总弹幕数量只有 1  的情况
+        if (barrageAll.length === 1) {
+          barrMoveRefKill.current = gsap.to(barrMoveRef.current, {
             duration: 16,
             ease: "none",
             x: endNum,
-            onComplete: () => {
-              let num = barrInd + 1;
-              if (num >= barrageAll.length) num = 0;
-              setBarrInd(num);
-            },
-          }
-        );
+            repeat: -1,
+          });
+        } else {
+          // 有超过 1 的情况
+          barrMoveRefKill.current = gsap.fromTo(
+            barrMoveRef.current,
+            { x: 0 },
+            {
+              duration: 16,
+              ease: "none",
+              x: endNum,
+              onComplete: () => {
+                let num = barrInd + 1;
+                if (num >= barrageAll.length) num = 0;
+                setBarrInd(num);
+              },
+            }
+          );
+        }
       }
     }, 200);
   }, [barrInd, barrageAll.length]);
@@ -420,7 +432,7 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
           <h3>{barrageAll[barrInd].name}</h3>
           <p>
             {barrageAll[barrInd].authorName}&nbsp;
-            {barrageAll[barrInd].updateTime}
+            {barrageAll[barrInd].createTime}
             &nbsp;观&nbsp;[{barrageAll[barrInd].goodsName}]&nbsp;有感
           </p>
         </div>

+ 2 - 0
pc/src/pages/A2Main/GoodsSw/index.tsx

@@ -289,6 +289,8 @@ function GoodsSw() {
       clearTimeout(timeS2.current);
       clearInterval(time1.current);
       clearInterval(time2.current);
+      // 清理 滚轮提示 定时器
+      clearInterval(curTimeRef.current);
     };
   }, []);
 

+ 13 - 0
pc/src/pages/A2Main/index.module.scss

@@ -4,6 +4,19 @@
   position: relative;
 
   :global {
+
+    .threeBox{
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      iframe{
+        width: 100%;
+        height: 100%;
+      }
+    }
+
     .logo {
       cursor: pointer;
       position: absolute;

+ 9 - 0
pc/src/pages/A2Main/index.tsx

@@ -1,3 +1,4 @@
+/* eslint-disable jsx-a11y/iframe-has-title */
 import React, { useCallback, useState } from "react";
 import styles from "./index.module.scss";
 import LogoImg from "@/assets/img/logo.png";
@@ -81,6 +82,14 @@ function A2Main() {
 
   return (
     <div className={styles.A2Main}>
+      {/* 三维模型页面 */}
+      <div className="threeBox">
+        {/* <iframe
+          src="https://4dscene.4dage.com/culturalrelics/YFYCModel/index.html#/"
+          frameBorder="0"
+        ></iframe> */}
+      </div>
+
       {/* 左上方logo */}
       <div className="logo" title="首页" onClick={() => history.push("/")}>
         <img src={LogoImg} alt="" />

+ 7 - 0
pc/src/store/action/A2Main.ts

@@ -75,6 +75,13 @@ export const A2_APIgetQuestion = (id: number) => {
 };
 
 /**
+ * 回答问题--对错统计
+ */
+export const A2_APIgoodsSaveAnswer = (questionId: number, has: 0 | 1) => {
+  return http.get(`show/goods/saveAnswer/${questionId}/${has}`);
+};
+
+/**
  * 获取留言列表
  */
 export const A2_APIgetBarrage = (id: number) => {