Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
94730a23
Commit
94730a23
authored
Jun 04, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接 会员信息 相关
parent
0b6b068c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1590 additions
and
54 deletions
+1590
-54
memberRoute.ts
config/routes/memberRoute.ts
+27
-3
menu.ts
src/locales/zh-CN/menu.ts
+4
-1
index.less
src/pages/member/memberMaintain/black/index.less
+0
-0
index.tsx
src/pages/member/memberMaintain/black/index.tsx
+0
-0
schema.ts
src/pages/member/memberMaintain/black/schema.ts
+60
-0
index.less
src/pages/member/memberMaintain/correct/index.less
+0
-0
index.tsx
src/pages/member/memberMaintain/correct/index.tsx
+275
-0
schema.ts
src/pages/member/memberMaintain/correct/schema.ts
+61
-0
index.less
src/pages/member/memberMaintain/eliminate/index.less
+0
-0
index.tsx
src/pages/member/memberMaintain/eliminate/index.tsx
+275
-0
schema.ts
src/pages/member/memberMaintain/eliminate/schema.ts
+61
-0
index.less
src/pages/member/memberMaintain/freeze/index.less
+0
-0
index.tsx
src/pages/member/memberMaintain/freeze/index.tsx
+265
-0
schema.ts
src/pages/member/memberMaintain/freeze/schema.ts
+44
-0
index.tsx
src/pages/member/memberMaintain/index.tsx
+69
-50
schema.ts
src/pages/member/memberMaintain/schema.ts
+123
-0
index.tsx
src/pages/member/memberMaintain/schema/index.tsx
+0
-0
index.less
src/pages/member/memberMaintain/unfreeze/index.less
+0
-0
index.tsx
src/pages/member/memberMaintain/unfreeze/index.tsx
+265
-0
schema.ts
src/pages/member/memberMaintain/unfreeze/schema.ts
+61
-0
No files found.
config/routes/memberRoute.ts
View file @
94730a23
...
...
@@ -102,11 +102,35 @@ const MemberRoute: RouterChild = {
},
// 会员信息-冻结
{
path
:
'/memberCenter/memberAbility/manage/maintain/fr
ozen
'
,
name
:
'maintainFr
ozen
'
,
path
:
'/memberCenter/memberAbility/manage/maintain/fr
eeze
'
,
name
:
'maintainFr
eeze
'
,
hideInMenu
:
true
,
noMargin
:
true
,
component
:
'@/pages/member/memberMaintain/frozen'
,
component
:
'@/pages/member/memberMaintain/freeze'
,
},
// 会员信息-解冻
{
path
:
'/memberCenter/memberAbility/manage/maintain/unfreeze'
,
name
:
'maintainUnfreeze'
,
hideInMenu
:
true
,
noMargin
:
true
,
component
:
'@/pages/member/memberMaintain/unfreeze'
,
},
// 会员信息-解除关系
{
path
:
'/memberCenter/memberAbility/manage/maintain/eliminate'
,
name
:
'maintainEliminate'
,
hideInMenu
:
true
,
noMargin
:
true
,
component
:
'@/pages/member/memberMaintain/eliminate'
,
},
// 会员信息-加入黑名单
{
path
:
'/memberCenter/memberAbility/manage/maintain/black'
,
name
:
'maintainBlack'
,
hideInMenu
:
true
,
noMargin
:
true
,
component
:
'@/pages/member/memberMaintain/black'
,
},
// // 待提交审核
// {
...
...
src/locales/zh-CN/menu.ts
View file @
94730a23
...
...
@@ -130,7 +130,10 @@ export default {
'menu.memberAbility.memberManage.maintainDetail.levelInfo'
:
'会员等级信息'
,
'menu.memberAbility.memberManage.maintainDetail.equityInfo'
:
'权益信息'
,
'menu.memberAbility.memberManage.maintainDetail.sincerityInfo'
:
'诚信信息'
,
'menu.memberAbility.memberManage.maintainFrozen'
:
'会员冻结与解除'
,
'menu.memberAbility.memberManage.maintainFreeze'
:
'会员冻结'
,
'menu.memberAbility.memberManage.maintainUnfreeze'
:
'会员解除'
,
'menu.memberAbility.memberManage.maintainEliminate'
:
'解除关系'
,
'menu.memberAbility.memberManage.maintainBlack'
:
'加入黑名单'
,
'menu.memberAbility.memberQuery'
:
'会员信息查询'
,
'menu.memberAbility.memberQueryDetail'
:
'会员信息详情'
,
'menu.memberAbility.memberQueryDetail.basicInfo'
:
'会员基本信息'
,
...
...
src/pages/member/memberMaintain/
frozen
.less
→
src/pages/member/memberMaintain/
black/index
.less
View file @
94730a23
File moved
src/pages/member/memberMaintain/
frozen
.tsx
→
src/pages/member/memberMaintain/
black/index
.tsx
View file @
94730a23
This diff is collapsed.
Click to expand it.
src/pages/member/memberMaintain/black/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:39:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:47:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
export
const
blockedModalSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
date
:
{
type
:
'string'
,
title
:
'进入黑名单日期'
,
'x-component'
:
'DatePicker'
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'100%'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择进入黑名单日期'
,
},
],
},
reason
:
{
type
:
'string'
,
title
:
'进入黑名单原因'
,
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写原因'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
src/pages/member/memberMaintain/correct/index.less
0 → 100644
View file @
94730a23
src/pages/member/memberMaintain/correct/index.tsx
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:36:43
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:53:48
* @Description: 会员整改详情
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
Tooltip
,
Space
,
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
StopOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
DatePicker
,
}
from
'@formily/antd-components'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMemberAbilityMaintenanceDetailResponse
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/layouts/AnchorPage'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
LevelBrand
from
'@/components/LevelBrand'
;
import
FlowRecords
from
'@/components/FlowRecords'
;
import
CustomizeColumn
from
'@/components/CustomizeColumn'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
unfriendModalSchema
}
from
'./schema'
;
import
{
MEMBER_OUTER_COLUMNS
,
MEMBER_INNER_COLUMNS
,
}
from
'../../constant'
;
import
MemberBasicInfo
from
'../../components/MemberBasicInfo'
;
import
MemberChannelInfo
from
'../../components/MemberChannelInfo'
;
import
PicWrap
from
'../../components/PicWrap'
;
type
ValueType
=
{
/**
* 日期
*/
date
:
string
,
/**
* 理由
*/
reason
:
string
,
}
const
formActions
=
createFormActions
();
const
MemberMaintainCorrect
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
validateId
}
=
usePageStatus
();
const
[
memberInfo
,
setMemberInfo
]
=
useState
<
GetMemberAbilityMaintenanceDetailResponse
>
(
null
);
const
[
infoLoading
,
setInfoLoaading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
unfriendModalVisible
,
setUnfriendModalVisible
]
=
useState
(
false
);
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
PublicApi
.
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
PublicApi
.
postMemberAbilityMaintenanceEliminate
({
validateId
:
validateId
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnfriendModalVisible
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
const
anchorsArr
=
[
{
key
:
'basicInfo'
,
name
:
'基本信息'
,
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
'渠道信息'
,
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
'流转记录'
,
},
].
filter
(
Boolean
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
(
<
AvatarWrap
info=
{
{
name
:
memberInfo
?.
name
,
}
}
extra=
{
(
<
LevelBrand
level=
{
2
}
/>
)
}
/>
)
}
anchors=
{
anchorsArr
}
extra=
{
(
<
Space
size=
{
16
}
>
<
Button
icon=
{
<
StopOutlined
/>
}
onClick=
{
()
=>
setUnfriendModalVisible
(
true
)
}
>
解除关系
</
Button
>
</
Space
>
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
MemberBasicInfo
dataSource=
{
{
memberId
:
memberInfo
?.
memberId
,
memberTypeName
:
memberInfo
?.
memberTypeName
,
account
:
memberInfo
?.
account
,
name
:
memberInfo
?.
name
,
roleName
:
memberInfo
?.
roleName
,
phone
:
memberInfo
?.
phone
,
outerStatus
:
memberInfo
?.
outerStatus
,
outerStatusName
:
memberInfo
?.
outerStatusName
,
levelTag
:
memberInfo
?.
levelTag
,
email
:
memberInfo
?.
email
,
createTime
:
memberInfo
?.
registerTime
,
}
}
id=
"basicInfo"
/>
</
Col
>
{
/* 渠道信息 */
}
{
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
(
<
Col
span=
{
24
}
>
<
MemberChannelInfo
dataSource=
{
{
level
:
memberInfo
?.
channelLevelTag
,
type
:
memberInfo
?.
channelTypeName
,
areas
:
memberInfo
?.
areas
,
desc
:
memberInfo
?.
remark
,
}
}
id=
"channelInfo"
/>
</
Col
>
)
:
null
}
{
/* 其他注册信息 */
}
{
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
(
<
Col
span=
{
24
}
key=
{
`group${index}`
}
>
<
CustomizeColumn
title=
{
item
.
groupName
}
data=
{
(
item
.
elements
.
map
((
ele
)
=>
({
title
:
ele
.
fieldLocalName
,
value
:
(
ele
.
fieldType
!==
'upload'
?
ele
.
fieldValue
:
(
<
PicWrap
pics=
{
[
ele
.
fieldValue
]
}
/>
)
),
}))
)
}
id=
{
`group${index}`
}
/>
</
Col
>
))
:
null
}
{
/* 流转记录 */
}
<
Col
span=
{
24
}
>
<
FlowRecords
outerColumns=
{
MEMBER_OUTER_COLUMNS
}
innerColumns=
{
MEMBER_INNER_COLUMNS
}
outerRowkey=
"id"
innerRowkey=
"id"
outerDataSource=
{
memberInfo
?.
outerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
</
AnchorPage
>
{
/* 解除关系相关 */
}
<
Modal
title=
{
(
<
div
>
会员关系解除
<
Tooltip
title=
"解除当前会员关系,不在享用会员权益;可重新申请会员关系"
>
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
8
}
}
/>
</
Tooltip
>
</
div
>
)
}
visible=
{
unfriendModalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setUnfriendModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
components=
{
{
DatePicker
,
}
}
effects=
{
()
=>
{
}
}
actions=
{
formActions
}
schema=
{
unfriendModalSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
Spin
>
);
};
export
default
MemberMaintainCorrect
;
src/pages/member/memberMaintain/correct/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:39:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:47:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
export
const
unfriendModalSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
date
:
{
type
:
'string'
,
title
:
'解除日期'
,
'x-component'
:
'DatePicker'
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'100%'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择解除日期'
,
},
],
},
reason
:
{
type
:
'string'
,
title
:
'解除原因'
,
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写原因'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
\ No newline at end of file
src/pages/member/memberMaintain/eliminate/index.less
0 → 100644
View file @
94730a23
src/pages/member/memberMaintain/eliminate/index.tsx
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:36:43
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:56:09
* @Description: 解除关系
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
Tooltip
,
Space
,
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
StopOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
DatePicker
,
}
from
'@formily/antd-components'
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMemberAbilityMaintenanceDetailResponse
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/layouts/AnchorPage'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
LevelBrand
from
'@/components/LevelBrand'
;
import
FlowRecords
from
'@/components/FlowRecords'
;
import
CustomizeColumn
from
'@/components/CustomizeColumn'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
unfriendModalSchema
}
from
'./schema'
;
import
{
MEMBER_OUTER_COLUMNS
,
MEMBER_INNER_COLUMNS
,
}
from
'../../constant'
;
import
MemberBasicInfo
from
'../../components/MemberBasicInfo'
;
import
MemberChannelInfo
from
'../../components/MemberChannelInfo'
;
import
PicWrap
from
'../../components/PicWrap'
;
type
ValueType
=
{
/**
* 日期
*/
date
:
string
,
/**
* 理由
*/
reason
:
string
,
}
const
formActions
=
createFormActions
();
const
MemberMaintainEliminate
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
validateId
}
=
usePageStatus
();
const
[
memberInfo
,
setMemberInfo
]
=
useState
<
GetMemberAbilityMaintenanceDetailResponse
>
(
null
);
const
[
infoLoading
,
setInfoLoaading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
unfriendModalVisible
,
setUnfriendModalVisible
]
=
useState
(
false
);
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
PublicApi
.
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
PublicApi
.
postMemberAbilityMaintenanceEliminate
({
validateId
:
validateId
,
...
values
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setUnfriendModalVisible
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
const
anchorsArr
=
[
{
key
:
'basicInfo'
,
name
:
'基本信息'
,
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
'渠道信息'
,
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
'流转记录'
,
},
].
filter
(
Boolean
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
(
<
AvatarWrap
info=
{
{
name
:
memberInfo
?.
name
,
}
}
extra=
{
(
<
LevelBrand
level=
{
2
}
/>
)
}
/>
)
}
anchors=
{
anchorsArr
}
extra=
{
(
<
Space
size=
{
16
}
>
<
Button
icon=
{
<
StopOutlined
/>
}
onClick=
{
()
=>
setUnfriendModalVisible
(
true
)
}
>
解除关系
</
Button
>
</
Space
>
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
MemberBasicInfo
dataSource=
{
{
memberId
:
memberInfo
?.
memberId
,
memberTypeName
:
memberInfo
?.
memberTypeName
,
account
:
memberInfo
?.
account
,
name
:
memberInfo
?.
name
,
roleName
:
memberInfo
?.
roleName
,
phone
:
memberInfo
?.
phone
,
outerStatus
:
memberInfo
?.
outerStatus
,
outerStatusName
:
memberInfo
?.
outerStatusName
,
levelTag
:
memberInfo
?.
levelTag
,
email
:
memberInfo
?.
email
,
createTime
:
memberInfo
?.
registerTime
,
}
}
id=
"basicInfo"
/>
</
Col
>
{
/* 渠道信息 */
}
{
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
(
<
Col
span=
{
24
}
>
<
MemberChannelInfo
dataSource=
{
{
level
:
memberInfo
?.
channelLevelTag
,
type
:
memberInfo
?.
channelTypeName
,
areas
:
memberInfo
?.
areas
,
desc
:
memberInfo
?.
remark
,
}
}
id=
"channelInfo"
/>
</
Col
>
)
:
null
}
{
/* 其他注册信息 */
}
{
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
(
<
Col
span=
{
24
}
key=
{
`group${index}`
}
>
<
CustomizeColumn
title=
{
item
.
groupName
}
data=
{
(
item
.
elements
.
map
((
ele
)
=>
({
title
:
ele
.
fieldLocalName
,
value
:
(
ele
.
fieldType
!==
'upload'
?
ele
.
fieldValue
:
(
<
PicWrap
pics=
{
[
ele
.
fieldValue
]
}
/>
)
),
}))
)
}
id=
{
`group${index}`
}
/>
</
Col
>
))
:
null
}
{
/* 流转记录 */
}
<
Col
span=
{
24
}
>
<
FlowRecords
outerColumns=
{
MEMBER_OUTER_COLUMNS
}
innerColumns=
{
MEMBER_INNER_COLUMNS
}
outerRowkey=
"id"
innerRowkey=
"id"
outerDataSource=
{
memberInfo
?.
outerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
</
AnchorPage
>
{
/* 解除关系相关 */
}
<
Modal
title=
{
(
<
div
>
会员关系解除
<
Tooltip
title=
"解除当前会员关系,不在享用会员权益;可重新申请会员关系"
>
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
8
}
}
/>
</
Tooltip
>
</
div
>
)
}
visible=
{
unfriendModalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setUnfriendModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
components=
{
{
DatePicker
,
}
}
effects=
{
()
=>
{
}
}
actions=
{
formActions
}
schema=
{
unfriendModalSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
Spin
>
);
};
export
default
MemberMaintainEliminate
;
src/pages/member/memberMaintain/eliminate/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:39:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:47:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
export
const
unfriendModalSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
date
:
{
type
:
'string'
,
title
:
'解除日期'
,
'x-component'
:
'DatePicker'
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'100%'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择解除日期'
,
},
],
},
reason
:
{
type
:
'string'
,
title
:
'解除原因'
,
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写原因'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
\ No newline at end of file
src/pages/member/memberMaintain/freeze/index.less
0 → 100644
View file @
94730a23
src/pages/member/memberMaintain/freeze/index.tsx
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 11:31:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 11:42:18
* @Description: 会员冻结
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
StopOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMemberAbilityMaintenanceDetailResponse
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/layouts/AnchorPage'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
LevelBrand
from
'@/components/LevelBrand'
;
import
FlowRecords
from
'@/components/FlowRecords'
;
import
CustomizeColumn
from
'@/components/CustomizeColumn'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
freezeSchema
}
from
'./schema'
;
import
{
MEMBER_OUTER_COLUMNS
,
MEMBER_INNER_COLUMNS
,
}
from
'../../constant'
;
import
MemberBasicInfo
from
'../../components/MemberBasicInfo'
;
import
MemberChannelInfo
from
'../../components/MemberChannelInfo'
;
import
PicWrap
from
'../../components/PicWrap'
;
type
ValueType
=
{
/**
* 理由
*/
reason
:
string
,
}
const
formActions
=
createFormActions
();
const
MemberFrozen
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
validateId
}
=
usePageStatus
();
const
[
memberInfo
,
setMemberInfo
]
=
useState
<
GetMemberAbilityMaintenanceDetailResponse
>
(
null
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoaading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
PublicApi
.
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
// 冻结与解冻
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
PublicApi
.
postMemberAbilityMaintenanceFreeze
({
validateId
:
validateId
,
status
:
2
,
reason
:
values
.
reason
||
''
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setModalVisible
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
const
anchorsArr
=
[
{
key
:
'verifySteps'
,
name
:
'流转进度'
,
},
{
key
:
'basicInfo'
,
name
:
'基本信息'
,
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
'渠道信息'
,
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
'流转记录'
,
},
].
filter
(
Boolean
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
(
<
AvatarWrap
info=
{
{
name
:
memberInfo
?.
name
,
}
}
extra=
{
(
<
LevelBrand
level=
{
2
}
/>
)
}
/>
)
}
anchors=
{
anchorsArr
}
extra=
{
(
<
Button
icon=
{
<
StopOutlined
/>
}
onClick=
{
()
=>
setModalVisible
(
true
)
}
>
冻结
</
Button
>
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
MemberBasicInfo
dataSource=
{
{
memberId
:
memberInfo
?.
memberId
,
memberTypeName
:
memberInfo
?.
memberTypeName
,
account
:
memberInfo
?.
account
,
name
:
memberInfo
?.
name
,
roleName
:
memberInfo
?.
roleName
,
phone
:
memberInfo
?.
phone
,
outerStatus
:
memberInfo
?.
outerStatus
,
outerStatusName
:
memberInfo
?.
outerStatusName
,
levelTag
:
memberInfo
?.
levelTag
,
email
:
memberInfo
?.
email
,
createTime
:
memberInfo
?.
registerTime
,
}
}
id=
"basicInfo"
/>
</
Col
>
{
/* 渠道信息 */
}
{
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
(
<
Col
span=
{
24
}
>
<
MemberChannelInfo
dataSource=
{
{
level
:
memberInfo
?.
channelLevelTag
,
type
:
memberInfo
?.
channelTypeName
,
areas
:
memberInfo
?.
areas
,
desc
:
memberInfo
?.
remark
,
}
}
id=
"channelInfo"
/>
</
Col
>
)
:
null
}
{
/* 其他注册信息 */
}
{
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
(
<
Col
span=
{
24
}
key=
{
`group${index}`
}
>
<
CustomizeColumn
title=
{
item
.
groupName
}
data=
{
(
item
.
elements
.
map
((
ele
)
=>
({
title
:
ele
.
fieldLocalName
,
value
:
(
ele
.
fieldType
!==
'upload'
?
ele
.
fieldValue
:
(
<
PicWrap
pics=
{
[
ele
.
fieldValue
]
}
/>
)
),
}))
)
}
id=
{
`group${index}`
}
/>
</
Col
>
))
:
null
}
{
/* 流转记录 */
}
<
Col
span=
{
24
}
>
<
FlowRecords
outerColumns=
{
MEMBER_OUTER_COLUMNS
}
innerColumns=
{
MEMBER_INNER_COLUMNS
}
outerRowkey=
"id"
innerRowkey=
"id"
outerDataSource=
{
memberInfo
?.
outerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
{
/* 冻结相关 */
}
<
Modal
title=
"会员冻结"
visible=
{
modalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
effects=
{
(
$
,
{
setFieldState
})
=>
{
FormEffectHooks
.
onFieldInit$
(
'reason'
).
subscribe
(()
=>
{
setFieldState
(
'reason'
,
fieldState
=>
{
fieldState
.
props
.
title
=
'会员冻结原因'
;
});
});
}
}
actions=
{
formActions
}
schema=
{
freezeSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
AnchorPage
>
</
Spin
>
);
};
export
default
MemberFrozen
;
src/pages/member/memberMaintain/freeze/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 11:27:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 11:27:43
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
export
const
freezeSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
reason
:
{
type
:
'string'
,
title
:
'会员解冻原因'
,
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写原因'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
\ No newline at end of file
src/pages/member/memberMaintain/index.tsx
View file @
94730a23
import
React
,
{
use
State
,
use
Ref
}
from
'react'
;
import
React
,
{
useRef
}
from
'react'
;
import
{
Link
}
from
'umi'
;
import
{
Card
,
...
...
@@ -8,7 +8,7 @@ import {
import
{
StandardTable
}
from
'god'
;
import
moment
from
'moment'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
...
...
@@ -17,18 +17,13 @@ import NiceForm from '@/components/NiceForm';
import
LevelBrand
from
'@/components/LevelBrand'
;
import
StatusTag
from
'../components/StatusTag'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
MEMBER_STATUS_NORMAL
,
MEMBER_INNER_STATUS_SUCCESS
,
MEMBER_OUTER_STATUS_SUCCESS
,
}
from
'@/constants/member'
;
import
{
maintianSchema
}
from
'./schema'
;
import
useSpliceArray
from
'@/hooks/useSpliceArray'
;
import
{
querySchema
}
from
'./schema'
;
import
{
MEMBER_STATUS_TAG_MAP
,
MEMBER_INNER_STATUS_BADGE_COLOR
,
MEMBER_OUTER_STATUS_TYPE
,
}
from
'../constant'
;
import
{
coverColFiltersItem
}
from
'../utils'
;
import
styles
from
'./index.less'
;
const
formActions
=
createFormActions
();
...
...
@@ -120,23 +115,56 @@ const MemberMaintain: React.FC<[]> = () => {
filters
:
[],
align
:
'center'
,
onFilter
:
(
value
,
record
)
=>
record
.
innerStatus
===
value
,
render
:
(
text
,
record
)
=>
<
Badge
color=
{
MEMBER_INNER_STATUS_BADGE_COLOR
[
record
.
innerStatus
]
}
text=
{
text
}
/>,
render
:
(
text
,
record
)
=>
<
Badge
color=
{
MEMBER_INNER_STATUS_BADGE_COLOR
[
record
.
innerStatus
]
||
'#606266'
}
text=
{
text
}
/>,
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
<>
{
(
record
.
innerStatus
===
MEMBER_INNER_STATUS_SUCCESS
&&
record
.
outerStatus
===
MEMBER_OUTER_STATUS_SUCCESS
)
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/manage/maintain/frozen?id=${record.memberId}&validateId=${record.validateId}`
}
>
{
record
.
showFreeze
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/manage/maintain/freeze?validateId=${record.validateId}`
}
>
<
Button
type=
"link"
>
冻结
</
Button
>
</
Link
>
)
}
{
record
.
showUnfreeze
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/manage/maintain/unfreeze?validateId=${record.validateId}`
}
>
<
Button
type=
"link"
>
解冻
</
Button
>
</
Link
>
)
}
{
record
.
showCorrect
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/memberRectification/rectificationAdd/add?validateId=${record.validateId}`
}
>
<
Button
type=
"link"
>
整改
</
Button
>
</
Link
>
)
}
{
record
.
showEliminate
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/manage/maintain/eliminate?validateId=${record.validateId}`
}
>
<
Button
type=
"link"
>
{
record
.
status
===
MEMBER_STATUS_NORMAL
?
'冻结'
:
'解冻'
}
淘汰
</
Button
>
</
Link
>
)
}
{
record
.
showBlacklist
&&
(
<
Link
to=
{
`/memberCenter/memberAbility/manage/maintain/black?validateId=${record.validateId}`
}
>
<
Button
type=
"link"
>
黑名单
</
Button
>
</
Link
>
)
}
...
...
@@ -145,18 +173,7 @@ const MemberMaintain: React.FC<[]> = () => {
},
];
const
[
columns
,
setColumns
]
=
useState
<
any
[]
>
(
defaultColumns
);
// 更改会员状态
const
handleModify
=
record
=>
{
PublicApi
.
postMemberMaintenanceStatus
({
memberId
:
record
.
memberId
,
validateId
:
record
.
validateId
,
status
:
record
.
status
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
});
};
const
[
columns
,
columnsHandle
]
=
useSpliceArray
<
ColumnType
<
any
>>
(
defaultColumns
);
// 初始化高级筛选选项
const
fetchSelectOptions
=
async
()
=>
{
...
...
@@ -174,26 +191,28 @@ const MemberMaintain: React.FC<[]> = () => {
sources
=
[],
}
=
data
;
const
newColumns
=
columns
.
slice
();
// filter 0 过滤掉全部选项
coverColFiltersItem
(
newColumns
,
'statusName'
,
status
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
);
coverColFiltersItem
(
newColumns
,
'outerStatusName'
,
outerStatus
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
);
coverColFiltersItem
(
newColumns
,
'innerStatusName'
,
innerStatus
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
);
setColumns
(
newColumns
);
const
statusIndex
=
columns
.
findIndex
((
item
)
=>
item
.
dataIndex
===
'statusName'
);
const
outerIndex
=
columns
.
findIndex
((
item
)
=>
item
.
dataIndex
===
'outerStatusName'
);
const
innerIndex
=
columns
.
findIndex
((
item
)
=>
item
.
dataIndex
===
'innerStatusName'
);
if
(
statusIndex
)
{
columnsHandle
.
replace
(
statusIndex
,
{
...
columns
[
statusIndex
],
filters
:
status
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
});
}
if
(
outerIndex
)
{
columnsHandle
.
replace
(
outerIndex
,
{
...
columns
[
outerIndex
],
filters
:
outerStatus
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
});
}
if
(
innerIndex
)
{
columnsHandle
.
replace
(
innerIndex
,
{
...
columns
[
innerIndex
],
filters
:
innerStatus
.
map
(
item
=>
({
text
:
item
.
text
,
value
:
item
.
id
})).
filter
(
item
=>
item
.
value
!==
0
),
});
}
return
{
memberTypeId
:
memberTypes
.
map
(
item
=>
({
label
:
item
.
memberTypeName
,
value
:
item
.
memberTypeId
})),
...
...
@@ -233,7 +252,7 @@ const MemberMaintain: React.FC<[]> = () => {
fetchSelectOptions
,
);
}
}
schema=
{
maintian
Schema
}
schema=
{
query
Schema
}
/>
}
/>
...
...
src/pages/member/memberMaintain/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 11:49:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 11:49:18
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
export
const
querySchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megaLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-left'
,
tip
:
'输入 会员名称 进行搜索'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
6
,
},
properties
:
{
memberTypeId
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员类型(全部)'
,
allowClear
:
true
,
},
},
roleId
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员角色(全部)'
,
allowClear
:
true
,
},
},
level
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员等级(全部)'
,
allowClear
:
true
,
},
},
source
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'申请来源(全部)'
,
allowClear
:
true
,
},
},
innerStatus
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'内部状态(全部)'
,
allowClear
:
true
,
},
},
outerStatus
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'外部状态(全部)'
,
allowClear
:
true
,
},
},
status
:
{
type
:
'string'
,
enum
:
[],
default
:
undefined
,
'x-component-props'
:
{
placeholder
:
'会员状态(全部)'
,
allowClear
:
true
,
},
},
'[startDate, endDate]'
:
{
type
:
'string'
,
default
:
''
,
'x-component'
:
'dateSelect'
,
'x-component-props'
:
{
placeholder
:
'时间范围(全部)'
,
allowClear
:
true
,
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
},
},
},
};
src/pages/member/memberMaintain/schema/index.tsx
deleted
100644 → 0
View file @
0b6b068c
This diff is collapsed.
Click to expand it.
src/pages/member/memberMaintain/unfreeze/index.less
0 → 100644
View file @
94730a23
src/pages/member/memberMaintain/unfreeze/index.tsx
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:36:43
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 11:40:54
* @Description: 解除解冻
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
StopOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMemberAbilityMaintenanceDetailResponse
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/layouts/AnchorPage'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
LevelBrand
from
'@/components/LevelBrand'
;
import
FlowRecords
from
'@/components/FlowRecords'
;
import
CustomizeColumn
from
'@/components/CustomizeColumn'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
freezeSchema
}
from
'../freeze/schema'
;
import
{
MEMBER_OUTER_COLUMNS
,
MEMBER_INNER_COLUMNS
,
}
from
'../../constant'
;
import
MemberBasicInfo
from
'../../components/MemberBasicInfo'
;
import
MemberChannelInfo
from
'../../components/MemberChannelInfo'
;
import
PicWrap
from
'../../components/PicWrap'
;
type
ValueType
=
{
/**
* 理由
*/
reason
:
string
,
}
const
formActions
=
createFormActions
();
const
MemberMaintainUnfreeze
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
validateId
}
=
usePageStatus
();
const
[
memberInfo
,
setMemberInfo
]
=
useState
<
GetMemberAbilityMaintenanceDetailResponse
>
(
null
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoaading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
PublicApi
.
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
// 解冻与解冻
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
PublicApi
.
postMemberAbilityMaintenanceFreeze
({
validateId
:
validateId
,
status
:
1
,
reason
:
values
.
reason
||
''
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setModalVisible
(
false
);
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
});
};
const
anchorsArr
=
[
{
key
:
'verifySteps'
,
name
:
'流转进度'
,
},
{
key
:
'basicInfo'
,
name
:
'基本信息'
,
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
'渠道信息'
,
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
'流转记录'
,
},
].
filter
(
Boolean
);
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
(
<
AvatarWrap
info=
{
{
name
:
memberInfo
?.
name
,
}
}
extra=
{
(
<
LevelBrand
level=
{
2
}
/>
)
}
/>
)
}
anchors=
{
anchorsArr
}
extra=
{
(
<
Button
icon=
{
<
StopOutlined
/>
}
onClick=
{
()
=>
setModalVisible
(
true
)
}
>
解冻
</
Button
>
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
MemberBasicInfo
dataSource=
{
{
memberId
:
memberInfo
?.
memberId
,
memberTypeName
:
memberInfo
?.
memberTypeName
,
account
:
memberInfo
?.
account
,
name
:
memberInfo
?.
name
,
roleName
:
memberInfo
?.
roleName
,
phone
:
memberInfo
?.
phone
,
outerStatus
:
memberInfo
?.
outerStatus
,
outerStatusName
:
memberInfo
?.
outerStatusName
,
levelTag
:
memberInfo
?.
levelTag
,
email
:
memberInfo
?.
email
,
createTime
:
memberInfo
?.
registerTime
,
}
}
id=
"basicInfo"
/>
</
Col
>
{
/* 渠道信息 */
}
{
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
(
<
Col
span=
{
24
}
>
<
MemberChannelInfo
dataSource=
{
{
level
:
memberInfo
?.
channelLevelTag
,
type
:
memberInfo
?.
channelTypeName
,
areas
:
memberInfo
?.
areas
,
desc
:
memberInfo
?.
remark
,
}
}
id=
"channelInfo"
/>
</
Col
>
)
:
null
}
{
/* 其他注册信息 */
}
{
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
(
<
Col
span=
{
24
}
key=
{
`group${index}`
}
>
<
CustomizeColumn
title=
{
item
.
groupName
}
data=
{
(
item
.
elements
.
map
((
ele
)
=>
({
title
:
ele
.
fieldLocalName
,
value
:
(
ele
.
fieldType
!==
'upload'
?
ele
.
fieldValue
:
(
<
PicWrap
pics=
{
[
ele
.
fieldValue
]
}
/>
)
),
}))
)
}
id=
{
`group${index}`
}
/>
</
Col
>
))
:
null
}
{
/* 流转记录 */
}
<
Col
span=
{
24
}
>
<
FlowRecords
outerColumns=
{
MEMBER_OUTER_COLUMNS
}
innerColumns=
{
MEMBER_INNER_COLUMNS
}
outerRowkey=
"id"
innerRowkey=
"id"
outerDataSource=
{
memberInfo
?.
outerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
{
/* 解冻相关 */
}
<
Modal
title=
"会员解冻"
visible=
{
modalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
effects=
{
(
$
,
{
setFieldState
})
=>
{
FormEffectHooks
.
onFieldInit$
(
'reason'
).
subscribe
(()
=>
{
setFieldState
(
'reason'
,
fieldState
=>
{
fieldState
.
props
.
title
=
'会员解冻原因'
;
});
});
}
}
actions=
{
formActions
}
schema=
{
freezeSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
AnchorPage
>
</
Spin
>
);
};
export
default
MemberMaintainUnfreeze
;
src/pages/member/memberMaintain/unfreeze/schema.ts
0 → 100644
View file @
94730a23
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 10:39:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 10:47:51
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
export
const
unfriendModalSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
MEGA_LAYOUT
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
labelAlign
:
'top'
,
},
properties
:
{
date
:
{
type
:
'string'
,
title
:
'解除日期'
,
'x-component'
:
'DatePicker'
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
style
:
{
width
:
'100%'
,
},
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择解除日期'
,
},
],
},
reason
:
{
type
:
'string'
,
title
:
'解除原因'
,
'x-component'
:
'Textarea'
,
'x-component-props'
:
{
placeholder
:
'在此输入你的内容,最长120个字符,60个汉字'
,
maxLength
:
60
,
rows
:
5
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写原因'
,
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
120
,
}
],
},
},
},
},
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment