diff --git a/miniprogram/src/app.config.js b/miniprogram/src/app.config.js
index 3b87a9e..2ce1a63 100644
--- a/miniprogram/src/app.config.js
+++ b/miniprogram/src/app.config.js
@@ -18,7 +18,7 @@ export default {
'my-cert/index', 'compute/index', 'pay/index', 'pay-qr/index',
'event-edit/index', 'my-events/index', 'event-bookings/index', 'hall-talents/index', 'hall-talent-detail/index',
'hall-jobs/index', 'hall-job-detail/index', 'hall-services/index', 'hall-service-detail/index',
- 'community/index', 'community-post/index', 'community-post-detail/index',
+ 'community/index',
'hall-task-publish/index', 'hall-service-publish/index', 'hall-job-publish/index',
'talent-edit/index'
]
diff --git a/miniprogram/src/pages-extra/community-post-detail/index.config.js b/miniprogram/src/pages-extra/community-post-detail/index.config.js
deleted file mode 100644
index 145220d..0000000
--- a/miniprogram/src/pages-extra/community-post-detail/index.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export default { navigationBarTitleText: '详情', navigationStyle: 'custom' };
diff --git a/miniprogram/src/pages-extra/community-post-detail/index.jsx b/miniprogram/src/pages-extra/community-post-detail/index.jsx
deleted file mode 100644
index a2c5276..0000000
--- a/miniprogram/src/pages-extra/community-post-detail/index.jsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { View, Text, Input, Button } from '@tarojs/components';
-import Taro from '@tarojs/taro';
-import { useState, useEffect, useCallback } from 'react';
-import { getCurrentInstance } from '@tarojs/taro';
-import { communityLikePost, communityCommentPost } from '@/utils/hall';
-import { request } from '@/utils/api';
-import { isAuthed } from '@/utils/auth';
-import { PageHeader } from '@/components/TopInset';
-import Skeleton from '@/components/skeleton';
-import './index.scss';
-
-/* 帖子详情:正文 + 评论列表 + 发评论 */
-export default function CommunityPostDetail() {
- const id = (getCurrentInstance().router || {}).params?.id;
- const [data, setData] = useState(null);
- const [content, setContent] = useState('');
- const [busy, setBusy] = useState(false);
- const load = useCallback(() => {
- request('GET', `/community/posts/${encodeURIComponent(id)}`).then(setData).catch(() => {});
- }, [id]);
- useEffect(load, [load]);
-
- if (!data) return ;
- const { post, comments } = data;
- const like = async () => {
- if (!isAuthed()) { Taro.showToast({ title: '请先登录', icon: 'none' }); return; }
- try {
- const r = await communityLikePost(post.id);
- setData((d) => ({ ...d, post: { ...d.post, likeCount: Math.max(0, (d.post.likeCount || 0) + (r.liked ? 1 : -1)) } }));
- } catch { /* 忽略 */ }
- };
- const comment = async () => {
- if (!isAuthed()) { Taro.showToast({ title: '请先登录', icon: 'none' }); return; }
- if (!content.trim()) return;
- setBusy(true);
- try {
- await communityCommentPost(post.id, { content });
- setContent('');
- load();
- } catch (e) { Taro.showToast({ title: (e && e.message) || '评论失败', icon: 'none' }); }
- finally { setBusy(false); }
- };
- return (
-
-
-
- {/* 帖子正文卡片 */}
-
-
- {(post.authorName || '·').slice(0, 1)}
-
- {post.authorName}
- {post.topic}{post.pinned ? ' · 置顶' : ''} · {(post.createdAt || '').slice(0, 10)}
-
-
- {post.title}
- {post.content}
-
- 赞 {post.likeCount || 0}
- 评论 {post.commentCount || 0}
-
-
-
- {/* 评论区 */}
- 评论({(comments || []).length})
- {(comments || []).length === 0 && 还没有评论}
- {(comments || []).map((c) => (
-
-
- {c.authorName}
- {(c.createdAt || '').slice(0, 10)}
-
- {c.content}
-
- ))}
-
- {/* 评论输入 */}
-
- setContent(e.detail.value)} />
-
-
-
- );
-}
diff --git a/miniprogram/src/pages-extra/community-post-detail/index.scss b/miniprogram/src/pages-extra/community-post-detail/index.scss
deleted file mode 100644
index 6f11a76..0000000
--- a/miniprogram/src/pages-extra/community-post-detail/index.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-/* 社区帖子详情 · 参考任务详情 Soft UI 风格 */
-.cpd { position: relative; z-index: 2; padding: 32rpx 24rpx 60rpx; min-height: 100vh;
- background: linear-gradient(165deg, #edf2ff 0%, #f6eefc 34%, #ecf7f6 68%, #eaf4ff 100%); }
-.cpd-empty { display: block; padding: 120rpx 0; text-align: center; color: #9aa4c6; font-size: 26rpx; }
-
-/* 帖子正文卡片 */
-.cpd-post { background: rgba(255,255,255,.82); border: 1rpx solid rgba(99,132,255,.12); border-radius: 22rpx; padding: 24rpx; margin-bottom: 16rpx; box-shadow: 0 8rpx 24rpx rgba(59,79,125,.08); }
-.cpd-post-head { display: flex; align-items: center; gap: 16rpx; }
-.cpd-avatar { width: 72rpx; height: 72rpx; border-radius: 50%; background: linear-gradient(135deg, #4d7cfe, #7a5ff0);
- color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30rpx; font-weight: 700; flex: none; }
-.cpd-author { font-size: 27rpx; font-weight: 600; color: #2b3a66; }
-.cpd-meta { font-size: 22rpx; color: #8a94c0; margin-top: 2rpx; }
-.cpd-title { display: block; margin-top: 16rpx; font-size: 34rpx; font-weight: 800; color: #2b3a66; line-height: 1.35; }
-.cpd-content { display: block; margin-top: 12rpx; font-size: 27rpx; color: #4a5580; line-height: 1.75; white-space: pre-wrap; }
-.cpd-foot { display: flex; gap: 36rpx; margin-top: 18rpx; font-size: 24rpx; color: #8a94c0; }
-.cpd-foot-item { display: flex; align-items: center; gap: 6rpx; }
-
-/* 评论区 */
-.cpd-sec { display: block; font-size: 28rpx; font-weight: 700; color: #2b3a66; margin: 8rpx 4rpx 14rpx; }
-.cpd-comment { background: rgba(255,255,255,.6); border: 1rpx solid rgba(99,132,255,.08); border-radius: 18rpx; padding: 20rpx 22rpx; margin-bottom: 12rpx; }
-.cpd-comment-head { display: flex; align-items: center; gap: 12rpx; }
-.cpd-comment-author { font-size: 25rpx; font-weight: 600; color: #2b3a66; }
-.cpd-comment-time { font-size: 22rpx; color: #8a94c0; }
-.cpd-comment-content { display: block; margin-top: 8rpx; font-size: 25rpx; color: #4a5580; line-height: 1.65; }
-
-/* 评论输入区 */
-.cpd-input-row { display: flex; gap: 14rpx; margin-top: 16rpx; }
-.cpd-input { flex: 1; min-width: 0; height: 72rpx; line-height: 72rpx; padding: 0 22rpx;
- border-radius: 16rpx; background: rgba(255,255,255,.8); font-size: 25rpx; border: 1rpx solid rgba(99,132,255,.12); }
-.cpd-send { flex: none; width: 140rpx; height: 72rpx; line-height: 72rpx; border-radius: 999rpx;
- background: linear-gradient(135deg, #4d7cfe, #7a5ff0); color: #fff; font-size: 25rpx; font-weight: 600; padding: 0; border: none; }
-.cpd-send::after { border: none; }
diff --git a/miniprogram/src/pages-extra/community-post/index.config.js b/miniprogram/src/pages-extra/community-post/index.config.js
deleted file mode 100644
index a4049ce..0000000
--- a/miniprogram/src/pages-extra/community-post/index.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export default { navigationStyle: 'custom' };
diff --git a/miniprogram/src/pages-extra/community-post/index.jsx b/miniprogram/src/pages-extra/community-post/index.jsx
deleted file mode 100644
index 7486256..0000000
--- a/miniprogram/src/pages-extra/community-post/index.jsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { View, Text, Input, Textarea, Button } from '@tarojs/components';
-import Taro from '@tarojs/taro';
-import { useState } from 'react';
-import { communityCreatePost } from '@/utils/hall';
-import { isAuthed } from '@/utils/auth';
-import { PageHeader } from '@/components/TopInset';
-import '@/styles/hall.scss';
-
-const TOPICS = ['交流', '求助', '资源', '经验', '公告'];
-
-export default function CommunityPost() {
- const [f, setF] = useState({ topic: '交流', title: '', content: '' });
- const [msg, setMsg] = useState('');
- const [busy, setBusy] = useState(false);
- const submit = async () => {
- if (!isAuthed()) { Taro.showToast({ title: '请先登录', icon: 'none' }); return; }
- setBusy(true); setMsg('');
- try {
- await communityCreatePost(f);
- Taro.showToast({ title: '发布成功', icon: 'success' });
- setTimeout(() => Taro.navigateBack(), 800);
- } catch (e) { setMsg((e && e.message) || '发布失败'); }
- finally { setBusy(false); }
- };
- return (
-
-
-
-
- {TOPICS.map((t) => (
- setF((s) => ({ ...s, topic: t }))}>{t}
- ))}
-
- setF((s) => ({ ...s, title: e.detail.value }))} />
-
-
- );
-}
diff --git a/miniprogram/src/pages-extra/community-post/index.scss b/miniprogram/src/pages-extra/community-post/index.scss
deleted file mode 100644
index 32b8902..0000000
--- a/miniprogram/src/pages-extra/community-post/index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import '@/styles/hall.scss';
diff --git a/miniprogram/src/pages/hall/index.jsx b/miniprogram/src/pages/hall/index.jsx
index c0429be..4c8bf80 100644
--- a/miniprogram/src/pages/hall/index.jsx
+++ b/miniprogram/src/pages/hall/index.jsx
@@ -41,7 +41,6 @@ const salary = (a, b) => (!a && !b ? '面议' : a && b && a !== b ? `${a}–${b}
const PUBLISH_URL = {
tasks: '/pages-extra/hall-task-publish/index',
services: '/pages-extra/hall-service-publish/index',
- community: '/pages-extra/community-post/index',
};
export default function Hall() {
@@ -264,9 +263,9 @@ function CommunityPane({ topic, onTopic }) {
return (
<>
{!posts && }
- {posts && posts.length === 0 && 还没有帖子,来发第一帖}
+ {posts && posts.length === 0 && 暂无社区内容}
{(posts || []).map((p) => (
- Taro.navigateTo({ url: `/pages-extra/community-post-detail/index?id=${p.id}` })}>
+
{(p.authorName || '·').slice(0, 1)}
diff --git a/miniprogram/src/utils/hall.js b/miniprogram/src/utils/hall.js
index f107ea4..31b06c2 100644
--- a/miniprogram/src/utils/hall.js
+++ b/miniprogram/src/utils/hall.js
@@ -59,6 +59,4 @@ export const communityPosts = (params = {}) => {
const qs = Object.entries(params).filter(([, v]) => v).map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');
return cachedRequest('GET', `/community/posts${qs ? `?${qs}` : ''}`, 15000);
};
-export const communityCreatePost = (body) => request('POST', '/community/posts', body, true);
export const communityLikePost = (id) => request('POST', `/community/posts/${encodeURIComponent(id)}/like`, {}, true);
-export const communityCommentPost = (id, body) => request('POST', `/community/posts/${encodeURIComponent(id)}/comments`, body, true);