Explorar el Código

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

任一存 hace 1 año
padre
commit
9e1d9ceb46
Se han modificado 45 ficheros con 567 adiciones y 370 borrados
  1. BIN
      houtai/src/assets/img/logo-white.png
  2. 6 50
      houtai/src/assets/styles/base.css
  3. 1 1
      houtai/src/assets/styles/base.less
  4. 1 1
      houtai/src/index.tsx
  5. 10 7
      houtai/src/pages/A1Rule/RuleEdit/index.tsx
  6. 1 1
      houtai/src/pages/A1Rule/TopicSetting/index.module.scss
  7. 73 10
      houtai/src/pages/A1Rule/TopicSetting/index.tsx
  8. 7 5
      houtai/src/pages/A1Rule/index.module.scss
  9. 33 16
      houtai/src/pages/A1Rule/index.tsx
  10. 4 0
      houtai/src/pages/A2Integral/index.module.scss
  11. 13 17
      houtai/src/pages/A2Integral/index.tsx
  12. 12 7
      houtai/src/pages/A3User/UserAdd/index.tsx
  13. 24 11
      houtai/src/pages/A3User/index.module.scss
  14. 44 28
      houtai/src/pages/A3User/index.tsx
  15. 1 1
      houtai/src/pages/A4Prize/index.module.scss
  16. 5 0
      houtai/src/pages/A5Exchange/index.module.scss
  17. 9 9
      houtai/src/pages/A5Exchange/index.tsx
  18. 9 2
      houtai/src/pages/A6IDUser/IntegralEdit/index.module.scss
  19. 32 26
      houtai/src/pages/A6IDUser/IntegralEdit/index.tsx
  20. 5 0
      houtai/src/pages/A6IDUser/index.module.scss
  21. 58 18
      houtai/src/pages/A6IDUser/index.tsx
  22. 6 0
      houtai/src/pages/C7Log/index.module.scss
  23. 1 1
      houtai/src/pages/C7Log/index.tsx
  24. 3 3
      houtai/src/pages/Layout/index.module.scss
  25. 19 9
      houtai/src/store/action/A1Rule.ts
  26. 9 13
      houtai/src/store/action/A2Integral.ts
  27. 4 4
      houtai/src/store/action/A5Log.ts
  28. 20 5
      houtai/src/store/action/A6IDUser.ts
  29. 9 9
      houtai/src/store/action/TopicSetting.ts
  30. 1 1
      houtai/src/store/reducer/A1Rule.ts
  31. 9 6
      houtai/src/store/reducer/A2Integral.ts
  32. 1 1
      houtai/src/store/reducer/A4Prise.ts
  33. 31 0
      houtai/src/store/reducer/A5Exchange.ts
  34. 1 1
      houtai/src/store/reducer/A6IDUser.ts
  35. 2 2
      houtai/src/store/reducer/TopicSetting.ts
  36. 4 2
      houtai/src/store/reducer/index.ts
  37. 28 29
      houtai/src/types/api/A1Rule.ts
  38. 3 24
      houtai/src/types/api/A2Integral.ts
  39. 24 0
      houtai/src/types/api/A5Exchange.d.ts
  40. 31 0
      houtai/src/types/api/A6IDUser.d.ts
  41. 0 38
      houtai/src/types/api/A6IDUser.ts
  42. 0 0
      houtai/src/types/api/A7Log.d.ts
  43. 2 1
      houtai/src/types/index.d.ts
  44. 1 1
      houtai/src/utils/http.ts
  45. 10 10
      zhengquan/public/staticData/data.js

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


+ 6 - 50
houtai/src/assets/styles/base.css

@@ -3,62 +3,51 @@
   padding: 0;
   box-sizing: border-box;
 }
-
 html {
   height: 100%;
   font-size: 14px;
   user-select: none;
 }
-
 body {
   font: 1em/1.4 'Microsoft Yahei', 'PingFang SC', 'Avenir', 'Segoe UI', 'Hiragino Sans GB', 'STHeiti', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
   height: 100%;
   color: black;
 }
-
 a {
   text-decoration: none;
   color: black;
   outline: none;
 }
-
 i {
   font-style: normal;
 }
-
 img {
   max-width: 100%;
   max-height: 100%;
   vertical-align: middle;
   object-fit: cover;
 }
-
 ul {
   list-style: none;
 }
-
 body {
   overflow: auto;
   overflow-y: overlay;
 }
-
 /* 文本域取消下拉 */
 textarea {
   resize: none !important;
   min-height: 100px !important;
 }
-
 /* 主题色 */
 :root {
-  --themeColor: #1F5CD8;
+  --themeColor: #ddc39c;
 }
-
 /* 找不到页面 */
 .noFindPage {
   opacity: 0;
   transition: opacity 0.5s;
 }
-
 /* 兼容360浏览器的下拉框 */
 .ant-select-selector {
   position: relative;
@@ -66,7 +55,6 @@ textarea {
   border: 1px solid #d9d9d9;
   transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
 }
-
 #root {
   width: 100vw;
   height: 100vh;
@@ -81,148 +69,116 @@ textarea {
   /* antd图片预览组件 */
   /* antd表格居中 */
 }
-
 #root .ant-btn-text {
   color: var(--themeColor);
 }
-
 #root .ant-btn-text:disabled {
   cursor: not-allowed;
   color: rgba(0, 0, 0, 0.25);
 }
-
 #root .ant-btn-text.ant-btn-dangerous {
   color: #ff4d4d;
 }
-
 #root .ant-pagination {
-  margin: 40px 0 !important;
+  margin: 15px 0 !important;
 }
-
 #root .ant-pagination .ant-pagination-item {
   border-radius: 50%;
   border: 1px solid #999;
   background-color: transparent !important;
 }
-
 #root .ant-pagination .ant-pagination-item-active {
   background-color: var(--themeColor) !important;
 }
-
 #root .ant-pagination .ant-pagination-item-active a {
   color: #fff !important;
 }
-
 #root .ant-pagination .ant-pagination-item:hover {
   background-color: var(--themeColor) !important;
 }
-
 #root .ant-pagination .ant-pagination-item:hover a {
   color: #fff !important;
 }
-
 #root .ant-pagination-prev {
   border-radius: 50% !important;
   border: 1px solid #999;
 }
-
 #root .ant-pagination-prev:hover {
   background-color: var(--themeColor);
 }
-
 #root .ant-pagination-prev:hover button {
   color: #fff;
 }
-
 #root .ant-pagination-next {
   border-radius: 50% !important;
   border: 1px solid #999;
 }
-
 #root .ant-pagination-next:hover {
   background-color: var(--themeColor);
 }
-
 #root .ant-pagination-next:hover button {
   color: #fff;
 }
-
 #root .ant-pagination-disabled {
   border: 1px solid #ccc;
 }
-
 #root .ant-pagination-disabled:hover {
   background-color: transparent;
 }
-
 #root .tableImgAuto {
   display: flex;
   justify-content: center;
 }
-
 #root .ant-image {
   display: none;
 }
-
 #root .ant-table-cell {
   text-align: center !important;
 }
-
 #root .ant-table-container {
   border: 1px solid #f0f0f0 !important;
 }
-
 [hidden] {
   display: none !important;
 }
-
 #upInput {
   display: none;
 }
-
 #upInput2 {
   display: none;
 }
-
 .pageTitle {
   font-size: 18px;
   font-weight: 700;
   position: absolute;
   z-index: 11;
-  padding-left: 10px;
-  margin-bottom: 20px;
-  position: relative;
-  color: #1F5CD8;
+  padding-left: 40px;
 }
-
 .pageTitle::before {
   position: absolute;
-  left: 0;
+  left: 20px;
   top: 50%;
   transform: translateY(-50%);
   content: '';
   width: 6px;
   height: 20px;
-  background-color: #1F5CD8;
+  background-color: #775755;
 }
