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);