From 573a0944f05b61ce84a0c0e746b28f517a966066 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 26 Feb 2024 17:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B9=B0=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants.ts | 15 +++++++++++++++ src/pages/MemberList/index.tsx | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 451000a..94c51c3 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -77,6 +77,21 @@ const Constants = { INDIVIDUAL: '个体户', BUSINESS: '公司' }, + /** + * 会员类型 + */ + pbcUserType: { + 0: '卖家', + 1: '买家' + }, + /** + * 会员来源渠道 + */ + pbcUserSourceType: { + qrcode: '二维码', + link: '链接', + share: '买家' + }, }; export default Constants; diff --git a/src/pages/MemberList/index.tsx b/src/pages/MemberList/index.tsx index 28a0d03..414f830 100644 --- a/src/pages/MemberList/index.tsx +++ b/src/pages/MemberList/index.tsx @@ -49,6 +49,11 @@ const TableList: React.FC<{}> = () => { const access: any = useAccess(); const columns: ProColumns[] = [ + { + title: '会员类型', + dataIndex: 'pbcUserType', + valueEnum: Constants.pbcUserType + }, { title: '会员昵称', dataIndex: 'pbcUserNickName', @@ -61,6 +66,7 @@ const TableList: React.FC<{}> = () => { title: '入口', dataIndex: 'pbcUserSourceType', search: false, + valueEnum: Constants.pbcUserSourceType }, { title: '会员等级', @@ -121,12 +127,18 @@ const TableList: React.FC<{}> = () => { columns={columns} actionRef={actionRef} request={(param: any) => { + console.log(param) + let hasUserType = false + if (param.pbcUserType) { + param.pbcUserType = parseInt(param.pbcUserType) + hasUserType = true + } const queryParam = handlePageQuery(param); - if (queryParam.filters) { + if (!hasUserType && queryParam.filters) { queryParam.filters.push({ key: 'pbcUserType'.replace(/([A-Z])/g, '_$1').toLowerCase(), - value: 0, - action: '=', + value: 1, + action: '<=', }); } return fetchData(queryParam);