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
黄庭坚
jinfa-platform
Commits
588d80ec
Commit
588d80ec
authored
Dec 16, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改部分翻译
parent
7ce5b41d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
60 additions
and
88 deletions
+60
-88
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
+0
-0
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
This diff is collapsed.
Click to expand it.
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