国际化

This commit is contained in:
linxd
2025-08-08 14:05:10 +08:00
parent 48ca4e9069
commit 09c06d14e9
9 changed files with 183 additions and 42 deletions

View File

@ -1,19 +1,23 @@
import React, { useEffect, useState } from 'react';
import { Divider, Select } from 'antd';
import { useIntl } from 'umi';
import { getCoscoPortalsLinksClassification } from '@/servers/api';
const Footer: React.FC = () => {
const intl = useIntl();
const [links, setLinks] = useState<API.CoscoPortalsLinksClassification>([]);
useEffect(() => {
getCoscoPortalsLinksClassification().then((res) => {
setLinks(res.data);
});
}, []);
return (
<div className="footer">
<div className="footer-content">
<div className="link">
<div></div>
<div>{intl.formatMessage({ id: 'footer.friendLinks.title' })}</div>
<div className="flex">
{links.map((link) => (
<>
@ -43,11 +47,13 @@ const Footer: React.FC = () => {
<img src={require('@/assets/img/logoWhite.png')} className="footerLogo" alt="" />
<div className="copyright-text">
<div className="copyright-text-item">
<span></span>
<span></span>
<span></span>
<span>{intl.formatMessage({ id: 'footer.nav.home' })}</span>
<span>{intl.formatMessage({ id: 'footer.nav.notifications' })}</span>
<span>{intl.formatMessage({ id: 'footer.nav.announcements' })}</span>
</div>
<div>
{intl.formatMessage({ id: 'footer.copyright' })}
</div>
<div>Copyright ©</div>
</div>
</div>
</div>

View File

@ -5,6 +5,7 @@ import policy from './en-US/policy';
import register from './en-US/register';
import home from './en-US/home';
import login from './en-US/login';
import footer from './en-US/footer';
export default {
'menu.首页': 'Home',
@ -61,4 +62,5 @@ export default {
// Login page
...login,
...footer
};

View File

@ -0,0 +1,8 @@
export default {
// Footer
"footer.friendLinks.title": "Friend Links",
"footer.nav.home": "Home",
"footer.nav.notifications": "Notifications",
"footer.nav.announcements": "Announcements",
"footer.copyright": "Copyright © China COSCO Shipping Corporation Limited",
}

View File

@ -1,7 +1,49 @@
export default {
'home.data.contactsPhone': 'contactsPhoneEn',
'home.data.contactsEmail': 'contactsEmailEn',
'home.data.address': 'addressEn',
'home.data.addressEn': 'address',
'home.data.contactsConsult': 'contactsConsultEn',
// Homepage
"home.notice.title": "Notices",
"home.button.enterNow": "Enter Now",
"home.button.registerNow": "Register Now",
// Entry
"home.entry.supplier.title": "Supplier Entrance",
"home.entry.supplier.desc": "Supplier registration, bidding, contract management, settlement, and full-process services",
"home.entry.expert.title": "Procurement Expert Entrance",
"home.entry.expert.desc": "Procurement requirement release, review, contract signing, supplier management and other services",
"home.entry.agent.title": "Bidding Agent Entrance",
"home.entry.agent.desc": "Tender document preparation, announcement release, bid opening and evaluation, and other professional services",
// Procurement types
"home.procurement.title": "Procurement Types",
"home.procurement.type1": "Procurement Demand Announcement",
"home.procurement.type2": "Tender Procurement Announcement",
"home.procurement.type3": "Non-Tender Procurement Announcement",
"home.procurement.type4": "Prequalification Announcement",
"home.procurement.type5": "Recruitment Announcement",
"home.procurement.type6": "Change Announcement",
"home.procurement.type7": "Bid (Selection) Candidate Announcement",
"home.procurement.type8": "Bid (Selection) Result Announcement",
"home.procurement.type9": "Procurement Failure (Bidding Failure) Announcement",
// Table
"home.table.col.address": "Project Location",
"home.table.col.title": "Announcement Title",
"home.table.col.publishTime": "Publish Time",
"home.table.col.deadline": "Document Purchase Deadline",
"home.table.sampleTitle": "COSCO Air Transport Northern Logistics Base Signage Production and Installation Service",
"home.table.sampleAddress": "No.1, Underwater Park, Xihu District",
"home.table.remainingTime": "3 days 4 hours remaining",
// About us
"home.question.title": "Consultation Methods",
// CA Service
"home.ca.title": "Service",
"home.ca.handle": "CA Handling",
"home.ca.service": "CA Support",
// Contact
"home.contact.title": "Contact Information",
// Friend links
"home.friendlink.title": "Friend Links",
};

View File

@ -5,6 +5,7 @@ import policy from './zh-CN/policy';
import register from './zh-CN/register';
import home from './zh-CN/home';
import login from './zh-CN/login';
import footer from './zh-CN/footer';
export default {
'menu.首页': '首页',
@ -61,4 +62,5 @@ export default {
// Login page
...login,
...footer
};

View File

@ -0,0 +1,8 @@
export default {
// Footer
"footer.friendLinks.title": "友情链接",
"footer.nav.home": "网站首页",
"footer.nav.notifications": "消息通知",
"footer.nav.announcements": "公示公告",
"footer.copyright": "Copyright ©中国远洋海运集团有限公司",
}

View File

@ -1,7 +1,49 @@
export default {
'home.data.contactsPhone': 'contactsPhone',
'home.data.contactsEmail': 'contactsEmail',
'home.data.address': 'address',
'home.data.addressEn': 'addressEn',
'home.data.contactsConsult': 'contactsConsult',
// 首页
"home.notice.title": "通知公告",
"home.button.enterNow": "立即进入",
"home.button.registerNow": "立即注册",
// 登录入口
"home.entry.supplier.title": "供应商入口",
"home.entry.supplier.desc": "供应商注册、投标、合同管理、结算等全流程服务",
"home.entry.expert.title": "采购专家入口",
"home.entry.expert.desc": "采购需求发布、评审、合同签订、供应商管理等服务",
"home.entry.agent.title": "招标代理入口",
"home.entry.agent.desc": "招标文件编制、公告发布、开标评标等专业服务",
// 采购类型
"home.procurement.title": "采购类型",
"home.procurement.type1": "采购需求公示",
"home.procurement.type2": "招标采购公告",
"home.procurement.type3": "非招标采购公告",
"home.procurement.type4": "资格预审公告",
"home.procurement.type5": "招募公告",
"home.procurement.type6": "变更公告",
"home.procurement.type7": "中标(中选)候选人公示",
"home.procurement.type8": "中标(中选)结果公示",
"home.procurement.type9": "采购失败(流标)公告",
// 表格
"home.table.col.address": "项目所在地",
"home.table.col.title": "公告标题",
"home.table.col.publishTime": "发布时间",
"home.table.col.deadline": "文件购买截止时间",
"home.table.sampleTitle": "中远海运空运北方物流基地标识制作及安装服务",
"home.table.sampleAddress": "西湖区湖底公园1号",
"home.table.remainingTime": "剩余3天4小时",
// 关于我们
"home.question.title": "问题咨询方式",
// CA 服务
"home.ca.title": "服务",
"home.ca.handle": "CA办理",
"home.ca.service": "CA客服",
// 联系方式
"home.contact.title": "联系方式",
// 友情链接
"home.friendlink.title": "友情链接",
};

View File

@ -97,7 +97,7 @@
display: flex;
gap: 20px;
.ant-btn {
width: 100px;
min-width: 100px;
border-radius: 5px;
}
}

View File

@ -146,7 +146,6 @@ const IndexPage: React.FC<any> = ({ user }) => {
}).then((res) => {
setNoticeList(res.data.records);
});
}, []);
const toSystem = (type: string) => {
@ -160,7 +159,9 @@ const IndexPage: React.FC<any> = ({ user }) => {
};
const toRegister = (type: string) => {
window.location.href = `${REGISTER_URL}/${type}?redirect=${encodeURIComponent(window.location.href)}`;
window.location.href = `${REGISTER_URL}/${type}?redirect=${encodeURIComponent(
window.location.href,
)}`;
// history.push({
// pathname: '/register/supplier',
// query: {
@ -191,7 +192,7 @@ const IndexPage: React.FC<any> = ({ user }) => {
<img className="banner" src={require('@/assets/img/banner.jpg')} alt="" />
{/* 通知列表 */}
<div className="noticeList layout-content-main">
<div className="noticeName"></div>
<div className="noticeName">{intl.formatMessage({ id: 'home.notice.title' })}</div>
{noticeList.map((item) => (
<div className="noticeItem" key={item.id}>
<div className="cardTitle">
@ -218,16 +219,18 @@ const IndexPage: React.FC<any> = ({ user }) => {
<Col span={8}>
<div className="loginTypeItem">
<img src={require('@/assets/img/loginType1.png')} alt="" />
<div className="loginTypeItemTitle"></div>
<div className="loginTypeItemTitle">
{intl.formatMessage({ id: 'home.entry.supplier.title' })}
</div>
<div className="loginTypeItemContent">
{intl.formatMessage({ id: 'home.entry.supplier.desc' })}
</div>
<div className="btns">
<Button type="primary" onClick={() => toSystem('supplier')}>
{intl.formatMessage({ id: 'home.button.enterNow' })}
</Button>
<Button type="primary" ghost onClick={() => toRegister('supplier')}>
{intl.formatMessage({ id: 'home.button.registerNow' })}
</Button>
</div>
</div>
@ -235,16 +238,18 @@ const IndexPage: React.FC<any> = ({ user }) => {
<Col span={8}>
<div className="loginTypeItem">
<img src={require('@/assets/img/loginType2.png')} alt="" />
<div className="loginTypeItemTitle"></div>
<div className="loginTypeItemTitle">
{intl.formatMessage({ id: 'home.entry.expert.title' })}
</div>
<div className="loginTypeItemContent">
{intl.formatMessage({ id: 'home.entry.expert.desc' })}
</div>
<div className="btns">
<Button type="primary" ghost onClick={() => toSystem('expert')}>
{intl.formatMessage({ id: 'home.button.enterNow' })}
</Button>
<Button type="primary" ghost onClick={() => toRegister('expert')}>
{intl.formatMessage({ id: 'home.button.registerNow' })}
</Button>
</div>
</div>
@ -252,13 +257,15 @@ const IndexPage: React.FC<any> = ({ user }) => {
<Col span={8}>
<div className="loginTypeItem">
<img src={require('@/assets/img/loginType3.png')} alt="" />
<div className="loginTypeItemTitle"></div>
<div className="loginTypeItemTitle">
{intl.formatMessage({ id: 'home.entry.agent.title' })}
</div>
<div className="loginTypeItemContent">
{intl.formatMessage({ id: 'home.entry.agent.desc' })}
</div>
<div className="btns">
<Button type="primary" ghost onClick={() => toSystem('agent')}>
{intl.formatMessage({ id: 'home.button.enterNow' })}
</Button>
</div>
</div>
@ -271,7 +278,9 @@ const IndexPage: React.FC<any> = ({ user }) => {
<Row gutter={40}>
<Col span={5}>
<div className="types bg">
<div className="announceTitle"></div>
<div className="announceTitle">
{intl.formatMessage({ id: 'home.procurement.title' })}
</div>
{typeList.map((item) => (
<div
className={`typeItem ${item.key === '1' ? 'active' : ''}`}
@ -312,43 +321,61 @@ const IndexPage: React.FC<any> = ({ user }) => {
<div className="layout-content-main">
<Row gutter={40}>
<Col span={16}>
<div className="blockTitle"></div>
<div className="blockTitle">{intl.formatMessage({ id: 'home.question.title' })}</div>
<div className="borderBox">
{/* addressImg */}
<img src={aboutUs.addressImg} alt="" />
<div className="questionItem">
<IconFont type="icon-dizhi" className="icon" />
<span dangerouslySetInnerHTML={{ __html: aboutUs[intl.formatMessage({ id: 'home.data.address' })] }} />
<span
dangerouslySetInnerHTML={{
__html: aboutUs['address'],
}}
/>
</div>
<div className="questionItem">
<IconFont type="icon-dianhua" className="icon" />
<span dangerouslySetInnerHTML={{ __html: aboutUs[intl.formatMessage({ id: 'home.data.contactsConsult' })] }} />
<span
dangerouslySetInnerHTML={{
__html: aboutUs['contactsConsult'],
}}
/>
</div>
<div className="questionItem">
<IconFont type="icon-youxiang" className="icon" />
<span dangerouslySetInnerHTML={{ __html: aboutUs[intl.formatMessage({ id: 'home.data.contactsEmail' })] }} />
<span
dangerouslySetInnerHTML={{
__html: aboutUs['contactsEmail'],
}}
/>
</div>
</div>
</Col>
<Col span={8} className="caBox">
<div>
<div className="blockTitle">CA服务</div>
<div className="blockTitle">CA {intl.formatMessage({ id: 'home.ca.title' })}</div>
<Row className="caRow">
<Col span={6} offset={6} className="caItem">
<img src={require('@/assets/img/ca1.png')} alt="" />
<span>CA办理</span>
<span>{intl.formatMessage({ id: 'home.ca.handle' })}</span>
</Col>
<Col span={6} className="caItem">
<img src={require('@/assets/img/ca2.png')} alt="" />
<span>CA客服</span>
<span>{intl.formatMessage({ id: 'home.ca.service' })}</span>
</Col>
</Row>
</div>
<div className="contactBox">
<div className="blockTitle mt20"></div>
<div className="blockTitle mt20">
{intl.formatMessage({ id: 'home.contact.title' })}
</div>
<div className="contact">
<span dangerouslySetInnerHTML={{ __html: aboutUs[intl.formatMessage({ id: 'home.data.contactsPhone' })] }} />
<span
dangerouslySetInnerHTML={{
__html: aboutUs[intl.formatMessage({ id: 'home.data.contactsPhone' })],
}}
/>
</div>
</div>
</Col>
@ -358,10 +385,14 @@ const IndexPage: React.FC<any> = ({ user }) => {
<div className="firendLink">
<div className="layout-content-main">
<div className="linkTitle"></div>
<div className="linkTitle">{intl.formatMessage({ id: 'home.friendlink.title' })}</div>
<Card>
{friendshipConnections.map((item, index) => (
<Card.Grid onClick={() => window.open(item.url)} key={item.id} style={{ width: '16.6667%', height: '130px' }}>
<Card.Grid
onClick={() => window.open(item.url)}
key={item.id}
style={{ width: '16.6667%', height: '130px' }}
>
<img src={item.thumbnail} alt="" />
</Card.Grid>
))}