Просмотр исходного кода

修改一些场景相关的排序

aamin 1 год назад
Родитель
Сommit
41f823f3ca

+ 9 - 5
houtai/src/components/Z_RichText/index.tsx

@@ -86,15 +86,19 @@ function RichText({ check, dirCode, isLook, myUrl }: Props, ref: any) {
     const txt: string = editorValue.toHTML();
     console.log(
       "判空函数",
-      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "")
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", ""),
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ==
+        '<psize="0"_root="undefined"__ownerID="undefined"__hash="undefined"__altered="false">'
     );
     if (
       txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ===
         "" ||
-      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ===
-        '<psize="5"_root="[objectObject]"__ownerID="undefined"__hash="undefined"__altered="false">' ||
-      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ===
-        '<psize="0"_root="undefined"__ownerid="undefined"__hash="undefined"__altered="false">'
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ==
+        '<psize="5"_root="[objectObject]"__ownerid="undefined"__hash="undefined"__altered="false">' ||
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ==
+        '<psize="0"_root="undefined"__ownerid="undefined"__hash="undefined"__altered="false">' ||
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ==
+        '<psize="5"_root="[objectObject]"__ownerID="undefined"__hash="undefined"__altered="false">'
     ) {
       return true;
     } else return false;

+ 20 - 5
houtai/src/pages/A1Rule/RuleEdit/index.tsx

@@ -60,12 +60,22 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
       setCheck(true);
       // 富文本 为空
       const { val, flag } = richTxtRef.current.fatherBtnOkFu();
-      console.log("富文本", val, flag);
+      // console.log("富文本", val, flag);
       if (flag) {
         MessageFu.error("游戏规则不能为空");
         return;
       }
 
+      if(values.second > 300) {
+        MessageFu.error("时限不能大于300s");
+        return;
+      }
+
+      if(values.score > 99999) {
+        MessageFu.error("得分不能大于99999");
+        return;
+      }
+
       const obj = {
         ...values,
         id: id ? id : null,
@@ -81,7 +91,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
 
         closePage();
       }
-      console.log("通过校验,点击确定");
+      // console.log("通过校验,点击确定");
     },
     [closePage, id, upTableList]
   );
@@ -108,7 +118,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
 
         closePage();
       }
-      console.log("通过校验,点击确定");
+      // console.log("通过校验,点击确定");
     },
     [closePage, id, upTableList]
   );
@@ -142,6 +152,9 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 rules={
                   id === 3 ? [] : [{ required: true, message: "请输入时限!" }]
                 }
+                getValueFromEvent={(e) =>
+                  e.target.value.replace(/^(?!^([1-9]\d{0,2}|1\d{2}|2\d{1}|300)$).*/g, "")
+                }
               >
                 <Input
                   disabled={id === 3}
@@ -155,10 +168,12 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 label="得分"
                 name="score"
                 rules={[{ required: true, message: "请输入游戏得分!" }]}
-                getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+                getValueFromEvent={(e) =>
+                  e.target.value.replace(/^(0+)|[^\d]+/g, "")
+                }
               >
                 <Input
-                  maxLength={6}
+                  maxLength={5}
                   showCount
                   placeholder="请输入数字,1-99999"
                 />

+ 35 - 20
houtai/src/pages/A1Rule/TopicSetting/index.tsx

