aamin пре 1 година
родитељ
комит
343a9b1202

+ 3 - 1
houtai/src/pages/A2Integral/index.tsx

@@ -118,7 +118,9 @@ function A2Integral() {
       {
         title: "说明",
         render: (item: IntegralTableAPIType) => {
-          return <>{item.description}</>;
+          return (
+            <>{item.type === "奖品兑换" ? item.prizeName : item.description}</>
+          );
         },
       },
     ];

+ 252 - 133
houtai/src/pages/A4Prize/index.tsx

@@ -30,7 +30,6 @@ import {
 } from "@/store/action/A4Prise";
 import { MessageFu } from "@/utils/message";
 import { RangePickerProps } from "antd/es/date-picker";
-import { RcFile } from "antd/es/upload";
 import RichText from "@/components/Z_RichText";
 import moment from "moment";
 import UpFileOne from "@/components/Z_upFileOne";
@@ -82,7 +81,9 @@ function A4Prize() {
           setCover(res.data.thumb);
           setDirCode(res.data.id);
           // 调用富文本子组件的函数,回显数据
-          richTxtRef.current.ritxtShowFu(res.data.rtf);
+          if (res.data.name !== "公益合伙人证书") {
+            richTxtRef.current.ritxtShowFu(res.data.rtf);
+          }
         }
       } else {
         setModalType("add");
@@ -149,6 +150,31 @@ function A4Prize() {
     [cover, curEditItem, form, getList, modalType]
   );
 
+  const onFinishForZhengShu = useCallback(
+    async (values: any) => {
+      if (values) {
+        setCheck(true);
+
+        const obj = {
+          ...values,
+          id: curEditItem && modalType !== "add" ? curEditItem.id : null,
+          thumb: curEditItem?.thumb,
+          rtf: curEditItem?.rtf,
+        };
+
+        const res: any = await editPrizeByIdAPI(obj);
+        if (res.code === 0) {
+          MessageFu.success("提交成功!");
+          getList();
+          setEditPageVisible(false);
+        }
+      }
+      form.resetFields();
+      setCover("");
+    },
+    [curEditItem, form, getList, modalType]
+  );
+
   const handleChange = (value: string) => {
     // console.log(`selected ${value}`);
   };
@@ -176,11 +202,17 @@ function A4Prize() {
       },
       {
         title: "库存",
-        dataIndex: "stock",
+        // dataIndex: "stock",
+        render: (item: PrizeTableType) => (
+          <div>{item.name === "公益合伙人证书" ? "-" : item.stock}</div>
+        ),
       },
       {
         title: "登记日期",
-        dataIndex: "updateTime",
+        // dataIndex: "updateTime",
+        render: (item: PrizeTableType) => (
+          <div>{item.name === "公益合伙人证书" ? "-" : item.updateTime}</div>
+        ),
       },
       {
         title: "状态",
@@ -191,7 +223,7 @@ function A4Prize() {
       {
         title: "操作",
         render: (item: PrizeTableType) => {
-          return (
+          return item.name !== "公益合伙人证书" ? (
             <>
               <Button
                 size="small"
@@ -215,6 +247,14 @@ function A4Prize() {
                 </Button>
               </Popconfirm>
             </>
+          ) : (
+            <Button
+              size="small"
+              type="text"
+              onClick={() => openEditPageFu(item.id)}
+            >
+              编辑
+            </Button>
           );
         },
       },
@@ -280,141 +320,220 @@ function A4Prize() {
           />
         </div>
       </div>
-      {/* 编辑/新增弹窗 */}
-      <Modal
-        destroyOnClose
-        closable={false}
-        maskClosable={false}
-        open={editPageVisible}
-        title={modalType === "add" ? "新增奖品" : "编辑奖品"}
-        width={1000}
-        onCancel={() => setEditPageVisible(false)}
-        footer={
-          [] // 设置footer为空,去掉 取消 确定默认按钮
-        }
-      >
-        <Form
-          form={form}
-          ref={FormBoxRef}
-          name="basic"
-          labelCol={{ span: 3 }}
-          onFinish={onFinish}
-          onFinishFailed={onFinishFailed}
-          autoComplete="off"
+      {curEditItem?.name === "公益合伙人证书" && modalType === "edit" ? (
+        <Modal
+          destroyOnClose
+          closable={false}
+          maskClosable={false}
+          open={editPageVisible}
+          title={"编辑奖品"}
+          width={1000}
+          onCancel={() => setEditPageVisible(false)}
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
         >
-          <Form.Item
-            label="奖品名称"
-            name="name"
-            rules={[{ required: true, message: "不能为空!" }]}
-          >
-            <Input maxLength={20} placeholder="请输入内容,不超过20个字" />
-          </Form.Item>
-          <Form.Item
-            label="所需的积分"
-            name="score"
-            rules={[{ required: true, message: "不能为空!" }]}
-            getValueFromEvent={(e) =>
-              e.target.value.replace(/^(0+)|[^\d]+/g, "")
-            }
-          >
-            <Input maxLength={5} placeholder="请输入正整数,1-99999" />
-          </Form.Item>
-          <Form.Item
-            label="库存"
-            name="stock"
-            rules={[{ required: true, message: "不能为空!" }]}
-            getValueFromEvent={(e) =>
-              e.target.value.replace(/^(0+)|[^\d]+/g, "")
-            }
-          >
-            <Input maxLength={5} placeholder="请输入正整数,1-99999" />
-          </Form.Item>
-          <Form.Item
-            label="登记日期"
-            name="date"
-            initialValue={moment() as any}
-            rules={[{ required: true, message: "不能为空!" }]}
+          <Form
+            form={form}
+            ref={FormBoxRef}
+            name="basic"
+            labelCol={{ span: 3 }}
+            onFinish={onFinishForZhengShu}
+            onFinishFailed={onFinishFailed}
+            autoComplete="off"
           >
-            <DatePicker showTime onChange={onChange} onOk={onOk} />
-          </Form.Item>
-          <Form.Item
-            label="状态"
-            name="isEnabled"
-            initialValue={curEditItem ? (curEditItem.stock > 0 ? 1 : 0) : 1}
-            rules={[{ required: true, message: "不能为空!" }]}
-          >
-            <Select
-              defaultValue={"上架"}
-              style={{ width: 120 }}
-              onChange={handleChange}
-              options={[
-                { value: 1, label: "上架" },
-                { value: 0, label: "下架" },
-              ]}
-            />
-          </Form.Item>
-          <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);
+            <Form.Item
+              label="奖品名称"
+              name="name"
+              rules={[{ required: true, message: "不能为空!" }]}
+            >
+              {curEditItem.name}
+            </Form.Item>
+            <Form.Item
+              label="所需的积分"
+              name="score"
+              rules={[{ required: true, message: "不能为空!" }]}
+              getValueFromEvent={(e) =>
+                e.target.value.replace(/^(0+)|[^\d]+/g, "")
+              }
+            >
+              <Input maxLength={5} placeholder="请输入正整数,1-99999" />
+            </Form.Item>
+            <Form.Item
+              label="状态"
+              name="isEnabled"
+              initialValue={curEditItem ? (curEditItem.stock > 0 ? 1 : 0) : 1}
+              rules={[{ required: true, message: "不能为空!" }]}
+            >
+              <Select
+                defaultValue={"上架"}
+                style={{ width: 120 }}
+                onChange={handleChange}
+                options={[
+                  { value: 1, label: "上架" },
+                  { value: 0, label: "下架" },
+                ]}
+              />
+            </Form.Item>
+            {/* 确定和取消按钮 */}
+            <br />
+            <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
+              <Button type="primary" htmlType="submit">
+                提交
+              </Button>
+              &emsp;
+              <Popconfirm
+                title="放弃编辑后,信息将不会保存!"
+                okText="放弃"
+                cancelText="取消"
+                onConfirm={() => {
+                  setEditPageVisible(false);
+                  form.resetFields();
+                  setCover("");
                 }}
-                isLook={false}
-                coverCheck={check}
-                size={2}
-                dirCode={dirCode}
-                checkTxt="请上传图片!"
+                okButtonProps={{ loading: false }}
+              >
+                <Button>取消</Button>
+              </Popconfirm>
+            </Form.Item>
+          </Form>
+        </Modal>
+      ) : (
+        <Modal
+          destroyOnClose
+          closable={false}
+          maskClosable={false}
+          open={editPageVisible}
+          title={modalType === "add" ? "新增奖品" : "编辑奖品"}
+          width={1000}
+          onCancel={() => setEditPageVisible(false)}
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
+        >
+          <Form
+            form={form}
+            ref={FormBoxRef}
+            name="basic"
+            labelCol={{ span: 3 }}
+            onFinish={onFinish}
+            onFinishFailed={onFinishFailed}
+            autoComplete="off"
+          >
+            <Form.Item
+              label="奖品名称"
+              name="name"
+              rules={[{ required: true, message: "不能为空!" }]}
+            >
+              <Input maxLength={20} placeholder="请输入内容,不超过20个字" />
+            </Form.Item>
+            <Form.Item
+              label="所需的积分"
+              name="score"
+              rules={[{ required: true, message: "不能为空!" }]}
+              getValueFromEvent={(e) =>
+                e.target.value.replace(/^(0+)|[^\d]+/g, "")
+              }
+            >
+              <Input maxLength={5} placeholder="请输入正整数,1-99999" />
+            </Form.Item>
+            <Form.Item
+              label="库存"
+              name="stock"
+              rules={[{ required: true, message: "不能为空!" }]}
+              getValueFromEvent={(e) =>
+                e.target.value.replace(/^(0+)|[^\d]+/g, "")
+              }
+            >
+              <Input maxLength={5} placeholder="请输入正整数,1-99999" />
+            </Form.Item>
+            <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="isEnabled"
+              initialValue={curEditItem ? (curEditItem.stock > 0 ? 1 : 0) : 1}
+              rules={[{ required: true, message: "不能为空!" }]}
+            >
+              <Select
+                defaultValue={"上架"}
+                style={{ width: 120 }}
+                onChange={handleChange}
+                options={[
+                  { value: 1, label: "上架" },
+                  { value: 0, label: "下架" },
+                ]}
               />
-            </div>
+            </Form.Item>
+            <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={2}
+                  dirCode={dirCode}
+                  checkTxt="请上传图片!"
+                />
+              </div>
 
-            {/* <span style={{ marginLeft: "14%" }}>
+              {/* <span style={{ marginLeft: "14%" }}>
               格式要求:支持png、jpg和jpeg的图片格式;最大支持2M;最多1张
             </span> */}
-          </Form.Item>
-          <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 />
-          <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
-            <Button type="primary" htmlType="submit">
-              提交
-            </Button>
-            &emsp;
-            <Popconfirm
-              title="放弃编辑后,信息将不会保存!"
-              okText="放弃"
-              cancelText="取消"
-              onConfirm={() => {
-                setEditPageVisible(false);
-                form.resetFields();
-                setCover("");
-              }}
-              okButtonProps={{ loading: false }}
-            >
-              <Button>取消</Button>
-            </Popconfirm>
-          </Form.Item>
-        </Form>
-      </Modal>
+            </Form.Item>
+            <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 />
+            <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
+              <Button type="primary" htmlType="submit">
+                提交
+              </Button>
+              &emsp;
+              <Popconfirm
+                title="放弃编辑后,信息将不会保存!"
+                okText="放弃"
+                cancelText="取消"
+                onConfirm={() => {
+                  setEditPageVisible(false);
+                  form.resetFields();
+                  setCover("");
+                }}
+                okButtonProps={{ loading: false }}
+              >
+                <Button>取消</Button>
+              </Popconfirm>
+            </Form.Item>
+          </Form>
+        </Modal>
+      )}
     </div>
   );
 }

+ 10 - 3
houtai/src/pages/A5Exchange/index.tsx

@@ -5,6 +5,7 @@ import { useDispatch, useSelector } from "react-redux";
 
 import styles from "./index.module.scss";
 import { getExchangeListAPI } from "@/store/action/A5Exchange";
+import { ExchangeTableType } from "@/types";
 
 const { RangePicker } = DatePicker;
 
@@ -97,15 +98,21 @@ function A5Exchange() {
       },
       {
         title: "称呼",
-        dataIndex: "name",
+        render: (item: ExchangeTableType) => (
+          <div>{item.name === "" ? "(空)" : item.name}</div>
+        ),
       },
       {
         title: "联系方式",
-        dataIndex: "phone",
+        render: (item: ExchangeTableType) => (
+          <div>{item.phone === "" ? "(空)" : item.phone}</div>
+        ),
       },
       {
         title: "地址和留言",
-        dataIndex: "description",
+        render: (item: ExchangeTableType) => (
+          <div>{item.description === "" ? "(空)" : item.description}</div>
+        ),
       },
     ];
   }, []);

