shenwu 8 月之前
父節點
當前提交
5cc362b485

+ 13 - 6
config/routes.tsx

@@ -14,7 +14,7 @@ const newMenu = [
   // 分销商页面
   {
     path: '/distributor',
-    redirect: '/distributor/miniApp',
+    redirect: '/distributor/wxMiniApp',
   },
   {
     name: 'distributor.account',
@@ -24,11 +24,18 @@ const newMenu = [
     component: './Distributor/Account',
   },
   {
-    name: 'distributor.miniApp',
-    icon: 'icon-xiaochengxu',
-    path: '/distributor/miniApp',
+    name: 'distributor.wxMiniApp',
+    icon: 'icon-weixin',
+    path: '/distributor/wxMiniApp',
     access: "isShow",
-    component: './Distributor/MiniApp',
+    component: './Distributor/WxMiniApp',
+  },
+  {
+    name: 'distributor.dyMiniApp',
+    icon: 'icon-douyinzhanghao',
+    path: '/distributor/dyMiniApp',
+    access: "isShow",
+    component: './Distributor/DyMiniApp',
   },
   // 小程序页面
   {
@@ -143,7 +150,7 @@ export default [
   },
   {
     path: '/',
-    redirect: '/distributor/miniApp',
+    redirect: '/distributor/wxMiniApp',
   },
   {
     path: '*',

+ 2 - 1
src/locales/zh-CN/menu.ts

@@ -51,7 +51,8 @@ export default {
   'menu.editor.koni': '拓扑编辑器',
   // 新增
   // 分销商页面
-  "menu.distributor.miniApp":"微信小程序管理",
+  "menu.distributor.wxMiniApp":"微信小程序管理",
+  "menu.distributor.dyMiniApp":"抖音小程序管理",
   "menu.distributor.account":"账号管理",
   // 小程序页面
   "menu.miniApp.consume":"消费订单管理",

+ 1 - 1
src/pages/Distributor/Account/tableConfig.tsx

@@ -8,7 +8,7 @@ export const columns = (): ProColumns<any>[] => {
             dataIndex: 'id',
             hideInSearch: true,
             align: "center",
-            key: "id"
+            key: "id",
         },
         {
             title: "账号昵称",

+ 42 - 0
src/pages/Distributor/DyMiniApp/index.tsx

@@ -0,0 +1,42 @@
+import { miniAppList } from "@/services/distributor/miniApp"
+import { PageContainer, ProTable } from "@ant-design/pro-components"
+import { Table } from "antd"
+import { columns, childrenColumns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+
+const Page: React.FC = () => {
+    let getList = useAjax((params) => miniAppList(params), { type: 'table' })
+    return <PageContainer>
+        <ProTable<any, any>
+            headerTitle={"抖音小程序列表"}
+            rowKey={(r) => r.id}
+            search={{
+                labelWidth: 120,
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns()}
+            // showHeader={false}//隐藏标题
+            // options={false}//隐藏工具栏
+            // ghost={true}//幽灵模式
+            // bordered
+            expandable={{
+                rowExpandable: (record) => record.status,
+                expandRowByClick: true,
+                expandedRowRender: (record) => {
+                    return <Table
+                        columns={childrenColumns}
+                        dataSource={record.wxAppCarrierVOList}
+                        rowKey={(r) => r.id}
+                        pagination={false}
+                        size='small'
+                        bordered
+                    />
+                },
+            }}
+        />
+    </PageContainer>
+
+}
+export default Page

+ 11 - 4
src/pages/Distributor/MiniApp/tableConfig.tsx → src/pages/Distributor/DyMiniApp/tableConfig.tsx

@@ -1,6 +1,7 @@
 import MenuChange from "@/components/MenuChange";
+import { MyIcon } from "@/global";
 import { ProColumns } from "@ant-design/pro-components";
-import { Badge, TableColumnsType } from "antd";
+import { Badge, Space, TableColumnsType } from "antd";
 
 export const columns = (): ProColumns<any>[] => {
     return [
@@ -8,14 +9,20 @@ export const columns = (): ProColumns<any>[] => {
             title: "小程序名称",
             dataIndex: 'appName',
             key: "appName",
-            align: "center",
+            align: "left",
+            render:(a:any,b:any)=>{
+                return <Space size={[3,0]}>
+                    <MyIcon type="icon-xiaochengxu-dy" />
+                    {b.appName}
+                </Space>
+            }
         },
         {
             title: "AppId",
             dataIndex: 'appId',
             key: "appId",
             hideInSearch: true,
-            align: "center",
+            align: "left",
         },
 
         {
@@ -34,7 +41,7 @@ export const columns = (): ProColumns<any>[] => {
             valueType: 'option',
             align: "center",
             render: (_, record) => {
-                return <MenuChange menuType="miniApp" data={{ ...record, appType: record.status ? 1 : 2 }}><a type='primary'>管理</a></MenuChange>
+                return <MenuChange menuType="miniApp" data={{ ...record, appType: 2 }}><a type='primary'>管理</a></MenuChange>
             },
         },
     ];

+ 0 - 0
src/pages/Distributor/MiniApp/index.tsx → src/pages/Distributor/WxMiniApp/index.tsx


+ 71 - 0
src/pages/Distributor/WxMiniApp/tableConfig.tsx

@@ -0,0 +1,71 @@
+import MenuChange from "@/components/MenuChange";
+import { MyIcon } from "@/global";
+import { ProColumns } from "@ant-design/pro-components";
+import { Badge, Space, TableColumnsType } from "antd";
+
+export const columns = (): ProColumns<any>[] => {
+    return [
+        {
+            title: "小程序名称",
+            dataIndex: 'appName',
+            key: "appName",
+            align: "left",
+            render: (a: any, b: any) => {
+                return <Space size={[3,0]}>
+                    <MyIcon type="icon-xiaochengxu-wx" />
+                    {b.appName}
+                </Space>
+            }
+        },
+        {
+            title: "AppId",
+            dataIndex: 'appId',
+            key: "appId",
+            hideInSearch: true,
+            align: "left",
+        },
+
+        {
+            title: "运营载体状态",
+            dataIndex: 'status',
+            key: "status",
+            hideInSearch: true,
+            align: "center",
+            render: (a) => {
+                return <Badge status={a ? "processing" : "error"} text={a ? "有" : "无"} />
+            }
+        },
+        {
+            title: "操作",
+            dataIndex: 'option',
+            valueType: 'option',
+            align: "center",
+            render: (_, record) => {
+                return <MenuChange menuType="miniApp" data={{ ...record, appType:1 }}><a type='primary'>管理</a></MenuChange>
+            },
+        },
+    ];
+}
+export const childrenColumns: TableColumnsType<any> = [
+    {
+        title: "载体名称",
+        dataIndex: 'carrierName',
+        key: "carrierName",
+        align: "center",
+    },
+    {
+        title: "载体类型",
+        dataIndex: 'carrierType',
+        key: "carrierType",
+        align: "center",
+        render: (a: string, b: any) => {
+            return { '1': '企业微信', "2": "公众号" }[a]
+        }
+    },
+    {
+        title: "绑定时间",
+        dataIndex: 'createTime',
+        key: "createTime",
+        align: "center",
+    }
+]