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

Merge branch 'master' of http://face3d.4dage.com:7005/chenzimin2/ZGZQBWG

任一存 1 год назад
Родитель
Сommit
bdcc0112a5
32 измененных файлов с 1029 добавлено и 213 удалено
  1. 14 0
      houtai/package-lock.json
  2. 1 0
      houtai/package.json
  3. BIN
      houtai/src/assets/img/bg.jpg
  4. BIN
      houtai/src/assets/img/center.png
  5. BIN
      houtai/src/assets/img/logo.png
  6. 84 0
      houtai/src/components/Z_upFileOne/index.module.scss
  7. 165 0
      houtai/src/components/Z_upFileOne/index.tsx
  8. 37 32
      houtai/src/pages/A1Rule/RuleEdit/index.tsx
  9. 3 1
      houtai/src/pages/A1Rule/TopicSetting/index.module.scss
  10. 425 29
      houtai/src/pages/A1Rule/TopicSetting/index.tsx
  11. 8 1
      houtai/src/pages/A1Rule/index.module.scss
  12. 8 4
      houtai/src/pages/A1Rule/index.tsx
  13. 12 2
      houtai/src/pages/A2Integral/index.module.scss
  14. 11 9
      houtai/src/pages/A3User/UserAdd/index.tsx
  15. 120 94
      houtai/src/pages/A4Prize/index.tsx
  16. 11 2
      houtai/src/pages/A5Exchange/index.module.scss
  17. 7 0
      houtai/src/pages/A6IDUser/index.module.scss
  18. 7 0
      houtai/src/pages/C7Log/index.module.scss
  19. 17 3
      houtai/src/pages/Login/index.module.scss
  20. 6 4
      houtai/src/pages/Login/index.tsx
  21. 16 2
      houtai/src/store/action/A1Rule.ts
  22. 38 8
      houtai/src/store/action/A4Prise.ts
  23. 9 1
      houtai/src/types/api/A1Rule.ts
  24. 7 7
      houtai/src/types/api/A4Prize.ts
  25. BIN
      zhengquan/public/staticData/animation/2/greeting.png
  26. BIN
      zhengquan/public/staticData/animation/2/talk.png
  27. BIN
      zhengquan/public/staticData/animation/5/greeting.png
  28. BIN
      zhengquan/public/staticData/animation/5/talk.png
  29. BIN
      zhengquan/public/staticData/animation/6/greeting.png
  30. BIN
      zhengquan/public/staticData/animation/6/talk.png
  31. 5 12
      zhengquan/public/staticData/data.js
  32. 18 2
      zhengquan/src/views/Scene/ScenePage.vue

+ 14 - 0
houtai/package-lock.json

@@ -27,6 +27,7 @@
         "js-base64": "^3.7.3",
         "js-export-excel": "^1.1.4",
         "jspdf": "^2.5.1",
+        "moment": "^2.30.1",
         "react": "^18.2.0",
         "react-dnd": "^16.0.1",
         "react-dnd-html5-backend": "^16.0.1",
@@ -11928,6 +11929,14 @@
         "mkdirp": "bin/cmd.js"
       }
     },
+    "node_modules/moment": {
+      "version": "2.30.1",
+      "resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
+      "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
+      "engines": {
+        "node": "*"
+      }
+    },
     "node_modules/ms": {
       "version": "2.1.2",
       "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
@@ -26877,6 +26886,11 @@
         "minimist": "^1.2.6"
       }
     },