+ 4 - 2
houtai/src/pages/A6IDUser/IntegralEdit/index.tsx

@@ -47,7 +47,6 @@ function IntegralEdit({ currentItem, closeFu }: Props) {
     }
 
     const ress = await getIDUserListAPI2({
-      isEnabled: 0,
       pageNum: 0,
       pageSize: 9999999,
       searchKey: "",
@@ -56,7 +55,10 @@ function IntegralEdit({ currentItem, closeFu }: Props) {
       const curItem = ress.data.records.find((item: any) => {
         return item.id === currentItem.id;
       });
-      setCurrentItemShow(curItem);
+      console.log('当前',ress.data.record)
+      if (curItem) {
+        setCurrentItemShow(curItem);
+      }
     }
   }, [currentItem.id]);
 

+ 1 - 0
houtai/src/types/api/A2Integral.ts

@@ -7,4 +7,5 @@ export type IntegralTableAPIType = {
   score: number;
   type: string;
   updateTime: string;
+  prizeName: string;
 };

+ 4 - 15
houtai/src/types/api/A5Exchange.d.ts

@@ -3,22 +3,11 @@ export type ExchangeTableType = {
   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;
+  phone: string;
+  prizeId: number;
+  prizeName: string;
+  score: number;
   updateTime: string;
-  tagType?: string;
-  tagCountry?: string;
 };
