rating detail

This commit is contained in:
zzc
2026-05-26 21:02:06 +08:00
parent f295b53f72
commit b6d55e7698
4 changed files with 23 additions and 23 deletions

View File

@@ -27,7 +27,7 @@
</view>
<view class="hero-meta">
<text class="meta-rank">🥇 No.1</text>
<text class="meta-heat">🔥 {{ detailData.hotScore }} 热度</text>
<text class="meta-heat">🔥 {{ detailData.hotScore }}w 热度</text>
<text class="meta-count" style="margin-left: 20rpx; color: #999;">{{ detailData.ratingCount }} 人评分</text>
</view>
</view>
@@ -83,7 +83,7 @@
<text class="tab" :class="{ active: currentTab === 'hot' }" @tap="switchTab('hot')">最热</text>
<text class="tab" :class="{ active: currentTab === 'new' }" @tap="switchTab('new')">最新</text>
</view>
<text class="filter-icon"></text>
<!-- <text class="filter-icon"></text> -->
</view>
<view class="comment-list" style="min-height: 400rpx;">
@@ -227,7 +227,7 @@ const getCommentsData = async (isSwitchTab = false) => {
const formattedList = list.map(item => ({
id: item.id,
name: item.user?.nickname || '匿名用户',
avatar: item.user?.avatar ? `${FILE_BASE_URL}${item.user.avatar}` : 'https://api.dicebear.com/7.x/avataaars/svg?seed=fallback',
avatar: item.user?.avatar ? item.user.avatar : 'https://api.dicebear.com/7.x/avataaars/svg?seed=fallback',
time: formatDate(item.createdAt) || '刚刚', // 如果后端返回了时间字段可以替换
content: item.content,
likes: item.likeCount || 0,

View File

@@ -23,7 +23,7 @@
<view class="topic-stats">
<text class="stat-icon fire-icon"></text>
<text class="stat-text">热度 {{ topicData.heat }}</text>
<text class="stat-text margin-left">{{ topicData.participants }}人参与</text>
<text class="stat-text margin-left">{{ topicData.participantCount }}人参与</text>
</view>
</view>
@@ -85,7 +85,7 @@
</view>
<!-- 热门锐评 -->
<view class="comments-section">
<!-- <view class="comments-section">
<view class="section-header">
<text class="comment-icon"></text>
<text class="section-title">热门锐评</text>
@@ -108,7 +108,7 @@
</view>
</view>
</view>
</view>
</view> -->
<!-- 加载更多 -->
<view class="load-more">
@@ -192,7 +192,8 @@ const loadDetail = async (topicId) => {
title: data.title || '',
heat: data.heat || '0',
participants: data.participants || '0',
aiSummary: data.aiSummary || '暂无总结'
aiSummary: data.aiSummary || '暂无总结',
participantCount: data.participantCount || '0'
};
} catch (e) {
console.error("获取主题详情失败:", e);

View File

@@ -20,21 +20,21 @@
v-model="formData.title"
class="topic-input"
maxlength="40"
placeholder="输入一个有争议的话题..."
placeholder="输入一个有的话题..."
placeholder-class="topic-placeholder"
auto-height
/>
<textarea
<!-- <textarea
v-model="formData.description"
class="desc-input"
maxlength="120"
placeholder="简单介绍一下这个评分话题..."
placeholder-class="desc-placeholder"
auto-height
/>
/> -->
</view>
<view class="cover-card" :class="{ 'has-cover': formData.coverUrl }" @tap="chooseCover">
<!-- <view class="cover-card" :class="{ 'has-cover': formData.coverUrl }" @tap="chooseCover">
<image
v-if="formData.coverUrl"
:src="FILE_BASE_URL + formData.coverUrl"
@@ -45,7 +45,7 @@
<view class="cover-icon"></view>
<text class="cover-text">上传封面图</text>
</view>
</view>
</view> -->
<view class="category-group">
<view
@@ -87,20 +87,20 @@
v-model="item.name"
class="participant-name"
maxlength="12"
placeholder="输入名字"
placeholder="输入评价对象"
placeholder-class="participant-placeholder"
/>
<input
<!-- <input
v-model="item.desc"
class="participant-desc"
maxlength="24"
placeholder="一句话简介"
placeholder-class="participant-placeholder"
/>
/> -->
</view>
</view>
<view class="participant-actions">
<text class="drag-icon"></text>
<!-- <text class="drag-icon"></text> -->
<text class="delete-icon" @tap="removeParticipant(item.id)">🗑</text>
</view>
</view>
@@ -209,7 +209,7 @@ const tagInput = ref("");
const participants = ref([
{
id: 1,
name: "秦始皇",
name: "",
desc: "一句话简介",
avatar: "",
},
@@ -298,10 +298,10 @@ const handleSubmit = async () => {
uni.showToast({ title: '请输入话题', icon: 'none' });
return;
}
if (!formData.coverUrl) {
uni.showToast({ title: '请上传封面图', icon: 'none' });
return;
}
// if (!formData.coverUrl) {
// uni.showToast({ title: '请上传封面图', icon: 'none' });
// return;
// }
if (!formData.categoryId) {
uni.showToast({ title: '请选择话题分类', icon: 'none' });
return;
@@ -320,7 +320,6 @@ const handleSubmit = async () => {
...formData,
participants: participants.value,
};
console.log(11111, payload)
await releaseTopic(payload);
uni.hideLoading();