shenwu 6 mesiacov pred
rodič
commit
0304b73d6c

+ 69 - 0
config/routes.tsx

@@ -96,6 +96,75 @@ const newMenu = [
     access: "isShow",
     component: './MiniApp/ModuleConfig',
   },
+  // 公众号
+  {
+    name:"miniApp.EmsCnpl",
+    icon: 'icon-gongzhonghao-wx',
+    path: '/miniApp/emsCnpl',
+    access: "isShow",
+    routes: [
+      {
+        path: '/miniApp/emsCnpl',
+        redirect: '/miniApp/emsCnpl/auth',
+      },
+      {
+        path:'/miniApp/emsCnpl/auth',
+        name: "auth",
+        component: './MiniApp/EmsCnpl/Auth',
+      },
+      {
+        path:'/miniApp/emsCnpl/users',
+        name: "users",
+        component: './MiniApp/EmsCnpl/Users',
+      },
+    ],
+  },
+  // 企微
+  {
+    name:"miniApp.EntWeChat",
+    icon: 'icon-qiyeweixin-wx',
+    path: '/miniApp/entWeChat',
+    access: "isShow",
+    routes: [
+      {
+        path: '/miniApp/entWeChat',
+        redirect: '/miniApp/entWeChat/users',
+      },
+      {
+        path: '/miniApp/entWeChat/users',
+        name: "users",
+        component: './MiniApp/EntWeChat/Users',
+      },
+      {
+        path: '/miniApp/entWeChat/welcome',
+        name: "welcome",
+        component: './MiniApp/EntWeChat/Welcome',
+      },
+    ],
+  },
+  // 推广运营
+  {
+    name:"miniApp.Extend",
+    icon: 'icon-zizhutuiguang-wx',
+    path: '/miniApp/extend',
+    access: "isShow",
+    routes: [
+      {
+        path: '/miniApp/extend',
+        redirect: '/miniApp/extend/book',
+      },
+      {
+        path: '/miniApp/extend/book',
+        name: "book",
+        component: './MiniApp/Extend/Book',
+      },
+      {
+        path: '/miniApp/extend/page',
+        name: "page",
+        component: './MiniApp/Extend/Page',
+      },
+    ],
+  },
   // 数据统计中心
   {
     name:"miniApp.dataManage",

+ 1 - 1
src/global.tsx

@@ -5,7 +5,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
 import nocover from '../public/nocover.jpg'
 const { pwa } = defaultSettings;
 const isHttps = document.location.protocol === 'https:';
-export let scriptUrl = "//at.alicdn.com/t/c/font_4644725_joneow2nore.js"//线上icon
+export let scriptUrl = "//at.alicdn.com/t/c/font_4644725_zdmv8tw2lp.js"//线上icon
 // 自定义icon组件用于线上icon
 export const MyIcon = createFromIconfontCN({
   scriptUrl// 在 iconfont.cn 上生成

+ 12 - 0
src/locales/zh-CN/menu.ts

@@ -68,4 +68,16 @@ export default {
   "menu.miniApp.dataManage.consume":"书币变更记录",
   // 授权
   "menu.miniApp.adBack":"广告回传",
+  // 推广运营
+  "menu.miniApp.Extend":"推广运营",
+  "menu.miniApp.Extend.book":"作品推广",
+  "menu.miniApp.Extend.page":"页面推广",
+  // 公众号
+  "menu.miniApp.EmsCnpl":"公众号",
+  "menu.miniApp.EmsCnpl.auth":"授权管理",
+  "menu.miniApp.EmsCnpl.users":"用户管理",
+  // 企微
+  "menu.miniApp.EntWeChat":"企业微信",
+  "menu.miniApp.EntWeChat.users":"用户管理",
+  "menu.miniApp.EntWeChat.welcome":"欢迎语",
 };

+ 12 - 0
src/models/global.tsx

@@ -70,6 +70,18 @@ export default (): { state: State, init: () => void, getEnum: (enumName: string,
                 { value: 5, description: "退出企业" },
             ]
         }
+        //公众号认证类型
+        enumList["VERIFYTYPE"] = {
+            values: [
+                { value: -1, description: "未认证" },
+                { value: 0, description: "微信认证" },
+                { value: 1, description: "新浪微博认证" },
+                { value: 2, description: "腾讯微博认证" },
+                { value: 3, description: "已资质认证通过但还未通过名称认证" },
+                { value: 4, description: "已资质认证通过、还未通过名称认证,但通过了新浪微博认证" },
+                { value: 5, description: "已资质认证通过、还未通过名称认证,但通过了腾讯微博认证" },
+            ]
+        }
         dispatch({ type: "setAll", params: { enumList, authList } })
         isLoding = false
     }

+ 17 - 16
src/pages/MiniApp/AdBack/index.tsx

@@ -6,8 +6,8 @@ import { Button, Divider, Space } from "antd"
 import { useEffect, useRef, useState } from "react"
 
 function Auth() {
-    let {getEnum} = useModel('global')
-    let {initialState} = useModel("@@initialState")
+    let { getEnum } = useModel('global')
+    let { initialState } = useModel("@@initialState")
     let [key, setKey] = useState<any>()
     let [isEdit, setIsEdit] = useState(false)
     let formRef = useRef()
@@ -16,31 +16,32 @@ function Auth() {
     let GetAppAccountConfig = useAjax((params) => getAppAccountConfig(params))//获取回传配置
     // 获取广告回传列表
     useEffect(() => {
-        console.log("history.location.search",history.location.search)
+        console.log("history.location.search", history.location.search)
         getConfig()
     }, [])
     //获取回传配置
-    const getConfig =()=>{
-        GetAppAccountConfig.run({appType:initialState?.selectApp?.appType,appId:initialState?.selectApp?.id})
+    const getConfig = () => {
+        GetAppAccountConfig.run({ appType: initialState?.selectApp?.appType, appId: initialState?.selectApp?.id })
     }
     // 授权
     const auth = () => {
-        // TencentAdAccountToAuth.run({
-
-        // })
-        console.log("授权",{
-            appType:initialState?.selectApp?.appType,
-            appId:initialState?.selectApp?.id,
-            advertisingChannel:key,
-            callbackPage:"https://testdistribution.zanxiangnet.com/#/miniApp/adBack"
+        TencentAdAccountToAuth.run({
+            appType: initialState?.selectApp?.appType,
+            appId: initialState?.selectApp?.id,
+            advertisingChannel: key,
+            callbackPage: "https://testdistribution.zanxiangwl.com/#/miniApp/adBack"
+        }).then(res => {
+            if (res.code === 200) {
+                window.open(res.data)
+            }
         })
     }
     return <PageContainer
-        tabList={getEnum("ADVERTISING_CHANNEL","arr")?.map((item: { label: any; key: any },index:number)=>{
-            if(index === 0 && !key){
+        tabList={getEnum("ADVERTISING_CHANNEL", "arr")?.map((item: { label: any; key: any }, index: number) => {
+            if (index === 0 && !key) {
                 setKey(item.key)
             }
-            return {tab:item.label,key:item.key}
+            return { tab: item.label, key: item.key }
         })}
         tabProps={{
             type: 'card',

+ 13 - 6
src/pages/MiniApp/BookManage/Short/tableConfig.tsx

@@ -3,6 +3,7 @@ import { getDescriptions } from "@/utils";
 import { ProColumns } from "@ant-design/pro-components";
 import { Badge, Col, Image, Row, Space, Tag } from "antd";
 import { createStyles } from "antd-style";
+import BookExtend from "../components/extend";
 const useStyles = createStyles(({ token }) => {
     return {
         bookLabel: {
@@ -10,7 +11,10 @@ const useStyles = createStyles(({ token }) => {
         },
         del: {
             textDecoration: "line-through",
-            color:token.colorTextDisabled
+            color: token.colorTextDisabled
+        },
+        tuiguang: {
+            color: token.colorSuccessActive
         }
     }
 })
@@ -26,8 +30,8 @@ const brightColors = [
     "#FF69B4", // 热粉红色
     "#FF1493"  // 深粉红色
 ];
-export const columns = (props: { authList?: any[], labelList?: any[], enumList?: { [key: string]: any }, categoryList?: any[], lookBook: (data: any) => void, closeForm: (b: boolean, d: any) => void, setWorkDirection: (w: any) => void ,isModal:boolean}): ProColumns<any>[] => {
-    let { authList, labelList, categoryList, enumList, lookBook, closeForm, setWorkDirection,isModal } = props
+export const columns = (props: { authList?: any[], labelList?: any[], enumList?: { [key: string]: any }, categoryList?: any[], lookBook: (data: any) => void, closeForm: (b: boolean, d: any) => void, setWorkDirection: (w: any) => void, isModal: boolean }): ProColumns<any>[] => {
+    let { authList, labelList, categoryList, enumList, lookBook, closeForm, setWorkDirection, isModal } = props
     let { styles } = useStyles()
     return enumList?.BOOK_STATUS ? [
         {
@@ -208,9 +212,12 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             ellipsis: true,
             align: 'center',
             hideInSearch: true,
-            hideInTable:isModal,
+            hideInTable: isModal,
             render: (a: any, b: any) => {
-                return <a onClick={() => { closeForm(true, b) }}>付费配置</a>
+                return <Space>
+                    <a onClick={() => { closeForm(true, b) }}>付费配置</a>
+                    <BookExtend shortBookId={b?.bookId} bookName={b?.shortBookInfoVO?.bookName}/>
+                </Space>
             }
         },
         // 搜索条件
@@ -346,7 +353,7 @@ export const columns = (props: { authList?: any[], labelList?: any[], enumList?:
             dataIndex: 'wordCount',
             valueType: 'segmented',
             hideInTable: true,
-            fieldProps: { type: 'primary', style: { width: 'auto' },block:true},
+            fieldProps: { type: 'primary', style: { width: 'auto' }, block: true },
             colSize: 3,
             initialValue: '',
             valueEnum: {

+ 24 - 0
src/pages/MiniApp/BookManage/components/extend/formConfig.tsx

@@ -0,0 +1,24 @@
+import { ProFormColumnsType } from "@ant-design/pro-components";
+
+function formConfig(props?: { }): ProFormColumnsType<{
+    name: string;
+    state: string;
+}>[] {
+    return [
+        {
+            title: '链接名称',
+            dataIndex: 'linkName',
+            formItemProps: {
+                style: { marginBottom: 10 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+        },
+    ]
+}
+
+export default formConfig

+ 57 - 0
src/pages/MiniApp/BookManage/components/extend/index.tsx

@@ -0,0 +1,57 @@
+import { BetaSchemaForm, ProFormInstance } from "@ant-design/pro-components"
+import { Button } from "antd"
+import { useEffect, useRef, useState } from "react";
+import formConfig from "./formConfig";
+import { useModel } from "@umijs/max";
+import { getPromotionLink, getPromotionPage } from "@/services/miniApp/extend";
+import { useAjax } from "@/Hook/useAjax";
+import { copy } from "@/utils";
+
+
+function BookExtend(props: { shortBookId?: any, bookName: any, longBookId?: any, longBookChapterId?: any }) {
+    let [open, setOpen] = useState<any>(false)
+    let { initialState } = useModel('@@initialState')
+    const formRef = useRef<ProFormInstance>();
+    let GetPromotionPage = useAjax((params) => getPromotionPage(params))//页面列表
+    let PromotionLink = useAjax((params) => getPromotionLink(params))//创建链接
+    let publicData = {
+        appId: initialState?.selectApp?.id,
+        appType: initialState?.selectApp?.appType
+    }
+    const submit = async (values: any) => {
+        let data = {
+            appType: initialState?.selectApp?.appType,
+            appId: initialState?.selectApp?.id,
+            linkType:1,
+            ...values,
+            appPageId: GetPromotionPage?.data?.data?.[0].id
+        }
+        PromotionLink.run(props?.shortBookId ? { ...data, shortBookId: props.shortBookId } : { ...data, longBookId: props.longBookId, longBookChapterId: props?.longBookChapterId }).then(res => {
+            if (res.code === 200) {
+                copy(res?.data?.data)
+            }
+        })
+    }
+    return <div>
+        <Button type="link" size="small" onClick={() => {
+            setOpen(true)
+            GetPromotionPage.run({ ...publicData, readingContent: true })
+        }}>推广</Button>
+        {/* 推广配置 */}
+        <BetaSchemaForm<any>
+            title={`《${props?.bookName}》推广配置`}
+            formRef={formRef}
+            open={open}
+            onOpenChange={(b) => { !b && setOpen(b) }}
+            layoutType={"ModalForm"}
+            labelCol={{ span: 6 }}
+            wrapperCol={{ span: 14 }}
+            layout='horizontal'
+            onFinish={submit}
+            columns={formConfig()}
+            loading={PromotionLink?.loading}
+        />
+    </div>
+}
+
+export default BookExtend

+ 62 - 0
src/pages/MiniApp/EmsCnpl/Auth/index.tsx

@@ -0,0 +1,62 @@
+import { PageContainer, ProTable } from "@ant-design/pro-components"
+import { columns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+import { history, useModel } from "@umijs/max"
+import { Button } from "antd"
+import { PlusCircleOutlined } from "@ant-design/icons"
+import { listOfPage } from "@/services/miniApp/extend"
+import { authSuccess, getMpAccount, preAuth } from "@/services/miniApp/emsCnpl"
+import { useEffect } from "react"
+
+const Page: React.FC = () => {
+    let { initialState } = useModel("@@initialState")
+    let getList = useAjax((params) => getMpAccount(params), { type: 'table' })
+    let PreAuth = useAjax((params) => preAuth(params)) //授权地址
+    let AuthSuccess = useAjax((params) => authSuccess(params)) //授权
+    useEffect(()=>{
+        console.log("history.location.search", history.location.search)
+    },[])
+    // 授权
+    const auth = () => {
+        PreAuth.run({ callbackPage: "https://testdistribution.zanxiangwl.com/#/miniApp/emsCnpl/auth" }).then(res => {
+            if (res.code === 200) {
+                window.open(res?.data?.data)
+            }
+        })
+    }
+    return <PageContainer title={false}
+    >
+        <ProTable<any, any>
+            scroll={{ x: true }}
+            toolBarRender={() => {
+                return [
+                    <Button
+                        type="primary"
+                        onClick={auth}
+                    >
+                        <PlusCircleOutlined />
+                        授权
+                    </Button>,
+                ];
+            }}
+            params={{
+                appId: initialState?.selectApp?.id || "",
+                appType: initialState?.selectApp?.appType || "",
+                linkType: 1,
+            }}
+            headerTitle={"已授权公众号列表"}
+            rowKey={(r) => r.linkId}
+            search={{
+                labelWidth: 90,
+                span: 4
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns(initialState?.selectApp?.appCategory || 1)}
+        // bordered
+        />
+    </PageContainer>
+
+}
+export default Page

+ 99 - 0
src/pages/MiniApp/EmsCnpl/Auth/tableConfig.tsx

@@ -0,0 +1,99 @@
+import { ProColumns } from "@ant-design/pro-components";
+import { useModel } from "@umijs/max";
+import { Avatar, Badge, Image, Typography } from 'antd';
+const { Paragraph } = Typography;
+export const columns = (appCategory: 1 | 2): ProColumns<any>[] => {
+    let { getEnum } = useModel("global")
+    return [
+        {
+            title: "公众号AppId",
+            dataIndex: 'mpAppId',
+            key: "mpAppId",
+            align: "center",
+        },
+        {
+            title: "公众号名称",
+            dataIndex: 'nickName',
+            key: "nickName",
+            align: "center",
+            render: (_, row) => {
+                return <div> <Avatar shape="square" size={64} src={row?.headImg} />{row?.nickName}</div>
+            }
+        },
+        {
+            title: "公众号类型",
+            dataIndex: 'serviceTypeInfo',
+            key: "serviceTypeInfo",
+            align: "center",
+            hideInSearch: true,
+            render: (_, row) => {
+                return ["订阅号", "服务号"][row?.serviceTypeInfo]
+            }
+        },
+        {
+            title: "公众号认证类型",
+            dataIndex: 'verifyTypeInfo',
+            key: "verifyTypeInfo",
+            align: "center",
+            hideInSearch: true,
+            valueEnum: getEnum("VERIFYTYPE", "map")
+        },
+        {
+            title: "主体名称",
+            dataIndex: 'principalName',
+            key: "principalName",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "原始ID",
+            dataIndex: 'userName',
+            key: "userName",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "公众号所设置的微信号",
+            dataIndex: 'alias',
+            key: "alias",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "用以了解功能的开通状况",
+            dataIndex: 'businessInfo',
+            key: "businessInfo",
+            align: "center",
+            hideInSearch: true,
+            render: (_, row) => {
+                return ["未开通", "已开通"][row?.businessInfo]
+            }
+        },
+        {
+            title: "二维码",
+            dataIndex: 'qrcodeUrl',
+            key: "qrcodeUrl",
+            hideInSearch: true,
+            align: "center",
+            render: (_, row) => {
+                return  <Image src={row?.qrcodeUrl} style={{width:25}} />
+            }
+        },
+        {
+            title: "授权状态",
+            dataIndex: 'authStatus',
+            key: "authStatus",
+            hideInSearch: true,
+            align: "center",
+            valueEnum(row) {
+                let obj = {true:{
+                    text:<Badge status="success" text="已授权" />
+                },false:{
+                    text:<Badge status="error" text="未授权" />
+                }}
+                return  obj
+            },
+        },
+
+    ];
+}

+ 0 - 0
src/pages/MiniApp/EmsCnpl/Users/index.tsx


+ 58 - 0
src/pages/MiniApp/EmsCnpl/Users/tableConfig.tsx

@@ -0,0 +1,58 @@
+import { ProColumns } from "@ant-design/pro-components";
+import { Typography } from 'antd';
+const { Paragraph } = Typography;
+export const columns = (appCategory: 1 | 2): ProColumns<any>[] => {
+    return [
+        {
+            title: "链接名称",
+            dataIndex: 'linkName',
+            key: "linkName",
+            align: "center",
+        },
+        {
+            title: "书籍名称",
+            dataIndex: 'bookName',
+            key: "bookName",
+            align: "center",
+        },
+        {
+            title: "推广章节",
+            dataIndex: 'bookChapterName',
+            key: "bookChapterName",
+            align: "center",
+            hideInSearch: true,
+            hideInTable: appCategory === 2
+        },
+        {
+            title: "创建时间",
+            dataIndex: 'createTime',
+            key: "createTime",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "链接",
+            dataIndex: 'pagePath',
+            key: "pagePath",
+            hideInSearch: true,
+            align: "center",
+            render: (_, row) => {
+                return <Paragraph copyable>{row.pagePath}</Paragraph>
+            }
+        },
+
+        // 搜索条件
+        {
+            title: "开始时间",
+            dataIndex: 'startTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+        {
+            title: "结束时间",
+            dataIndex: 'endTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+    ];
+}

+ 0 - 0
src/pages/MiniApp/EntWeChat/Users/index.tsx


+ 0 - 0
src/pages/MiniApp/EntWeChat/Welcome/index.tsx


+ 49 - 0
src/pages/MiniApp/Extend/Book/index.tsx

@@ -0,0 +1,49 @@
+import { PageContainer, ProTable } from "@ant-design/pro-components"
+import { columns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+import { history, useModel } from "@umijs/max"
+import { Button } from "antd"
+import { PlusCircleOutlined } from "@ant-design/icons"
+import { listOfPage } from "@/services/miniApp/extend"
+
+const Page: React.FC = () => {
+    let { initialState } = useModel("@@initialState")
+    let getList = useAjax((params) => listOfPage(params), { type: 'table' })
+    return <PageContainer title={false}
+    >
+        <ProTable<any, any>
+            scroll={{ x: true}}
+            toolBarRender={() => {
+                return [
+                    <Button
+                        type="primary"
+                        onClick={() => {
+                            history.push("/miniApp/book")
+                        }}
+                    >
+                        <PlusCircleOutlined />
+                        新建作品链接
+                    </Button>,
+                ];
+            }}
+            params={{
+                appId: initialState?.selectApp?.id || "",
+                appType: initialState?.selectApp?.appType || "",
+                linkType:1,
+            }}
+            headerTitle={"作品推广列表"}
+            rowKey={(r) => r.linkId}
+            search={{
+                labelWidth: 90,
+                span:4
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns(initialState?.selectApp?.appCategory || 1)}
+        // bordered
+        />
+    </PageContainer>
+
+}
+export default Page

+ 58 - 0
src/pages/MiniApp/Extend/Book/tableConfig.tsx

@@ -0,0 +1,58 @@
+import { ProColumns } from "@ant-design/pro-components";
+import { Typography } from 'antd';
+const { Paragraph } = Typography;
+export const columns = (appCategory: 1 | 2): ProColumns<any>[] => {
+    return [
+        {
+            title: "链接名称",
+            dataIndex: 'linkName',
+            key: "linkName",
+            align: "center",
+        },
+        {
+            title: "书籍名称",
+            dataIndex: 'bookName',
+            key: "bookName",
+            align: "center",
+        },
+        {
+            title: "推广章节",
+            dataIndex: 'bookChapterName',
+            key: "bookChapterName",
+            align: "center",
+            hideInSearch: true,
+            hideInTable: appCategory === 2
+        },
+        {
+            title: "创建时间",
+            dataIndex: 'createTime',
+            key: "createTime",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "链接",
+            dataIndex: 'pagePath',
+            key: "pagePath",
+            hideInSearch: true,
+            align: "center",
+            render: (_, row) => {
+                return <Paragraph copyable>{row.pagePath}</Paragraph>
+            }
+        },
+
+        // 搜索条件
+        {
+            title: "开始时间",
+            dataIndex: 'startTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+        {
+            title: "结束时间",
+            dataIndex: 'endTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+    ];
+}

+ 45 - 0
src/pages/MiniApp/Extend/Page/extend/formConfig.tsx

@@ -0,0 +1,45 @@
+import { ProFormColumnsType } from "@ant-design/pro-components";
+
+function formConfig(props: { pageList: any[] }): ProFormColumnsType<{
+    name: string;
+    state: string;
+}>[] {
+    return [
+        {
+            title: '链接名称',
+            dataIndex: 'linkName',
+            formItemProps: {
+                style: { marginBottom: 10 },
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+        },
+        {
+            title: '推广页面',
+            dataIndex: 'appPageId',
+            valueType: 'radio',
+            valueEnum() {
+                let obj: any = {}
+                props?.pageList?.forEach(item => {
+                    obj[item.id] = { text: item.pageName }
+                })
+                return obj
+            },
+            formItemProps: {
+                rules: [
+                    {
+                        required: true,
+                        message: '此项为必填项',
+                    },
+                ],
+            },
+         
+        },
+    ]
+}
+
+export default formConfig

+ 64 - 0
src/pages/MiniApp/Extend/Page/extend/index.tsx

@@ -0,0 +1,64 @@
+import { BetaSchemaForm, ProFormInstance } from "@ant-design/pro-components"
+import { Button } from "antd"
+import { useEffect, useRef, useState } from "react";
+import formConfig from "./formConfig";
+import { useModel } from "@umijs/max";
+import { getPromotionLink, getPromotionPage } from "@/services/miniApp/extend";
+import { useAjax } from "@/Hook/useAjax";
+import { copy } from "@/utils";
+import { PlusCircleOutlined } from "@ant-design/icons";
+
+
+function PageExtend(props: { reload?: () => void }) {
+    let [open, setOpen] = useState<any>(false)
+    let { initialState } = useModel('@@initialState')
+    const formRef = useRef<ProFormInstance>();
+    let GetPromotionPage = useAjax((params) => getPromotionPage(params))//页面列表
+    let PromotionLink = useAjax((params) => getPromotionLink(params))//创建链接
+    let publicData = {
+        appId: initialState?.selectApp?.id,
+        appType: initialState?.selectApp?.appType
+    }
+    const submit = async (values: any) => {
+        let data = {
+            appType: initialState?.selectApp?.appType,
+            appId: initialState?.selectApp?.id,
+            linkType: 2,
+            ...values,
+        }
+        PromotionLink.run(data).then(res => {
+            if (res.code === 200) {
+                copy(res?.data?.data)
+                props?.reload?.()
+            }
+        })
+    }
+    return <div>
+        <Button
+            type="primary"
+            onClick={() => {
+                setOpen(true)
+                GetPromotionPage.run({ ...publicData, readingContent: false })
+            }}
+        >
+            <PlusCircleOutlined />
+            新建页面链接
+        </Button>
+        {/* 推广配置 */}
+        <BetaSchemaForm<any>
+            title={`页面推广配置`}
+            formRef={formRef}
+            open={open}
+            onOpenChange={(b) => { !b && setOpen(b) }}
+            layoutType={"ModalForm"}
+            labelCol={{ span: 6 }}
+            wrapperCol={{ span: 14 }}
+            layout='horizontal'
+            onFinish={submit}
+            columns={formConfig({ pageList: GetPromotionPage?.data?.data })}
+            loading={PromotionLink?.loading}
+        />
+    </div>
+}
+
+export default PageExtend

+ 44 - 0
src/pages/MiniApp/Extend/Page/index.tsx

@@ -0,0 +1,44 @@
+import { ActionType, PageContainer, ProTable } from "@ant-design/pro-components"
+import { columns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+import { useModel } from "@umijs/max"
+import PageExtend from "./extend"
+import { useRef } from "react"
+import { listOfPage } from "@/services/miniApp/extend"
+
+const Page: React.FC = () => {
+    let { initialState } = useModel("@@initialState")
+    const actionRef = useRef<ActionType>();
+    let getList = useAjax((params) => listOfPage(params), { type: 'table' })
+    return <PageContainer title={false}
+    >
+        <ProTable<any, any>
+            scroll={{ x: true }}
+            actionRef={actionRef}
+            toolBarRender={() => {
+                return [
+                    <PageExtend reload={actionRef?.current?.reload} />,
+                ];
+            }}
+            params={{
+                appId: initialState?.selectApp?.id || "",
+                appType: initialState?.selectApp?.appType || "",
+                linkType:2
+            }}
+            headerTitle={"页面推广列表"}
+            rowKey={(r) => r.linkId}
+            search={{
+                labelWidth: 90,
+                span:4
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns()}
+        // bordered
+        />
+
+    </PageContainer>
+
+}
+export default Page

+ 50 - 0
src/pages/MiniApp/Extend/Page/tableConfig.tsx

@@ -0,0 +1,50 @@
+import { ProColumns } from "@ant-design/pro-components";
+import { Typography } from 'antd';
+const { Paragraph } = Typography;
+export const columns = (): ProColumns<any>[] => {
+    return [
+        {
+            title: "链接名称",
+            dataIndex: 'linkName',
+            key: "linkName",
+            align: "center",
+        },
+        {
+            title: "页面名称",
+            dataIndex: 'pageName',
+            key: "pageName",
+            align: "center",
+        },
+        {
+            title: "创建时间",
+            dataIndex: 'createTime',
+            key: "createTime",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "链接",
+            dataIndex: 'pagePath',
+            key: "pagePath",
+            hideInSearch: true,
+            align: "center",
+            render: (_, row) => {
+                return <Paragraph copyable>{row.pagePath}</Paragraph>
+            }
+        },
+
+        // 搜索条件
+        {
+            title: "开始时间",
+            dataIndex: 'startTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+        {
+            title: "结束时间",
+            dataIndex: 'endTime',
+            valueType: 'date',
+            hideInTable: true
+        },
+    ];
+}

+ 0 - 1
src/pages/MiniApp/ModuleConfig/vip/formConfig.tsx

@@ -1,4 +1,3 @@
-import { convertEnumArr } from "@/utils";
 import { ProFormColumnsType } from "@ant-design/pro-components";
 import { useModel } from "@umijs/max";
 

+ 42 - 0
src/services/miniApp/emsCnpl/index.tsx

@@ -0,0 +1,42 @@
+import { api } from '@/services/api';
+import { request } from '@umijs/max';
+/**公众号用户列表 */
+export async function longBookCoinList(params: any) {
+    return request(api + '/admin/mpAccount/listOfPage', {
+        method: 'GET',
+        params
+    });
+}
+/**公众号授权地址 */
+export async function preAuth(params: {
+    callbackPage:string,
+}) {
+    return request(api + '/admin/mpAccount/preAuth', {
+        method: 'GET',
+        params
+    });
+}
+/**公众号授权列表 */
+export async function getMpAccount(params:{
+    appId:any,
+    appType:any,
+    pageNum:any,
+    pageSize:any
+} ) {
+    return request(api + '/admin/mpAccount/getMpAccount', {
+        method: 'GET',
+        params
+    });
+}
+/**公众号授权 */
+export async function authSuccess(params: {
+    uuid:any,
+    authCode:any,
+    appId:any,
+    appType:any
+}) {
+    return request(api + '/admin/mpAccount/authSuccess', {
+        method: 'GET',
+        params
+    });
+}

+ 25 - 0
src/services/miniApp/extend/index.tsx

@@ -0,0 +1,25 @@
+import { api } from '@/services/api';
+import { request } from '@umijs/max';
+/**推广配置 */
+export async function getPromotionLink(data: any) {
+    return request(api + '/admin/appAdvertisingLink/getPromotionLink', {
+        method: 'POST',
+        data
+    });
+}
+
+/**推广列表 */
+export async function listOfPage(data: any) {
+    return request(api + '/admin/appAdvertisingLink/listOfPage', {
+        method: 'POST',
+        data
+    });
+}
+
+/**页面模板列表 */
+export async function getPromotionPage(params: any) {
+    return request(api + '/admin/appAdvertisingLink/getPromotionPage', {
+        method: 'GET',
+        params
+    });
+}

+ 15 - 1
src/utils/index.ts

@@ -1,3 +1,5 @@
+import { message } from "antd";
+
 /**传入数组枚举数组和key数组 找到在枚举数组中的description值
  * @param {Array} enumArr 枚举数组
  * @param {Array} arr 要查找的数组
@@ -39,4 +41,16 @@ export const dataURLtoFile = (dataurl: any, filename: any) => {
       u8arr[n] = bstr.charCodeAt(n);
     }
     return new File([u8arr], filename, { type: mime });
-  };
+  };
+
+// 点击复制
+export const copy = (str: string) => {
+    let element = document.createElement("textarea");
+    element.id = 'myTextarea'
+    element.textContent = str
+    document.body.append(element);
+    (document.getElementById('myTextarea') as any).select();
+    document.execCommand("Copy")
+    document.body.removeChild(element);
+    message.success(`复制成功:${str}`)
+}