diff --git a/src/api/app.ts b/src/api/app.ts index 4c394bb..9715577 100644 --- a/src/api/app.ts +++ b/src/api/app.ts @@ -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", diff --git a/src/components/layout/JobPage/index.module.css b/src/components/layout/JobPage/index.module.css index cd8f850..b1e2880 100644 --- a/src/components/layout/JobPage/index.module.css +++ b/src/components/layout/JobPage/index.module.css @@ -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; diff --git a/src/pages/Join/Campus.module.css b/src/pages/Join/Campus.module.css index 9bf949e..ba7a51c 100644 --- a/src/pages/Join/Campus.module.css +++ b/src/pages/Join/Campus.module.css @@ -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; diff --git a/src/pages/Join/Campus.tsx b/src/pages/Join/Campus.tsx index 4aa6684..cc38657 100644 --- a/src/pages/Join/Campus.tsx +++ b/src/pages/Join/Campus.tsx @@ -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() {
- + - - - + + + - +
{/* 没有数据时显示 */} {localJobList.length === 0 && (
- +
)} {localJobList.map((item, index) => ( -
+
{item.title}
{viewDetail}
@@ -140,7 +141,7 @@ export default function JoinCampus() {
 •  {label}
))}
-
工作职责:{item.content}
+
{others?.jobDuty ?? "工作职责"}:{item.content}
))}
@@ -163,7 +164,9 @@ function SearchInput( { value, placeholder, onChange, onEnter }: SearchInputProps) { return (
- + onChange(v ?? "")} - prefix={} + prefix={ +
+ +
+ } suffixIcon={ !v); }} > - + } bordered={false} diff --git a/src/pages/News/Detail.tsx b/src/pages/News/Detail.tsx index 445dc08..c09d08e 100644 --- a/src/pages/News/Detail.tsx +++ b/src/pages/News/Detail.tsx @@ -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 (
- {newsDetail &&
getNewsDetail(id)}/>} + {newsDetail &&
getNewsDetail(id)} />}
); } diff --git a/src/pages/Social/Foundation.module.css b/src/pages/Social/Foundation.module.css index f1d27f1..7ee3a9d 100644 --- a/src/pages/Social/Foundation.module.css +++ b/src/pages/Social/Foundation.module.css @@ -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%; diff --git a/src/pages/Social/Foundation.tsx b/src/pages/Social/Foundation.tsx index 220d607..d03a7e6 100644 --- a/src/pages/Social/Foundation.tsx +++ b/src/pages/Social/Foundation.tsx @@ -135,7 +135,7 @@ export default function Foundation() { )} {section4Data && ( -
+
{section4Data.items?.map((item: any, index: number) => (