+    "moment": {
+      "version": "2.30.1",
+      "resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
+      "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
+    },
     "ms": {
       "version": "2.1.2",
       "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",

+ 1 - 0
houtai/package.json

@@ -22,6 +22,7 @@
     "js-base64": "^3.7.3",
     "js-export-excel": "^1.1.4",
     "jspdf": "^2.5.1",
+    "moment": "^2.30.1",
     "react": "^18.2.0",
     "react-dnd": "^16.0.1",
     "react-dnd-html5-backend": "^16.0.1",

BIN
houtai/src/assets/img/bg.jpg


BIN
houtai/src/assets/img/center.png


BIN
houtai/src/assets/img/logo.png


+ 84 - 0
houtai/src/components/Z_upFileOne/index.module.scss

@@ -0,0 +1,84 @@
+.Z_upFileOne {
+  width: 100%;
+  height: 100%;
+  position: relative;
+
+  :global {
+
+    .file_upIcon {
+      color: #a6a6a6;
+      border-radius: 3px;
+      cursor: pointer;
+      font-size: 30px;
+      width: 100px;
+      height: 100px;
+      border: 1px dashed #797979;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+
+    }
+
+    .file_img {
+      width: 100px;
+      height: 126px;
+      position: relative;
+
+      .file_closeBox {
+        position: absolute;
+        right: -10px;
+        top: -10px;
+        z-index: 99;
+        background-color: rgba(0, 0, 0, 0.8);
+        width: 20px;
+        height: 20px;
+        border-radius: 50%;
+        font-size: 16px;
+        color: #fff;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+      }
+
+
+
+      .file_lookBox {
+        width: 100%;
+        background-color: rgba(0, 0, 0, .6);
+        color: #fff;
+        display: flex;
+        justify-content: space-around;
+
+        &>a {
+          color: #fff;
+        }
+
+        font-size: 16px;
+      }
+    }
+
+    .fileBoxRow_r_tit {
+      height: 46px;
+      margin-top: 5px;
+      font-size: 14px;
+      color: rgb(126, 124, 124);
+
+
+    }
+
+    .noUpThumb {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top .2s;
+      color: #ff4d4f;
+      top: -10px;
+    }
+
+    .noUpThumbAc {
+      top: 0;
+      opacity: 1;
+    }
+  }
+}

+ 165 - 0
houtai/src/components/Z_upFileOne/index.tsx

@@ -0,0 +1,165 @@
+import React, { useCallback, useRef } from "react";
+import styles from "./index.module.scss";
+import ImageLazy from "@/components/ImageLazy";
+import {
+  PlusOutlined,
+  EyeOutlined,
+  CloseOutlined,
+  DownloadOutlined,
+} from "@ant-design/icons";
+import store from "@/store";
+import { baseURL } from "@/utils/http";
+import classNames from "classnames";
+import { Popconfirm } from "antd";
+import { MessageFu } from "@/utils/message";
+import { A1_APIupFile } from "@/store/action/A4Prise";
+import { fileDomInitialFu } from "@/utils/domShow";
+
+type Props = {
+  cover: string; //封面图
+  setCover: (val: string) => void; //设置封面图
+  isLook: boolean; //是不是查看
+  coverCheck: boolean; //有没有点击过确定
+  size: number; //上传图片大小(M)
+  dirCode: string; //文件的code码
+  myUrl: string;
+  format?: string[]; //上传图片格式
+  formatTxt?: string; //上传图片提示
+  sizeTxt?: string; //后面的建议尺寸信息
+  fromData?: any;
+  checkTxt?: string;
+};
+
+function Z_upFileOne({
+  cover,
+  setCover,
+  isLook,
+  coverCheck,
+  size,
+  dirCode,
+  myUrl,
+  format = ["image/jpeg", "image/png"],
+  formatTxt = "png、jpg和jpeg",
+  checkTxt = "请上传封面图!",
+  sizeTxt,
+  fromData,
+}: Props) {
+  const myInput = useRef<HTMLInputElement>(null);
+
+  // 上传封面图
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0];
+        // 校验格式
+        const type = format;
+        if (!type.includes(filesInfo.type)) {
+          e.target.value = "";
+          return MessageFu.warning(`只支持${formatTxt}格式!`);
+        }
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = "";
+          return MessageFu.warning(`最大支持${size}M!`);
+        }
+        // 创建FormData对象
+        const fd = new FormData();
+        // 把files添加进FormData对象(‘photo’为后端需要的字段)
+        fd.append("type", "thumb");
+        fd.append("dirCode", dirCode);
+        fd.append("file", filesInfo);
+
+        if (fromData) {
+          for (const k in fromData) {
+            if (fromData[k]) fd.append(k, fromData[k]);
+          }
+        }
+
+        e.target.value = "";
+
+        try {
+          const res = await A1_APIupFile(fd, myUrl);
+          if (res.code === 0) {
+            MessageFu.success("上传成功!");
+            setCover(res.data.filePath);
+          }
+          fileDomInitialFu();
+        } catch (error) {
+          fileDomInitialFu();
+        }
+      }
+    },
+    [dirCode, format, formatTxt, fromData, myUrl, setCover, size]
+  );
+
+  return (
+    <div className={styles.Z_upFileOne}>
+      <input
+        id="upInput"
+        type="file"
+        accept=".png,.jpg,.jpeg"
+        ref={myInput}
+        onChange={(e) => handeUpPhoto(e)}
+      />
+
+      <div
+        hidden={cover !== ""}
+        className="file_upIcon"
+        onClick={() => myInput.current?.click()}
+      >
+        <PlusOutlined />
+      </div>
+
+      <div className="file_img" hidden={cover === ""}>
+        {cover ? (
+          <ImageLazy width={100} height={100} src={cover} noLook />
+        ) : null}
+
+        {/* 删除 */}
+        <div className="file_closeBox" hidden={isLook}>
+          <Popconfirm
+            title="删除后无法恢复,是否删除?"
+            okText="删除"
+            cancelText="取消"
+            onConfirm={() => setCover("")}
+          >
+            <CloseOutlined />
+          </Popconfirm>
+        </div>
+
+        {/* 预览 下载 */}
+        <div className="file_lookBox">
+          <EyeOutlined
+            onClick={() =>
+              store.dispatch({
+                type: "layout/lookBigImg",
+                payload: { url: baseURL + cover, show: true },
+              })
+            }
+          />
+          <a href={baseURL + cover} download target="_blank" rel="noreferrer">
+            <DownloadOutlined />
+          </a>
+        </div>
+      </div>
+      <div className="fileBoxRow_r_tit" hidden={isLook}>
+        支持{formatTxt}的图片格式;最大支持{size}M。
+        {sizeTxt ? `建议尺寸${sizeTxt}` : null}
+        <br />
+        <div
+          className={classNames(
+            "noUpThumb",
+            !cover && coverCheck ? "noUpThumbAc" : ""
+          )}
+        >
+          {checkTxt}
+        </div>
+      </div>
+    </div>
+  );
+}
+
+const MemoZ_upFileOne = React.memo(Z_upFileOne);
+
+export default MemoZ_upFileOne;

+ 37 - 32
houtai/src/pages/A1Rule/RuleEdit/index.tsx

@@ -28,20 +28,23 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
   // 文件的code码
   const [dirCode, setDirCode] = useState("");
 
