feat(content): 小程序详情富UI(阅读/动作条/留言)
- content-detail 微信文章式:标题 + 作者(头像/昵称/认证✓) + 日期 + 阅读X + 富文本正文 - 作者条+动作(点赞/转发=复制链接/收藏/写留言滚动) - 阅读X + 留言区(输入框+😊🖼+发送+列表,未登录提示登录;空态"还没有留言,来写首评") - utils/content.js +getComments/addComment Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,3 +24,15 @@ export async function getContent(id) {
|
||||
const r = await request('GET', `/opc/content/${id}`, {}, false);
|
||||
return r || null;
|
||||
}
|
||||
|
||||
/** 资讯留言列表(公开) */
|
||||
export async function getComments(id) {
|
||||
const r = await request('GET', `/opc/content/${id}/comments`, {}, false);
|
||||
return Array.isArray(r?.items) ? r.items : [];
|
||||
}
|
||||
|
||||
/** 发表留言(需登录) */
|
||||
export async function addComment(id, content) {
|
||||
const r = await request('POST', `/opc/content/${id}/comments`, { content }, true);
|
||||
return r?.comment || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user