This commit is contained in:
zhangjianjun 2026-04-01 15:43:45 +08:00
parent f1c60e95d8
commit 91a40abb73
7 changed files with 52 additions and 21 deletions

View File

@ -56,6 +56,13 @@ const app = {
method: "get",
});
},
getNewsSiblings({id, category_id}: {id: number | string, category_id: number | string}) {
return requests({
url: `yt/api/news/prenext`,
method: "get",
params: { id, category_id }
});
},
getJobList(params: Params & { title?: string, job_type?: string, business_area?: string, business_plate?: string }) {
return requests({
url: "/yt/api/job",

View File

@ -61,7 +61,7 @@
font-weight: 400;
font-size: 1.125rem;
color: #333333;
line-height: 1.625rem;
line-height: 2.25rem;
text-align: left;
font-style: normal;
text-transform: none;

View File

@ -66,7 +66,7 @@
justify-content: space-between;
.jobItemTitle {
font-weight: 500;
font-weight: bold;
font-size: 1.25rem;
color: #222222;
line-height: 1.625rem;
@ -166,7 +166,8 @@
height: 3.125rem;
border-radius: .375rem;
border: .0625rem solid #B6C0CB;
padding: 0 .875rem;
/* padding: 0 .875rem; */
padding-left: .875rem;
display: flex;
align-items: center;
font-weight: 400;

View File

@ -22,12 +22,13 @@ type SelectOption = { label: string; value: string };
export default function JoinCampus() {
const appConfig = useStore((s) => s.appConfig);
const { viewDetail="查看详情" } = appConfig?.__global__?.others
const { viewDetail = "查看详情", noData = "暂无数据" } = appConfig?.__global__?.others
const supportLocales = useStore((s) => s.supportLocales);
const categoryList = useStore((s) => s.categoryList);
const locale = useStore((s) => s.locale);
const data = appConfig?.join?.campus;
const banner = data?.banner;
const others = data?.others;
const [searchValue, setSearchValue] = useState('');
@ -112,25 +113,25 @@ export default function JoinCampus() {
<Section maskBackground="#FFFFFF">
<div className={`${styles.campusRow} w-72-inner`}>
<div className={styles.campusColLeft}>
<SearchInput value={searchValue} placeholder="搜索职位" onChange={setSearchValue} onEnter={refreshData} />
<SearchInput value={searchValue} placeholder={others?.searchPlaceholder ?? "搜索职位"} onChange={setSearchValue} onEnter={refreshData} />
<SelectFormItem value={jobType} options={jobTypeOptions} label="职业类别" onChange={setJobType} />
<SelectFormItem value={businessArea} options={businessAreaOptions} label="业务领域" onChange={setBusinessArea} />
<SelectFormItem value={businessPlate} options={businessPlateOptions} label="所属板块" onChange={setBusinessPlate} />
<SelectFormItem value={jobType} options={jobTypeOptions} label={others?.jobType ?? "职业类别"} onChange={setJobType} />
<SelectFormItem value={businessArea} options={businessAreaOptions} label={others?.businessArea ?? "业务领域"} onChange={setBusinessArea} />
<SelectFormItem value={businessPlate} options={businessPlateOptions} label={others?.businessPlate ?? "所属板块"} onChange={setBusinessPlate} />
<button className={styles.resetButton} onClick={handleReset}></button>
<button className={styles.resetButton} onClick={handleReset}>{others?.resetButton ?? "重置"}</button>
</div>
<div className={styles.campusColRight}>
<div className={styles.jobList}>
{/* 没有数据时显示 */}
{localJobList.length === 0 && (
<div className={styles.noData}>
<Empty description="暂无数据" />
<Empty description={noData} />
</div>
)}
{localJobList.map((item, index) => (
<Link key={item.id} to={`/join/campus/detail/${item.id}`}>
<div className={styles.jobItem}>
<div className={styles.jobItem}>
<div className={styles.jobItemTitleRow}>
<div className={styles.jobItemTitle}>{item.title}</div>
<div className={styles.jobItemTitleRight}>{viewDetail} <RightOutlined /></div>
@ -140,7 +141,7 @@ export default function JoinCampus() {
<div key={index} className={styles.jobItemLabel}>&nbsp;&nbsp;&nbsp;{label}</div>
))}
</div>
<div className={styles.jobItemContent}>{item.content}</div>
<div className={styles.jobItemContent}>{others?.jobDuty ?? "工作职责"}{item.content}</div>
</div></Link>
))}
</div>
@ -163,7 +164,9 @@ function SearchInput(
{ value, placeholder, onChange, onEnter }: SearchInputProps) {
return (
<div className={styles.searchInput}>
<label htmlFor="searchInput"><SearchOutlined className={styles.searchIcon} /></label>
<label htmlFor="searchInput" style={{ display: 'flex', alignItems: 'center', marginRight: '10px' }}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><path d="M15.455796,16.398947C14.245328,17.399093999999998,12.6928396,18,11,18C7.1340001,18,4,14.866,4,11C4,7.1340001,7.1340001,4,11,4C14.866,4,18,7.1340001,18,11C18,12.7411137,17.364334,14.333755,16.312417,15.558511L20.072229,19.318322000000002C20.26749,19.513584,20.26749,19.830167,20.072227,20.025429L19.930806,20.166849C19.735544,20.362112,19.418962,20.362112,19.2237,20.166849L15.455796,16.398947ZM16.799219,11.0031252C16.799219,14.206385,14.202478,16.803125,10.999218899999999,16.803125C7.7959588,16.803125,5.1992188,14.206385,5.1992188,11.0031252C5.1992188,7.7998650000000005,7.7959588,5.203125,10.999218899999999,5.203125C14.202478,5.203125,16.799219,7.7998650000000005,16.799219,11.0031252Z" fill-rule="evenodd" fill="#000000" fill-opacity="0.8999999761581421" /></g></svg>
</label>
<input
id="searchInput"
type="text"
@ -209,7 +212,11 @@ function SelectFormItem({ value, options, label, onChange }: SelectFormItemProps
options={options}
value={value}
onChange={v => onChange(v ?? "")}
prefix={<FilterOutlined className={styles.selectFilterIcon} />}
prefix={
<div style={{ marginRight: '5px', marginTop: '5px'}}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_199_80367"><rect x="0" y="0" width="24" height="24" rx="0" /></clipPath></defs><g clip-path="url(#master_svg0_199_80367)"><path d="M14.05733975,21.081789C13.96563975,21.081789,13.87371875,21.059202,13.79029575,21.013798L9.675932450000001,18.777245999999998C9.495936350000001,18.679411,9.38386445,18.490966,9.383838650000001,18.286098000000003L9.383838650000001,10.00705L3.90227196,4.8075126C3.8966805,4.8021449,3.89131287,4.7967771,3.88594502,4.7914094C3.5768535242,4.4731479,3.488733269,4.003472,3.661618777,3.59463C3.83450428,3.18578807,4.23283428,2.921874900903624,4.6763426500000005,2.921875L19.32419875,2.921875C19.76792875,2.921875,20.16625975,3.18601185,20.33914575,3.59463C20.51203175,4.0032483,20.42390975,4.4729244999999995,20.11482075,4.7914094C20.10945275,4.7970008,20.10408575,4.8023684,20.09849375,4.8075126L14.61670375,10.00705L14.61670375,20.52265C14.61670375,20.719915,14.51292775,20.90242,14.34339575,21.003284C14.25693675,21.054735,14.15817675,21.081863,14.05756575,21.081789L14.05733975,21.081789ZM10.50211475,17.953525L13.49820045,19.58218L13.49820045,9.7668447C13.49820045,9.6134176,13.56127165,9.4666991,13.67265175,9.361134100000001L19.282148749999998,4.0403748L4.71838995,4.0403748L10.32811065,9.361134100000001C10.439490750000001,9.4666991,10.50256155,9.6134176,10.50256155,9.7668447L10.50256155,17.953522L10.50211475,17.953525ZM19.97973075,11.2396154C19.97973075,10.9307489,19.72946175,10.6804776,19.42059275,10.6804776L16.72979575,10.6804776C16.42092775,10.6804776,16.17065775,10.930747,16.17065775,11.2396154C16.17065775,11.5484848,16.42092775,11.7987537,16.72979575,11.7987537L19.42059275,11.7987537C19.72946175,11.7987537,19.97973075,11.5484848,19.97973075,11.2396154ZM19.97973075,14.074223C19.97973075,13.765355,19.72946175,13.515085,19.42059275,13.515085L16.72979575,13.515085C16.42092775,13.515085,16.17065775,13.765354,16.17065775,14.074223C16.17065775,14.383092,16.42092775,14.633361,16.72979575,14.633361L19.42059275,14.633361C19.72946175,14.633361,19.97973075,14.383092,19.97973075,14.074223ZM19.97973075,16.908830000000002C19.97973075,16.599961999999998,19.72946175,16.349690000000002,19.42059275,16.349690000000002L16.72979575,16.349690000000002C16.42092775,16.349690000000002,16.17065775,16.599961999999998,16.17065775,16.908830000000002C16.17065775,17.217699,16.42092775,17.467967,16.72979575,17.467967L19.42059275,17.467967C19.72946175,17.467967,19.97973075,17.217699,19.97973075,16.908830000000002Z" fill="#222222" fill-opacity="1" /></g></svg>
</div>
}
suffixIcon={
<span
className={styles.selectSuffixTrigger}
@ -219,7 +226,7 @@ function SelectFormItem({ value, options, label, onChange }: SelectFormItemProps
setOpen((v) => !v);
}}
>
<DownOutlined className={styles.selectDownIcon} />
<svg xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g transform="matrix(0,1,-1,0,24,-24)"><path d="M46.719387499999996,30.4020875C46.719387499999996,30.4020875,45.6587276,31.462787499999997,45.6587276,31.462787499999997C45.6587276,31.462787499999997,39.88055351,25.6845775,39.88055351,25.6845775C39.490028903,25.2940474,39.490028799,24.6608877,39.88055351,24.2703576C39.88055351,24.2703576,45.6587276,18.4921875,45.6587276,18.4921875C45.6587276,18.4921875,46.719387499999996,19.5528475,46.719387499999996,19.5528475C46.719387499999996,19.5528475,41.2947675,24.9774675,41.2947675,24.9774675C41.2947675,24.9774675,46.719387499999996,30.4020875,46.719387499999996,30.4020875C46.719387499999996,30.4020875,46.719387499999996,30.4020875,46.719387499999996,30.4020875Z" fill-rule="evenodd" fill="#BCBCBC" fill-opacity="1" transform="matrix(-1,0,0,-1,79.171875,36.984375)" /></g></svg>
</span>
}
bordered={false}

View File

@ -22,8 +22,9 @@ export default function NewsDetail() {
return newsDetailList?.find((item) => item.lang.toLowerCase() === locale.split('-')[0]);
}, [newsDetailList, locale]);
const getNewsDetail = useCallback((id: string | number) => {
id && appApi.getNewsDetail(id).then((res) => {
const getNewsDetail = useCallback(async (id: string | number) => {
if (id) {
const res = await appApi.getNewsDetail(id)
const data = res.data.map((item: any) => {
return {
id: item.id,
@ -32,19 +33,33 @@ export default function NewsDetail() {
readTimes: item.count,
content: item.content,
lang: item.lang,
category_id: item.category_id
}
})
setNewsDetailList(data)
return data
}
}, [])
const getNewsSiblings = useCallback((id: string | number, category_id: string | number) => {
appApi.getNewsSiblings({ id, category_id }).then((res) => {
console.log(res)
})
}, [])
useEffect(() => {
getNewsDetail(id)
getNewsDetail(id).then((data) => {
if(data && data.length > 0) {
const id = data[0].id
const category_id = data[0].category_id
getNewsSiblings(id, category_id)
}
})
}, [id])
return (
<div>
{newsDetail && <Article data={newsDetail} setDetailId={(id) => getNewsDetail(id)}/>}
{newsDetail && <Article data={newsDetail} setDetailId={(id) => getNewsDetail(id)} />}
</div>
);
}

View File

@ -69,10 +69,11 @@
height: 7.5rem;
border-radius: 62.4375rem;
overflow: hidden;
box-shadow: 0 0 .625rem 0 rgba(0, 0, 0, 0.3);
box-shadow: 0 0 .625rem 0 rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
background: #fff;
img {
width: 100%;

View File

@ -135,7 +135,7 @@ export default function Foundation() {
)}
{section4Data && (
<Section title={section4Data.title} background="" maskBackground="#F7FBFF">
<Section title={section4Data.title} background="" maskBackground="#FFFFFF">
<div className={`${styles.partnerItems} w-72-inner`}>
{section4Data.items?.map((item: any, index: number) => (
<ScrollReveal preset="slideUp" amount={0.2} delay={index * 0.5} key={index}>