+  const [shuoming, setShuoming] = useState<string>();
+
   const getInfoInAPIFu = useCallback(async (id: number) => {
     const res = await getRuleInfoByIdAPI(id);
     if (res.code === 0) {
       FormBoxRef.current?.setFieldsValue(res.data);
+      setShuoming(res.data.description);
 
       // 富文本回显
-      richTxtRef.current.ritxtShowFu(res.data.content);
+      richTxtRef.current.ritxtShowFu(res.data.rtf);
       currentIdInfo.current = res.data;
     }
   }, []);
 
   // 没有通过校验
   const onFinishFailed = useCallback(() => {
-    // return MessageFu.warning("有表单不符号规则!");
+    return MessageFu.warning("有表单不符号规则!");
   }, []);
 
   useEffect(() => {
@@ -54,9 +57,18 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
   // 通过校验点击确定
   const onFinish = useCallback(
     async (values: any) => {
-      const obj: SaveRuleType = {
+      setCheck(true);
+      // 富文本 为空
+      const { val, flag } = richTxtRef.current.fatherBtnOkFu();
+      if (flag) {
+        MessageFu.error("产品简介不能为空");
+        return;
+      }
+
+      const obj = {
         ...values,
         id: id ? id : null,
+        rtf: val,
       };
 
       const res: any = await ruleSaveAPI(obj);
@@ -98,9 +110,10 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
             >
               <Form.Item
                 label="时限(秒)"
-                name="time"
-                rules={[{ required: true, message: "请输入时限!" }]}
-                getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+                name="second"
+                rules={
+                  id === 3 ? [] : [{ required: true, message: "请输入时限!" }]
+                }
               >
                 <Input
                   disabled={id === 3}
@@ -123,28 +136,25 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 />
               </Form.Item>
 
-              <Form.Item
-                label="得分说明"
-                name="specification"
-                rules={[{ required: true, message: "请输入得分说明!" }]}
-                getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
-              >
+              <Form.Item label="得分说明" name="description">
                 {/* <Input maxLength={8} showCount placeholder="请输入内容" /> */}
-                <span>每观看完一个视频</span>
+                <span>{shuoming}</span>
               </Form.Item>
 
-              <Form.Item
-                label="游戏规则"
-                name="gameRule"
-                getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
-              >
-                <RichText
-                  myUrl="cms/goods/upload"
-                  ref={richTxtRef}
-                  check={check}
-                  dirCode={dirCode}
-                  isLook={true}
-                />
+              <Form.Item name="gameRule">
+                <div style={{ marginLeft: "0%", display: "flex" }}>
+                  <span style={{ marginRight: "2px", color: "red" }}>*</span>
+                  <div>游戏规则:</div>
+                </div>
+                <div style={{ marginLeft: "8%" }}>
+                  <RichText
+                    myUrl="cms/goods/upload"
+                    ref={richTxtRef}
+                    check={check}
+                    dirCode={dirCode}
+                    isLook={false}
+                  />
+                </div>
               </Form.Item>
 
               {/* {id ? null : <div className="passTit">* 默认密码 123456</div>} */}
@@ -201,14 +211,9 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 />
               </Form.Item>
 
-              <Form.Item
-                label="得分说明"
-                name="specification"
-                rules={[{ required: true, message: "请输入得分说明!" }]}
-                getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
-              >
+              <Form.Item label="得分说明" name="specification">
                 {/* <Input maxLength={8} showCount placeholder="请输入内容" /> */}
-                <span>currentIdInfo.specification</span>
+                <span>{shuoming}</span>
               </Form.Item>
               {/* 确定和取消按钮 */}
               <br />

+ 3 - 1
houtai/src/pages/A1Rule/TopicSetting/index.module.scss

@@ -34,6 +34,8 @@
           // height: 30px;
           cursor: pointer;
           margin-left: 20px;
+          position: absolute;
+          right: 24px;
           // transform: translateY(-50%);
         }
       }
@@ -47,7 +49,7 @@
         padding: 0px;
 
         .ant-table-body {
-          height: 600px;
+          height: 500px;
           overflow-y: auto !important;
           overflow-y: overlay !important;
 

+ 425 - 29
houtai/src/pages/A1Rule/TopicSetting/index.tsx

@@ -6,11 +6,25 @@ import React, {
   useState,
 } from "react";
 import styles from "./index.module.scss";
-import { Button, Popconfirm, Table } from "antd";
-import { useSelector } from "react-redux";
-import { RootState } from "@/store";
-import { getTopicByZhuNongKeTangAPI } from "@/store/action/A1Rule";
+import {
+  Button,
+  Form,
+  FormInstance,
+  Input,
+  Modal,
+  Popconfirm,
+  Select,
+  Table,
+} from "antd";
+import {
+  deleteQuestionAPI,
+  getTopicByZhuNongKeTangAPI,
+  saveQuestionAPI,
+} from "@/store/action/A1Rule";
 import { QuestionTableType } from "@/types";
+import { MessageFu } from "@/utils/message";
+import encodeStr from "@/utils/pass";
+import { Base64 } from "js-base64";
 type Props = {
   closeFu: () => void;
 };
@@ -33,30 +47,128 @@ function TopicSetting({ closeFu }: Props) {
     setTableSelect({ ...tableSelect, pageNum, pageSize });
   };
 
-  const results = useSelector((state: RootState) => state.A7Log.tableInfo);
-
   // 编辑前数据保存
   const [editBeforeData, setEditBeforeData] = useState<any>(
     [] as QuestionTableType[]
   );
 
+  const [editShow, setEditShow] = useState(false);
+
   // 用于编辑/展示/回显的新数据
   const [editShowData, setEditShowData] = useState<any>(
     [] as QuestionTableType[]
   );
 
+  const [form] = Form.useForm();
+  const [curEdit, setCurEdit] = useState<any>();
+  const onFinish = useCallback(
+    async (values: any) => {
+      let newList = editShowData;
+      console.log(curEdit, newList[curEdit.index], values.numberVal);
+      if (curEdit) {
+        switch (curEdit.project) {
+          case "题目描述":
+            newList[curEdit.index].question = values.numberVal;
+            break;
+          case "选项1":
+            newList[curEdit.index].answer.answer[0]
+              ? (newList[curEdit.index].answer.answer[0].name =
+                  values.numberVal)
+              : newList[curEdit.index].answer.answer.push({
+                  name: values.numberVal,
+                  val: encodeStr(Base64.encode("A")),
+                });
+            break;
+          case "选项2":
+            newList[curEdit.index].answer.answer[1]
+              ? (newList[curEdit.index].answer.answer[1].name =
+                  values.numberVal)
+              : newList[curEdit.index].answer.answer.push({
+                  name: values.numberVal,
+                  val: encodeStr(Base64.encode("B")),
+                });
+            break;
+          case "选项3":
+            newList[curEdit.index].answer.answer[2]
+              ? (newList[curEdit.index].answer.answer[2].name =
+                  values.numberVal)
+              : newList[curEdit.index].answer.answer.push({
+                  name: values.numberVal,
+                  val: encodeStr(Base64.encode("C")),
+                });
+            break;
+          case "选项4":
+            newList[curEdit.index].answer.answer[3]
+              ? (newList[curEdit.index].answer.answer[3].name =
+                  values.numberVal)
+              : newList[curEdit.index].answer.answer.push({
+                  name: values.numberVal,
+                  val: encodeStr(Base64.encode("D")),
+                });
+            break;
+          case "答案解析":
+            newList[curEdit.index].description = values.numberVal;
+            break;
+        }
+      }
+      setEditShowData([...newList]);
+      setEditShow(false);
+      console.log(curEdit, editShowData[curEdit.index], values.numberVal);
+    },
+    [curEdit, editShowData]
+  );
+
+  const disposeEditShowData = useCallback((data: QuestionTableType[]) => {
+    let newList = [] as QuestionTableType[];
+    data.forEach((element: QuestionTableType) => {
+      newList.push({
+        ...element,
+        answer: element.answer !== "" ? JSON.parse(element.answer) : "",
+      });
+    });
+    setEditShowData(newList);
+  }, []);
+
+  const handleCorrectChange = useCallback(
+    (value: string, index: number) => {
+      let newList = editShowData;
+      newList[index].answer.correct = value;
+      setEditShowData([...newList]);
+      console.log(editShowData);
+    },
+    [editShowData]
+  );
+
   const getList = useCallback(async () => {
     const res = await getTopicByZhuNongKeTangAPI();
     if (res.code === 0) {
+      // 保存编辑前的数据
       setEditBeforeData(res.data);
-      setEditShowData(res.data);
-      res.data.forEach((item:any) => {
-        console.log('题目选项解析',JSON.parse(item.answer))
-      })
+      // 保存编辑后的数据
+      disposeEditShowData(res.data);
     }
-  }, []);
+  }, [disposeEditShowData]);
+
+  // 删除列表
+  const [delTopicIdList, setDelTopicIdList] = useState([] as number[]);
+
+  const deleteQuestionFu = useCallback(
+    (id: number, index: any) => {
+      if (id == null) {
+        let newList = editShowData;
+        newList.splice(index, 1);
+        setEditShowData([...newList]);
+      } else {
+        setDelTopicIdList([...delTopicIdList, id]);
+        let newList = editShowData;
+        newList.splice(index, 1);
+        setEditShowData([...newList]);
+      }
+    },
+    [delTopicIdList, editShowData]
+  );
 
-  const deleteQuestionFu = useCallback((id: number) => {}, []);
+  const FormBoxRef = useRef<FormInstance>(null);
 
   const columns = useMemo(() => {
     return [
@@ -68,50 +180,279 @@ function TopicSetting({ closeFu }: Props) {
       },
       {
         title: "题目描述",
-        dataIndex: "question",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "题目描述",
+                  value: item.question,
+                });
+                form.setFieldsValue({
+                  numberVal: item.question,
+                });
+              }}
+            >
+              {item.question ? item.question : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "选项1",
-        dataIndex: "type",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "选项1",
+                  value: item.answer.answer[0]
+                    ? item.answer.answer[0].name
+                    : "",
+                });
+                form.setFieldsValue({
+                  numberVal: item.answer.answer[0]
+                    ? item.answer.answer[0].name
+                    : "",
+                });
+              }}
+            >
+              {item.answer.answer[0] ? item.answer.answer[0].name : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "选项2",
-        dataIndex: "type",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "选项2",
+                  value: item.answer.answer[1]
+                    ? item.answer.answer[1].name
+                    : "",
+                });
+                form.setFieldsValue({
+                  numberVal: item.answer.answer[1]
+                    ? item.answer.answer[1].name
+                    : "",
+                });
+              }}
+            >
+              {item.answer.answer[1] ? item.answer.answer[1].name : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "选项3",
-        dataIndex: "description",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "选项3",
+                  value: item.answer.answer[2]
+                    ? item.answer.answer[2].name
+                    : "",
+                });
+                form.setFieldsValue({
+                  numberVal: item.answer.answer[2]
+                    ? item.answer.answer[2].name
+                    : "",
+                });
+              }}
+            >
+              {item.answer.answer[2] ? item.answer.answer[2].name : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "选项4",
-        dataIndex: "description",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "选项4",
+                  value: item.answer.answer[3]
+                    ? item.answer.answer[3].name
+                    : "",
+                });
+                form.setFieldsValue({
+                  numberVal: item.answer.answer[3]
+                    ? item.answer.answer[3].name
+                    : "",
+                });
+              }}
+            >
+              {item.answer.answer[3] ? item.answer.answer[3].name : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "正确答案",
-        dataIndex: "description",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            <Select
+              style={{ width: 120 }}
+              defaultValue={item.answer.correct ? item.answer.correct : ""}
+              onChange={(value: any) => {
+                handleCorrectChange(value, index);
+              }}
+              options={item.answer.answer.map((item: any) => {
+                return {
+                  label: item.name,
+                  value: item.val,
+                };
+              })}
+            />
+          );
+        },
       },
       {
         title: "答案解析",
-        dataIndex: "description",
+        render: (item: QuestionTableType, record: any, index: any) => {
+          return (
+            // eslint-disable-next-line jsx-a11y/anchor-is-valid
+            <a
+              onClick={() => {
+                setEditShow(true);
+                setCurEdit({
+                  index: index,
+                  project: "答案解析",
+                  value: item.description ? item.description : "",
+                });
+                form.setFieldsValue({
+                  numberVal: item.description ? item.description : "",
+                });
+              }}
+            >
+              {item.description ? item.description : "请填入"}
+            </a>
+          );
+        },
       },
       {
         title: "操作",
-        render: (item: QuestionTableType) => {
+        render: (item: QuestionTableType, record: any, index: any) => {
           return (
             <>
-              <Button
-                size="small"
-                type="text"
-                onClick={() => deleteQuestionFu(item.id)}
+              <Popconfirm
+                title="删除后无法恢复,是否删除?"
+                okText="删除"
+                cancelText="取消"
+                onConfirm={() => deleteQuestionFu(item.id!, index)}
+                okButtonProps={{ loading: false }}
               >
-                删除
-              </Button>
+                <Button size="small" type="text">
+                  删除
+                </Button>
+              </Popconfirm>
             </>
           );
         },
       },
     ];
