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
588d80ec
Commit
588d80ec
authored
Dec 16, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改部分翻译
parent
7ce5b41d
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
318 additions
and
346 deletions
+318
-346
demo.js
demo.js
+10
-10
AvatarDropdown.tsx
src/layouts/components/AvatarDropdown.tsx
+6
-5
HeaderDropdown.tsx
src/layouts/components/HeaderDropdown.tsx
+2
-31
RightContent.tsx
src/layouts/components/RightContent.tsx
+4
-3
Roles.tsx
src/layouts/components/Roles.tsx
+1
-1
SelectLang.tsx
src/layouts/components/SelectLang.tsx
+2
-31
UserHeader.tsx
src/layouts/components/UserHeader.tsx
+5
-3
common.ts
src/locales/en-US/common.ts
+11
-3
common.ts
src/locales/ko-KR/common.ts
+9
-0
common.ts
src/locales/zh-CN/common.ts
+9
-0
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+1
-1
index.tsx
src/pages/member/memberMaintain/freeze/index.tsx
+258
-258
No files found.
demo.js
View file @
588d80ec
...
...
@@ -9,21 +9,21 @@ const mockData = {
key
:
'zh-CN'
,
icon
:
'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png'
},
//
{
//
name: 'English-EN',
//
key: 'en-US',
//
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png'
//
},
{
name
:
'English-EN'
,
key
:
'en-US'
,
icon
:
'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png'
},
// {
// name: '日本語-JP',
// key: 'jp',
// icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png'
// },
//
{
//
name: '한국어-KO',
// key: 'ko
',
//
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png'
//
}
{
name
:
'한국어-KO'
,
key
:
'ko-KR
'
,
icon
:
'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png'
}
]
}
}
...
...
src/layouts/components/AvatarDropdown.tsx
View file @
588d80ec
import
{
LogoutOutlined
,
LockOutlined
}
from
'@ant-design/icons'
;
import
{
Avatar
,
Menu
,
Spin
}
from
'antd'
;
import
React
from
'react'
;
import
{
history
,
Link
}
from
'umi'
;
import
{
history
,
Link
,
useIntl
}
from
'umi'
;
import
PersonDropdown
from
'./PersonDropdown'
import
styles
from
'../styles/RightContent.less'
;
import
{
removeAuth
,
removeRouters
,
getAuth
}
from
'@/utils/auth'
;
...
...
@@ -9,8 +9,9 @@ import { inject, observer } from 'mobx-react'
import
Icon
from
'@ant-design/icons'
;
import
{
ReactComponent
as
DefaultAvatar
}
from
'@/assets/imgs/default_avatar.svg'
;
const
AvatarDropdown
=
(
props
)
=>
{
const
AvatarDropdown
=
(
props
)
=>
{
const
intl
=
useIntl
();
const
logout
=
()
=>
{
removeAuth
()
removeRouters
()
...
...
@@ -18,7 +19,7 @@ const AvatarDropdown = (props) => {
}
const
currentUser
=
{
name
:
getAuth
()?.
company
||
'未知用户'
,
name
:
getAuth
()?.
company
||
intl
.
formatMessage
({
id
:
'common.weizhiyonghu'
})
,
avatar
:
props
.
UserStore
.
avatar
||
''
,
}
...
...
@@ -34,11 +35,11 @@ const AvatarDropdown = (props) => {
</Menu.Item>
<Menu.Divider /> */
}
<
Menu
.
Item
key=
"changePwd"
>
<
Link
to=
"/memberCenter/systemSetting/accountSetting"
><
LockOutlined
/>
修改密码
</
Link
>
<
Link
to=
"/memberCenter/systemSetting/accountSetting"
><
LockOutlined
/>
{
intl
.
formatMessage
({
id
:
'common.xiugaimima'
})
}
</
Link
>
</
Menu
.
Item
>
<
Menu
.
Item
onClick=
{
logout
}
key=
"logout"
>
<
LogoutOutlined
/>
退出登录
{
intl
.
formatMessage
({
id
:
'common.tuichudenglu'
})
}
</
Menu
.
Item
>
</
Menu
>
)
...
...
src/layouts/components/HeaderDropdown.tsx
View file @
588d80ec
...
...
@@ -70,23 +70,6 @@ interface countryItem {
const
HeaderDropdown
:
React
.
FC
=
()
=>
{
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const
[
currentLangKey
,
setCurrentLangKey
]
=
useState
<
string
>
(
'cn'
)
const
[
locales
]
=
useState
<
countryItem
[]
>
([
{
"name"
:
"简体中文-ZH"
,
"key"
:
"zh-CN"
,
"icon"
:
ChinaImg
},
{
"name"
:
"英文-US"
,
"key"
:
"en-US"
,
"icon"
:
us
},
{
"name"
:
"韩文-KR"
,
"key"
:
"ko-KR"
,
"icon"
:
korenImg
},
])
useEffect
(()
=>
{
console
.
log
(
getLocale
(),
"locale"
)
setCurrentLangKey
(
getLocale
())
...
...
@@ -99,14 +82,7 @@ const HeaderDropdown: React.FC = () => {
const
menuHeaderDropdown
=
(
<
Menu
selectedKeys=
{
[]
}
>
{
// GlobalConfig.publicSelect.siteList.map(v => <Menu.Item key=
{
v
.
key
}
onClick
=
{()
=>
setLang
(
v
)}
>
// <Space>
//
{
currentLangKey
===
v
.
key
?
<
img
src=
{
gou
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
:
<
div
style=
{
{
width
:
20
,
height
:
20
}
}
></
div
>}
// <img src=
{
v
.
icon
}
style
=
{{
width
:
24
,
height
:
17
}}
/
>
// <span>
{
v
.
name
}<
/
span
>
//
</
Space
>
// </Menu.Item>)
locales
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setLang
(
v
)
}
>
GlobalConfig
.
publicSelect
.
siteList
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setLang
(
v
)
}
>
<
Space
>
{
currentLangKey
===
v
.
key
?
<
img
src=
{
gou
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
:
<
div
style=
{
{
width
:
20
,
height
:
20
}
}
></
div
>
}
<
img
src=
{
v
.
icon
}
style=
{
{
width
:
24
,
height
:
17
}
}
/>
...
...
@@ -125,12 +101,7 @@ const HeaderDropdown: React.FC = () => {
const
renderCurrentLang
=
()
=>
{
let
currentLang
:
countryItem
// GlobalConfig.publicSelect.siteList.map(item => {
// if (item.key === currentLangKey) {
// currentLang = item
// }
// })
locales
.
map
(
item
=>
{
GlobalConfig
.
publicSelect
.
siteList
.
map
(
item
=>
{
if
(
item
.
key
===
currentLangKey
)
{
currentLang
=
item
}
...
...
src/layouts/components/RightContent.tsx
View file @
588d80ec
...
...
@@ -4,7 +4,7 @@ import React, { useCallback, useRef, useLayoutEffect, useState, useEffect, useMe
import
Avatar
from
'./AvatarDropdown'
;
import
SelectLang
from
'./SelectLang'
;
import
Location
from
'./Location'
;
import
{
history
,
Link
}
from
'umi'
import
{
history
,
Link
,
useIntl
}
from
'umi'
import
Roles
from
'./Roles'
;
import
{
inject
,
observer
}
from
'mobx-react'
import
styles
from
'../styles/RightContent.less'
;
...
...
@@ -40,6 +40,7 @@ type WsMessage = {
}
const
GlobalHeaderRight
:
React
.
FC
<
{
SiteStore
?:
any
,
isHome
:
boolean
}
>
=
(
props
)
=>
{
const
intl
=
useIntl
();
const
{
SiteStore
:
{
currentLayoutInfo
},
isHome
}
=
props
;
const
[
message
,
setMessage
]
=
useState
<
number
>
(
0
);
const
className
=
styles
.
right
;
...
...
@@ -119,11 +120,11 @@ const GlobalHeaderRight: React.FC<{ SiteStore?: any, isHome: boolean }> = (props
</
Link
>
</
div
>
<
div
className=
{
styles
.
rightContent
}
>
<
span
style=
{
{
color
:
'rgba(0, 0, 0, 0.85)'
,
cursor
:
"pointer"
}
}
onClick=
{
handleBackMall
}
>
返回商城
</
span
>
<
span
style=
{
{
color
:
'rgba(0, 0, 0, 0.85)'
,
cursor
:
"pointer"
}
}
onClick=
{
handleBackMall
}
>
{
intl
.
formatMessage
({
id
:
'common.fanhuishangcheng'
})
}
</
span
>
<
Roles
/>
{
/* <Location /> */
}
<
SelectLang
/>
<
Tooltip
title=
"消息"
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'common.xiaoxi'
})
}
>
<
Link
to=
"/memberCenter/systemSetting/message"
className=
{
styles
.
action
}
...
...
src/layouts/components/Roles.tsx
View file @
588d80ec
...
...
@@ -33,7 +33,7 @@ const Roles: React.FC = () => {
}
const
msg
=
message
.
loading
({
content
:
'正在切换角色...'
,
content
:
intl
.
formatMessage
({
id
:
'common.zhengzaiqiehuanjuese'
})
,
duration
:
0
,
});
...
...
src/layouts/components/SelectLang.tsx
View file @
588d80ec
...
...
@@ -19,23 +19,6 @@ interface countryItem {
const
SelectLang
:
React
.
FC
=
()
=>
{
// 此处暂时无接口, 对接接口后需用枚举类型做补充
const
[
currentLangKey
,
setCurrentLangKey
]
=
useState
<
string
>
(
'cn'
)
const
[
locales
]
=
useState
<
countryItem
[]
>
([
{
"name"
:
"简体中文-ZH"
,
"key"
:
"zh-CN"
,
"icon"
:
ChinaImg
},
{
"name"
:
"英文-US"
,
"key"
:
"en-US"
,
"icon"
:
us
},
{
"name"
:
"韩文-KR"
,
"key"
:
"ko-KR"
,
"icon"
:
korenImg
},
])
useEffect
(()
=>
{
console
.
log
(
getLocale
(),
"locale"
)
setCurrentLangKey
(
getLocale
())
...
...
@@ -48,14 +31,7 @@ const SelectLang: React.FC = () => {
const
menuHeaderDropdown
=
(
<
Menu
selectedKeys=
{
[]
}
>
{
// GlobalConfig.publicSelect.siteList.map(v => <Menu.Item key=
{
v
.
key
}
onClick
=
{()
=>
setLang
(
v
)}
>
// <Space>
//
{
currentLangKey
===
v
.
key
?
<
img
src=
{
gou
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
:
<
div
style=
{
{
width
:
20
,
height
:
20
}
}
></
div
>}
// <img src=
{
v
.
icon
}
style
=
{{
width
:
24
,
height
:
17
}}
/
>
// <span>
{
v
.
name
}<
/
span
>
//
</
Space
>
// </Menu.Item>)
locales
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setLang
(
v
)
}
>
GlobalConfig
.
publicSelect
.
siteList
.
map
(
v
=>
<
Menu
.
Item
key=
{
v
.
key
}
onClick=
{
()
=>
setLang
(
v
)
}
>
<
Space
>
{
currentLangKey
===
v
.
key
?
<
img
src=
{
gou
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
:
<
div
style=
{
{
width
:
20
,
height
:
20
}
}
></
div
>
}
<
img
src=
{
v
.
icon
}
style=
{
{
width
:
24
,
height
:
17
}
}
/>
...
...
@@ -74,12 +50,7 @@ const SelectLang: React.FC = () => {
const
renderCurrentLang
=
()
=>
{
let
currentLang
:
countryItem
// GlobalConfig.publicSelect.siteList.map(item => {
// if (item.key === currentLangKey) {
// currentLang = item
// }
// })
locales
.
map
(
item
=>
{
GlobalConfig
.
publicSelect
.
siteList
.
map
(
item
=>
{
if
(
item
.
key
===
currentLangKey
)
{
currentLang
=
item
}
...
...
src/layouts/components/UserHeader.tsx
View file @
588d80ec
...
...
@@ -6,6 +6,7 @@ import { isString } from '@/utils/type';
import
{
getCookie
}
from
'@/utils/cookie'
import
HeaderDropdown
from
'./HeaderDropdown'
;
import
{
useIntl
}
from
'umi'
;
export
interface
UserHeaderProps
{
logo
?:
React
.
ReactNode
,
...
...
@@ -16,6 +17,7 @@ export interface UserHeaderProps {
* 登录、注册等用户头部
*/
const
UserHeader
:
React
.
FC
<
UserHeaderProps
>
=
(
props
)
=>
{
const
intl
=
useIntl
();
const
{
pathname
}
=
props
?.
location
||
{}
const
[
title
,
setTitle
]
=
useState
<
string
>
()
...
...
@@ -26,14 +28,14 @@ const UserHeader: React.FC<UserHeaderProps> = (props) => {
const
getRouteName
=
()
=>
{
switch
(
pathname
)
{
case
'/user/login'
:
setTitle
(
"欢迎登录"
)
setTitle
(
intl
.
formatMessage
({
id
:
'common.huanyingdenglu'
})
)
break
case
'/user/register'
:
setTitle
(
"欢迎注册"
)
setTitle
(
intl
.
formatMessage
({
id
:
'common.huanyingzhuce'
})
)
break
case
'/user/getBack'
:
case
'/user/forget'
:
setTitle
(
"找回密码"
)
setTitle
(
intl
.
formatMessage
({
id
:
'common.zhaohuimima'
})
)
break
}
}
...
...
src/locales/en-US/common.ts
View file @
588d80ec
...
...
@@ -100,5 +100,14 @@
/** other */
'common.money'
:
'¥'
,
'common.money.yuan'
:
'元'
,
}
\ No newline at end of file
'common.money.yuan'
:
'yuan'
,
'common.weizhiyonghu'
:
'Unknown user'
,
'common.xiugaimima'
:
'Change the password'
,
'common.tuichudenglu'
:
'Log out'
,
'common.xiaoxi'
:
'The message'
,
'common.fanhuishangcheng'
:
'Return to the mall'
,
'common.zhengzaiqiehuanjuese'
:
'Switching roles...'
,
'common.zhaohuimima'
:
'Retrieve password'
,
'common.huanyingzhuce'
:
'Welcome to register'
,
'common.huanyingdenglu'
:
'Welcome to login'
,
}
src/locales/ko-KR/common.ts
View file @
588d80ec
...
...
@@ -101,4 +101,13 @@ export default {
/** 其他 */
'common.money'
:
'¥'
,
'common.money.yuan'
:
'원.'
,
'common.weizhiyonghu'
:
'알 수 없는 사용자'
,
'common.xiugaimima'
:
'비밀번호 변경'
,
'common.tuichudenglu'
:
'로그아웃'
,
'common.xiaoxi'
:
'소식'
,
'common.fanhuishangcheng'
:
'귀환 쇼핑몰'
,
'common.zhengzaiqiehuanjuese'
:
'역할 전환 중...'
,
'common.zhaohuimima'
:
'비밀번호 찾기'
,
'common.huanyingzhuce'
:
'등록을 환영합니다'
,
'common.huanyingdenglu'
:
'로그인을 환영합니다'
,
}
src/locales/zh-CN/common.ts
View file @
588d80ec
...
...
@@ -101,4 +101,13 @@ export default {
/** 其他 */
'common.money'
:
'¥'
,
'common.money.yuan'
:
'元'
,
'common.weizhiyonghu'
:
'未知用户'
,
'common.xiugaimima'
:
'修改密码'
,
'common.tuichudenglu'
:
'退出登录'
,
'common.xiaoxi'
:
'消息'
,
'common.fanhuishangcheng'
:
'返回商城'
,
'common.zhengzaiqiehuanjuese'
:
'正在切换角色...'
,
'common.zhaohuimima'
:
'找回密码'
,
'common.huanyingzhuce'
:
'欢迎注册'
,
'common.huanyingdenglu'
:
'欢迎登录'
,
}
src/pages/commodity/products/viewProducts.tsx
View file @
588d80ec
...
...
@@ -349,7 +349,7 @@ const viewProducts: React.FC<{}> = () => {
productDetail
?.
logistics
?.
carriageType
&&
<
Row
>
<
Col
span=
{
4
}
>
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.viewProducts.card.3.carriageType'
})
}
</
p
>
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.viewProducts.card.3.carriageType
Label
'
})
}
</
p
>
</
Col
>
<
Col
span=
{
20
}
>
<
p
>
{
carriageTypeLabel
[
productDetail
?.
logistics
?.
carriageType
]
}
</
p
>
...
...
src/pages/member/memberMaintain/freeze/index.tsx
View file @
588d80ec
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 11:31:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-29 17:56:21
* @Description: 会员冻结
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
}
from
'antd'
;
import
{
history
,
useIntl
}
from
'umi'
;
import
{
StopOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
getMemberAbilityMaintenanceDetail
,
GetMemberAbilityMaintenanceDetailResponse
,
postMemberAbilityMaintenanceFreeze
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/components/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
intl
=
useIntl
();
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
// 冻结与解冻
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
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
:
'basicInfo'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.basic'
}),
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.channel'
}),
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.flowRecords'
}),
},
].
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
}
innerDataSource=
{
memberInfo
?.
innerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
{
/* 冻结相关 */
}
<
Modal
title=
{
intl
.
formatMessage
({
id
:
'member.management.maintain.freeze.freeze.title'
})
}
visible=
{
modalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
actions=
{
formActions
}
schema=
{
freezeSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
AnchorPage
>
</
Spin
>
);
};
export
default
MemberFrozen
;
/*
* @Author: XieZhiXiong
* @Date: 2021-06-04 11:31:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-29 17:56:21
* @Description: 会员冻结
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Modal
,
Row
,
Col
,
Spin
,
}
from
'antd'
;
import
{
history
,
useIntl
}
from
'umi'
;
import
{
StopOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
}
from
'@formily/antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
getMemberAbilityMaintenanceDetail
,
GetMemberAbilityMaintenanceDetailResponse
,
postMemberAbilityMaintenanceFreeze
}
from
'@/services/MemberV2Api'
;
import
{
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants/member'
;
import
AnchorPage
from
'@/components/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
intl
=
useIntl
();
const
getBasicInfo
=
()
=>
{
if
(
!
validateId
)
{
return
;
}
setInfoLoaading
(
true
);
getMemberAbilityMaintenanceDetail
({
validateId
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setMemberInfo
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setInfoLoaading
(
false
);
});
};
useEffect
(()
=>
{
getBasicInfo
();
},
[]);
// 冻结与解冻
const
handleSubmit
=
(
values
:
ValueType
)
=>
{
setConfirmLoading
(
true
);
return
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
:
'basicInfo'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.basic'
}),
},
(
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_CORPORATE
||
memberInfo
?.
memberTypeEnum
===
MEMBER_TYPE_CHANNEL_INDIVIDUAL
?
{
key
:
'channelInfo'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.channel'
}),
}
:
null
),
...(
memberInfo
&&
memberInfo
.
groups
?
memberInfo
.
groups
.
map
((
item
,
index
)
=>
({
key
:
`group
${
index
}
`
,
name
:
item
.
groupName
,
}))
:
[]
),
{
key
:
'flowRecords'
,
name
:
intl
.
formatMessage
({
id
:
'member.management.maintain.flowRecords'
}),
},
].
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
)
}
>
{
intl
.
formatMessage
({
id
:
'member.management.maintain.query.freeze'
})
}
</
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
}
innerDataSource=
{
memberInfo
?.
innerHistory
}
id=
"flowRecords"
/>
</
Col
>
</
Row
>
{
/* 冻结相关 */
}
<
Modal
title=
{
intl
.
formatMessage
({
id
:
'member.management.maintain.freeze.freeze.title'
})
}
visible=
{
modalVisible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
destroyOnClose
>
<
NiceForm
previewPlaceholder=
"' '"
actions=
{
formActions
}
schema=
{
freezeSchema
}
onSubmit=
{
handleSubmit
}
/>
</
Modal
>
</
AnchorPage
>
</
Spin
>
);
};
export
default
MemberFrozen
;
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