-

+ 20 - 15
zhengquan/src/views/Scene/ScenePage.vue

@@ -405,12 +405,24 @@ onMounted(() => {
 
   // 跳转到游戏兑换页面
   window.openPricePageFu = () => {
-    router.push({
-      path: 'homePageMo',
-      query: {
-        src: '/game/index.html#/shop-for-visitor'
-      }
-    })
+    // 未登录状态
+    if (!isLogin.value) {
+      router.push({
+        path: 'homePageMo',
+        query: {
+          src: '/game/index.html#/shop-for-visitor'
+        }
+      })
+    } else {
+      // 登录状态
+      router.push({
+        path: 'homePageMo',
+        query: {
+          src: '/game/index.html#/shop-view?no-redirect=1'
+        }
+      })
+    }
+
   }
 
   checkLoginStatus()
@@ -496,14 +508,6 @@ const changePassFu = () => {
       }
     })
   }
-  // !browser.mobile ? () => { isPassChange.value = true; oldPass.value = '';newPass.value ='';affirmPass.value = ''} :() => {
-  //   router.push({
-  //     path:'/homePageMo',
-  //     query: {
-  //       src: '/game/index.html#/change-password?no-redirect=1'
-  //     }
-  //   })
-  // }
 }
 </script>
 
@@ -1514,4 +1518,5 @@ const changePassFu = () => {
     }
   }
 
-}</style>
+}
+</style>