-  }, [deleteQuestionFu]);
+  }, [deleteQuestionFu, form, handleCorrectChange]);
+
+  // 新增 (给编辑前数据添加空)、
+  const addTopic = useCallback(() => {
+    if (editShowData.length >= 50) {
+      MessageFu.warning("最多可以设置50道题!");
+    } else {
+      setEditShowData([
+        ...editShowData,
+        {
+          id: null,
+          answer: {
+            answer: [],
+          },
+          createTime: "",
+          creatorId: null,
+          creatorName: "",
+          description: "",
+          question: "",
+          updateTime: "",
+        },
+      ]);
+    }
+  }, [editShowData]);
+
+  // 提交所有编辑
+
+  const submitFinish = useCallback(async () => {
+    // 先执行删除
+    if (delTopicIdList.length > 0) {
+      delTopicIdList.forEach(async (item: any) => {
+        await deleteQuestionAPI(item);
+      });
+    }
+    // 执行数据提交   新增不用传id  编辑要传id
+    let data = editShowData.map((item: any) => {
+      return item.id == null
+        ? {
+            answer: JSON.stringify(item.answer),
+            description: item.description,
+            question: item.question,
+          }
+        : {
+            answer: JSON.stringify(item.answer),
+            description: item.description,
+            id: item.id,
+            question: item.question,
+          };
+    });
+    const res = await saveQuestionAPI(data);
+    if (res.code === 0) {
+      MessageFu.success("保存成功");
+      closeFu();
+    }
+  }, [closeFu, delTopicIdList, editShowData]);
+  const onFinishEdit = useCallback(async () => {
+    // 校验
+    // 至少提交一题
+    if (editShowData.length === 0) {
+      MessageFu.warning("至少提交一道题目");
+      return;
+    }
+
+    editShowData.forEach((element: any) => {
+      // 题目描述为空
+      if (element.question === "" || !element.question) {
+        MessageFu.warning("题目描述不能为空");
+        return;
+      }
+      if (element.answer.answer.length < 2) {
+        MessageFu.warning("每道题目至少填入两个选项");
+        return;
+      }
+      if (!element.answer.correct || element.answer.correct === "") {
+        MessageFu.warning("需设置正确答案且正确答案不能为空");
+        return;
+      }
+    });
+    submitFinish();
+  }, [editShowData, submitFinish]);
 
   useEffect(() => {
     getList();
@@ -124,7 +465,12 @@ function TopicSetting({ closeFu }: Props) {
           <div className="pageTitle">
             <div>助农课堂 题目设置</div>
           </div>
-          <Button className="addTopicBtn" size="middle" type="primary">
+          <Button
+            className="addTopicBtn"
+            size="middle"
+            type="primary"
+            onClick={addTopic}
+          >
             新增
           </Button>
         </div>
@@ -148,7 +494,7 @@ function TopicSetting({ closeFu }: Props) {
         </div>
         {/* 确认/取消按钮 */}
         <div style={{ marginTop: "10px" }}>
-          <Button type="primary" htmlType="submit">
+          <Button type="primary" htmlType="submit" onClick={onFinishEdit}>
             提交
           </Button>
           &emsp;
@@ -164,6 +510,56 @@ function TopicSetting({ closeFu }: Props) {
             <Button>取消</Button>
           </Popconfirm>
         </div>
+        {/* 编辑弹框 */}
+        <Modal
+          destroyOnClose
+          closable={false}
+          maskClosable={false}
+          open={editShow}
+          title="   "
+          onCancel={() => setEditShow(false)}
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
+        >
+          <Form
+            form={form}
+            ref={FormBoxRef}
+            name="basic"
+            labelCol={{ span: 8 }}
+            onFinish={onFinish}
+            autoComplete="off"
+          >
+            <Form.Item
+              label=""
+              name="numberVal"
+              initialValue={curEdit ? curEdit.value : ""}
+              style={{ marginTop: "40px" }}
+              hide-required-asterisk={true}
+            >
+              <Input placeholder="请输入" />
+            </Form.Item>
+            {/* 确定和取消按钮 */}
+            <br />
+            <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
+              <Button type="primary" htmlType="submit">
+                提交
+              </Button>
+              &emsp;
+              <Popconfirm
+                title="放弃编辑后,信息将不会保存!"
+                okText="放弃"
+                cancelText="取消"
+                onConfirm={() => {
+                  setEditShow(false);
+                }}
+                okButtonProps={{ loading: false }}
+              >
+                <Button>取消</Button>
+              </Popconfirm>
+            </Form.Item>
+          </Form>
+        </Modal>
       </div>
 
       {/* <Button className="scoreLimitBtn" size="middle" type="primary">

+ 8 - 1
houtai/src/pages/A1Rule/index.module.scss

@@ -42,14 +42,21 @@
         // height: calc(100% - 80px);
         // background-color: #fff;
         padding: 0px;
+
         // box-shadow: 3px 0px 10px 0px #d5d5d9;
+        ::-webkit-scrollbar {
+          /*滚动条整体样式*/
+          width: 0;
+          /*高宽分别对应横竖滚动条的尺寸*/
+          height: 0;
+        }
 
 
         .ant-table-body {
           height: 200px;
           overflow-y: auto !important;
           overflow-y: overlay !important;
-        
+
 
           .ant-table-row {
             .ant-table-cell {

+ 8 - 4
houtai/src/pages/A1Rule/index.tsx

@@ -52,7 +52,6 @@ function A1Rule() {
   // 积分上限窗口开关
   const [limitScoreShow, setLimitScoreShow] = useState(false);
 
-
   // 编辑游戏
   const editId = useRef(0);
   // 编辑模式 1是游戏规则 2是线上展厅
@@ -74,7 +73,11 @@ function A1Rule() {
   const onFinish = useCallback(
     async (values: any) => {
       if (values.numberVal) {
-        const res: any = await scoreLimitSaveAPI({} as SaveScoreLimitType);
+        const data = {
+          ...surScoreLimit,
+          score: values.numberVal,
+        };
+        const res: any = await scoreLimitSaveAPI(data);
         if (res.code === 0) {
           MessageFu.success("提交成功!");
           getList();
@@ -82,7 +85,7 @@ function A1Rule() {
         }
       }
     },
-    [getList]
+    [getList, surScoreLimit]
   );
 
   const columns = useMemo(() => {
@@ -94,7 +97,7 @@ function A1Rule() {
       {
         title: "时限(秒)",
         render: (item: RulesTableType) => {
-          return item.name === "乡村林场" ? <>-</> : <>60</>;
+          return item.name === "乡村林场" ? <>-</> : <>{item.second}</>;
         },
       },
       {
@@ -260,6 +263,7 @@ function A1Rule() {
               label="单日可获得积分上限"
               name="numberVal"
               style={{ marginTop: "40px" }}
+              initialValue={surScoreLimit.score}
               rules={[{ required: true, message: "不能为空!" }]}
               hide-required-asterisk={true}
               getValueFromEvent={(e) =>

+ 12 - 2
houtai/src/pages/A2Integral/index.module.scss

@@ -3,7 +3,8 @@
     .logTop {
       border-radius: 10px;
       background-color: #fff;
-      .pageTitle{
+
+      .pageTitle {
         margin-top: 10px;
       }
 
@@ -16,7 +17,8 @@
         .row {
           margin-right: 20px;
         }
-        .reSetBtn{
+
+        .reSetBtn {
           float: right;
           height: 100%;
         }
@@ -29,6 +31,14 @@
       height: calc(100% - 75px);
       background-color: #fff;
 
+      ::-webkit-scrollbar {
+        /*滚动条整体样式*/
+        width: 5px;
+        /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
+
       .ant-table-body {
         height: 500px;
 

+ 11 - 9
houtai/src/pages/A3User/UserAdd/index.tsx

@@ -1,6 +1,5 @@
-
 import { getUserInfoByIdAPI, userSaveAPI } from "@/store/action/A3user";
-import { SaveUserType } from "@/types";
+import { SaveUserType, UserTableListType } from "@/types";
 import { MessageFu } from "@/utils/message";
 import {
   Button,
@@ -11,7 +10,7 @@ import {
   Popconfirm,
   Select,
 } from "antd";
-import React, { useCallback, useEffect, useRef } from "react";
+import React, { useCallback, useEffect, useRef, useState } from "react";
 import styles from "./index.module.scss";
 
 type Props = {
@@ -25,10 +24,12 @@ function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
   // 设置表单初始数据(区分编辑和新增)
   const FormBoxRef = useRef<FormInstance>(null);
 
+  const [curEditItem, setEditItem] = useState<UserTableListType>();
+
   const getInfoInAPIFu = useCallback(async (id: number) => {
     const res = await getUserInfoByIdAPI(id);
     FormBoxRef.current?.setFieldsValue(res.data);
-    console.log("是编辑,在这里发请求拿数据", res);
+    setEditItem(res.data);
   }, []);
 
   // 没有通过校验
@@ -112,12 +113,13 @@ function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
             name="roleId"
             rules={[{ required: true, message: "请选择角色!" }]}
           >
-            <Select placeholder="请选择" options={
-              [
+            <Select
+              placeholder="请选择"
+              options={[
                 { value: 1, label: "管理员" },
                 { value: 2, label: "普通用户" },
-              ]
-            } />
+              ]}
+            />
           </Form.Item>
 
           <Form.Item
@@ -143,7 +145,7 @@ function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
               okText="放弃"
               cancelText="取消"
               onConfirm={closePage}
-              okButtonProps={{loading: false}}
+              okButtonProps={{ loading: false }}
             >
               <Button>取消</Button>
             </Popconfirm>

+ 120 - 94
houtai/src/pages/A4Prize/index.tsx

@@ -1,4 +1,10 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
 import {
   Button,
@@ -12,6 +18,7 @@ import {
   Select,
   Upload,
   message,
+  FormInstance,
 } from "antd";
 import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
@@ -34,17 +41,31 @@ import {
   UploadProps,
 } from "antd/es/upload";
 import RichText from "@/components/Z_RichText";
+import moment from "moment";
+import UpFileOne from "@/components/Z_upFileOne";
 
 function A4Prize() {
   const dispatch = useDispatch();
   // 从仓库中获取表格数据
   const tableInfo = useSelector((state: RootState) => state.A4Prise.tableInfo);
 
+  // 筛选和分页
+  const [tableSelect, setTableSelect] = useState({
+    pageNum: 0,
+    pageSize: 10,
+    searchKey: "",
+  });
+
+  const [cover, setCover] = useState("");
+
   // 当前是编辑还是增加?
   const [modalType, setModalType] = React.useState<string>("add");
 
   // 当前编辑单元
   const [editItem, setEditItem] = React.useState<PrizeTableType>();
+  const FormBoxRef = useRef<FormInstance>(null);
+  const [curEditItem, setCurEditItem] = useState<PrizeTableType>();
+
   // 编辑/新增页面弹窗开关
   const [editPageVisible, setEditPageVisible] = React.useState(false);
   // 编辑/新增页面弹窗打开
@@ -57,6 +78,12 @@ function A4Prize() {
         const res = await getPrizeDetailAPI(id);
         if (res.code === 0) {
           setEditItem(res.data);
+          FormBoxRef.current?.setFieldsValue(res.data);
+          setCurEditItem(res.data);
+          setCover(res.data.thumb);
+          setDirCode(res.data.id);
+          // 调用富文本子组件的函数,回显数据
+          richTxtRef.current.ritxtShowFu(res.data.rtf);
         }
       } else {
         setModalType("add");
@@ -65,26 +92,52 @@ function A4Prize() {
     [setEditItem]
   );
 
+  const getList = useCallback(async () => {
+    dispatch(getPrizeListAPI(tableSelect));
+  }, [dispatch, tableSelect]);
+
   // 通过id删除奖品
-  const deletePrizeFu = useCallback(async (id: number) => {
-    const res = await deletePrizeByIdAPI(id);
-    if (res.code === 0) {
-      MessageFu.success("删除成功");
-    }
-  }, []);
+  const deletePrizeFu = useCallback(
+    async (id: number) => {
+      const res = await deletePrizeByIdAPI(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功");
+        getList();
+      }
+    },
+    [getList]
+  );
   const [form] = Form.useForm();
 
-  const getList = useCallback(async () => {
-    dispatch(getPrizeListAPI());
-  }, [dispatch]);
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    setCheck(true);
+  }, []);
 
   const onFinish = useCallback(
     async (values: any) => {
-      if (values.numberVal) {
-        const res: any =
-          modalType === "add"
-            ? await addPrizeByIdAPI({} as AddPrizeType)
-            : await editPrizeByIdAPI({} as AddPrizeType);
+      if (values) {
+        setCheck(true);
+        // 封面没传
+        if (!cover) {
+          MessageFu.error("封面不能为空");
+          return;
+        }
+        // 富文本 为空
+        const { val, flag } = richTxtRef.current.fatherBtnOkFu();
+        if (flag) {
+          MessageFu.error("产品简介不能为空");
+          return;
+        }
+
+        const obj = {
+          ...values,
+          id: curEditItem && modalType !== "add" ? curEditItem.id : null,
+          thumb: cover,
+          rtf: val,
+        };
+
+        const res: any = await editPrizeByIdAPI(obj);
         if (res.code === 0) {
           MessageFu.success("提交成功!");
           getList();
@@ -92,7 +145,7 @@ function A4Prize() {
         }
       }
     },
-    [getList, modalType]
+    [cover, curEditItem, getList, modalType]
   );
 
   const [loading, setLoading] = React.useState<boolean>(false);
@@ -109,22 +162,6 @@ function A4Prize() {
     console.log(`selected ${value}`);
   };
 
-  const handleUploadChange: UploadProps["onChange"] = (
-    info: UploadChangeParam<UploadFile>
-  ) => {
-    if (info.file.status === "uploading") {
-      setLoading(true);
-      return;
-    }
-    if (info.file.status === "done") {
-      // Get this url from response in real world.
-      getBase64(info.file.originFileObj as RcFile, (url) => {
-        setLoading(false);
-        setImageUrl(url);
-      });
-    }
-  };
-
   useEffect(() => {
     getList();
   }, [dispatch, getList]);
@@ -144,19 +181,21 @@ function A4Prize() {
       },
       {
         title: "所需积分",
-        dataIndex: "needScore",
+        render: (item: PrizeTableType) => <div>{item.score}</div>,
       },
       {
         title: "库存",
-        dataIndex: "inventory",
+        dataIndex: "stock",
       },
       {
         title: "登记日期",
-        dataIndex: "date",
+        dataIndex: "updateTime",
       },
       {
         title: "状态",
-        dataIndex: "state",
+        render: (item: PrizeTableType) => (
+          <div>{item.stock > 0 ? "上架" : "下架"}</div>
+        ),
       },
       {
         title: "操作",
@@ -198,25 +237,6 @@ function A4Prize() {
     console.log("onOk: ", value);
   };
 
-  const beforeUpload = (file: RcFile) => {
-    const isJpgOrPng = file.type === "image/jpeg" || file.type === "image/png";
-    if (!isJpgOrPng) {
-      message.error("You can only upload JPG/PNG file!");
-    }
-    const isLt2M = file.size / 1024 / 1024 < 2;
-    if (!isLt2M) {
-      message.error("Image must smaller than 2MB!");
-    }
-    return isJpgOrPng && isLt2M;
-  };
-
-  const uploadButton = (
-    <div>
-      {loading ? <LoadingOutlined /> : <PlusOutlined />}
-      <div style={{ marginTop: 8 }}>Upload</div>
-    </div>
-  );
-
   // 富文本的ref
   const richTxtRef = useRef<any>(null);
 
@@ -271,9 +291,11 @@ function A4Prize() {
       >
         <Form
           form={form}
+          ref={FormBoxRef}
           name="basic"
           labelCol={{ span: 3 }}
           onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
           autoComplete="off"
         >
           <Form.Item
@@ -285,14 +307,14 @@ function A4Prize() {
           </Form.Item>
           <Form.Item
             label="所需的积分"
-            name="needScore"
+            name="score"
             rules={[{ required: true, message: "不能为空!" }]}
           >
             <Input maxLength={5} placeholder="请输入正整数,1-99999" />
           </Form.Item>
           <Form.Item
             label="库存"
-            name="inventory"
+            name="stock"
             rules={[{ required: true, message: "不能为空!" }]}
           >
             <Input maxLength={5} placeholder="请输入正整数,1-99999" />
@@ -300,61 +322,65 @@ function A4Prize() {
           <Form.Item
             label="登记日期"
             name="date"
+            initialValue={moment() as any}
             rules={[{ required: true, message: "不能为空!" }]}
           >
             <DatePicker showTime onChange={onChange} onOk={onOk} />
           </Form.Item>
           <Form.Item
             label="状态"
-            name="state"
+            name="isEnabled"
+            initialValue={curEditItem ? (curEditItem.stock > 0 ? 1 : 0) : 0}
             rules={[{ required: true, message: "不能为空!" }]}
           >
             <Select
-              defaultValue="上架"
+              defaultValue={"上架"}
               style={{ width: 120 }}
               onChange={handleChange}
               options={[
-                { value: "上架", label: "上架" },
-                { value: "下架", label: "下架" },
+                { value: 1, label: "上架" },
+                { value: 0, label: "下架" },
               ]}
             />
           </Form.Item>
-          <Form.Item
-            label="封面"
-            name="themb"
-            rules={[{ required: true, message: "不能为空!" }]}
-          >
-            <Upload
-              name="avatar"
-              listType="picture-card"
-              className="avatar-uploader"
-              showUploadList={false}
-              action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
-              beforeUpload={beforeUpload}
-              onChange={handleUploadChange}
-            >
-              {imageUrl ? (
-                <img src={imageUrl} alt="avatar" style={{ width: "100%" }} />
-              ) : (
-                uploadButton
-              )}
-            </Upload>
-            <span>
+          <Form.Item name="themb" initialValue={cover ? cover : ""}>
+            <div style={{ marginLeft: "7%", display: "flex" }}>
+              <span style={{ marginRight: "2px", color: "red" }}>*</span>
+              <div>封面:</div>
+            </div>
+            <div style={{ marginLeft: "14%" }}>
+              <UpFileOne
+                myUrl="cms/prize/upload"
+                cover={cover}
+                setCover={(val) => {
+                  setCover(val);
+                }}
+                isLook={false}
+                coverCheck={check}
+                size={5}
+                dirCode={dirCode}
+                checkTxt="请上传图片!"
+              />
+            </div>
+
+            <span style={{ marginLeft: "14%" }}>
               格式要求:支持png、jpg和jpeg的图片格式;最大支持2M;最多1张
             </span>
           </Form.Item>
-          <Form.Item
-            label="产品简介"
-            name="introduction"
-            rules={[{ required: true, message: "不能为空!" }]}
-          >
-            <RichText
-              myUrl="cms/goods/upload"
-              ref={richTxtRef}
-              check={check}
-              dirCode={dirCode}
-              isLook={true}
-            />
+          <Form.Item name="introduction">
+            <div style={{ marginLeft: "4%", display: "flex" }}>
+              <span style={{ marginRight: "2px", color: "red" }}>*</span>
+              <div>产品简介:</div>
+            </div>
+            <div style={{ marginLeft: "12%" }}>
+              <RichText
+                myUrl="cms/prize/upload"
+                ref={richTxtRef}
+                check={check}
+                dirCode={dirCode}
+                isLook={false}
+              />
+            </div>
           </Form.Item>
           {/* 确定和取消按钮 */}
           <br />

+ 11 - 2
houtai/src/pages/A5Exchange/index.module.scss

@@ -3,7 +3,8 @@
     .logTop {
       border-radius: 10px;
       background-color: #fff;
-      .pageTitle{
+
+      .pageTitle {
         margin-top: 10px;
       }
 
@@ -17,7 +18,8 @@
         .row {
           margin-right: 20px;
         }
-        .reSetBtn{
+
+        .reSetBtn {
           float: right;
           height: 100%;
         }
@@ -30,6 +32,13 @@
       height: calc(100% - 75px);
       background-color: #fff;
 
+      ::-webkit-scrollbar {
+        /*滚动条整体样式*/
+        width: 5px;
+        /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
       .ant-table-body {
         height: 500px;
 

+ 7 - 0
houtai/src/pages/A6IDUser/index.module.scss

@@ -30,6 +30,13 @@
       height: calc(100% - 75px);
       background-color: #fff;
 
+      ::-webkit-scrollbar {
+        /*滚动条整体样式*/
+        width: 5px;
+        /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
       .ant-table-body {
         height: 500px;
 

+ 7 - 0
houtai/src/pages/C7Log/index.module.scss

@@ -27,6 +27,13 @@
       height: calc(100% - 75px);
       background-color: #fff;
 
+      ::-webkit-scrollbar {
+        /*滚动条整体样式*/
+        width: 5px;
+        /*高宽分别对应横竖滚动条的尺寸*/
+        height: 1px;
+      }
+
       .ant-table-body {
         height: 500px;
 

+ 17 - 3
houtai/src/pages/Login/index.module.scss

@@ -21,11 +21,20 @@
         margin: 30px;
       }
     }
+
+    .center-img {
+      width: 60%;
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%, -50%);
+    }
+
     .main {
       border-radius: 4px;
       position: absolute;
-      top: 25%;
-      right: 10%;
+      top: 30%;
+      right: 29%;
       // transform: translate(-50%,-50%);
       width: 400px;
       padding: 40px 20px;
@@ -34,6 +43,7 @@
 
       .top {
         margin-bottom: 40px;
+
         .mainTitle {
           font-weight: 700;
           color: var(--themeColor);
@@ -42,10 +52,12 @@
           // margin-bottom: 20px;
           text-align: center;
         }
+
         .mainTitle:nth-child(1) {
           font-size: 18px;
           margin-bottom: 5px;
         }
+
         .mainTitle:nth-child(2) {
           font-size: 26px;
         }
@@ -53,6 +65,7 @@
 
       .inputBox {
         width: 100%;
+
         // padding: 0 40px;
         .inputBoxRow {
           width: 100%;
@@ -118,6 +131,7 @@
 
       .loginBtn {
         margin-top: 30px;
+
         .ant-btn {
           font-size: 16px;
           width: 100%;
@@ -129,4 +143,4 @@
       }
     }
   }
-}
+}

+ 6 - 4
houtai/src/pages/Login/index.tsx

@@ -12,7 +12,8 @@ import store from "@/store";
 import history from "@/utils/history";
 import encodeStr from "@/utils/pass";
 
-
+import LoginIMG from "@/assets/img/logo.png";
+import centerIMG from "@/assets/img/center.png";
 
 export default function Login() {
   // 进登录页面把权限的信息初始化,防止登录成功之后进到首页,数据渲染问题
@@ -49,9 +50,10 @@ export default function Login() {
 
   return (
     <div className={styles.Login}>
-      {/* <div className="museum-icon">
-        <img src={LoginIMG} />
-      </div> */}
+      <div className="museum-icon">
+        <img src={LoginIMG} alt="" />
+      </div>
+      <img className="center-img" src={centerIMG} alt="" />
       <div className="main">
         <div className="top">
           <div className="mainTitle">担当——证券期贷行业公益力量展</div>

+ 16 - 2
houtai/src/store/action/A1Rule.ts

@@ -29,7 +29,7 @@ export const getOnlineRuleAPI = (type: string) => {
  * 修改游戏规则
  */
 export const ruleSaveAPI = (data: SaveRuleType) => {
-  return http.post("sys/user/save", data);
+  return http.post("cms/rule/save", data);
 };
 
 /**
@@ -50,7 +50,7 @@ export const getScoreLimitAPI = (id: number) => {
  * 保存每日积分上限
  */
 export const scoreLimitSaveAPI = (data: SaveScoreLimitType) => {
-  return http.post("sys/user/save", data);
+  return http.post("cms/rule/save", data);
 };
 
 /**
@@ -59,3 +59,17 @@ export const scoreLimitSaveAPI = (data: SaveScoreLimitType) => {
 export const getTopicByZhuNongKeTangAPI = () => {
   return http.get("cms/question/getList");
 };
+
+/**
+ * 删除助农课堂题目
+ */
+export const deleteQuestionAPI = (id: number) => {
+  return http.get(`cms/question/remove/${id}`);
+};
+
+/**
+ * 新增/编辑助农课堂题目 - 批量
+ */
+export const saveQuestionAPI = (data: any) => {
+  return http.post(`cms/question/saveBatch`, data);
+};

+ 38 - 8
houtai/src/store/action/A4Prise.ts

@@ -1,16 +1,22 @@
 import http from "@/utils/http";
-import { AppDispatch } from "..";
+import store,{ AppDispatch } from "..";
 import { AddPrizeType } from "@/types";
+import { domShowFu, progressDomFu } from "@/utils/domShow";
 // import { AxiosRequestConfig } from "axios";
+import axios from "axios";
+
 /**
  * 获取奖品列表
  */
-export const getPrizeListAPI = () => {
+export const getPrizeListAPI = (data:any) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.get(`cms/share/detail/museum_cctv_mianyan`);
+    const res = await http.post(`cms/prize/pageList`,data);
     if (res.code === 0) {
-      const data = res.data;
-      dispatch({ type: "prise/getList", payload: data });
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+      dispatch({ type: "prise/getList", payload: obj });
     }
   };
 };
@@ -20,7 +26,7 @@ export const getPrizeListAPI = () => {
  */
 export const getPrizeDetailAPI = (id: number) => {
   // return http.post(`/cms/share/save/`, data);
-  return http.get(`cms/share/edit/id=${id}`);
+  return http.get(`cms/prize/detail/${id}`);
 };
 
 /**
@@ -28,7 +34,7 @@ export const getPrizeDetailAPI = (id: number) => {
  */
 export const deletePrizeByIdAPI = (id: number) => {
   // return http.post(`/cms/share/save/`, data);
-  return http.post(`cms/share/edit/`, { id: id });
+  return http.get(`cms/prize/removes/${id}`);
 };
 
 /**
@@ -36,7 +42,7 @@ export const deletePrizeByIdAPI = (id: number) => {
  */
 export const editPrizeByIdAPI = (data: AddPrizeType) => {
   // return http.post(`/cms/share/save/`, data);
-  return http.post(`cms/share/edit/`, data);
+  return http.post(`cms/prize/save/`, data);
 };
 
 /**
@@ -46,3 +52,27 @@ export const addPrizeByIdAPI = (data: AddPrizeType) => {
   // return http.post(`/cms/share/save/`, data);
   return http.post(`cms/share/edit/`, data);
 };
+
+const CancelToken = axios.CancelToken;
+/**
+ * 上传封面图和附件
+ */
+export const A1_APIupFile = (data: any, url: string) => {
+  domShowFu("#UpAsyncLoding", true);
+
+  return http.post(url, data, {
+    timeout: 0,
+    // 显示进度条
+    onUploadProgress: (e: any) => {
+      const complete = (e.loaded / e.total) * 100 || 0;
+      progressDomFu(complete + "%");
+    },
+    // 取消上传
+    cancelToken: new CancelToken(function executor(c) {
+      store.dispatch({
+        type: "layout/closeUpFile",
+        payload: { fu: c, state: true },
+      });
+    }),
+  });
+};

+ 9 - 1
houtai/src/types/api/A1Rule.ts

@@ -43,9 +43,17 @@ export type SaveScoreLimitType = {
   realName: string;
 };
 
+export type answerType = {
+  key: string;
+  name: string;
+  val?: number;
+  _save?: boolean;
+};
+
 // 题目数据类型
 export type QuestionTableType = {
-  answer: string;
+  answer: any;
+  // answer: string;
   createTime: string;
   creatorId: number;
   creatorName: string;

+ 7 - 7
houtai/src/types/api/A4Prize.ts

@@ -1,16 +1,16 @@
 export type PrizeTableType = {
-  count: number;
   createTime: string;
-  creatorId: null;
+  creatorId: number;
   creatorName: string;
   id: number;
   isEnabled: number;
-  roleDesc: string;
-  roleKey: string;
-  roleName: string;
-  sort: string;
-  updateTime: string;
+  name: string;
+  recordDate: null;
+  rtf: string;
+  score: number;
+  stock: number;
   thumb: string;
+  updateTime: string;
 };
 
 export type PermissionsAPIType = {

BIN
zhengquan/public/staticData/animation/2/greeting.png


BIN
zhengquan/public/staticData/animation/2/talk.png


BIN
zhengquan/public/staticData/animation/5/greeting.png


BIN
zhengquan/public/staticData/animation/5/talk.png


BIN
zhengquan/public/staticData/animation/6/greeting.png


BIN
zhengquan/public/staticData/animation/6/talk.png


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


+ 18 - 2
zhengquan/src/views/Scene/ScenePage.vue

@@ -118,11 +118,18 @@ const isShowFigure = ref(true)
 
 const isShowGameList = ref(false)
 
+const isLogin = ref(false)
+
 // 内嵌小游戏界面打开
 const openGame = (game: any) => {
   console.log(game)
 }
 
+// 点击登录
+const goLogin =() => {
+  // 跳转到手机端登录界面
+}
+
 
 onMounted(() => {
   getAllHotspot()
@@ -197,10 +204,15 @@ onMounted(() => {
       <!-- 积分牌 -->
       <div class="score-box" v-if="isReady">
         <img class="headImg" src="@/assets/images/scene/userHead.png" alt="">
+        <!-- 未登录状态 -->
+        <!-- <div class="no-login-box">
+          <div class=""></div>
+        </div> -->
         <!-- 已登录状态 -->
         <div>
-          <div class="title">积分</div>
-          <div class="scroll-wrap">
+          <div class="title" :style="{ marginTop: !isLogin ? '5px' : '' }" @click="() => { !isLogin ? goLogin() : '' }">{{
+            isLogin ? '积分' : '未登录' }}</div>
+          <div class="scroll-wrap" v-show="isLogin">
             <div class="scroll-item" title="56666666">
               56666666
             </div>
@@ -425,6 +437,10 @@ onMounted(() => {
         // margin-top: 2px;
       }
 
+      .title {
+        cursor: pointer;
+      }
+
       .scroll-wrap {
         max-width: 40%;
         display: inline-block;