-
 .mySorrl::-webkit-scrollbar {
   /*滚动条整体样式*/
   width: 5px;
   /*高宽分别对应横竖滚动条的尺寸*/
   height: 1px;
 }
-
 .mySorrl::-webkit-scrollbar-thumb {
   /*滚动条里面小方块*/
   border-radius: 10px;
   -webkit-box-shadow: inset 0 0 5px transparent;
   background: var(--themeColor);
 }
-
 .mySorrl::-webkit-scrollbar-track {
   /*滚动条里面轨道*/
   -webkit-box-shadow: inset 0 0 5px transparent;
   border-radius: 10px;
   background: transparent;
-}
+}

+ 1 - 1
houtai/src/assets/styles/base.less

@@ -50,7 +50,7 @@ textarea {
 
 /* 主题色 */
 :root {
-  --themeColor: #1F5CD8 ;
+  --themeColor: #ddc39c ;
 }
 
 

+ 1 - 1
houtai/src/index.tsx

@@ -25,7 +25,7 @@ root.render(
     locale={locale}
     theme={{
       token: {
-        colorPrimary: "#1F5CD8",
+        colorPrimary: "#DDC39C",
       },
     }}
   >

+ 10 - 7
houtai/src/pages/A1Rule/RuleEdit/index.tsx

@@ -30,11 +30,13 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
 
   const getInfoInAPIFu = useCallback(async (id: number) => {
     const res = await getRuleInfoByIdAPI(id);
-    FormBoxRef.current?.setFieldsValue(res.data);
+    if (res.code === 0) {
+      FormBoxRef.current?.setFieldsValue(res.data);
 
-    // 富文本回显
-    richTxtRef.current.ritxtShowFu(res.data.content);
-    currentIdInfo.current = res.data;
+      // 富文本回显
+      richTxtRef.current.ritxtShowFu(res.data.content);
+      currentIdInfo.current = res.data;
+    }
   }, []);
 
   // 没有通过校验
@@ -75,6 +77,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
     <>
       {editMode === 1 ? (
         <Modal
+          width={1000}
           wrapClassName={styles.RuleEdit}
           destroyOnClose
           open={true}
@@ -88,7 +91,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
             <Form
               ref={FormBoxRef}
               name="basic"
-              labelCol={{ span: 5 }}
+              labelCol={{ span: 2 }}
               onFinish={onFinish}
               onFinishFailed={onFinishFailed}
               autoComplete="off"
@@ -100,7 +103,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
               >
                 <Input
-                  disabled={id}
+                  disabled={id === 3}
                   maxLength={3}
                   showCount
                   placeholder="请输入数字,1-300"
@@ -127,7 +130,7 @@ function RuleEdit({ id, closePage, upTableList, editMode }: Props) {
                 getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
               >
                 {/* <Input maxLength={8} showCount placeholder="请输入内容" /> */}
-                <span>currentIdInfo.specification</span>
+                <span>每观看完一个视频</span>
               </Form.Item>
 
               <Form.Item

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

@@ -43,7 +43,7 @@
       .tableBox1 {
         border-radius: 4px;
         overflow: hidden;
-        margin-top: -10px;
+        margin-top: 3%;
         padding: 0px;
 
         .ant-table-body {

+ 73 - 10
houtai/src/pages/A1Rule/TopicSetting/index.tsx

@@ -1,8 +1,16 @@
-import React, { useMemo, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  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 { QuestionTableType } from "@/types";
 type Props = {
   closeFu: () => void;
 };
@@ -27,6 +35,29 @@ function TopicSetting({ closeFu }: Props) {
 
   const results = useSelector((state: RootState) => state.A7Log.tableInfo);
 
+  // 编辑前数据保存
+  const [editBeforeData, setEditBeforeData] = useState<any>(
+    [] as QuestionTableType[]
+  );
+
+  // 用于编辑/展示/回显的新数据
+  const [editShowData, setEditShowData] = useState<any>(
+    [] as QuestionTableType[]
+  );
+
+  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))
+      })
+    }
+  }, []);
+
+  const deleteQuestionFu = useCallback((id: number) => {}, []);
+
   const columns = useMemo(() => {
     return [
       {
@@ -36,23 +67,55 @@ function TopicSetting({ closeFu }: Props) {
           index + 1 + (pageNumRef.current - 1) * pagePageRef.current,
       },
       {
-        title: "时间",
-        dataIndex: "createTime",
+        title: "题目描述",
+        dataIndex: "question",
       },
       {
-        title: "类型",
+        title: "选项1",
         dataIndex: "type",
       },
       {
-        title: "积分",
+        title: "选项2",
         dataIndex: "type",
       },
       {
-        title: "说明",
+        title: "选项3",
+        dataIndex: "description",
+      },
+      {
+        title: "选项4",
         dataIndex: "description",
       },
+      {
+        title: "正确答案",
+        dataIndex: "description",
+      },
+      {
+        title: "答案解析",
+        dataIndex: "description",
+      },
+      {
+        title: "操作",
+        render: (item: QuestionTableType) => {
+          return (
+            <>
+              <Button
+                size="small"
+                type="text"
+                onClick={() => deleteQuestionFu(item.id)}
+              >
+                删除
+              </Button>
+            </>
+          );
+        },
+      },
     ];
-  }, []);
+  }, [deleteQuestionFu]);
+
+  useEffect(() => {
+    getList();
+  }, [getList]);
 
   return (
     <div className={styles.TopicSetting}>
@@ -69,7 +132,7 @@ function TopicSetting({ closeFu }: Props) {
         <div className="tableBox1">
           <Table
             scroll={{ y: 625 }}
-            dataSource={results.list}
+            dataSource={editShowData}
             columns={columns}
             rowKey="id"
             pagination={{
@@ -78,13 +141,13 @@ function TopicSetting({ closeFu }: Props) {
               showSizeChanger: true,
               current: tableSelect.pageNum,
               pageSize: tableSelect.pageSize,
-              total: results.total,
+              total: editShowData.length,
               onChange: paginationChange,
             }}
           />
         </div>
         {/* 确认/取消按钮 */}
-        <div style={{marginTop: '10px'}}>
+        <div style={{ marginTop: "10px" }}>
           <Button type="primary" htmlType="submit">
             提交
           </Button>

+ 7 - 5
houtai/src/pages/A1Rule/index.module.scss

@@ -8,7 +8,7 @@
   :global {
     .ruleTop {
       border-radius: 4px;
-      padding: 15px 20px 25px 20px;
+      padding: 15px 20px 10px 20px;
       background-color: #fff;
       box-shadow: 3px 0px 10px 0px #d5d5d9;
       position: relative;
@@ -26,7 +26,7 @@
         top: 3%;
         height: 30px;
         padding: 0 10px;
-        background: #1F5CD8;
+        background: #DDC39C;
         color: white;
         border: 1px solid white;
         border-radius: 5px;
@@ -38,16 +38,18 @@
       .tableBox1 {
         border-radius: 4px;
         overflow: hidden;
-        margin-top: -10px;
+        margin-top: 3%;
         // height: calc(100% - 80px);
         // background-color: #fff;
         padding: 0px;
         // box-shadow: 3px 0px 10px 0px #d5d5d9;
 
+
         .ant-table-body {
-          height: 300px;
+          height: 200px;
           overflow-y: auto !important;
           overflow-y: overlay !important;
+        
 
           .ant-table-row {
             .ant-table-cell {
@@ -64,7 +66,7 @@
       .tableBox2 {
         border-radius: 4px;
         overflow: hidden;
-        margin-top: -10px;
+        margin-top: 3%;
         // height: calc(100% - 80px);
         // background-color: #fff;
         padding: 0px;

+ 33 - 16
houtai/src/pages/A1Rule/index.tsx

@@ -11,6 +11,7 @@ import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
 import { RulesTableType, SaveScoreLimitType } from "@/types";
 import {
+  getOnlineRuleAPI,
   getRuleAPI,
   getScoreLimitAPI,
   scoreLimitSaveAPI,
@@ -27,32 +28,48 @@ function A1Rule() {
   // 从仓库中获取表格数据
   const tableInfo = useSelector((state: RootState) => state.A1Rule.tableInfo);
 
+  // 线上展厅表格数据
+  const [onlineTableInfo, setOnlineTableInfo] = useState(
+    [] as RulesTableType[]
+  );
   const [editPageShow, setEditPageShow] = useState(false);
 
   const [surScoreLimit, setSurScoreLimit] = useState({} as any);
 
   const getList = useCallback(async () => {
-    dispatch(getRuleAPI());
-    const res = await getScoreLimitAPI();
+    dispatch(getRuleAPI("game"));
+    const onlineRes = await getOnlineRuleAPI("online");
+    if (onlineRes.code === 0) {
+      setOnlineTableInfo(onlineRes.data);
+    }
+    const res = await getScoreLimitAPI(1);
     if (res.code === 0) {
       setSurScoreLimit(res.data);
+      // alert(res.data)
     }
   }, [dispatch]);
 
   // 积分上限窗口开关
   const [limitScoreShow, setLimitScoreShow] = useState(false);
 
+
   // 编辑游戏
   const editId = useRef(0);
   // 编辑模式 1是游戏规则 2是线上展厅
   const editMode = useRef(1);
-  const openEditPageFu = useCallback((type: number, id: number) => {
-    editMode.current = type;
-    editId.current = id;
-    setEditPageShow(true);
-  }, []);
+  const openEditPageFu = useCallback(
+    (type: number, id: number) => {
+      // alert('编辑2')
+      editMode.current = type;
+      editId.current = id;
+      setEditPageShow(true);
+      console.log(editPageShow, editMode.current);
+    },
+    [editPageShow]
+  );
 
   const [form] = Form.useForm();
+  const [form2] = Form.useForm();
 
   const onFinish = useCallback(
     async (values: any) => {
@@ -72,7 +89,7 @@ function A1Rule() {
     return [
       {
         title: "游戏名称",
-        dataIndex: "gameName",
+        dataIndex: "name",
       },
       {
         title: "时限(秒)",
@@ -86,7 +103,7 @@ function A1Rule() {
       },
       {
         title: "得分说明",
-        dataIndex: "specification",
+        dataIndex: "description",
       },
       {
         title: "操作",
@@ -129,7 +146,7 @@ function A1Rule() {
     return [
       {
         title: "事件名称",
-        dataIndex: "eventName",
+        dataIndex: "name",
       },
       {
         title: "得分",
@@ -137,7 +154,7 @@ function A1Rule() {
       },
       {
         title: "得分说明",
-        dataIndex: "specification",
+        dataIndex: "description",
       },
       {
         title: "操作",
@@ -159,8 +176,8 @@ function A1Rule() {
   }, [openEditPageFu]);
 
   useEffect(() => {
-    dispatch(getRuleAPI());
-  }, [dispatch]);
+    getList();
+  }, [dispatch, getList]);
   return !topicSettingShow ? (
     <>
       <div className={styles.A1Rule}>
@@ -173,7 +190,7 @@ function A1Rule() {
               setLimitScoreShow(true);
             }}
           >
-            单日可获得积分上线:5000
+            单日可获得积分上限:<span>{surScoreLimit.score}</span>
           </button>
           {/* 表格主体 */}
           <div className="tableBox1">
@@ -199,7 +216,7 @@ function A1Rule() {
             <Table
               scroll={{ y: 500 }}
               bordered={false}
-              dataSource={tableInfo.list}
+              dataSource={onlineTableInfo}
               columns={columns2}
               rowKey="id"
               pagination={{
@@ -212,7 +229,7 @@ function A1Rule() {
           </div>
         </div>
         {/* 点击游戏编辑 */}
-        {editPageShow && editMode.current === 1 ? (
+        {editPageShow ? (
           <RuleEdit
             id={editId.current}
             closePage={() => setEditPageShow(false)}

+ 4 - 0
houtai/src/pages/A2Integral/index.module.scss

@@ -3,11 +3,15 @@
     .logTop {
       border-radius: 10px;
       background-color: #fff;
+      .pageTitle{
+        margin-top: 10px;
+      }
 
       .tableSelectBox {
         padding: 15px 24px;
         display: flex;
         align-items: center;
+        margin-top: 2%;
 
         .row {
           margin-right: 20px;

+ 13 - 17
houtai/src/pages/A2Integral/index.tsx

@@ -1,11 +1,11 @@
 import { RootState } from "@/store";
-import { getLogListAPI } from "@/store/action/A7Log";
 import { Input, DatePicker, Table, Button, Select } from "antd";
 import React, { useEffect, useMemo, useRef, useState } from "react";
 import { useDispatch, useSelector } from "react-redux";
 
 import styles from "./index.module.scss";
 import { IntegralTableAPIType } from "@/types";
+import { getIntegralListAPI } from "@/store/action/A2Integral";
 
 const { RangePicker } = DatePicker;
 
@@ -65,7 +65,7 @@ function A2Integral() {
   useEffect(() => {
     pageNumRef.current = tableSelect.pageNum;
     pagePageRef.current = tableSelect.pageSize;
-    dispatch(getLogListAPI(tableSelect));
+    dispatch(getIntegralListAPI(tableSelect));
   }, [dispatch, tableSelect]);
 
   // ---------关于表格
@@ -77,7 +77,7 @@ function A2Integral() {
     setTableSelect({ ...tableSelect, pageNum, pageSize });
   };
 
-  const results = useSelector((state: RootState) => state.A7Log.tableInfo);
+  const results = useSelector((state: RootState) => state.A2Integral.tableInfo);
 
   const columns = useMemo(() => {
     return [
@@ -89,7 +89,7 @@ function A2Integral() {
       // },
       {
         title: "用户名",
-        dataIndex: "userName",
+        dataIndex: "creatorName",
       },
       {
         title: "时间",
@@ -97,20 +97,16 @@ function A2Integral() {
       },
       {
         title: "类型",
-        dataIndex: "ip",
+        dataIndex: "type",
       },
       {
         title: "积分",
-        dataIndex: "type",
+        dataIndex: "score",
       },
       {
         title: "说明",
         render: (item: IntegralTableAPIType) => {
-          return (
-            <>
-            {item.explain}
-            </>
-          );
+          return <>{item.description}</>;
         },
       },
     ];
@@ -118,8 +114,8 @@ function A2Integral() {
 
   return (
     <div className={styles.A2Integral}>
-      <div className="pageTitle">积分记录</div>
       <div className="logTop">
+        <div className="pageTitle">积分记录</div>
         <div className="tableSelectBox">
           <div className="row">
             <span>用户名:</span>
@@ -140,14 +136,14 @@ function A2Integral() {
           <div className="row">
             <span>类型:</span>
             <Select
-              value={tableSelect.type}
-              defaultValue="lucy"
               style={{ width: 120 }}
               onChange={typeChange}
+              placeholder="请选择"
               options={[
-                { value: "jack", label: "Jack" },
-                { value: "lucy", label: "Lucy" },
-                { value: "Yiminghe", label: "yiminghe" },
+                { value: "玩游戏", label: "玩游戏" },
+                { value: "观看视频", label: "观看视频" },
+                { value: "奖品兑换", label: "奖品兑换" },
+                { value: "编辑", label: "编辑" },
               ]}
             />
           </div>

+ 12 - 7
houtai/src/pages/A3User/UserAdd/index.tsx

@@ -1,4 +1,4 @@
-import { RootState } from "@/store";
+
 import { getUserInfoByIdAPI, userSaveAPI } from "@/store/action/A3user";
 import { SaveUserType } from "@/types";
 import { MessageFu } from "@/utils/message";
@@ -9,9 +9,9 @@ import {
   Input,
   Modal,
   Popconfirm,
+  Select,
 } from "antd";
 import React, { useCallback, useEffect, useRef } from "react";
-import { useSelector } from "react-redux";
 import styles from "./index.module.scss";
 
 type Props = {
@@ -98,22 +98,27 @@ function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
             />
           </Form.Item>
 
-          <Form.Item
+          {/* <Form.Item
             label="用户昵称"
             name="nickName"
             rules={[{ required: true, message: "请输入用户昵称!" }]}
             getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
           >
             <Input maxLength={8} showCount placeholder="请输入内容" />
-          </Form.Item>
+          </Form.Item> */}
 
-          {/* <Form.Item
+          <Form.Item
             label="用户角色"
             name="roleId"
             rules={[{ required: true, message: "请选择角色!" }]}
           >
-            <Select placeholder="请选择" options={roleList} />
-          </Form.Item> */}
+            <Select placeholder="请选择" options={
+              [
+                { value: 1, label: "管理员" },
+                { value: 2, label: "普通用户" },
+              ]
+            } />
+          </Form.Item>
 
           <Form.Item
             label="真实姓名"

+ 24 - 11
houtai/src/pages/A3User/index.module.scss

@@ -1,20 +1,33 @@
 .A3User {
+
   :global {
     .userTop {
-      border-radius: 4px;
-      padding: 15px 20px;
+      // border-radius: 4px;
+      // padding: 15px 20px;
+      // background-color: #fff;
+      // box-shadow: 3px 0px 10px 0px #d5d5d9;
+      border-radius: 10px;
       background-color: #fff;
-      box-shadow: 3px 0px 10px 0px #d5d5d9;
-    }
-    .selectBox {
-      display: flex;
-      .selectBoxRow {
-        margin-right: 30px;
-        @media screen and (max-width: 1717px) {
-          margin-right: 10px;
+
+      .pageTitle {
+        margin-top: 10px;
+      }
+
+      .selectBox {
+        display: flex;
+        margin-top: 2%;
+        padding: 15px 24px;
+
+        .selectBoxRow {
+          margin-right: 30px;
+
+          @media screen and (max-width: 1717px) {
+            margin-right: 10px;
+          }
         }
       }
     }
+
     .tableBox {
       border-radius: 4px;
       overflow: hidden;
@@ -37,4 +50,4 @@
       }
     }
   }
-}
+}

+ 44 - 28
houtai/src/pages/A3User/index.tsx

@@ -186,38 +186,44 @@ function A3User() {
     [tableInfo.list.length]
   );
 
-  const [ isBorder ] = useState(true)
+  const [isBorder] = useState(true);
   const columns = useMemo(() => {
     return [
       {
-        title: "账号名",
+        title: "用户名",
         dataIndex: "userName",
       },
+      // {
+      //   title: "用户昵称",
+      //   dataIndex: "nickName",
+      // },
+      // {
+      //   title: "真实姓名",
+      //   dataIndex: "realName",
+      // },
       {
-        title: "用户昵称",
-        dataIndex: "nickName",
-      },
-      {
-        title: "真实姓名",
-        dataIndex: "realName",
+        title: "角色",
+        render: (item: UserTableListType) => {
+          return <>{item.roleId === 1 ? "管理员" : "普通用户"}</>;
+        },
       },
       {
-        title: "注册时间",
+        title: "创建日期",
         dataIndex: "createTime",
       },
 
-      {
-        title: "启用状态",
-        render: (item: UserTableListType) => (
-          <Switch
-            disabled={item.isAdmin === 1}
-            checkedChildren="启用"
-            unCheckedChildren="停用"
-            checked={item.isEnabled === 1}
-            onChange={(val) => isEnabledClickFu(val, item.id!)}
-          />
-        ),
-      },
+      // {
+      //   title: "启用状态",
+      //   render: (item: UserTableListType) => (
+      //     <Switch
+      //       disabled={item.isAdmin === 1}
+      //       checkedChildren="启用"
+      //       unCheckedChildren="停用"
+      //       checked={item.isEnabled === 1}
+      //       onChange={(val) => isEnabledClickFu(val, item.id!)}
+      //     />
+      //   ),
+      // },
 
       {
         title: "操作",
@@ -231,7 +237,7 @@ function A3User() {
                 okText="重置"
                 cancelText="取消"
                 onConfirm={() => resetPassFu(item.id!)}
-                okButtonProps={{loading: false}}
+                okButtonProps={{ loading: false }}
               >
                 <Button size="small" type="text">
                   重置密码
@@ -250,7 +256,7 @@ function A3User() {
                 okText="删除"
                 cancelText="取消"
                 onConfirm={() => delTableFu(item.id!)}
-                okButtonProps={{loading: false}}
+                okButtonProps={{ loading: false }}
               >
                 <Button size="small" type="text" danger>
                   删除
@@ -261,14 +267,14 @@ function A3User() {
         },
       },
     ];
-  }, [delTableFu, isEnabledClickFu, openEditPageFu, resetPassFu]);
+  }, [delTableFu, openEditPageFu, resetPassFu]);
 
   return (
     <div className={styles.A3User}>
       <div className="userTop">
         <div className="pageTitle">后台账号</div>
         <div className="selectBox">
-          <div className="selectBoxRow">
+          {/* <div className="selectBoxRow">
             <span>用户昵称:</span>
             <Input
               key={inputKey}
@@ -278,7 +284,7 @@ function A3User() {
               allowClear
               onChange={(e) => nameChange(e)}
             />
-          </div>
+          </div> */}
 
           <div className="selectBoxRow">
             <span>真实姓名:</span>
@@ -302,9 +308,19 @@ function A3User() {
           </div>
 
           <div className="selectBoxRow">
-            &emsp;<Button style={{ borderRadius: '3px', boxShadow: 'none' }} onClick={resetSelectFu}>重置</Button>
             &emsp;
-            <Button type="primary" style={{ borderRadius: '3px', boxShadow:'none' }} onClick={() => openEditPageFu(0)}>
+            <Button
+              style={{ borderRadius: "3px", boxShadow: "none" }}
+              onClick={resetSelectFu}
+            >
+              重置
+            </Button>
+            &emsp;
+            <Button
+              type="primary"
+              style={{ borderRadius: "3px", boxShadow: "none" }}
+              onClick={() => openEditPageFu(0)}
+            >
               新增
             </Button>
           </div>

+ 1 - 1
houtai/src/pages/A4Prize/index.module.scss

@@ -32,7 +32,7 @@
       .tableBox1 {
         border-radius: 4px;
         overflow: hidden;
-        margin-top: -10px;
+        margin-top: 3%;
         // height: calc(100% - 80px);
         // background-color: #fff;
         padding: 0px;

+ 5 - 0
houtai/src/pages/A5Exchange/index.module.scss

@@ -3,11 +3,16 @@
     .logTop {
       border-radius: 10px;
       background-color: #fff;
+      .pageTitle{
+        margin-top: 10px;
+      }
 
       .tableSelectBox {
         padding: 15px 24px;
         display: flex;
         align-items: center;
+        margin-top: 2%;
+
 
         .row {
           margin-right: 20px;

+ 9 - 9
houtai/src/pages/A5Exchange/index.tsx

@@ -1,10 +1,10 @@
 import { RootState } from "@/store";
-import { getLogListAPI } from "@/store/action/A7Log";
 import { Input, DatePicker, Table, Button } from "antd";
 import React, { useEffect, useMemo, useRef, useState } from "react";
 import { useDispatch, useSelector } from "react-redux";
 
 import styles from "./index.module.scss";
+import { getExchangeListAPI } from "@/store/action/A5Exchange";
 
 const { RangePicker } = DatePicker;
 
@@ -57,7 +57,7 @@ function A5Exchange() {
   useEffect(() => {
     pageNumRef.current = tableSelect.pageNum;
     pagePageRef.current = tableSelect.pageSize;
-    dispatch(getLogListAPI(tableSelect));
+    dispatch(getExchangeListAPI(tableSelect));
   }, [dispatch, tableSelect]);
 
   // ---------关于表格
@@ -69,7 +69,7 @@ function A5Exchange() {
     setTableSelect({ ...tableSelect, pageNum, pageSize });
   };
 
-  const results = useSelector((state: RootState) => state.A7Log.tableInfo);
+  const results = useSelector((state: RootState) => state.A5Exchange.tableInfo);
 
   const columns = useMemo(() => {
     return [
@@ -81,7 +81,7 @@ function A5Exchange() {
       // },
       {
         title: "用户名",
-        dataIndex: "userName",
+        dataIndex: "creatorName",
       },
       {
         title: "兑换日期",
@@ -89,19 +89,19 @@ function A5Exchange() {
       },
       {
         title: "兑换奖品",
-        dataIndex: "ip",
+        dataIndex: "prizeName",
       },
       {
         title: "积分记录",
-        dataIndex: "type",
+        dataIndex: "score",
       },
       {
         title: "称呼",
-        dataIndex: "description",
+        dataIndex: "name",
       },
       {
         title: "联系方式",
-        dataIndex: "description",
+        dataIndex: "phone",
       },
       {
         title: "地址和留言",
@@ -112,8 +112,8 @@ function A5Exchange() {
 
   return (
     <div className={styles.A5Exchange}>
-      <div className="pageTitle">兑换记录</div>
       <div className="logTop">
+        <div className="pageTitle">兑换记录</div>
         <div className="tableSelectBox">
           <div className="row">
             <span>用户名:</span>

+ 9 - 2
houtai/src/pages/A6IDUser/IntegralEdit/index.module.scss

@@ -7,6 +7,7 @@
 
   :global {
     .pageTitle {
+      width: 100%;
       font-size: 25px;
       display: flex;
       justify-content: space-between;
@@ -22,12 +23,18 @@
 
     .tableMain {
       border-radius: 10px;
-      height: calc(100%);
+      height: 92%;
+      margin-top: 5%;
       background-color: #fff;
+      ::-webkit-scrollbar {
+        /*滚动条整体样式*/
+        width: 0;
+        /*高宽分别对应横竖滚动条的尺寸*/
+        height: 0;
+      }
 
       .ant-table-body {
         height: 500px;
-
       }
     }
   }

+ 32 - 26
houtai/src/pages/A6IDUser/IntegralEdit/index.tsx

@@ -1,4 +1,3 @@
-import { RootState } from "@/store";
 import { Button, Form, Input, Modal, Popconfirm, Table } from "antd";
 import React, {
   useCallback,
@@ -13,17 +12,18 @@ import styles from "./index.module.scss";
 import {
   IDUserScoreSaveAPI,
   getIDUserInfoByIdAPI,
+  getIDUserListAPI,
 } from "@/store/action/A6IDUser";
-import { IDUserType, SaveIDUserScoreType } from "@/types";
+import { IDUserTableType, IDUserType, SaveIDUserScoreType } from "@/types";
 import { MessageFu } from "@/utils/message";
+import { RootState } from "@/store";
 type Props = {
-  id: number; //用户id
+  currentItem: IDUserTableType;
   closeFu: () => void;
 };
 
-function IntegralEdit({ id,closeFu }: Props) {
+function IntegralEdit({ currentItem, closeFu }: Props) {
   const dispatch = useDispatch();
-
   const pageNumRef = useRef(1);
   const pagePageRef = useRef(10);
   // 筛选和分页
@@ -35,24 +35,23 @@ function IntegralEdit({ id,closeFu }: Props) {
     endTime: "",
   });
 
-  // 获取当前用户信息
-  const [curIDUser, setCurIDUser] = useState<IDUserType>({
-    id: 1,
-    name: "用户1",
-  } as IDUserType);
+  const [results, setResults] = useState<IDUserType[]>([]);
 
   const getInfoById = useCallback(async () => {
-    const res = await getIDUserInfoByIdAPI(id);
+    const res = await getIDUserInfoByIdAPI(currentItem.id);
     if (res.code === 0) {
-      setCurIDUser(res.data);
+      setResults(res.data);
     }
-  }, [id]);
+  }, [currentItem.id]);
+
+  const [currentItemShow, setCurrentItemShow] = useState<IDUserTableType>();
 
   useEffect(() => {
+    setCurrentItemShow(currentItem);
     pageNumRef.current = tableSelect.pageNum;
     pagePageRef.current = tableSelect.pageSize;
     getInfoById();
-  }, [dispatch, getInfoById, tableSelect]);
+  }, [currentItem, dispatch, getInfoById, tableSelect]);
 
   // ---------关于表格
 
@@ -63,8 +62,6 @@ function IntegralEdit({ id,closeFu }: Props) {
     setTableSelect({ ...tableSelect, pageNum, pageSize });
   };
 
-  const results = useSelector((state: RootState) => state.A7Log.tableInfo);
-
   const columns = useMemo(() => {
     return [
       {
@@ -77,7 +74,7 @@ function IntegralEdit({ id,closeFu }: Props) {
       },
       {
         title: "积分",
-        dataIndex: "type",
+        dataIndex: "score",
       },
       {
         title: "说明",
@@ -89,28 +86,36 @@ function IntegralEdit({ id,closeFu }: Props) {
   // 修改积分弹窗开关
   const [editIntegralVisible, setEditIntegralVisible] = useState(false);
   const [form] = Form.useForm();
+  const resultss = useSelector((state: RootState) => state.A6IDUser.tableInfo);
 
   const onFinish = useCallback(
     async (values: any) => {
-      if (values.numberVal) {
-        const res: any = await IDUserScoreSaveAPI({} as SaveIDUserScoreType);
+      if (values) {
+        const res: any = await IDUserScoreSaveAPI({
+          description: values.description,
+          userId: currentItem.id,
+          score: values.score,
+          type: "编辑",
+        });
         if (res.code === 0) {
           MessageFu.success("提交成功!");
           pageNumRef.current = tableSelect.pageNum;
           pagePageRef.current = tableSelect.pageSize;
           getInfoById();
+          dispatch(getIDUserListAPI(tableSelect));
+          setCurrentItemShow({...currentItem,score: Number(currentItem.score) + Number(values.score)});
           setEditIntegralVisible(false);
         }
       }
     },
-    [getInfoById, tableSelect.pageNum, tableSelect.pageSize]
+    [currentItem, dispatch, getInfoById, tableSelect]
   );
 
   return (
     <div className={styles.IntegralEdit}>
       <div className="pageTitle">
-        <div>{curIDUser.name}</div>
-        <div>当前积分:5000</div>
+        <div>{currentItemShow?.userName}</div>
+        <div>当前积分:{currentItemShow?.score}</div>
         <div>
           <Button
             className="scoreLimitBtn"
@@ -135,7 +140,7 @@ function IntegralEdit({ id,closeFu }: Props) {
       <div className="tableMain">
         <Table
           scroll={{ y: 625 }}
-          dataSource={results.list}
+          dataSource={results}
           columns={columns}
           rowKey="id"
           pagination={{
@@ -144,7 +149,7 @@ function IntegralEdit({ id,closeFu }: Props) {
             showSizeChanger: true,
             current: tableSelect.pageNum,
             pageSize: tableSelect.pageSize,
-            total: results.total,
+            total: results.length,
             onChange: paginationChange,
           }}
         />
@@ -170,12 +175,12 @@ function IntegralEdit({ id,closeFu }: Props) {
         >
           <Form.Item
             label="积分变动"
-            name="numberVal"
+            name="score"
             style={{ marginTop: "40px" }}
             rules={[{ required: true, message: "不能为空!" }]}
             hide-required-asterisk={true}
             getValueFromEvent={(e) =>
-              e.target.value.replace(/^(0+)|[^\d]+/g, "")
+              e.target.value.replace(/[-]?^|[^\d]+/g, "")
             }
           >
             <Input
@@ -186,6 +191,7 @@ function IntegralEdit({ id,closeFu }: Props) {
           </Form.Item>
           <Form.Item
             label="积分原因"
+            name="description"
             style={{ marginTop: "40px" }}
             hide-required-asterisk={true}
           >

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

@@ -4,10 +4,15 @@
       border-radius: 10px;
       background-color: #fff;
 
+      .pageTitle{
+        margin-top: 10px;
+      }
+
       .tableSelectBox {
         padding: 15px 24px;
         display: flex;
         align-items: center;
+        margin-top: 2%;
 
         .row {
           margin-right: 20px;

+ 58 - 18
houtai/src/pages/A6IDUser/index.tsx

@@ -1,6 +1,5 @@
 import { RootState } from "@/store";
-import { getLogListAPI } from "@/store/action/A7Log";
-import { Input, DatePicker, Table, Button, Popconfirm } from "antd";
+import { Input, DatePicker, Table, Button, Popconfirm, Switch } from "antd";
 import React, {
   useCallback,
   useEffect,
@@ -9,10 +8,15 @@ import React, {
   useState,
 } from "react";
 import { useDispatch, useSelector } from "react-redux";
-import history from "@/utils/history";
 import styles from "./index.module.scss";
 import { IDUserTableType } from "@/types/api/A6IDUser";
 import IntegralEdit from "./IntegralEdit";
+import {
+  IDUserPassResetAPI,
+  IDUserStateChangeAPI,
+  getIDUserListAPI,
+} from "@/store/action/A6IDUser";
+import { MessageFu } from "@/utils/message";
 
 const { RangePicker } = DatePicker;
 
@@ -62,15 +66,15 @@ function A6IDUser() {
     });
   };
 
-  // 点击跳转
-  const pathCutFu = useCallback((path: string) => {
-    history.push(path);
-  }, []);
+  // // 点击跳转
+  // const pathCutFu = useCallback((path: string) => {
+  //   history.push(path);
+  // }, []);
 
   useEffect(() => {
     pageNumRef.current = tableSelect.pageNum;
     pagePageRef.current = tableSelect.pageSize;
-    dispatch(getLogListAPI(tableSelect));
+    dispatch(getIDUserListAPI(tableSelect));
   }, [dispatch, tableSelect]);
 
   // ---------关于表格
@@ -86,10 +90,32 @@ function A6IDUser() {
     id: 0,
   } as IDUserTableType);
 
-  const results = useSelector((state: RootState) => state.A7Log.tableInfo);
+  const results = useSelector((state: RootState) => state.A6IDUser.tableInfo);
 
   const [editPageShow, setEditPageShow] = useState(false);
 
+  // 点击重置密码
+  const resetPassFu = useCallback(async (id: number) => {
+    const res: any = await IDUserPassResetAPI(id);
+    if (res.code === 0) MessageFu.success("重置成功!");
+  }, []);
+
+  // 切换表格中的启用停用状态
+  const IDUserStateChange = useCallback(
+    async (id: number, num: number) => {
+      const res = await IDUserStateChangeAPI(id, num);
+      if (res.code === 0) {
+        MessageFu.success(`成功${num === 0 ? "设为" : "取消"}黑名单`);
+        pageNumRef.current = tableSelect.pageNum;
+        pagePageRef.current = tableSelect.pageSize;
+        dispatch(getIDUserListAPI(tableSelect));
+      } else {
+        MessageFu.success(`操作失败`);
+      }
+    },
+    [dispatch, tableSelect]
+  );
+
   const columns = useMemo(() => {
     return [
       {
@@ -98,19 +124,22 @@ function A6IDUser() {
       },
       {
         title: "手机号",
-        dataIndex: "createTime",
+        dataIndex: "phone",
       },
       {
         title: "创建日期",
-        dataIndex: "ip",
+        dataIndex: "createTime",
       },
       {
         title: "状态",
-        dataIndex: "description",
+        // dataIndex: "isEnabled",
+        render: (item: IDUserTableType) => (
+          <div>{item.isEnabled === 0 ? "禁用" : "启用"}</div>
+        ),
       },
       {
         title: "当前积分",
-        dataIndex: "description",
+        dataIndex: "score",
       },
       {
         title: "操作",
@@ -131,29 +160,37 @@ function A6IDUser() {
                 title="是否将密码重置为123456?"
                 okText="确认"
                 cancelText="取消"
+                onConfirm={() => resetPassFu(item.id!)}
                 okButtonProps={{ loading: false }}
               >
                 <Button type="text">重置密码</Button>
               </Popconfirm>
               <Popconfirm
-                title="是否将用户设为黑名单"
+                title={`是否将用户${
+                  item.isEnabled === 0 ? "取消" : "设为"
+                }黑名单`}
                 okText="确认"
                 cancelText="取消"
+                onConfirm={() => {
+                  IDUserStateChange(item.id, item.isEnabled === 0 ? 1 : 0);
+                }}
                 okButtonProps={{ loading: false }}
               >
-                <Button type="text">设为黑名单</Button>
+                <Button type="text">
+                  {item.isEnabled === 0 ? "取消黑名单" : "设为黑名单"}
+                </Button>
               </Popconfirm>
             </>
           );
         },
       },
     ];
-  }, []);
+  }, [IDUserStateChange, resetPassFu]);
 
   return !editPageShow ? (
     <div className={styles.A6IDUser}>
-      <div className="pageTitle">用户管理</div>
       <div className="logTop">
+        <div className="pageTitle">用户管理</div>
         <div className="tableSelectBox">
           <div className="row">
             <span>用户名:</span>
@@ -203,7 +240,10 @@ function A6IDUser() {
       </div>
     </div>
   ) : (
-    <IntegralEdit id={currentItem.id} closeFu={() => setEditPageShow(false)} />
+    <IntegralEdit
+      currentItem={currentItem}
+      closeFu={() => setEditPageShow(false)}
+    />
   );
 }
 

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

@@ -4,10 +4,16 @@
       border-radius: 10px;
       background-color: #fff;
 
+      .pageTitle {
+        margin-top: 10px;
+      }
+
       .tableSelectBox {
         padding: 15px 24px;
         display: flex;
         align-items: center;
+        margin-top: 2%;
+
 
         .row {
           margin-right: 20px;

+ 1 - 1
houtai/src/pages/C7Log/index.tsx

@@ -91,8 +91,8 @@ function C2Log() {
 
   return (
     <div className={styles.C2Log}>
-      <div className="pageTitle">系统日志</div>
       <div className="logTop">
+        <div className="pageTitle">系统日志</div>
         <div className="tableSelectBox">
           <div className="row">
             <span>操作者:</span>

+ 3 - 3
houtai/src/pages/Layout/index.module.scss

@@ -160,14 +160,14 @@
           .active {
             pointer-events: none;
             opacity: 1;
-            color: #19CBFF;
+            color: #ffffffF;
             background-color: var(--themeColor);
 
             > div::before {
               content: "";
               width: 6px;
               height:6px;
-              background-color: #19CBFF;
+              background-color: #ffffffF;
               display: inline-table;
               margin-right: 15px;
               vertical-align: middle;
@@ -179,7 +179,7 @@
               content: "";
               width: 6px;
               height:6px;
-              background-color: #19CBFF;
+              background-color: #ffffffF;
               display: inline-table;
               margin-left: 15px;
               vertical-align: middle;

+ 19 - 9
houtai/src/store/action/A1Rule.ts

@@ -5,17 +5,27 @@ import { SaveRuleType, SaveScoreLimitType } from "@/types";
 /**
  * 获取游戏规则列表
  */
-export const getRuleAPI = () => {
+export const getRuleAPI = (type: string) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.get(`cms/share/detail/museum_cctv_mianyan`);
+    const res = await http.get(`cms/rule/getList?type=${type}`);
     if (res.code === 0) {
-      const data = res.data;
-      dispatch({ type: "rules/getList", payload: data });
+      const obj = {
+        list: res.data,
+        total: res.data.length,
+      };
+      dispatch({ type: "rules/getList", payload: obj });
     }
   };
 };
 
 /**
+ * 获取线上展厅列表
+ */
+export const getOnlineRuleAPI = (type: string) => {
+  return http.get(`cms/rule/getList?type=${type}`);
+};
+
+/**
  * 修改游戏规则
  */
 export const ruleSaveAPI = (data: SaveRuleType) => {
@@ -26,14 +36,14 @@ export const ruleSaveAPI = (data: SaveRuleType) => {
  * 获取游戏info
  */
 export const getRuleInfoByIdAPI = (id: number) => {
-  return http.get(`sys/user/detail/${id}`);
+  return http.get(`cms/rule/detail/${id}`);
 };
 
 /**
  * 获得每日积分上限
  */
-export const getScoreLimitAPI = () => {
-  return http.get("sys/user/save");
+export const getScoreLimitAPI = (id: number) => {
+  return http.get(`cms/rule/detail/${id}`);
 };
 
 /**
@@ -46,6 +56,6 @@ export const scoreLimitSaveAPI = (data: SaveScoreLimitType) => {
 /**
  * 获取助农课堂题目列表
  */
-export const getTopicByZhuNongKeTangAPI = (data: any) => {
-  return http.post("sys/log/list", data);
+export const getTopicByZhuNongKeTangAPI = () => {
+  return http.get("cms/question/getList");
 };

+ 9 - 13
houtai/src/store/action/A2Integral.ts

@@ -2,22 +2,18 @@ import http from "@/utils/http";
 import { AppDispatch } from "..";
 // import { AxiosRequestConfig } from "axios";
 /**
- * 获取浏览量信息
+ * 获取积分记录列表数据
  */
-export const getShareAPI = () => {
+export const getIntegralListAPI = (data: any) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.get(`cms/share/detail/museum_cctv_mianyan`);
+    const res = await http.post(`cms/pointLog/pageList`,data);
     if (res.code === 0) {
-      const data = res.data;
-      dispatch({ type: "Share/getShare", payload: data });
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+      console.log(obj);
+      dispatch({ type: "integral/getShare", payload: obj });
     }
   };
 };
-
-/**
- * 提交参与者基数
- */
-export const shareEditAPI = (data: any) => {
-  // return http.post(`/cms/share/save/`, data);
-  return http.post(`cms/share/edit/`, data);
-};

+ 4 - 4
houtai/src/store/action/A5Log.ts

@@ -1,17 +1,17 @@
 import http from "@/utils/http";
 import { AppDispatch } from "..";
 /**
- * 获取日志表格列表
+ * 获取兑换记录表格数据
  */
-export const getLogListAPI = (data: any) => {
+export const getExchangeListAPI = (data: any) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.post("sys/log/list", data);
+    const res = await http.post("cms/redeem/pageList", data);
     if (res.code === 0) {
       const obj = {
         list: res.data.records,
         total: res.data.total,
       };
-      dispatch({ type: "log/getList", payload: obj });
+      dispatch({ type: "exchange/getList", payload: obj });
     }
   };
 };

+ 20 - 5
houtai/src/store/action/A6IDUser.ts

@@ -2,11 +2,11 @@ import http from "@/utils/http";
 import { AppDispatch } from "..";
 import { SaveIDUserScoreType } from "@/types";
 /**
- * 获取日志表格列表
+ * 获取用户列表
  */
 export const getIDUserListAPI = (data: any) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.post("sys/log/list", data);
+    const res = await http.post("cms/user/pageList", data);
     if (res.code === 0) {
       const obj = {
         list: res.data.records,
@@ -18,10 +18,17 @@ export const getIDUserListAPI = (data: any) => {
 };
 
 /**
- * 用户-获得用户积分记录
+ * 切换用户账号状态
+ */
+export const IDUserStateChangeAPI = (id:number,num:number) => {
+  return http.get(`cms/user/isEnabled/${id}/${num}`);
+};
+
+/**
+ * 用户-获得用户积分记录列表
  */
 export const getIDUserInfoByIdAPI = (id: number) => {
-  return http.get(`sys/user/editStatus/${id}`);
+  return http.get(`cms/user/point/getList/${id}`);
 };
 
 
@@ -29,5 +36,13 @@ export const getIDUserInfoByIdAPI = (id: number) => {
  * 保存用户积分修改
  */
 export const IDUserScoreSaveAPI = (data: SaveIDUserScoreType) => {
-  return http.post("sys/user/save", data);
+  return http.post("cms/user/point/add", data);
+};
+
+
+/**
+ * 重置密码
+ */
+export const IDUserPassResetAPI = (id: number) => {
+  return http.get(`cms/user/reset/pass/${id}`);
 };

+ 9 - 9
houtai/src/store/action/TopicSetting.ts

@@ -5,15 +5,15 @@ import { SaveRuleType, SaveScoreLimitType } from "@/types";
 /**
  * 获取游戏规则列表
  */
-export const getRuleAPI = () => {
-  return async (dispatch: AppDispatch) => {
-    const res = await http.get(`cms/share/detail/museum_cctv_mianyan`);
-    if (res.code === 0) {
-      const data = res.data;
-      dispatch({ type: "rules/getList", payload: data });
-    }
-  };
-};
+// export const getRuleAPI = () => {
+//   return async (dispatch: AppDispatch) => {
+//     const res = await http.get(`cms/share/detail/museum_cctv_mianyan`);
+//     if (res.code === 0) {
+//       const data = res.data;
+//       dispatch({ type: "rules/getList", payload: data });
+//     }
+//   };
+// };
 
 /**
  * 修改游戏规则

+ 1 - 1
houtai/src/store/reducer/A1Rule.ts

@@ -17,7 +17,7 @@ type GoodsActionType = {
 
 
 // 频道 reducer
-export default function goodsReducer(
+export default function RulesReducer(
   state = initState,
   action: GoodsActionType
 ) {

+ 9 - 6
houtai/src/store/reducer/A2Integral.ts

@@ -3,21 +3,24 @@ import { IntegralTableAPIType } from "@/types";
 // 初始化状态
 const initState = {
   // 分享数据
-  shareInfo: {} as IntegralTableAPIType,
+  tableInfo: {
+    list: [] as IntegralTableAPIType[],
+    total: 0,
+  },
 };
 
 // 定义 action 类型
 type ShareActionType = {
-  type: "Share/getShare";
-  payload: IntegralTableAPIType;
+  type: "integral/getShare";
+  payload: { list: IntegralTableAPIType[]; total: number };
 };
 
 // 频道 reducer
-export default function ShareReducer(state = initState, action: ShareActionType) {
+export default function IntegralReducer(state = initState, action: ShareActionType) {
   switch (action.type) {
     // 获取分享数据
-    case "Share/getShare":
-      return { ...state, shareInfo: action.payload };
+    case "integral/getShare":
+      return { ...state, tableInfo: action.payload };
     default:
       return state;
   }

+ 1 - 1
houtai/src/store/reducer/A4Prise.ts

@@ -16,7 +16,7 @@ type GoodsActionType = {
 };
 
 // 频道 reducer
-export default function goodsReducer(
+export default function PrizeReducer(
   state = initState,
   action: GoodsActionType
 ) {

+ 31 - 0
houtai/src/store/reducer/A5Exchange.ts

@@ -0,0 +1,31 @@
+import { ExchangeTableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as ExchangeTableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type GoodsActionType = {
+  type: "exchange/getList";
+  payload: { list: ExchangeTableType[]; total: number };
+};
+
+
+// 频道 reducer
+export default function ExchangeReducer(
+  state = initState,
+  action: GoodsActionType
+) {
+  switch (action.type) {
+    // 获取列表数据
+    case "exchange/getList":
+      return { ...state, tableInfo: action.payload };
+    default:
+      return state;
+  }
+}

+ 1 - 1
houtai/src/store/reducer/A6IDUser.ts

@@ -16,7 +16,7 @@ type IDUserActionType = {
 };
 
 // 频道 reducer
-export default function logReducer(state = initState, action: IDUserActionType) {
+export default function IDUserReducer(state = initState, action: IDUserActionType) {
   switch (action.type) {
     // 获取列表数据
     case "iduser/getList":

+ 2 - 2
houtai/src/store/reducer/TopicSetting.ts

@@ -11,7 +11,7 @@ const initState = {
 
 // 定义 action 类型
 type GoodsActionType = {
-  type: "rules/getList";
+  type: "ruless/getList";
   payload: { list: RulesTableType[]; total: number };
 };
 
@@ -23,7 +23,7 @@ export default function goodsReducer(
 ) {
   switch (action.type) {
     // 获取列表数据
-    case "rules/getList":
+    case "ruless/getList":
       return { ...state, tableInfo: action.payload };
     default:
       return state;

+ 4 - 2
houtai/src/store/reducer/index.ts

@@ -8,10 +8,11 @@ import A0Layout from './layout'
 import A3User from './A3User'
 import A4Prise from './A4Prise'
 import TopicSetting from './TopicSetting'
-
 import A6IDUser from './A6IDUser'
 import A7Log from './A7Log'
 import A2Integral from './A2Integral'
+import A5Exchange from './A5Exchange'
+
 
 // 合并 reducer
 const rootReducer = combineReducers({
@@ -22,7 +23,8 @@ const rootReducer = combineReducers({
   A7Log,
   A2Integral,
   TopicSetting,
-  A6IDUser
+  A6IDUser,
+  A5Exchange
 })
 
 // 默认导出

+ 28 - 29
houtai/src/types/api/A1Rule.ts

@@ -3,23 +3,13 @@ export type RulesTableType = {
   creatorId: number;
   creatorName: string;
   description: string;
-  dictAge: string;
-  dictLevel: string;
-  dictSource: string;
-  dictTexture: string;
-  dirCode: string;
-  display: number;
-  fileIds: string;
   id: number;
-  isBarrage: number;
   name: string;
-  num: string;
-  thumb: string;
-  topic: string;
+  rtf: string;
+  score: number;
+  second: number;
   type: string;
   updateTime: string;
-  tagType?: string;
-  tagCountry?: string;
 };
 
 export type FileListType = {
@@ -37,21 +27,30 @@ export type FileImgListType = {
   filePath: string;
 };
 
+export type SaveRuleType = {
+  id: number | null;
+  userName: string;
+  nickName: string;
+  roleId: number;
+  realName: string;
+};
 
+export type SaveScoreLimitType = {
+  id: number | null;
+  userName: string;
+  nickName: string;
+  roleId: number;
+  realName: string;
+};
 
-export type SaveRuleType ={
-  id:number|null
-  userName:string
-  nickName:string
-  roleId:number
-  realName:string
-}
-
-
-export type SaveScoreLimitType ={
-  id:number|null
-  userName:string
-  nickName:string
-  roleId:number
-  realName:string
-}
+// 题目数据类型
+export type QuestionTableType = {
+  answer: string;
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  description: string;
+  id: number;
+  question: string;
+  updateTime: string;
+};

+ 3 - 24
houtai/src/types/api/A2Integral.ts

@@ -2,30 +2,9 @@ export type IntegralTableAPIType = {
   createTime: string;
   creatorId: number;
   creatorName: string;
+  description: string;
   id: number;
-  pcsBooth: number;
-  pcsExhibits: number;
-  pcsShare: number;
-  pcsStar: number;
-  pcsStarShow: number;
-  pcsVisit: number;
-  pcsVisitShow: number;
-  pcsArea: number;
-  sceneCode: string;
-  updateTime: string;
-  explain: string;
+  score: number;
   type: string;
+  updateTime: string;
 };
-// export type ShareDataAPIType = {
-//   createTime: string;
-//   creatorId: number;
-//   creatorName: string;
-//   id: number;
-//   moduleId: number;
-//   moduleType: string;
-//   pcsShow: number;
-//   pcsStar: number;
-//   pcsVisit: number;
-//   today: string;
-//   updateTime: string;
-// };

+ 24 - 0
houtai/src/types/api/A5Exchange.d.ts

@@ -0,0 +1,24 @@
+export type ExchangeTableType = {
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  description: string;
+  dictAge: string;
+  dictLevel: string;
+  dictSource: string;
+  dictTexture: string;
+  dirCode: string;
+  display: number;
+  fileIds: string;
+  id: number;
+  isBarrage: number;
+  name: string;
+  num: string;
+  thumb: string;
+  topic: string;
+  type: string;
+  updateTime: string;
+  tagType?: string;
+  tagCountry?: string;
+};
+

+ 31 - 0
houtai/src/types/api/A6IDUser.d.ts

@@ -0,0 +1,31 @@
+export type IDUserTableType = {
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  id: number;
+  isEnabled: number;
+  phone: string;
+  realName: string;
+  score: number;
+  sex: string;
+  updateTime: string;
+  userName: string;
+};
+
+export type IDUserType = {
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  description: string;
+  id: number;
+  score: number;
+  type: string;
+  updateTime: string;
+};
+
+export type SaveIDUserScoreType = {
+  description: string;
+  score: number;
+  type: string;
+  userId: number;
+};

+ 0 - 38
houtai/src/types/api/A6IDUser.ts

@@ -1,38 +0,0 @@
-export type IDUserTableType = {
-  createTime: string;
-  creatorId: null;
-  creatorName: string;
-  description: string;
-  id: number;
-  ip: string;
-  type: string;
-  updateTime: null;
-  userName: string;
-}
-
-
-export type IDUserType = {
-  createTime: string;
-  creatorId: null;
-  creatorName: string;
-  description: string;
-  id: number;
-  ip: string;
-  type: string;
-  updateTime: null;
-  userName: string;
-  name: string;
-}
-
-export type SaveIDUserScoreType = {
-  createTime: string;
-  creatorId: null;
-  creatorName: string;
-  description: string;
-  id: number;
-  ip: string;
-  type: string;
-  updateTime: null;
-  userName: string;
-  name: string;
-}

houtai/src/types/api/A5Log.d.ts → houtai/src/types/api/A7Log.d.ts


+ 2 - 1
houtai/src/types/index.d.ts

@@ -5,8 +5,9 @@ export * from './api/A2Integral'
 export * from './api/A3User'
 export * from './api/A4Role'
 export * from './api/A4Prize'
-export * from './api/A5Log'
+export * from './api/A5Exchange'
 export * from './api/A6IDUser'
+export * from './api/A7Log'
 export * from './api/A2Integral'
 
 

+ 1 - 1
houtai/src/utils/http.ts

@@ -8,7 +8,7 @@ import { domShowFu } from "./domShow";
 export const baseURL =
   // 线下的图片地址需要加上/api/
   process.env.NODE_ENV === "development"
-    ? "https://sit-likecount.4dage.com/api2/"
+    ? "http://192.168.20.61:8063/api/"
     : "";
   // process.env.NODE_ENV === "development" ? "https://kbhyzl.mianyang.cn" : "";
 

+ 10 - 10
zhengquan/public/staticData/data.js

@@ -117,16 +117,16 @@ const dataAll = {
       intro: '医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助医疗援助',
       xuliezhen: {
         greeting: {
-          zhenShu: 36,
-          duration: '1.12s'
+          zhenShu: 60,
+          duration: '2.12s'
         },
         talk: {
-          zhenShu: 96,
-          duration: '4s'
+          zhenShu: 120,
+          duration: '5s'
         },
         idle: {
-          zhenShu: 48,
-          duration: '2s'
+          zhenShu: 60,
+          duration: '2.12s'
         }
       }
     },
@@ -139,12 +139,12 @@ const dataAll = {
       intro: '应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾应急救灾',
       xuliezhen: {
         greeting: {
-          zhenShu: 36,
-          duration: '1.12s'
+          zhenShu:  48,
+          duration: '2s'
         },
         talk: {
-          zhenShu: 96,
-          duration: '4s'
+          zhenShu: 120,
+          duration: '5s'
         },
         idle: {
           zhenShu: 48,