shenwu пре 8 месеци
родитељ
комит
5f1d51a299

+ 3 - 3
src/app.tsx

@@ -209,9 +209,9 @@ export const request: RequestConfig = {
             history.push(loginPath)
             history.push(loginPath)
           }
           }
           break;
           break;
-        case 500:
-          message.error(data.msg)
-          break
+        // case 500:
+        //   message.error(data.msg)
+        //   break
       }
       }
 
 
 
 

+ 13 - 3
src/pages/Distributor/DyMiniApp/tableConfig.tsx

@@ -10,8 +10,8 @@ export const columns = (): ProColumns<any>[] => {
             dataIndex: 'appName',
             dataIndex: 'appName',
             key: "appName",
             key: "appName",
             align: "left",
             align: "left",
-            render:(a:any,b:any)=>{
-                return <Space size={[3,0]}>
+            render: (a: any, b: any) => {
+                return <Space size={[3, 0]}>
                     <MyIcon type="icon-xiaochengxu-dy" />
                     <MyIcon type="icon-xiaochengxu-dy" />
                     {b.appName}
                     {b.appName}
                 </Space>
                 </Space>
@@ -24,6 +24,16 @@ export const columns = (): ProColumns<any>[] => {
             hideInSearch: true,
             hideInSearch: true,
             align: "left",
             align: "left",
         },
         },
+        {
+            title: "小程序类型",
+            dataIndex: 'appCategory',
+            key: "appCategory",
+            hideInSearch: true,
+            align: "left",
+            render: (a: any, b: any) => {
+                return b.appCategory === 1 ? "长篇" : "短篇"
+            }
+        },
 
 
         {
         {
             title: "运营载体状态",
             title: "运营载体状态",
@@ -41,7 +51,7 @@ export const columns = (): ProColumns<any>[] => {
             valueType: 'option',
             valueType: 'option',
             align: "center",
             align: "center",
             render: (_, record) => {
             render: (_, record) => {
-                return <MenuChange menuType="miniApp" data={{ ...record, appType: 2 }}><a type='primary'>管理</a></MenuChange>
+                return <MenuChange menuType="miniApp" data={{ ...record, appType: record?.appCategory || 2 }}><a type='primary'>管理</a></MenuChange>
             },
             },
         },
         },
     ];
     ];

+ 13 - 4
src/pages/Distributor/WxMiniApp/tableConfig.tsx

@@ -19,12 +19,21 @@ export const columns = (): ProColumns<any>[] => {
         },
         },
         {
         {
             title: "AppId",
             title: "AppId",
-            dataIndex: 'appId',
-            key: "appId",
+            dataIndex: 'wechatAppId',
+            key: "wechatAppId",
             hideInSearch: true,
             hideInSearch: true,
             align: "left",
             align: "left",
         },
         },
-
+        {
+            title: "小程序类型",
+            dataIndex: 'appCategory',
+            key: "appCategory",
+            hideInSearch: true,
+            align: "left",
+            render:(a:any,b:any)=>{
+                return b.appCategory === 1 ? "长篇":"短篇"
+            }
+        },
         {
         {
             title: "运营载体状态",
             title: "运营载体状态",
             dataIndex: 'status',
             dataIndex: 'status',
@@ -41,7 +50,7 @@ export const columns = (): ProColumns<any>[] => {
             valueType: 'option',
             valueType: 'option',
             align: "center",
             align: "center",
             render: (_, record) => {
             render: (_, record) => {
-                return <MenuChange menuType="miniApp" data={{ ...record, appType:1 }}><a type='primary'>管理</a></MenuChange>
+                return <MenuChange menuType="miniApp" data={{ ...record, appType:record?.appCategory || 1}}><a type='primary'>管理</a></MenuChange>
             },
             },
         },
         },
     ];
     ];

+ 69 - 32
src/pages/MiniApp/BookManage/Long/formConfig.tsx

@@ -1,22 +1,24 @@
-import { convertEnumArr } from "@/utils";
 import { ProFormColumnsType } from "@ant-design/pro-components";
 import { ProFormColumnsType } from "@ant-design/pro-components";
 
 
