Commit 86aaebbd authored by XieZhiXiong's avatar XieZhiXiong

feat: 调整 会员信息查询 相关

parent e4ca589c
...@@ -444,72 +444,87 @@ const MemberRoute: RouterChild = { ...@@ -444,72 +444,87 @@ const MemberRoute: RouterChild = {
}, },
// 会员信息查询 // 会员信息查询
{ {
path: '/memberCenter/memberAbility/query', path: '/memberCenter/memberAbility/profile',
name: 'memberQuery', name: 'memberProfile',
component: '@/pages/member/memberQuery/index',
},
// 会员信息查询-详情
{
path: '/memberCenter/memberAbility/query/detail',
name: 'memberQueryDetail',
component: '@/pages/member/memberQuery/detailed',
hideInMenu: true,
noMargin: true,
routes: [ routes: [
// 会员信息查询-详情-基本信息 // 会员信息查询
{
path: '/memberCenter/memberAbility/profile/query',
name: 'memberQuery',
component: '@/pages/member/memberQuery/index',
},
// 会员信息查询-详情
{
path: '/memberCenter/memberAbility/profile/query/detail',
name: 'memberQueryDetail',
component: '@/pages/member/memberQuery/detailed',
hideInMenu: true,
noMargin: true,
routes: [
// 会员信息查询-详情-基本信息
{
path: '/memberCenter/memberAbility/profile/query/detail/basicInfo',
name: 'basicInfo',
component: '@/pages/member/memberQuery/detailed/basicInfo',
hideInMenu: true,
},
// 会员信息查询-详情-等级信息
{
path: '/memberCenter/memberAbility/profile/query/detail/levelInfo',
name: 'levelInfo',
component: '@/pages/member/memberQuery/detailed/levelInfo',
hideInMenu: true,
},
// 会员信息查询-详情-权益信息
{
path: '/memberCenter/memberAbility/profile/query/detail/equityInfo',
name: 'equityInfo',
component: '@/pages/member/memberQuery/detailed/equityInfo',
hideInMenu: true,
},
// 会员信息查询-详情-诚信信息
{
path: '/memberCenter/memberAbility/profile/query/detail/sincerityInfo',
name: 'sincerityInfo',
component: '@/pages/member/memberQuery/detailed/sincerityInfo',
hideInMenu: true,
},
],
},
// 新增会员角色
{ {
path: '/memberCenter/memberAbility/query/detail/basicInfo', path: '/memberCenter/memberAbility/profile/query/addSubRole',
name: 'basicInfo', name: 'addSubRole',
component: '@/pages/member/memberQuery/detailed/basicInfo',
hideInMenu: true, hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/addSubRole',
}, },
// 会员信息查询-详情-等级信息 // 申请会员
{ {
path: '/memberCenter/memberAbility/query/detail/levelInfo', path: '/memberCenter/memberAbility/profile/query/apply',
name: 'levelInfo', name: 'applyMember',
component: '@/pages/member/memberQuery/detailed/levelInfo',
hideInMenu: true, hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/applyMember',
}, },
// 会员信息查询-详情-权益信息 // 会员信息变更
{ {
path: '/memberCenter/memberAbility/query/detail/equityInfo', path: '/memberCenter/memberAbility/profile/query/modify',
name: 'equityInfo', name: 'modifyMember',
component: '@/pages/member/memberQuery/detailed/equityInfo',
hideInMenu: true, hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/applyMember',
}, },
// 会员信息查询-详情-诚信信息 // 修改注册信息
{ {
path: '/memberCenter/memberAbility/query/detail/sincerityInfo', path: '/memberCenter/memberAbility/profile/query/update',
name: 'sincerityInfo', name: 'memberUpdate',
component: '@/pages/member/memberQuery/detailed/sincerityInfo',
hideInMenu: true, hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/updateMember',
}, },
], ],
}, },
// 会员信息变更
{
path: '/memberCenter/memberAbility/query/update',
name: 'memberUpdate',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/update',
},
// 新增会员角色
{
path: '/memberCenter/memberAbility/query/addSubRole',
name: 'addSubRole',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/addSubRole',
},
// 申请会员
{
path: '/memberCenter/memberAbility/query/apply',
name: 'applyMember',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberQuery/applyMember',
},
// 会员考察 // 会员考察
{ {
path: '/memberCenter/memberAbility/memberInspection', path: '/memberCenter/memberAbility/memberInspection',
......
...@@ -134,15 +134,16 @@ export default { ...@@ -134,15 +134,16 @@ export default {
'menu.memberAbility.memberManage.maintainUnfreeze': '会员解除', 'menu.memberAbility.memberManage.maintainUnfreeze': '会员解除',
'menu.memberAbility.memberManage.maintainEliminate': '解除关系', 'menu.memberAbility.memberManage.maintainEliminate': '解除关系',
'menu.memberAbility.memberManage.maintainBlack': '加入黑名单', 'menu.memberAbility.memberManage.maintainBlack': '加入黑名单',
'menu.memberAbility.memberQuery': '会员信息查询', 'menu.memberAbility.memberProfile.memberQuery': '会员信息查询',
'menu.memberAbility.memberQueryDetail': '会员信息详情', 'menu.memberAbility.memberProfile.memberQueryDetail': '会员信息详情',
'menu.memberAbility.memberQueryDetail.basicInfo': '会员基本信息', 'menu.memberAbility.memberProfile.memberQueryDetail.basicInfo': '会员基本信息',
'menu.memberAbility.memberQueryDetail.levelInfo': '会员等级信息', 'menu.memberAbility.memberProfile.memberQueryDetail.levelInfo': '会员等级信息',
'menu.memberAbility.memberQueryDetail.equityInfo': '权益信息', 'menu.memberAbility.memberProfile.memberQueryDetail.equityInfo': '权益信息',
'menu.memberAbility.memberQueryDetail.sincerityInfo': '诚信信息', 'menu.memberAbility.memberProfile.memberQueryDetail.sincerityInfo': '诚信信息',
'menu.memberAbility.memberUpdate': '变更会员信息', 'menu.memberAbility.memberProfile.memberUpdate': '修改注册信息',
'menu.memberAbility.addSubRole': '新建会员角色', 'menu.memberAbility.memberProfile.addSubRole': '新建会员角色',
'menu.memberAbility.applyMember': '申请会员', 'menu.memberAbility.memberProfile.modifyMember': '变更会员信息',
'menu.memberAbility.memberProfile.applyMember': '申请会员',
'menu.memberAbility.memberRuleConfiguration': '会员规则配置', 'menu.memberAbility.memberRuleConfiguration': '会员规则配置',
'menu.memberAbility.memberRuleConfiguration.memberLevel': '会员等级', 'menu.memberAbility.memberRuleConfiguration.memberLevel': '会员等级',
'menu.memberAbility.memberRuleConfiguration.memberLevelEdit': '会员权益设置', 'menu.memberAbility.memberRuleConfiguration.memberLevelEdit': '会员权益设置',
......
...@@ -87,7 +87,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => { ...@@ -87,7 +87,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
</Link> </Link>
</div> </div>
<div className={styles.nav_list_item}> <div className={styles.nav_list_item}>
<Link to="/memberCenter/memberAbility/query"> <Link to="/memberCenter/memberAbility/profile/query">
<img src={memberInfoIcon} /> <img src={memberInfoIcon} />
<span>会员信息</span> <span>会员信息</span>
</Link> </Link>
...@@ -99,7 +99,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => { ...@@ -99,7 +99,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
</Link> </Link>
</div> </div>
<div className={styles.nav_list_item}> <div className={styles.nav_list_item}>
<Link to="/memberCenter/memberAbility/query"> <Link to="/memberCenter/memberAbility/profile/query">
<img src={memberBenefitsIcon} /> <img src={memberBenefitsIcon} />
<span>会员权益</span> <span>会员权益</span>
</Link> </Link>
......
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 15:53:07
* @Description: 新增会员角色
*/
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { history, Prompt } from 'umi'; import { history, Prompt } from 'umi';
import { Button, Card, Spin, message } from 'antd'; import { Button, Card, Spin, message } from 'antd';
...@@ -8,8 +15,7 @@ import { usePageStatus } from '@/hooks/usePageStatus'; ...@@ -8,8 +15,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi'; import { schema, GroupItem } from './schema/createRole';
import { initDetailSchema } from './schema';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -18,8 +24,7 @@ const { ...@@ -18,8 +24,7 @@ const {
const AddSubRole: React.FC<any> = props => { const AddSubRole: React.FC<any> = props => {
const { memberTypeId, roleId } = usePageStatus(); const { memberTypeId, roleId } = usePageStatus();
const [memberItems, setMemberItems] = useState<any>({}); const [memberItems, setMemberItems] = useState<GroupItem[]>([]);
const [memberInfo, setMemberInfo] = useState<GetMemberAbilitySubGetResponse>(null);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false); const [unsaved, setUnsaved] = useState(false);
...@@ -97,15 +102,14 @@ const AddSubRole: React.FC<any> = props => { ...@@ -97,15 +102,14 @@ const AddSubRole: React.FC<any> = props => {
<NiceForm <NiceForm
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={formActions} actions={formActions}
initialValues={memberInfo || {}} effects={() => {
effects={($, actions) => {
onFormInputChange$().subscribe(() => { onFormInputChange$().subscribe(() => {
if (!unsaved) { if (!unsaved) {
setUnsaved(true); setUnsaved(true);
} }
}); });
}} }}
schema={initDetailSchema(memberItems)} schema={schema(memberItems)}
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35 * @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 16:07:15 * @LastEditTime: 2021-06-04 16:00:10
* @Description: 会员权益信息详情 * @Description: 会员权益信息详情
*/ */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
...@@ -15,14 +15,13 @@ import MemberRights from '../../components/MemberRights'; ...@@ -15,14 +15,13 @@ import MemberRights from '../../components/MemberRights';
import MemberRightsRecords, { ReceivedData, UsageData } from '../../components/MemberRightsRecords'; import MemberRightsRecords, { ReceivedData, UsageData } from '../../components/MemberRightsRecords';
const MemberRightsInfo: React.FC<{}> = () => { const MemberRightsInfo: React.FC<{}> = () => {
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [equityInfo, setEquityInfo] = useState<GetMemberAbilityMaintenanceDetailRightBasicResponse>(null); const [equityInfo, setEquityInfo] = useState<GetMemberAbilityMaintenanceDetailRightBasicResponse>(null);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const getEquityInfo = () => { const getEquityInfo = () => {
setInfoLoading(true); setInfoLoading(true);
PublicApi.getMemberAbilityInfoDetailRightBasic({ PublicApi.getMemberAbilityInfoDetailRightBasic({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -41,7 +40,6 @@ const MemberRightsInfo: React.FC<{}> = () => { ...@@ -41,7 +40,6 @@ const MemberRightsInfo: React.FC<{}> = () => {
const getReceivedList = params => { const getReceivedList = params => {
return new Promise<{ data: ReceivedData[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: ReceivedData[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailRightHistoryPage({ PublicApi.getMemberAbilityInfoDetailRightHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
...@@ -56,7 +54,6 @@ const MemberRightsInfo: React.FC<{}> = () => { ...@@ -56,7 +54,6 @@ const MemberRightsInfo: React.FC<{}> = () => {
const getUsageList = params => { const getUsageList = params => {
return new Promise<{ data: UsageData[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: UsageData[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailRightSpendHistoryPage({ PublicApi.getMemberAbilityInfoDetailRightSpendHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
......
...@@ -36,17 +36,16 @@ interface QueryProps { ...@@ -36,17 +36,16 @@ interface QueryProps {
const MemberQueryDetailed: React.FC<QueryProps> = props => { const MemberQueryDetailed: React.FC<QueryProps> = props => {
const { MemberStore, children } = props; const { MemberStore, children } = props;
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityInfoDetailBasicResponse>(null); const [memberInfo, setMemberInfo] = useState<GetMemberAbilityInfoDetailBasicResponse>(null);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const getBasicInfo = () => { const getBasicInfo = () => {
if (!id || !validateId) { if (!validateId) {
return; return;
} }
setInfoLoading(true); setInfoLoading(true);
PublicApi.getMemberAbilityInfoDetailBasic({ PublicApi.getMemberAbilityInfoDetailBasic({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -61,7 +60,7 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => { ...@@ -61,7 +60,7 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => {
useEffect(() => { useEffect(() => {
// 手动重定向到基础信息页,防止查询字符串被弄掉 // 手动重定向到基础信息页,防止查询字符串被弄掉
history.replace(`/memberCenter/memberAbility/query/detail/basicInfo?id=${id}&validateId=${validateId}`); history.replace(`/memberCenter/memberAbility/profile/query/detail/basicInfo?&validateId=${validateId}`);
getBasicInfo(); getBasicInfo();
}, []); }, []);
...@@ -70,16 +69,16 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => { ...@@ -70,16 +69,16 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => {
const url = match.url === '/' ? '' : match.url; const url = match.url === '/' ? '' : match.url;
switch (val) { switch (val) {
case 'basicInfo': case 'basicInfo':
history.push(`${url}/basicInfo?id=${id}&validateId=${validateId}`); history.push(`${url}/basicInfo?&validateId=${validateId}`);
break; break;
case 'levelInfo': case 'levelInfo':
history.push(`${url}/levelInfo?id=${id}&validateId=${validateId}`); history.push(`${url}/levelInfo?&validateId=${validateId}`);
break; break;
case 'equityInfo': case 'equityInfo':
history.push(`${url}/equityInfo?id=${id}&validateId=${validateId}`); history.push(`${url}/equityInfo?&validateId=${validateId}`);
break; break;
case 'sincerityInfo': case 'sincerityInfo':
history.push(`${url}/sincerityInfo?id=${id}&validateId=${validateId}`); history.push(`${url}/sincerityInfo?&validateId=${validateId}`);
break; break;
default: default:
break; break;
...@@ -200,7 +199,7 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => { ...@@ -200,7 +199,7 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => {
)} )}
/> />
)} )}
onBack={() => history.push(`/memberCenter/memberAbility/manage/maintain`)} onBack={() => history.push(`/memberCenter/memberAbility/profile/query`)}
anchors={getAnchorsArr()} anchors={getAnchorsArr()}
extra={( extra={(
<Bookmark value={getBookmarkKey()} onChange={handleBookmarkChange}> <Bookmark value={getBookmarkKey()} onChange={handleBookmarkChange}>
......
...@@ -21,17 +21,16 @@ import MemberDocRectificationInfo from '../../components/MemberDocRectificationI ...@@ -21,17 +21,16 @@ import MemberDocRectificationInfo from '../../components/MemberDocRectificationI
import MemberChangedInfo from '../../components/MemberChangedInfo'; import MemberChangedInfo from '../../components/MemberChangedInfo';
const MemberLevelInfo: React.FC<{}> = () => { const MemberLevelInfo: React.FC<{}> = () => {
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [levelInfo, setLevelInfo] = useState<GetMemberAbilityMaintenanceDetailLevelBasicResponse>(null); const [levelInfo, setLevelInfo] = useState<GetMemberAbilityMaintenanceDetailLevelBasicResponse>(null);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const getMemberLevelInfo = () => { const getMemberLevelInfo = () => {
if (!id && !validateId) { if (!validateId) {
return; return;
} }
setInfoLoading(true); setInfoLoading(true);
PublicApi.getMemberAbilityInfoDetailLevelBasic({ PublicApi.getMemberAbilityInfoDetailLevelBasic({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -51,7 +50,6 @@ const MemberLevelInfo: React.FC<{}> = () => { ...@@ -51,7 +50,6 @@ const MemberLevelInfo: React.FC<{}> = () => {
const getActivePointRecords = params => { const getActivePointRecords = params => {
return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailLevelHistoryPage({ PublicApi.getMemberAbilityInfoDetailLevelHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
......
...@@ -29,7 +29,7 @@ export interface BasicInfo { ...@@ -29,7 +29,7 @@ export interface BasicInfo {
}; };
const MemberSincerityInfo: React.FC<{}> = () => { const MemberSincerityInfo: React.FC<{}> = () => {
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [basicInfo, setBasicInfo] = useState<BasicInfo>(null); const [basicInfo, setBasicInfo] = useState<BasicInfo>(null);
const [basicInfoLoading, setBasicInfoLoading] = useState(false); const [basicInfoLoading, setBasicInfoLoading] = useState(false);
const [orderEstimateSum, setOrderEstimateSum] = useState<EstimateSumItems[]>([]); const [orderEstimateSum, setOrderEstimateSum] = useState<EstimateSumItems[]>([]);
...@@ -47,7 +47,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -47,7 +47,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getBasicInfo = () => { const getBasicInfo = () => {
setBasicInfoLoading(true); setBasicInfoLoading(true);
PublicApi.getMemberAbilityInfoDetailCreditBasic({ PublicApi.getMemberAbilityInfoDetailCreditBasic({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -91,7 +90,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -91,7 +90,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getOrderEstimateSum = () => { const getOrderEstimateSum = () => {
setOrderEstimateSumLoading(true); setOrderEstimateSumLoading(true);
PublicApi.getMemberAbilityInfoDetailCreditTradeSummary({ PublicApi.getMemberAbilityInfoDetailCreditTradeSummary({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -108,7 +106,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -108,7 +106,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getAfterEstimateSum = () => { const getAfterEstimateSum = () => {
setAfterServiceEstimateSumLoading(true); setAfterServiceEstimateSumLoading(true);
PublicApi.getMemberAbilityInfoDetailCreditAftersaleSummary({ PublicApi.getMemberAbilityInfoDetailCreditAftersaleSummary({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -124,7 +121,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -124,7 +121,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
// 反馈汇总 // 反馈汇总
const getFeedbackSum = () => { const getFeedbackSum = () => {
PublicApi.getMemberAbilityInfoDetailCreditComplainSummary({ PublicApi.getMemberAbilityInfoDetailCreditComplainSummary({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
...@@ -145,7 +141,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -145,7 +141,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getOrderEvaluationList = (params) => { const getOrderEvaluationList = (params) => {
return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailCreditTradeHistoryPage({ PublicApi.getMemberAbilityInfoDetailCreditTradeHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
...@@ -161,7 +156,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -161,7 +156,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getAfterServiceEvaluationList = (params) => { const getAfterServiceEvaluationList = (params) => {
return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: ListItem[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailCreditAftersaleHistoryPage({ PublicApi.getMemberAbilityInfoDetailCreditAftersaleHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
...@@ -177,7 +171,6 @@ const MemberSincerityInfo: React.FC<{}> = () => { ...@@ -177,7 +171,6 @@ const MemberSincerityInfo: React.FC<{}> = () => {
const getFeedbackList = (params) => { const getFeedbackList = (params) => {
return new Promise<{ data: FeedbackItem[] , totalCount: number }>((resolve, reject) => { return new Promise<{ data: FeedbackItem[] , totalCount: number }>((resolve, reject) => {
PublicApi.getMemberAbilityInfoDetailCreditComplainHistoryPage({ PublicApi.getMemberAbilityInfoDetailCreditComplainHistoryPage({
memberId: id,
validateId, validateId,
...params, ...params,
}).then(res => { }).then(res => {
......
...@@ -24,7 +24,8 @@ import { ...@@ -24,7 +24,8 @@ import {
MEMBER_LEVEL_TYPE_CHANNEL, MEMBER_LEVEL_TYPE_CHANNEL,
MEMBER_OUTER_STATUS_FAILED, MEMBER_OUTER_STATUS_FAILED,
} from '@/constants/member'; } from '@/constants/member';
import { maintianSchema } from './schema'; import useSpliceArray from '@/hooks/useSpliceArray';
import { querySchema } from './schema';
import { coverColFiltersItem } from '../utils'; import { coverColFiltersItem } from '../utils';
import { import {
MEMBER_OUTER_STATUS_BADGE_COLOR, MEMBER_OUTER_STATUS_BADGE_COLOR,
...@@ -43,20 +44,14 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -43,20 +44,14 @@ const MemberQuery: React.FC<{}> = () => {
return res.data; return res.data;
}; };
const handleJumpUpdate = record => { // 跳转修改会员信息页面
history.push(`/memberCenter/memberAbility/query/update?id=${record.memberId}&validateId=${record.validateId}`); const handleJumpModify = record => {
history.push(`/memberCenter/memberAbility/profile/query/modify?&validateId=${record.validateId}`);
}; };
// 再次申请 // 跳转修改注册信息页面
const handleReapply = record => { const handleJumpUpdate = record => {
PublicApi.postMemberAbilityInfoValidateRecommit({ history.push(`/memberCenter/memberAbility/profile/query/update?&validateId=${record.validateId}`);
memberId: record.memberId,
validateId: record.validateId,
}).then(res => {
if (res.code === 1000) {
ref.current.reload();
}
});
}; };
const defaultColumns: ColumnType<any>[] = [ const defaultColumns: ColumnType<any>[] = [
...@@ -66,7 +61,7 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -66,7 +61,7 @@ const MemberQuery: React.FC<{}> = () => {
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/query/detail?id=${record.memberId}&validateId=${record.validateId}`} url={`/memberCenter/memberAbility/profile/query/detail?validateId=${record.validateId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -100,7 +95,7 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -100,7 +95,7 @@ const MemberQuery: React.FC<{}> = () => {
}, },
{ {
title: '入库时间', title: '入库时间',
dataIndex: 'comingTime', dataIndex: 'depositTime',
align: 'center', align: 'center',
}, },
{ {
...@@ -120,45 +115,42 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -120,45 +115,42 @@ const MemberQuery: React.FC<{}> = () => {
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (text, record) => ( render: (_, record) => (
<> <>
{/* 渠道会员, 且外部审核状态为不通过才可以 变更信息 */} {/* 渠道会员, 且外部审核状态为不通过才可以 变更信息 */}
{ {
( record.showModify && (
record.levelTypeEnum === MEMBER_LEVEL_TYPE_PLATFORM &&
record.outerStatus === MEMBER_OUTER_STATUS_FAILED
) && (
<Button <Button
type="link" type="link"
onClick={() => handleJumpUpdate(record)} onClick={() => handleJumpModify(record)}
> >
变更信息 变更
</Button> </Button>
) )
} }
{/* 商户会员、渠道会员 且外部审核状态为不通过才可以 再次申请 */} {/* 商户会员、渠道会员 且外部审核状态为不通过才可以 再次申请 */}
{ {
( record.showUpdate && (
(
record.levelTypeEnum === MEMBER_LEVEL_TYPE_MERCHANT ||
record.levelTypeEnum === MEMBER_LEVEL_TYPE_CHANNEL
) &&
record.outerStatus === MEMBER_OUTER_STATUS_FAILED
) && (
<Button <Button
type="link" type="link"
onClick={() => handleReapply(record)} onClick={() => handleJumpUpdate(record)}
> >
再次申请 修改
</Button> </Button>
) )
} }
<Button
type="link"
onClick={() => handleJumpUpdate(record)}
>
修改
</Button>
</> </>
), ),
}, },
]; ];
const [columns, setColumns] = useState<any[]>(defaultColumns); const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
// 初始化高级筛选选项 // 初始化高级筛选选项
const fetchSelectOptions = async () => { const fetchSelectOptions = async () => {
...@@ -170,16 +162,14 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -170,16 +162,14 @@ const MemberQuery: React.FC<{}> = () => {
outerStatus = [], outerStatus = [],
} = data; } = data;
const newColumns = columns.slice(); const outerIndex = columns.findIndex((item) => item.dataIndex === 'memberTypeName');
// filter 0 过滤掉全部选项 if (outerIndex) {
coverColFiltersItem( columnsHandle.replace(outerIndex, {
newColumns, ...columns[outerIndex],
'outerStatusName', filters: outerStatus.map(item => ({ text: item.text, value: item.id })).filter(item => item.value !== 0),
outerStatus.map(item => ({ text: item.text, value: item.id })).filter(item => item.value !== 0), });
); }
setColumns(newColumns);
return { return {
outerStatus: outerStatus.map(item => ({ label: item.text, value: item.id })), outerStatus: outerStatus.map(item => ({ label: item.text, value: item.id })),
...@@ -190,14 +180,14 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -190,14 +180,14 @@ const MemberQuery: React.FC<{}> = () => {
const handleSubmit = values => { const handleSubmit = values => {
history.push({ history.push({
pathname: `/memberCenter/memberAbility/query/addSubRole`, pathname: `/memberCenter/memberAbility/profile/query/addSubRole`,
query: { query: {
...values, ...values,
}, },
}); });
}; };
const controllerBtns = ( const ControllerBtns = () => (
<Space> <Space>
<Button <Button
type="primary" type="primary"
...@@ -221,8 +211,8 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -221,8 +211,8 @@ const MemberQuery: React.FC<{}> = () => {
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
expressionScope={{ components={{
controllerBtns, ControllerBtns,
}} }}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
effects={($, actions) => { effects={($, actions) => {
...@@ -237,7 +227,7 @@ const MemberQuery: React.FC<{}> = () => { ...@@ -237,7 +227,7 @@ const MemberQuery: React.FC<{}> = () => {
fetchSelectOptions, fetchSelectOptions,
); );
}} }}
schema={maintianSchema} schema={querySchema}
/> />
} }
/> />
......
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 15:51:19
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 15:51:20
* @Description:
*/
import { ISchema } from '@formily/antd';
import { createMemberSchema, ElementType } from '../../utils';
export type GroupItem = {
/**
* 组名
*/
groupName: string,
/**
* 元素
*/
elements: ElementType[],
};
export const schema = (groups: GroupItem[]): ISchema => {
const tabSchema: ISchema = {
properties: {},
};
if (Array.isArray(groups)) {
for (let [index, item] of groups.entries()) {
tabSchema.properties[`tab-${index}`] = {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: item.groupName,
},
properties: {
[`MEGA_LAYOUT${index}`]: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: createMemberSchema(item.elements),
},
},
};
}
}
return {
type: 'object',
properties: {
tabs: {
type: 'object',
'x-component': 'Tab',
'x-component-props': {
type: 'card',
},
...tabSchema,
},
},
};
};
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants'
export const maintianSchema: ISchema = { export const querySchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
megaLayout: { megaLayout: {
...@@ -18,10 +17,7 @@ export const maintianSchema: ISchema = { ...@@ -18,10 +17,7 @@ export const maintianSchema: ISchema = {
properties: { properties: {
ctl: { ctl: {
type: 'object', type: 'object',
'x-component': 'Children', 'x-component': 'ControllerBtns',
'x-component-props': {
children: '{{controllerBtns}}',
},
}, },
name: { name: {
type: 'string', type: 'string',
......
import React, { useState, useEffect, useRef } from 'react'; /*
import { history, Prompt } from 'umi'; * @Author: XieZhiXiong
import { Button, Card, Spin, message } from 'antd'; * @Date: 2021-06-04 15:37:19
import { PageHeaderWrapper } from '@ant-design/pro-layout'; * @LastEditors: XieZhiXiong
import { SaveOutlined } from '@ant-design/icons'; * @LastEditTime: 2021-06-04 15:54:38
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; * @Description: 修改会员注册信息
import { usePageStatus } from '@/hooks/usePageStatus'; */
import ReutrnEle from '@/components/ReturnEle'; import React, { useState, useEffect } from 'react';
import NiceForm from '@/components/NiceForm'; import { history, Prompt } from 'umi';
import { PublicApi } from '@/services/api'; import { Button, Card, Spin, message } from 'antd';
import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { initDetailSchema } from './schema'; import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
const formActions = createFormActions(); import { usePageStatus } from '@/hooks/usePageStatus';
const { import ReutrnEle from '@/components/ReturnEle';
onFormInputChange$, import NiceForm from '@/components/NiceForm';
} = FormEffectHooks; import { PublicApi } from '@/services/api';
import { schema, GroupItem } from '../schema/createRole';
const MemberUpdate: React.FC<any> = props => {
const areaRef = useRef<any[]>([]) const formActions = createFormActions();
const { id, validateId } = usePageStatus(); const {
const [memberItems, setMemberItems] = useState<any>({}); onFormInputChange$,
const [memberInfo, setMemberInfo] = useState<GetMemberAbilitySubGetResponse>(null); } = FormEffectHooks;
const [submitLoading, setSubmitLoading] = useState(false);
const [infoLoading, setInfoLoading] = useState(false); const MemberUpdate: React.FC<any> = props => {
const [unsaved, setUnsaved] = useState(false); const { validateId } = usePageStatus();
const [memberItems, setMemberItems] = useState<GroupItem[]>([]);
const getDetailedInfo = async () => { const [submitLoading, setSubmitLoading] = useState(false);
if (id && validateId) { const [infoLoading, setInfoLoading] = useState(false);
setInfoLoading(true); const [unsaved, setUnsaved] = useState(false);
const infoRes = await PublicApi.getMemberAbilityInfoDetailUpdateGet({
memberId: id, const getDetailedInfo = async () => {
validateId, if (validateId) {
}); setInfoLoading(true);
const infoRes = await PublicApi.getMemberAbilityInfoDetail({
setInfoLoading(false); validateId,
if (infoRes.code !== 1000) { });
return;
} setInfoLoading(false);
const { groups = [] } = infoRes.data; if (infoRes.code !== 1000) {
return;
setMemberItems(groups); }
} const { groups = [] } = infoRes.data;
};
setMemberItems(groups);
useEffect(() => { }
getDetailedInfo(); };
}, []);
useEffect(() => {
const handleSubmit = (values: any) => { getDetailedInfo();
if (!id || !validateId) { }, []);
return;
} const handleSubmit = (values: any) => {
setSubmitLoading(true); if (!validateId) {
const msg = message.loading({ return;
content: '正在保存,请稍候...', }
duration: 0, setSubmitLoading(true);
}); const msg = message.loading({
PublicApi.postMemberAbilityInfoDetailUpdate({ content: '正在保存,请稍候...',
memberId: id, duration: 0,
validateId, });
detail: values, PublicApi.postMemberAbilityInfoDetailUpdate({
}).then(res => { validateId,
if (res.code !== 1000) { detail: values,
return; }).then(res => {
} if (res.code !== 1000) {
setUnsaved(false); return;
setTimeout(() => { }
history.goBack(); setUnsaved(false);
}, 800); setTimeout(() => {
}).finally(() => { history.goBack();
msg(); }, 800);
setSubmitLoading(false); }).finally(() => {
}); msg();
}; setSubmitLoading(false);
});
return ( };
<Spin spinning={infoLoading}>
<PageHeaderWrapper return (
style={{ <Spin spinning={infoLoading}>
padding: 24, <PageHeaderWrapper
}} style={{
onBack={() => history.goBack()} padding: 24,
backIcon={<ReutrnEle description="返回" />} }}
title="编辑会员" onBack={() => history.goBack()}
extra={[ backIcon={<ReutrnEle description="返回" />}
<Button title="编辑会员"
key="1" extra={[
type="primary" <Button
icon={<SaveOutlined />} key="1"
loading={submitLoading} type="primary"
onClick={() => formActions.submit()} icon={<SaveOutlined />}
> loading={submitLoading}
保存 onClick={() => formActions.submit()}
</Button>, >
]} 保存
> </Button>,
<Card> ]}
<NiceForm >
onSubmit={handleSubmit} <Card>
actions={formActions} <NiceForm
initialValues={memberInfo || {}} onSubmit={handleSubmit}
effects={($, actions) => { actions={formActions}
onFormInputChange$().subscribe(() => { effects={() => {
if (!unsaved) { onFormInputChange$().subscribe(() => {
setUnsaved(true); if (!unsaved) {
} setUnsaved(true);
}); }
}} });
schema={initDetailSchema(memberItems)} }}
/> schema={schema(memberItems)}
</Card> />
</PageHeaderWrapper> </Card>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</Spin> <Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
); </Spin>
}; );
};
export default MemberUpdate; export default MemberUpdate;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment