add mainView, reward, community pages
Change-Id: I70da6ed3e91ebf4124c2074b6508192a19ed9909
diff --git "a/src/app/community/community-detail/\133communityId\135/page.tsx" "b/src/app/community/community-detail/\133communityId\135/page.tsx"
index 40200f7..850c54e 100644
--- "a/src/app/community/community-detail/\133communityId\135/page.tsx"
+++ "b/src/app/community/community-detail/\133communityId\135/page.tsx"
@@ -88,7 +88,7 @@
useEffect(() => {
const fetchThreadInfo = async () => {
try {
- const { data } = await axios.get(`http://127.0.0.1:4523/m1/6387307-6083949-default/community/info?communityId=${communityId}`);
+ const { data } = await axios.get(process.env.PUBLIC_URL + `/community/info?communityId=${communityId}`);
setCommunityInfo(data);
setTotalThreads(data.threadNumber);
} catch (err) {
@@ -106,12 +106,12 @@
const fetchThreads = async () => {
try {
- const page = first / rows + 1;
- console.log("当前页" + page + "size" + rows + "搜索内容" + searchValue);
+ const pageNumber = first / rows + 1;
+ console.log("当前页" + pageNumber + "size" + rows + "搜索内容" + searchValue);
const option = selectedOption.name // 添加排序参数
const response = await axios.get<ThreadList>(
- `http://127.0.0.1:4523/m1/6387307-6083949-default/community/threads`, {
- params: { communityId, page, rows, option, searchValue }
+ process.env.PUBLIC_URL + `/community/threads`, {
+ params: { communityId, pageNumber, rows, option, searchValue }
}
);
console.log('获取帖子列表:', response.data.records);
@@ -147,7 +147,7 @@
communityId: communityId // 从URL参数获取的社区ID
};
// 发送POST请求
- const response = await axios.post('http://127.0.0.1:4523/m1/6387307-6083949-default/thread', postData);
+ const response = await axios.post(process.env.PUBLIC_URL + '/thread', postData);
if (response.status === 200) {
toast.current?.show({ severity: 'success', summary: 'Success', detail: '帖子发布成功' });
@@ -187,9 +187,8 @@
</div>
</div>
<div className="input">
- <Button label="返回列表" link onClick={() => router.push(`/community/resource-community-list/${communityInfo?.type}`)} />
<div className="action-section">
- <div className="communities-searchBar">
+ <div className="searchBar">
<i className="pi pi-search" />
<InputText type="search" className="search-helper" placeholder="搜索你感兴趣的帖子" onChange={(e) => { const target = e.target as HTMLInputElement; debouncedSearch(target.value); }} />
</div>
@@ -274,7 +273,7 @@
<FileUpload
mode="basic"
name="thread-image"
- url="/file" // 与后端交互的URL
+ url={process.env.PUBLIC_URL + "/file"} // 与后端交互的URL
accept="image/*"
maxFileSize={10000000000}
chooseLabel="选择图片"
diff --git "a/src/app/community/community-detail/\133communityId\135/resource-community.scss" "b/src/app/community/community-detail/\133communityId\135/resource-community.scss"
index a40ebaa..543a846 100644
--- "a/src/app/community/community-detail/\133communityId\135/resource-community.scss"
+++ "b/src/app/community/community-detail/\133communityId\135/resource-community.scss"
@@ -76,10 +76,10 @@
display: flex;
align-items: center;
- .communities-searchBar {
+ .searchBar {
max-width: 100%;
position: relative;
-
+ border-radius: 0px 10px 10px 0px;
.pi-search {
position: absolute;
left: 1rem;