-function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any[] }): ProFormColumnsType<{
+function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any }): ProFormColumnsType<{
     name: string;
     name: string;
     state: string;
     state: string;
 }>[] {
 }>[] {
     let { paragraphList, enumList, paymentType } = props
     let { paragraphList, enumList, paymentType } = props
-    // console.log("paragraphList",paragraphList)
+    console.log(paymentType)
     return [
     return [
         {
         {
-            title: '开始付费段落',
-            dataIndex: 'beginPayChapterNo',
-            valueType: 'select',
+            title: '付费方式',
+            dataIndex: 'paymentType',
+            valueType: 'radio',
             fieldProps: {
             fieldProps: {
-                showSearch: true, placeholder: '请选择开始收费段落'
+                onChange: (e) => {
+                    let value = e.target.value
+                    paymentType[1](value)
+                }
             },
             },
             formItemProps: {
             formItemProps: {
-                style: { marginBottom: 15 },
+                style: { marginBottom: 0 },
                 rules: [
                 rules: [
                     {
                     {
                         required: true,
                         required: true,
@@ -25,62 +27,97 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
                 ],
                 ],
             },
             },
             valueEnum: () => {
             valueEnum: () => {
-                return new Map(paragraphList?.map(item => [item.chapterNo, item.chapterName]))
+                let arr = enumList?.PAYMENT_TYPE?.values
+                return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
-            title: 'VIP阅读',
-            dataIndex: 'vipFree',
-            valueType: 'segmented',
+            title: '收费类型',
+            dataIndex: 'paymentOption',
+            valueType: 'radio',
             formItemProps: {
             formItemProps: {
-                style: { marginBottom: 15 },
+                style: { marginBottom: 10 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
+            hideInForm:paymentType[0] != 2,
             valueEnum: () => {
             valueEnum: () => {
-                let arr = enumList?.VIP_FREE?.values
+                let arr = enumList?.PAYMENT_OPTION?.values
                 return new Map(arr?.map(({ value, description }: any) => [value, description]))
                 return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
-            title: '付费方式',
-            dataIndex: 'paymentType',
-            valueType: 'checkbox',
+            title: '开始付费段落',
+            dataIndex: 'beginPayParagraphNo',
+            valueType: 'select',
             fieldProps: {
             fieldProps: {
-                onChange: (value) => {
-                    paymentType[1](value)
-                }
+                showSearch: true, placeholder: '请选择开始收费段落'
             },
             },
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
+            hideInForm:paymentType[0] != 2,
             valueEnum: () => {
             valueEnum: () => {
-                let arr = enumList?.PAYMENT_TYPE?.values
-                let obj = {}
-                if (paymentType?.[0]?.includes('0')) {
-                    obj = { "1": { disabled: true }, '2': { disabled: true }, '3': { disabled: true } }
-                }
-                if (paymentType?.[0]?.join().match(/[123]/g)) {
-                    obj = { "0": { disabled: true } }
-                }
-                let enumObj = convertEnumArr(arr, obj)
-                return enumObj
+                return new Map(paragraphList?.map(item => [item.paragraphNo, item.content]))
+            }
+        },
+        {
+            title: 'VIP阅读',
+            dataIndex: 'vipFree',
+            valueType: 'segmented',
+            formItemProps: {
+                style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+            hideInForm:paymentType[0] == 0,
+            valueEnum: () => {
+                let arr = enumList?.VIP_FREE?.values
+                return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
             title: '收费金额',
             title: '收费金额',
             dataIndex: 'paymentAmount',
             dataIndex: 'paymentAmount',
             valueType: 'money',
             valueType: 'money',
-            hideInForm: !paymentType?.[0]?.includes('2'),
+            hideInForm: paymentType[0] != 1,
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
         },
         },
         {
         {
             title: '收费书币',
             title: '收费书币',
             dataIndex: 'paymentCoin',
             dataIndex: 'paymentCoin',
             valueType: 'digit',
             valueType: 'digit',
-            hideInForm: !paymentType?.[0]?.join().match(/[13]/g),
+            hideInForm: paymentType[0] != 2,
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
         },
         },
         {
         {

+ 9 - 7
src/pages/MiniApp/BookManage/Long/index.tsx

@@ -30,7 +30,7 @@ const Page: React.FC = () => {
     let { state, getLabelAndClassList } = useModel('global')
     let { state, getLabelAndClassList } = useModel('global')
     let [open, setOpen] = useState<any>(null)//付费配置
     let [open, setOpen] = useState<any>(null)//付费配置
     let [editValues, setEditValues] = useState<any>({})
     let [editValues, setEditValues] = useState<any>({})
-    let paymentType = useState([])
+    let paymentType = useState(0)
     let [workDirection, setWorkDirection] = useState<any>(null)
     let [workDirection, setWorkDirection] = useState<any>(null)
     const [openBook, setOpneBook] = useState<any>(null)//阅读小说
     const [openBook, setOpneBook] = useState<any>(null)//阅读小说
     let getList = useAjax((params) => longBookInfoList(params), { type: 'table' })//获取书列表
     let getList = useAjax((params) => longBookInfoList(params), { type: 'table' })//获取书列表
@@ -47,7 +47,7 @@ const Page: React.FC = () => {
     // 接口公共参数
     // 接口公共参数
     let publicData = useMemo(() => {
     let publicData = useMemo(() => {
         return {
         return {
-            miniappId: initialState?.selectApp?.id || "",
+            appId: initialState?.selectApp?.id || "",
             distributorId: initialState?.currentUser?.distributorId,
             distributorId: initialState?.currentUser?.distributorId,
             appType: initialState?.selectApp?.appType || ""
             appType: initialState?.selectApp?.appType || ""
         }
         }
@@ -74,6 +74,9 @@ const Page: React.FC = () => {
         if (editValues?.bookId) {
         if (editValues?.bookId) {
             values.bookId = editValues?.bookId
             values.bookId = editValues?.bookId
         }
         }
+        if(values.paymentType === 0){//假如免费,设置vip也免费
+            values.vipFree = true
+        }
         add.run({ ...values, ...publicData }).then(res => {
         add.run({ ...values, ...publicData }).then(res => {
             if (res.code === 200) {
             if (res.code === 200) {
                 actionRef?.current?.reload()
                 actionRef?.current?.reload()
@@ -86,7 +89,7 @@ const Page: React.FC = () => {
     const closeForm = (b: boolean, values?: any) => {
     const closeForm = (b: boolean, values?: any) => {
         if (!b) {
         if (!b) {
             setEditValues({})
             setEditValues({})
-            paymentType[1]([])
+            paymentType[1](0)
             formRef?.current?.resetFields?.()
             formRef?.current?.resetFields?.()
             setOpen(b)
             setOpen(b)
         } else {
         } else {
@@ -98,11 +101,10 @@ const Page: React.FC = () => {
                         // 获取书付费配置
                         // 获取书付费配置
                         configInfo.run({ bookId: values.bookId, ...publicData }).then(res => {
                         configInfo.run({ bookId: values.bookId, ...publicData }).then(res => {
                             if (res.code === 200) {
                             if (res.code === 200) {
-                                let paymentTypeArr = res.data?.paymentType?.map((i: string) => i + '')
-                                let data = { ...res.data, paymentType: paymentTypeArr }
+                                let data = { ...res.data }
                                 setEditValues(data)
                                 setEditValues(data)
-                                paymentType[1](paymentTypeArr)
-                                formRef?.current?.setFieldsValue(data)
+                                paymentType[1](data?.paymentType || 0)
+                                formRef?.current?.setFieldsValue({ ...data, paymentType:data?.paymentType || 0,vipFree:data?.vipFree === null ? true : data?.vipFree})
                             }
                             }
                         })
                         })
                     }
                     }

+ 1 - 1
src/pages/MiniApp/BookManage/Long/tableConfig.tsx

@@ -136,7 +136,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [], b?.paymentType || [])
+                let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [],[ b?.paymentType ]|| [])
                 return <Space size={[0, 5]} wrap>
                 return <Space size={[0, 5]} wrap>
                     {
                     {
                         arr?.map(str => {
                         arr?.map(str => {

+ 113 - 31
src/pages/MiniApp/BookManage/Short/formConfig.tsx

@@ -1,21 +1,23 @@
-import { convertEnumArr } from "@/utils";
 import { ProFormColumnsType } from "@ant-design/pro-components";
 import { ProFormColumnsType } from "@ant-design/pro-components";
 
 
-function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any[] }): ProFormColumnsType<{
+function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any, paymentCategory: any, isGlobalConfig: boolean }): ProFormColumnsType<{
     name: string;
     name: string;
     state: string;
     state: string;
 }>[] {
 }>[] {
-    let { paragraphList, enumList, paymentType } = props
+    let { paragraphList, enumList, paymentType, paymentCategory, isGlobalConfig } = props
     return [
     return [
         {
         {
-            title: '开始付费段落',
-            dataIndex: 'beginPayParagraphNo',
-            valueType: 'select',
+            title: '付费方式',
+            dataIndex: 'paymentType',
+            valueType: 'radio',
             fieldProps: {
             fieldProps: {
-                showSearch: true, placeholder: '请选择开始收费段落'
+                onChange: (e) => {
+                    let value = e.target.value
+                    paymentType[1](value)
+                }
             },
             },
             formItemProps: {
             formItemProps: {
-                style: { marginBottom: 15 },
+                style: { marginBottom: 10 },
                 rules: [
                 rules: [
                     {
                     {
                         required: true,
                         required: true,
@@ -24,68 +26,148 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
                 ],
                 ],
             },
             },
             valueEnum: () => {
             valueEnum: () => {
-                return new Map(paragraphList?.map(item => [item.paragraphNo, item.content]))
+                let arr = enumList?.PAYMENT_TYPE?.values
+                return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
-            title: 'VIP阅读',
-            dataIndex: 'vipFree',
-            valueType: 'segmented',
+            title: '收费类型',
+            dataIndex: 'paymentOption',
+            valueType: 'radio',
             formItemProps: {
             formItemProps: {
-                style: { marginBottom: 15 },
+                style: { marginBottom: 10 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
+            hideInForm: paymentType[0] != 2,
             valueEnum: () => {
             valueEnum: () => {
-                let arr = enumList?.VIP_FREE?.values
+                let arr = enumList?.PAYMENT_OPTION?.values
                 return new Map(arr?.map(({ value, description }: any) => [value, description]))
                 return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
-            title: '付费方式',
-            dataIndex: 'paymentType',
-            valueType: 'checkbox',
+            title: '收费货币',
+            dataIndex: 'paymentCategory',
+            valueType: 'radio',
             fieldProps: {
             fieldProps: {
-                onChange: (value) => {
-                    paymentType[1](value)
+                onChange: (e) => {
+                    let value = e.target.value
+                    paymentCategory[1](value)
                 }
                 }
             },
             },
+            formItemProps: {
+                style: { marginBottom: 10 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+            hideInForm: paymentType[0] == 0,
+            valueEnum: () => {
+                let arr = [{ value: 0, description: "现金" }, { value: 1, description: "书币" }]
+                return new Map(arr?.map(({ value, description }: any) => [value, description]))
+            }
+        },
+        {//单本
+            title: '付费起始段落',
+            dataIndex: 'beginPayParagraphNo',
+            valueType: 'select',
+            fieldProps: {
+                showSearch: true, placeholder: '请选择开始收费段落'
+            },
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
+            hideInForm: paymentType[0] != 2 || isGlobalConfig,//单本书
             valueEnum: () => {
             valueEnum: () => {
-                let arr = enumList?.PAYMENT_TYPE?.values
-                let obj = {}
-                if (paymentType?.[0]?.includes('0')) {
-                    obj = { "1": { disabled: true }, '2': { disabled: true }, '3': { disabled: true } }
-                }
-                if (paymentType?.[0]?.join().match(/[123]/g)) {
-                    obj = { "0": { disabled: true } }
-                }
-                let enumObj = convertEnumArr(arr, obj)
-                return enumObj
+                return new Map(paragraphList?.map(item => [item.paragraphNo, item.content]))
+            }
+        },
+        {//全局
+            title: '付费起始段落',
+            dataIndex: 'beginPayNo',
+            valueType: 'digit',
+            fieldProps: {
+                placeholder: '请输入收费段落'
+            },
+            width: 200,
+            formItemProps: {
+                style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+            hideInForm: paymentType[0] != 2 || !isGlobalConfig,//单本书
+        },
+        {
+            title: 'VIP阅读',
+            dataIndex: 'vipFree',
+            valueType: 'segmented',
+            formItemProps: {
+                style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+            hideInForm: paymentType[0] == 0 || isGlobalConfig,
+            valueEnum: () => {
+                let arr = enumList?.VIP_FREE?.values
+                return new Map(arr?.map(({ value, description }: any) => [value, description]))
             }
             }
         },
         },
         {
         {
             title: '收费金额',
             title: '收费金额',
             dataIndex: 'paymentAmount',
             dataIndex: 'paymentAmount',
             valueType: 'money',
             valueType: 'money',
-            hideInForm: !paymentType?.[0]?.includes('2'),
+            hideInForm: paymentCategory[0] == 1,
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
         },
         },
         {
         {
             title: '收费书币',
             title: '收费书币',
             dataIndex: 'paymentCoin',
             dataIndex: 'paymentCoin',
             valueType: 'digit',
             valueType: 'digit',
-            hideInForm: !paymentType?.[0]?.join().match(/[13]/g),
+            hideInForm: paymentCategory[0] == 0,
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
             },
             },
         },
         },
         {
         {
             title: '备注',
             title: '备注',
             dataIndex: 'remark',
             dataIndex: 'remark',
             valueType: 'textarea',
             valueType: 'textarea',
+            hideInForm: isGlobalConfig,
             formItemProps: {
             formItemProps: {
                 style: { marginBottom: 15 },
                 style: { marginBottom: 15 },
             },
             },

+ 77 - 26
src/pages/MiniApp/BookManage/Short/index.tsx

@@ -2,8 +2,8 @@ import { ActionType, BetaSchemaForm, PageContainer, ProFormInstance, ProTable }
 import { columns } from "./tableConfig"
 import { columns } from "./tableConfig"
 import { useAjax } from "@/Hook/useAjax"
 import { useAjax } from "@/Hook/useAjax"
 import { useModel } from "@umijs/max"
 import { useModel } from "@umijs/max"
-import { shortBookInfoList, shortBookInfoParagraphList, shortBookInfoBookConfig, shortBookInfoConfig, shortBookInfoParagraphAllList } from "@/services/miniApp/bookManage"
-import { useEffect, useMemo, useRef, useState } from "react"
+import { shortBookInfoList, shortBookInfoParagraphList, shortBookInfoBookConfig, shortBookInfoConfig, shortBookInfoParagraphAllList, sysRechargeGetInfo, sysRechargeAddOrEdit } from "@/services/miniApp/bookManage"
+import { useCallback, useEffect, useMemo, useRef, useState } from "react"
 import { Drawer, message, Space, Tag } from "antd"
 import { Drawer, message, Space, Tag } from "antd"
 import ReadText from "../components/readText"
 import ReadText from "../components/readText"
 import formConfig from "./formConfig"
 import formConfig from "./formConfig"
@@ -30,7 +30,9 @@ const Page: React.FC = () => {
     let { state, getLabelAndClassList } = useModel('global')
     let { state, getLabelAndClassList } = useModel('global')
     let [open, setOpen] = useState<any>(null)//付费配置
     let [open, setOpen] = useState<any>(null)//付费配置
     let [editValues, setEditValues] = useState<any>({})
     let [editValues, setEditValues] = useState<any>({})
-    let paymentType = useState([])
+    let paymentType = useState(0)//付费方式
+    let paymentCategory = useState(0)//收费货币
+    let [isGlobalConfig, setIsGlobalConfig] = useState(false)//
     let [workDirection, setWorkDirection] = useState<any>(null)
     let [workDirection, setWorkDirection] = useState<any>(null)
     const [openBook, setOpneBook] = useState<any>(null)//阅读小说
     const [openBook, setOpneBook] = useState<any>(null)//阅读小说
     let getList = useAjax((params) => shortBookInfoList(params), { type: 'table' })//获取书列表
     let getList = useAjax((params) => shortBookInfoList(params), { type: 'table' })//获取书列表
@@ -38,22 +40,30 @@ const Page: React.FC = () => {
     let getParagraphAllList = useAjax((params) => shortBookInfoParagraphAllList(params))//获取全部段落
     let getParagraphAllList = useAjax((params) => shortBookInfoParagraphAllList(params))//获取全部段落
     let add = useAjax((params) => shortBookInfoBookConfig(params))//新增配置
     let add = useAjax((params) => shortBookInfoBookConfig(params))//新增配置
     let configInfo = useAjax((params) => shortBookInfoConfig(params))//获取配置信息
     let configInfo = useAjax((params) => shortBookInfoConfig(params))//获取配置信息
+    let globaleConfig = useAjax((params) => sysRechargeGetInfo(params))//获取全局配置信息
+    let globaleAddOrEdit = useAjax((params) => sysRechargeAddOrEdit(params))//全局配置信息修改
     const formRef = useRef<ProFormInstance>();
     const formRef = useRef<ProFormInstance>();
     const actionRef = useRef<ActionType>();
     const actionRef = useRef<ActionType>();
 
 
     // 获取标签和分类
     // 获取标签和分类
     useEffect(() => {
     useEffect(() => {
         getLabelAndClassList({ workDirection })
         getLabelAndClassList({ workDirection })
+        getGlobalInfo()
     }, [workDirection])
     }, [workDirection])
     // 接口公共参数
     // 接口公共参数
     let publicData = useMemo(() => {
     let publicData = useMemo(() => {
         return {
         return {
-            miniappId: initialState?.selectApp?.id || "",
+            appId: initialState?.selectApp?.id || "",
             distributorId: initialState?.currentUser?.distributorId,
             distributorId: initialState?.currentUser?.distributorId,
             appType: initialState?.selectApp?.appType || ""
             appType: initialState?.selectApp?.appType || ""
         }
         }
     }, [initialState?.selectApp, initialState?.currentUser?.distributorId])
     }, [initialState?.selectApp, initialState?.currentUser?.distributorId])
-
+    //获取全局收费配置
+    const getGlobalInfo = useCallback(() => {
+        globaleConfig.run(publicData).then(res => {
+            console.log(res)
+        })
+    }, [publicData])
     // 看小说
     // 看小说
     const lookBook = (params: any) => {
     const lookBook = (params: any) => {
         let { id, pageNum, pageSize } = params
         let { id, pageNum, pageSize } = params
@@ -64,25 +74,53 @@ const Page: React.FC = () => {
     }
     }
     // 提交表单
     // 提交表单
     const submit = async (values: any) => {
     const submit = async (values: any) => {
-        if (editValues?.id) {
-            values.id = editValues?.id
-        }
-        if (editValues?.bookId) {
-            values.bookId = editValues?.bookId
+        let api = isGlobalConfig ? globaleAddOrEdit : add
+        let newValue = { ...values, ...publicData }
+        if (isGlobalConfig) {
+
+        } else {
+            if (editValues?.id) {
+                newValue.id = editValues?.id
+            }
+            if (editValues?.bookId) {
+                newValue.bookId = editValues?.bookId
+            }
+            if (values.paymentType === 0) {//假如免费,设置vip也免费
+                newValue.vipFree = true
+            }
         }
         }
-        add.run({ ...values, ...publicData }).then(res => {
+
+        api.run(newValue).then(res => {
             if (res.code === 200) {
             if (res.code === 200) {
-                actionRef?.current?.reload()
+                if (isGlobalConfig) {
+                    getGlobalInfo()
+                } else {
+                    actionRef?.current?.reload()
+                }
                 message.success("付费配置成功!")
                 message.success("付费配置成功!")
                 closeForm(false)
                 closeForm(false)
             }
             }
         })
         })
     }
     }
+    // 全局配置弹窗
+    const closeGlobalForm = () => {
+        setIsGlobalConfig(true)
+        setOpen(true)//弹窗开启
+        let data = globaleConfig?.data?.data
+        setEditValues({ ...data })
+        paymentType[1](data?.paymentType || 0)
+        paymentCategory[1](data?.paymentCategory || 0)
+        setTimeout(() => {
+            formRef?.current?.setFieldsValue({ ...data })
+        }, 100)
+    }
     // 关闭表单弹窗和重置表单内容
     // 关闭表单弹窗和重置表单内容
     const closeForm = (b: boolean, values?: any) => {
     const closeForm = (b: boolean, values?: any) => {
         if (!b) {
         if (!b) {
             setEditValues({})
             setEditValues({})
-            paymentType[1]([])
+            paymentType[1](0)
+            paymentCategory[1](0)
+            setIsGlobalConfig(false)
             formRef?.current?.resetFields?.()
             formRef?.current?.resetFields?.()
             setOpen(b)
             setOpen(b)
         } else {
         } else {
@@ -94,11 +132,11 @@ const Page: React.FC = () => {
                         // 获取书付费配置
                         // 获取书付费配置
                         configInfo.run({ bookId: values.bookId, ...publicData }).then(res => {
                         configInfo.run({ bookId: values.bookId, ...publicData }).then(res => {
                             if (res.code === 200) {
                             if (res.code === 200) {
-                                let paymentTypeArr = res.data?.paymentType?.map((i: string) => i + '')
-                                let data = { ...res.data, paymentType: paymentTypeArr }
-                                setEditValues(data)
-                                paymentType[1](paymentTypeArr)
-                                formRef?.current?.setFieldsValue(data)
+                                let data = { ...res.data }
+                                setEditValues({ ...data, bookName: values?.shortBookInfoVO?.bookName })
+                                paymentType[1](data?.paymentType || 0)
+                                paymentCategory[1](data?.paymentCategory || 0)
+                                formRef?.current?.setFieldsValue({ ...data, paymentType: data?.paymentType || 0 })
                             }
                             }
                         })
                         })
                     }
                     }
@@ -108,6 +146,7 @@ const Page: React.FC = () => {
     }
     }
     return <PageContainer title={false}
     return <PageContainer title={false}
         tabProps={{ type: 'card' }}
         tabProps={{ type: 'card' }}
+        loading={globaleConfig?.loading}
     >
     >
         <ProTable<any, any>
         <ProTable<any, any>
             params={publicData}
             params={publicData}
@@ -115,11 +154,23 @@ const Page: React.FC = () => {
             headerTitle={"小说列表"}
             headerTitle={"小说列表"}
             rowKey={(r) => r.bookId}
             rowKey={(r) => r.bookId}
             rowSelection={{ alwaysShowAlert: true, hideSelectAll: true, columnWidth: 0, columnTitle: '', renderCell: () => null }}
             rowSelection={{ alwaysShowAlert: true, hideSelectAll: true, columnWidth: 0, columnTitle: '', renderCell: () => null }}
-            tableAlertRender={() => <Space>
-                <Tag  bordered={false} color="processing" style={{cursor:'pointer'}}>收费价格:短篇¥2/千字,中长篇¥2/千字<EditFilled /></Tag>
-                <Tag bordered={false} color="processing" style={{cursor:'pointer'}}>收费起始章节:短篇2,中长篇21<EditFilled /></Tag>
-                <Tag bordered={false} color="processing" style={{cursor:'pointer'}}>整本价格:短篇19.9元,中长篇99元<EditFilled /></Tag>
-            </Space>}
+            tableAlertRender={() => {
+                let { paymentType, paymentOption, paymentCategory, paymentAmount, paymentCoin, beginPayNo } = globaleConfig?.data?.data || {}
+                let enumList: any = state?.enumList
+                let PAYMENT_TYPE_Map: Map<any, any> = new Map(enumList?.PAYMENT_TYPE?.values?.map(({ value, description }: any) => [value, description]))
+                let PAYMENT_OPTION_Map: Map<any, any> = new Map(enumList?.PAYMENT_OPTION?.values?.map(({ value, description }: any) => [value, description]))
+                return <Tag bordered={false} style={{ cursor: 'pointer' }} onClick={closeGlobalForm}>
+                    <Space>
+                        <Tag bordered={false} color="processing" style={{ cursor: 'pointer' }}>收费类型:<span style={{ color: '#f64747' }}>{PAYMENT_TYPE_Map?.get(paymentType)}</span></Tag>
+                        <Tag bordered={false} color="processing" style={{ cursor: 'pointer' }}>付费起始段落/章节:<span style={{ color: "#f64747" }}>{beginPayNo}</span></Tag>
+                        {paymentType === 2 && <Tag bordered={false} color="processing" style={{ cursor: 'pointer' }}>段落/章节收费类型:<span style={{ color: '#f64747' }}>{PAYMENT_OPTION_Map?.get(paymentOption)}</span></Tag>}
+                        <Tag bordered={false} color="processing" style={{ cursor: 'pointer' }}>付费价格:
+                            <span style={{ color: "#f64747" }}>{paymentCategory === 0 && '¥'}{paymentCategory === 0 ? paymentAmount : paymentCoin}</span>
+                            {paymentCategory === 1 && '书币'}</Tag>
+                    </Space>
+                    <EditFilled />
+                </Tag>
+            }}
             tableAlertOptionRender={false}
             tableAlertOptionRender={false}
             search={{
             search={{
                 labelWidth: 90,
                 labelWidth: 90,
@@ -151,7 +202,7 @@ const Page: React.FC = () => {
         />
         />
         {/* 付费配置 */}
         {/* 付费配置 */}
         <BetaSchemaForm<DataItem>
         <BetaSchemaForm<DataItem>
-            title={"付费配置"}
+            title={(isGlobalConfig ? "全局" : "《" + editValues?.bookName + "》") + "付费配置"}
             formRef={formRef}
             formRef={formRef}
             open={open}
             open={open}
             onOpenChange={(b) => { !b && closeForm(b) }}
             onOpenChange={(b) => { !b && closeForm(b) }}
@@ -161,8 +212,8 @@ const Page: React.FC = () => {
             // grid={true}
             // grid={true}
             layout='horizontal'
             layout='horizontal'
             onFinish={submit}
             onFinish={submit}
-            columns={formConfig({ enumList: state?.enumList, paymentType, paragraphList: getParagraphAllList?.data?.data?.map((item: { paragraphInfo: any }) => item.paragraphInfo) })}
-            loading={add?.loading}
+            columns={formConfig({ isGlobalConfig, enumList: state?.enumList, paymentType, paymentCategory, paragraphList: getParagraphAllList?.data?.data?.map((item: { paragraphInfo: any }) => item.paragraphInfo) })}
+            loading={add?.loading || globaleAddOrEdit?.loading}
         />
         />
         {/* 阅读小说 */}
         {/* 阅读小说 */}
         <Drawer
         <Drawer

+ 21 - 10
src/pages/MiniApp/BookManage/Short/tableConfig.tsx

@@ -7,6 +7,10 @@ const useStyles = createStyles(({ token }) => {
     return {
     return {
         bookLabel: {
         bookLabel: {
             color: token.colorTextTertiary
             color: token.colorTextTertiary
+        },
+        del: {
+            textDecoration: "line-through",
+            color:token.colorTextDisabled
         }
         }
     }
     }
 })
 })
@@ -35,11 +39,11 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                return <div style={{position:'relative'}}>
-                   {b?.vipFree && <MyIcon type="icon-vipmianfei" style={{fontSize:20,position:'absolute',zIndex:1}}/>}
-                    <Image src={b?.shortBookInfoVO?.picUrl} style={{ width: 50 }}  onError={(e:any)=>{
+                return <div style={{ position: 'relative' }}>
+                    {b?.vipFree && <MyIcon type="icon-vipmianfei" style={{ fontSize: 20, position: 'absolute', zIndex: 1 }} />}
+                    <Image src={b?.shortBookInfoVO?.picUrl} style={{ width: 50 }} onError={(e: any) => {
                         e.target.src = localStorage.getItem("nocover")
                         e.target.src = localStorage.getItem("nocover")
-                    }}/>
+                    }} />
                 </div>
                 </div>
             }
             }
         },
         },
@@ -49,7 +53,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             key: 'authorId',
             key: 'authorId',
             ellipsis: true,
             ellipsis: true,
             hideInSearch: true,
             hideInSearch: true,
-            width:500,
+            width: 500,
             render: (a, b) => {
             render: (a, b) => {
                 let { bookName, wordCount, labelInfoList, bookStatus, categoryInfo, authorInfo, score } = b?.shortBookInfoVO
                 let { bookName, wordCount, labelInfoList, bookStatus, categoryInfo, authorInfo, score } = b?.shortBookInfoVO
                 let arr = enumList?.BOOK_STATUS?.values
                 let arr = enumList?.BOOK_STATUS?.values
@@ -57,7 +61,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
                     <Col span={24}>
                     <Col span={24}>
                         <Space size={[5, 0]} wrap>
                         <Space size={[5, 0]} wrap>
                             <a style={{ fontSize: 14, color: "#337ab7" }} onClick={() => {
                             <a style={{ fontSize: 14, color: "#337ab7" }} onClick={() => {
-                                lookBook?.({ ...b.shortBookInfoVO,vipFree:b.vipFree,beginPayParagraphNo:b.beginPayParagraphNo, pageNum: 1, pageSize: 2 })
+                                lookBook?.({ ...b.shortBookInfoVO, vipFree: b.vipFree, beginPayParagraphNo: b.beginPayParagraphNo, pageNum: 1, pageSize: 2 })
                             }}>[{categoryInfo?.name}]{bookName}</a>
                             }}>[{categoryInfo?.name}]{bookName}</a>
                             <span style={{ fontSize: 11 }} className={styles.bookLabel}>[{arr[bookStatus]?.description}]</span>
                             <span style={{ fontSize: 11 }} className={styles.bookLabel}>[{arr[bookStatus]?.description}]</span>
                             <Space size={[0, 0]}>
                             <Space size={[0, 0]}>
@@ -137,11 +141,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
             render: (a: any, b: any) => {
             render: (a: any, b: any) => {
-                let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [], b?.paymentType || [])
+                let arr = getDescriptions(enumList?.PAYMENT_TYPE?.values || [], [b?.paymentType] || [])
+                let arr1 = new Map(enumList?.PAYMENT_OPTION?.values?.map(({ value, description }: any) => [value, description]))
                 return <Space size={[0, 5]} wrap>
                 return <Space size={[0, 5]} wrap>
                     {
                     {
                         arr?.map(str => {
                         arr?.map(str => {
-                            return <Tag bordered={false} key={str}>{str}</Tag>
+                            return <Tag bordered={false} key={str}>{str}{b?.paymentOption != null && '(' + arr1.get(b?.paymentOption) + ')'}</Tag>
                         })
                         })
                     }
                     }
                 </Space>
                 </Space>
@@ -168,6 +173,9 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             ellipsis: true,
             ellipsis: true,
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
+            render: (a, b) => {
+                return <span className={b?.paymentCategory === 1 ? styles.del : ''}>{b?.paymentAmount || '-'}</span>
+            }
         },
         },
         {
         {
             title: '收费书币',
             title: '收费书币',
@@ -178,6 +186,9 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             ellipsis: true,
             ellipsis: true,
             align: 'center',
             align: 'center',
             hideInSearch: true,
             hideInSearch: true,
+            render: (a, b) => {
+                return <span className={b?.paymentCategory === 0 ? styles.del : ''}>{b?.paymentCoin || '-'}</span>
+            }
         },
         },
         {
         {
             title: '开始收费段落',
             title: '开始收费段落',
@@ -246,7 +257,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             initialValue: '',
             initialValue: '',
             valueEnum: () => {
             valueEnum: () => {
                 let arr = categoryList || []
                 let arr = categoryList || []
-                return new Map([{id:"",name:"全部"},...arr]?.map(item=>[item.id,item.name]))
+                return new Map([{ id: "", name: "全部" }, ...arr]?.map(item => [item.id, item.name]))
             }
             }
         },
         },
         {
         {
@@ -260,7 +271,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             initialValue: '',
             initialValue: '',
             valueEnum: () => {
             valueEnum: () => {
                 let arr = labelList || []
                 let arr = labelList || []
-                return new Map([{id:"",name:"全部"},...arr]?.map(item=>[item.id,item.name]))
+                return new Map([{ id: "", name: "全部" }, ...arr]?.map(item => [item.id, item.name]))
             },
             },
         },
         },
         {
         {

+ 1 - 1
src/pages/MiniApp/Consume/index.tsx

@@ -17,7 +17,7 @@ const Page: React.FC = () => {
     >
     >
         <ProTable<any, any>
         <ProTable<any, any>
             params={{
             params={{
-                miniappId: initialState?.selectApp?.id || "",
+                appId: initialState?.selectApp?.id || "",
                 distributorId: initialState?.currentUser?.distributorId,
                 distributorId: initialState?.currentUser?.distributorId,
                 appType: initialState?.selectApp?.appType || ""
                 appType: initialState?.selectApp?.appType || ""
             }}
             }}

+ 1 - 1
src/pages/MiniApp/ModuleConfig/index.tsx

@@ -52,7 +52,7 @@ const Page: React.FC = () => {
     const formRef = useRef<ProFormInstance>();
     const formRef = useRef<ProFormInstance>();
     let publicData = useMemo(() => {
     let publicData = useMemo(() => {
         return {
         return {
-            miniappId: initialState?.selectApp?.id || "",
+            appId: initialState?.selectApp?.id || "",
             distributorId: initialState?.currentUser?.distributorId,
             distributorId: initialState?.currentUser?.distributorId,
             appType: initialState?.selectApp?.appType || ""
             appType: initialState?.selectApp?.appType || ""
         }
         }

+ 1 - 1
src/pages/MiniApp/PayLog/Long/index.tsx

@@ -12,7 +12,7 @@ const Page: React.FC = () => {
         <ProTable<any, any>
         <ProTable<any, any>
             scroll={{ x: true}}
             scroll={{ x: true}}
             params={{
             params={{
-                miniappId: initialState?.selectApp?.id || "",
+                appId: initialState?.selectApp?.id || "",
                 distributorId: initialState?.currentUser?.distributorId,
                 distributorId: initialState?.currentUser?.distributorId,
                 appType: initialState?.selectApp?.appType || ""
                 appType: initialState?.selectApp?.appType || ""
             }}
             }}

+ 15 - 0
src/pages/MiniApp/PayLog/Long/tableConfig.tsx

@@ -19,6 +19,9 @@ export const columns = (): ProColumns<any>[] => {
             key: "bookName",
             key: "bookName",
             align: "center",
             align: "center",
             hideInSearch: true,
             hideInSearch: true,
+            render:(a,b:any)=>{
+                return b?.bookInfo?.bookName
+            }
         },
         },
         {
         {
             title: "支付渠道",
             title: "支付渠道",
@@ -100,5 +103,17 @@ export const columns = (): ProColumns<any>[] => {
             valueType: 'dateTime',
             valueType: 'dateTime',
             hideInTable: true
             hideInTable: true
         },
         },
+        {
+            title: "最小充值金额",
+            dataIndex: 'amountMin',
+            valueType: 'money',
+            hideInTable: true,
+        },
+        {
+            title: "最大充值金额",
+            dataIndex: 'amountMax',
+            valueType: 'money',
+            hideInTable: true
+        },
     ];
     ];
 }
 }

+ 1 - 1
src/pages/MiniApp/PayLog/Short/index.tsx

@@ -12,7 +12,7 @@ const Page: React.FC = () => {
         <ProTable<any, any>
         <ProTable<any, any>
             scroll={{ x: true}}
             scroll={{ x: true}}
             params={{
             params={{
-                miniappId: initialState?.selectApp?.id || "",
+                appId: initialState?.selectApp?.id || "",
                 distributorId: initialState?.currentUser?.distributorId,
                 distributorId: initialState?.currentUser?.distributorId,
                 appType: initialState?.selectApp?.appType || ""
                 appType: initialState?.selectApp?.appType || ""
             }}
             }}

+ 15 - 0
src/pages/MiniApp/PayLog/Short/tableConfig.tsx

@@ -19,6 +19,9 @@ export const columns = (): ProColumns<any>[] => {
             key: "bookName",
             key: "bookName",
             align: "center",
             align: "center",
             hideInSearch: true,
             hideInSearch: true,
+            render:(a,b:any)=>{
+                return b?.bookInfo?.bookName
+            }
         },
         },
         {
         {
             title: "支付渠道",
             title: "支付渠道",
@@ -100,5 +103,17 @@ export const columns = (): ProColumns<any>[] => {
             valueType: 'dateTime',
             valueType: 'dateTime',
             hideInTable: true
             hideInTable: true
         },
         },
+        {
+            title: "最小充值金额",
+            dataIndex: 'amountMin',
+            valueType: 'money',
+            hideInTable: true,
+        },
+        {
+            title: "最大充值金额",
+            dataIndex: 'amountMax',
+            valueType: 'money',
+            hideInTable: true
+        },
     ];
     ];
 }
 }

+ 1 - 1
src/pages/MiniApp/ReadLog/Long/index.tsx

@@ -12,7 +12,7 @@ const Page: React.FC = () => {
         <ProTable<any, any>
         <ProTable<any, any>
             scroll={{ x: true}}
             scroll={{ x: true}}
             params={{
             params={{
-                miniappId: initialState?.selectApp?.id || "",
+                appId: initialState?.selectApp?.id || "",
                 distributorId: initialState?.currentUser?.distributorId,
                 distributorId: initialState?.currentUser?.distributorId,
                 appType: initialState?.selectApp?.appType || ""
                 appType: initialState?.selectApp?.appType || ""
             }}
             }}

+ 3 - 2
src/pages/MiniApp/ReadLog/Long/tableConfig.tsx

@@ -14,7 +14,6 @@ export const columns = (): ProColumns<any>[] => {
             dataIndex: 'userId',
             dataIndex: 'userId',
             key: "userId",
             key: "userId",
             align: "center",
             align: "center",
-            hideInSearch: true,
         },
         },
         {
         {
             title: "小说名称",
             title: "小说名称",
@@ -22,6 +21,9 @@ export const columns = (): ProColumns<any>[] => {
             key: "bookName",
             key: "bookName",
             align: "center",
             align: "center",
             hideInSearch: true,
             hideInSearch: true,
+            render:(a,b:any)=>{
+                return b?.bookInfo?.bookName
+            }
         },
         },
         {
         {
             title: "章节名称",
             title: "章节名称",
@@ -34,7 +36,6 @@ export const columns = (): ProColumns<any>[] => {
             title: "阅读时间",
             title: "阅读时间",
             dataIndex: 'createTime',
             dataIndex: 'createTime',
             key: "createTime",
             key: "createTime",
-            hideInSearch: true,
             align: "center",
             align: "center",
         },
         },
         // 搜索条件
         // 搜索条件

+ 1 - 1
src/pages/MiniApp/ReadLog/Short/index.tsx

@@ -13,7 +13,7 @@ const Page: React.FC = () => {
         <ProTable<any, any>
         <ProTable<any, any>
             scroll={{ x: true}}
             scroll={{ x: true}}
             params={{
             params={{
-                miniappId: initialState?.selectApp?.id || "",
+                appId: initialState?.selectApp?.id || "",
                 distributorId: initialState?.currentUser?.distributorId,
                 distributorId: initialState?.currentUser?.distributorId,
                 appType: initialState?.selectApp?.appType || ""
                 appType: initialState?.selectApp?.appType || ""
             }}
             }}

+ 10 - 1
src/pages/MiniApp/ReadLog/Short/tableConfig.tsx

@@ -14,7 +14,7 @@ export const columns = (): ProColumns<any>[] => {
             dataIndex: 'userId',
             dataIndex: 'userId',
             key: "userId",
             key: "userId",
             align: "center",
             align: "center",
-            hideInSearch: true,
+            
         },
         },
         {
         {
             title: "小说名称",
             title: "小说名称",
@@ -22,6 +22,9 @@ export const columns = (): ProColumns<any>[] => {
             key: "bookName",
             key: "bookName",
             align: "center",
             align: "center",
             hideInSearch: true,
             hideInSearch: true,
+            render:(a,b:any)=>{
+                return b?.bookInfo?.bookName
+            }
         },
         },
         {
         {
             title: "段落ID",
             title: "段落ID",
@@ -30,6 +33,12 @@ export const columns = (): ProColumns<any>[] => {
             hideInSearch: true,
             hideInSearch: true,
             align: "center",
             align: "center",
         },
         },
+        {
+            title: "阅读场景",
+            dataIndex: 'readCondition',
+            key: "readCondition",
+            align: "center",
+        },
         {
         {
             title: "阅读时间",
             title: "阅读时间",
             dataIndex: 'createTime',
             dataIndex: 'createTime',

+ 1 - 1
src/services/distributor/miniApp/index.tsx

@@ -10,7 +10,7 @@ interface MiniAppListParams extends Page{
 }
 }
 /** 获取当前的用户 GET /api/currentUser */
 /** 获取当前的用户 GET /api/currentUser */
 export async function miniAppList(params:MiniAppListParams) {
 export async function miniAppList(params:MiniAppListParams) {
-  return request(api+'/admin/wxAppConfig/list', {
+  return request(api+'/admin/wechatMiniapp/list', {
     method: 'GET',
     method: 'GET',
     params
     params
   });
   });

+ 19 - 2
src/services/miniApp/bookManage/index.tsx

@@ -9,7 +9,7 @@ interface BookId {
 }
 }
 interface LongBookParams extends Page, BookId { };
 interface LongBookParams extends Page, BookId { };
 interface PublicParams {
 interface PublicParams {
-  miniappId: string,//微信小程序组件ID
+  appId: string,//微信小程序组件ID
   distributorId: string,//分销商ID
   distributorId: string,//分销商ID
   appType: string,//小程序类型 1:微信小程序、2:抖音小程序
   appType: string,//小程序类型 1:微信小程序、2:抖音小程序
 }
 }
@@ -127,4 +127,21 @@ export async function shortBookInfoBookConfig(data: ShortConfigParmas) {
     method: 'POST',
     method: 'POST',
     data
     data
   });
   });
-}
+}
+
+//======================================全局收费配置================================
+
+/**全局付费配置详情 */
+export async function sysRechargeGetInfo(params: PublicParams) {
+  return request(api + `/admin/sysRecharge/getInfo`, {
+    method: 'GET',
+    params
+  });
+}
+/**全局付费配置 */
+export async function sysRechargeAddOrEdit(data: any) {
+  return request(api + `/admin/sysRecharge/addOrEdit`, {
+    method: 'POST',
+    data
+  });
+}

+ 1 - 0
src/utils/index.ts

@@ -9,6 +9,7 @@ export function getDescriptions(enumArr: any[], arr: any[]) {
         return acc;
         return acc;
     }, {});
     }, {});
     // 使用 arr2 中的 value 查找对应的 description
     // 使用 arr2 中的 value 查找对应的 description
+    // console.log(enumArr,arr)
     return arr.map(value => valueToDescription[value]);
     return arr.map(value => valueToDescription[value]);
 }
 }
 /**传入数组枚举数组和key数组 找到在枚举数组中的description值
 /**传入数组枚举数组和key数组 找到在枚举数组中的description值