@@ -70,8 +70,8 @@ function TopicSetting({ closeFu }: Props) {
     async (values: any) => {
       let newList = editShowData;
       // console.log(curEdit, newList[curEdit.index + (Number(pageNumRef) * Number(pagePageRef))], values.numberVal);
-      console.log(curEdit, editShowData);
-      if (curEdit) {
+      // console.log(curEdit, editShowData);
+      if (curEdit && values.numberVal !== "") {
         switch (curEdit.project) {
           case "题目描述":
             newList[
@@ -190,13 +190,13 @@ function TopicSetting({ closeFu }: Props) {
       }
       setEditShowData([...newList]);
       setEditShow(false);
-      console.log(
-        "修改的单元",
-        newList[
-          curEdit.index +
-            Number(pageNumRef.current - 1) * Number(pagePageRef.current)
-        ]
-      );
+      // console.log(
+      //   "修改的单元",
+      //   newList[
+      //     curEdit.index +
+      //       Number(pageNumRef.current - 1) * Number(pagePageRef.current)
+      //   ]
+      // );
     },
     [curEdit, editShowData]
   );
@@ -220,7 +220,7 @@ function TopicSetting({ closeFu }: Props) {
         index + Number(pageNumRef.current - 1) * Number(pagePageRef.current)
       ].answer.correct = value;
       setEditShowData([...newList]);
-      console.log(editShowData);
+      // console.log(editShowData);
     },
     [editShowData]
   );
@@ -239,15 +239,17 @@ function TopicSetting({ closeFu }: Props) {
   const [delTopicIdList, setDelTopicIdList] = useState([] as number[]);
 
   const deleteQuestionFu = useCallback(
-    (id: number, index: any) => {
-      if (id == null) {
-        let newList = editShowData;
-        newList.splice(index, 1);
+    (id: number, index: any, type?: string) => {
+      if (type === "add") {
+        let newList = editShowData.filter((item: any) => {
+          return item.id !== id;
+        });
         setEditShowData([...newList]);
       } else {
         setDelTopicIdList([...delTopicIdList, id]);
-        let newList = editShowData;
-        newList.splice(index, 1);
+        let newList = editShowData.filter((item: any) => {
+          return item.id !== id;
+        });
         setEditShowData([...newList]);
       }
     },
@@ -443,14 +445,16 @@ function TopicSetting({ closeFu }: Props) {
       },
       {
         title: "操作",
-        render: (item: QuestionTableType, record: any, index: any) => {
+        render: (item: any, record: any, index: any) => {
           return (
             <>
               <Popconfirm
                 title="删除后无法恢复,是否删除?"
                 okText="删除"
                 cancelText="取消"
-                onConfirm={() => deleteQuestionFu(item.id!, index)}
+                onConfirm={() =>
+                  deleteQuestionFu(item.id!, index, item.type ? item.type : "")
+                }
                 okButtonProps={{ loading: false }}
               >
                 <Button size="small" type="text">
@@ -491,6 +495,9 @@ function TopicSetting({ closeFu }: Props) {
   // 提交所有编辑
 
   const submitFinish = useCallback(async () => {
+    // console.log("删除列表", delTopicIdList);
+    // console.log("更新列表", editShowData);
+
     // 先执行删除
     if (delTopicIdList.length > 0) {
       delTopicIdList.forEach(async (item: any) => {
@@ -525,7 +532,7 @@ function TopicSetting({ closeFu }: Props) {
       MessageFu.warning("至少提交一道题目");
       return;
     }
-    console.log(editShowData);
+    // console.log(editShowData);
 
     editShowData.forEach((element: any) => {
       // 题目描述为空
@@ -627,11 +634,19 @@ function TopicSetting({ closeFu }: Props) {
               initialValue={curEdit ? curEdit.value : ""}
               style={{ marginTop: "40px" }}
               hide-required-asterisk={true}
+              getValueFromEvent={(e) =>
+                e.target.value.replace(" ", "")
+              }
             >
               <Input
                 placeholder="请输入"
                 maxLength={
-                  curEdit ? (curEdit.project === "题目描述" || curEdit.project === "答案解析" ? 200 : 50) : 50
+                  curEdit
+                    ? curEdit.project === "题目描述" ||
+                      curEdit.project === "答案解析"
+                      ? 200
+                      : 50
+                    : 50
                 }
               />
             </Form.Item>

+ 2 - 2
houtai/src/pages/A1Rule/index.tsx

@@ -62,7 +62,7 @@ function A1Rule() {
       editMode.current = type;
       editId.current = id;
       setEditPageShow(true);
-      console.log(editPageShow, editMode.current);
+      // console.log(editPageShow, editMode.current);
     },
     [editPageShow]
   );
@@ -189,7 +189,7 @@ function A1Rule() {
           <button
             className="scoreLimitBtn"
             onClick={() => {
-              console.log("打开");
+              // console.log("打开");
               setLimitScoreShow(true);
             }}
           >

+ 1 - 1
houtai/src/pages/A3User/UserAdd/index.tsx

@@ -61,7 +61,7 @@ function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
 
         closePage();
       }
-      console.log("通过校验,点击确定");
+      // console.log("通过校验,点击确定");
     },
     [addTableList, closePage, id, upTableList]
   );

+ 17 - 6
houtai/src/pages/A4Prize/index.tsx

@@ -39,11 +39,12 @@ function A4Prize() {
   const dispatch = useDispatch();
   // 从仓库中获取表格数据
   const tableInfo = useSelector((state: RootState) => state.A4Prise.tableInfo);
-
+  const pageNumRef = useRef(1);
+  const pagePageRef = useRef(10);
   // 筛选和分页
   const [tableSelect, setTableSelect] = useState({
-    pageNum: 0,
     pageSize: 10,
+    pageNum: 1,
     searchKey: "",
   });
 
@@ -57,6 +58,13 @@ function A4Prize() {
   const FormBoxRef = useRef<FormInstance>(null);
   const [curEditItem, setCurEditItem] = useState<PrizeTableType>();
 
+  // 页码变化
+  const paginationChange = (pageNum: number, pageSize: number) => {
+    pageNumRef.current = pageNum;
+    pagePageRef.current = pageSize;
+    setTableSelect({ ...tableSelect, pageNum, pageSize });
+  };
+
   // 编辑/新增页面弹窗开关
   const [editPageVisible, setEditPageVisible] = React.useState(false);
   // 编辑/新增页面弹窗打开
@@ -142,7 +150,7 @@ function A4Prize() {
   );
 
   const handleChange = (value: string) => {
-    console.log(`selected ${value}`);
+    // console.log(`selected ${value}`);
   };
 
   useEffect(() => {
@@ -217,14 +225,14 @@ function A4Prize() {
     value: DatePickerProps["value"] | RangePickerProps["value"],
     dateString: [string, string] | string
   ) => {
-    console.log("Selected Time: ", value);
-    console.log("Formatted Selected Time: ", dateString);
+    // console.log("Selected Time: ", value);
+    // console.log("Formatted Selected Time: ", dateString);
   };
 
   const onOk = (
     value: DatePickerProps["value"] | RangePickerProps["value"]
   ) => {
-    console.log("onOk: ", value);
+    // console.log("onOk: ", value);
   };
 
   // 富文本的ref
@@ -263,8 +271,11 @@ function A4Prize() {
             pagination={{
               showQuickJumper: true,
               position: ["bottomCenter"],
+              current: tableSelect.pageNum,
+              pageSize: tableSelect.pageSize,
               showSizeChanger: true,
               total: tableInfo.total,
+              onChange: paginationChange,
             }}
           />
         </div>

+ 1 - 1
houtai/src/store/action/A2Integral.ts

@@ -12,7 +12,7 @@ export const getIntegralListAPI = (data: any) => {
         list: res.data.records,
         total: res.data.total,
       };
-      console.log(obj);
+      // console.log(obj);
       dispatch({ type: "integral/getShare", payload: obj });
     }
   };

+ 2 - 0
scene - 离线版/public/static/js/main_2020_show.js

@@ -14920,6 +14920,8 @@ window.Modernizr = function(n, e, t) {
                     
                     
                     $("#volume").show();
+                }else {
+                    $("#volume").hide();
                 }
 
                 //隐藏公司logo

+ 2 - 0
scene/public/static/js/main_2020_show.js

@@ -14920,6 +14920,8 @@ window.Modernizr = function(n, e, t) {
                     
                     
                     $("#volume").show();
+                }else {
+                    $("#volume").hide();
                 }
 
                 //隐藏公司logo

+ 2 - 44
scene/src/views/gui/menu.vue

@@ -79,56 +79,14 @@
               <img style="display: block;" src="../../assets/img/game.png" alt="" />
               <div class="btmText">互动游戏</div>
             </div>
-            <div id="volume" class="toHomeBox toHomeBox2" style="margin-right: '10px';float: left; ">
+            <div id="volume" class="toHomeBox toHomeBox2"
+              :style="{ marginRight: '10px', float: 'left' }">
               <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 data-original-title="音乐" id="volume" rel="tooltip" title="音乐">
-              <img id="openMusic" class="icon icon-inside" :src="require('@/assets/img/musicAc.png')" />
-              <img  class="active icon icon-inside active" :src="require('@/assets/img/music.png')" />
-              <div class="btmText">音乐</div>
-            </div> -->
-
-            <!-- <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
-              data-original-title="VR"
-              id="vr"
-              rel="tooltip"
-              title=""
-              style="display: none"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/VR.png')"
-              />
-            </div> -->
-            <!-- <div
-              data-original-title="消除外壳"
-              id="gui-remove-face"
-              rel="tooltip"
-              title=""
-              style="display: none; float: left"
-            >
-              <img
-                class="icon icon-inside"
-                :src="require('@/assets/images/face.jpg')"
-              />
-            </div> -->
           </div>
         </div>
       </div>

Разница между файлами не показана из-за своего большого размера
+ 32 - 20
zhengquan/public/staticData/data.js


+ 102 - 38
zhengquan/src/views/Scene/ScenePage.vue

@@ -32,6 +32,7 @@ const isShowHosList = ref(false)
 
 const currentUnit = ref({} as any)
 const currentHot = ref({} as any)
+const currentHotsUnit = ref({} as any)
 const isReady = ref(false)
 const pointInfo = ref('')
 
@@ -47,7 +48,6 @@ const changeUnit = (unit: any) => {
   isShowExperienceGame.value = true
 }
 const hotspots = ref([] as any)
-
 // 用Object.keys 和 reduce 方法过滤空值属性
 const filterEmptyProps = (obj: any) => {
   return Object.keys(obj).reduce((acc, key) => {
@@ -59,29 +59,54 @@ const filterEmptyProps = (obj: any) => {
   }, {});
 }
 
-// 批量去掉序号
 const sortHotspots = (hotspots: any) => {
-  const newHot = {}
-  for (let key in hotspots) {
-    const index = hotspots[key].title.indexOf('.')
-    if (index != -1) {
-      console.log('删除', index, hotspots[key])
-      hotspots[key].title = hotspots[key].title.substring(index + 1)
-      // @ts-ignore
-      newHot[key] = hotspots[key]
-
-    } else {
-      // @ts-ignore
-      newHot[key] = hotspots[key]
+  // 将数据对象转换成数组
+  let newHotspots = Object.values(hotspots)
+  let newShowHotspots = [] as any
+  newHotspots.forEach((item: any) => {
+    const nameArr = item.title.split('&')
+    if (nameArr[1] == 'show') {
+      newShowHotspots.push({
+        ...item,
+        title: nameArr[2],
+        sort: nameArr[0]
+      })
     }
-  }
-  return newHot
+  })
+  return newShowHotspots.sort((a: any, b: any) => {
+    return Number(a.sort) - Number(b.sort)
+  })
 }
+
+// // 批量去掉序号
+// const sortHotspots = (hotspots: any) => {
+//   const newHot = {}
+//   for (let key in hotspots) {
+//     let index = hotspots[key].title.indexOf('.')
+
+//     if (index != -1) {
+//       hotspots[key].title = hotspots[key].title.substring(index + 1)
+//       // @ts-ignore
+//       newHot[key] = hotspots[key]
+
+//     } else if (hotspots[key].title.indexOf(' ')) {
+//       index = hotspots[key].title.indexOf(' ')
+//       hotspots[key].title = hotspots[key].title.substring(index + 1)
+//       // @ts-ignore
+//       newHot[key] = hotspots[key]
+//     } else {
+//       // @ts-ignore
+//       newHot[key] = hotspots[key]
+//     }
+//   }
+//   return newHot
+// }
 // 获取所有单元的热点列表
 const getAllHotspot = () => {
   store.dataAll.sceneList.forEach((item: any) => {
     // https://super.4dage.com
     axios.get(`https://super.4dage.com/data/${item.code}/data2.js?m=${new Date().getTime()}`).then((res: any) => {
+      console.log(sortHotspots)
       //@ts-ignore
       hotspots.value.push({
         id: item.id,
@@ -90,7 +115,8 @@ const getAllHotspot = () => {
         code: item.code,
         xuliezhen: item.xuliezhen,
         gameId: item.gameId,
-        backPoint: item.backPoint
+        backPoint: item.backPoint,
+        sort: item.sort,
       })
       if (item.code == route.query.code) {
         currentUnit.value = {
@@ -102,6 +128,7 @@ const getAllHotspot = () => {
           gameId: item.gameId,
           backPoint: item.backPoint
         }
+        currentHotsUnit.value = currentUnit.value
         store.currentUnit = currentUnit.value
         if (route.query.name == '尾厅') pointInfo.value = '&firstView=pano:42,qua:0.009218044457158925,0.8470543054294898,-0.01469850441003682,0.5312231071060547&qs=1'
       }
@@ -109,14 +136,9 @@ const getAllHotspot = () => {
   })
   setTimeout(() => {
     // let newList = []
-    hotspots.value.forEach((item: any, index: number) => {
-      if (item.id == 1) {
-        hotspots.value.unshift(hotspots.value.splice(index, 1)[0])
-      } else if (item.id == 0) {
-        hotspots.value.unshift(hotspots.value.splice(index, 1)[0])
-      } else if (item.id == 9) {
-        hotspots.value.push(hotspots.value.splice(index, 1)[0])
-      }
+    // 场景排序
+    hotspots.value.sort((a: any, b: any) => {
+      return Number(a.sort) - Number(b.sort)
     })
   }, 500)
 }
@@ -138,11 +160,20 @@ watch(isShowHosList, (newVal: any) => {
 })
 
 const goHotCamarer = (hot: any) => {
-  const iframe = document.getElementById('sceneiframe') as HTMLIFrameElement
-  //@ts-ignore
-  iframe.contentWindow.initCamera(hot.sid)
-  currentHot.value = hot
-  isShowHosList.value = false
+  currentUnit.value = currentHotsUnit.value
+  store.currentUnit = currentHotsUnit.value
+  pointInfo.value = ''
+  // isShowExperienceGame.value = true
+  setTimeout(() => {
+    const iframe = document.getElementById('sceneiframe') as HTMLIFrameElement
+    //@ts-ignore
+    iframe.contentWindow.initCamera(hot.sid)
+
+    currentHot.value = hot
+    console.log(currentHot.value)
+    isShowHosList.value = false
+    isShowFigure.value = true
+  }, 1500)
 }
 
 // 形象状态 greeting-招呼 idle-静默 talk-说话
@@ -454,9 +485,8 @@ const changePassFu = () => {
         src="@/assets/images/close-icon.png" alt="">
       <div v-show="browser.mobile" class="show-title">行业公益力量展</div>
       <div class="hots-box-left">
-        <div class="left-item" :style="{ background: currentUnit.unit == item.unit ? '#66141885' : '' }"
-          v-for="(item, index) in store.hotspots" :key="index"
-          @click="() => { changeUnit(item); pointInfo = ''; isShowFigure = true }">{{
+        <div class="left-item" :style="{ background: currentHotsUnit.unit == item.unit ? '#66141885' : '' }"
+          v-for="(item, index) in store.hotspots" :key="index" @click="() => { currentHotsUnit = item }">{{
             item.unit
           }}</div>
       </div>
@@ -465,9 +495,9 @@ const changePassFu = () => {
           src="@/assets/images/close-icon.png" alt="">
         <div class="right-content">
           <div v-show="JSON.stringify(currentUnit.hots) == '{}'" class="right-item">暂无热点</div>
-          <div class="right-item" :title="item.title" v-for="(item, index) in currentUnit.hots" :key="index"
-            @click="goHotCamarer(item)" :style="{ color: currentHot.sid == item.sid ? '#C5A16C' : '' }">{{ item.title
-            }}
+          <div class="right-item" :title="item.title" v-for="(item, index) in currentHotsUnit.hots" :key="index"
+            @click="goHotCamarer(item)" :style="{ color: currentHot.sid == item.sid ? '#C5A16C' : '' }">
+            <div :class="item.title.length > 8 ? 'gundong' : ''">{{ item.title }}</div>
           </div>
         </div>
       </div>
@@ -809,6 +839,24 @@ const changePassFu = () => {
         text-overflow: ellipsis;
         cursor: pointer;
 
+        .gundong {
+          width: 100%;
+          animation: identifier 8s linear infinite;
+        }
+
+        @keyframes identifier {
+
+          30% {
+            transform: translateX(0%);
+          }
+
+
+
+          100% {
+            transform: translateX(-100%);
+          }
+        }
+
         &:hover {
           color: #C5A16C;
           background: rgba(114, 37, 37, 0.74);
@@ -1137,10 +1185,10 @@ const changePassFu = () => {
         padding: 0 20px;
         box-sizing: border-box;
 
-        .close-icon {}
+        // .close-icon {}
 
 
-        .right-content {}
+        // .right-content {}
 
         .right-item {
           width: 100%;
@@ -1155,6 +1203,22 @@ const changePassFu = () => {
           cursor: pointer;
           font-family: 'Courier New';
 
+          .gundong {
+            width: 100%;
+            animation: identifier 8s linear infinite;
+          }
+
+          @keyframes identifier {
+
+            0% {
+              transform: translateX(100%);
+            }
+
+            100% {
+              transform: translateX(-100%);
+            }
+          }
+
           &:hover {
             color: #C5A16C;
             background: rgba(114, 37, 37, 0.74);