rating detail
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<view class="topic-stats">
|
<view class="topic-stats">
|
||||||
<view class="stat-item">
|
<view class="stat-item">
|
||||||
<text class="stat-icon icon-group"></text>
|
<text class="stat-icon icon-group"></text>
|
||||||
<text>{{ topic.participants }}人参与</text>
|
<text>{{ topic.participantCount }}人参与</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="stat-item heat">
|
<view class="stat-item heat">
|
||||||
<text class="stat-icon icon-fire"></text>
|
<text class="stat-icon icon-fire"></text>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="hero-meta">
|
<view class="hero-meta">
|
||||||
<text class="meta-rank">🥇 No.1</text>
|
<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>
|
<text class="meta-count" style="margin-left: 20rpx; color: #999;">{{ detailData.ratingCount }} 人评分</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<text class="tab" :class="{ active: currentTab === 'hot' }" @tap="switchTab('hot')">最热</text>
|
<text class="tab" :class="{ active: currentTab === 'hot' }" @tap="switchTab('hot')">最热</text>
|
||||||
<text class="tab" :class="{ active: currentTab === 'new' }" @tap="switchTab('new')">最新</text>
|
<text class="tab" :class="{ active: currentTab === 'new' }" @tap="switchTab('new')">最新</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="filter-icon"></text>
|
<!-- <text class="filter-icon"></text> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="comment-list" style="min-height: 400rpx;">
|
<view class="comment-list" style="min-height: 400rpx;">
|
||||||
@@ -227,7 +227,7 @@ const getCommentsData = async (isSwitchTab = false) => {
|
|||||||
const formattedList = list.map(item => ({
|
const formattedList = list.map(item => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.user?.nickname || '匿名用户',
|
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) || '刚刚', // 如果后端返回了时间字段可以替换
|
time: formatDate(item.createdAt) || '刚刚', // 如果后端返回了时间字段可以替换
|
||||||
content: item.content,
|
content: item.content,
|
||||||
likes: item.likeCount || 0,
|
likes: item.likeCount || 0,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<view class="topic-stats">
|
<view class="topic-stats">
|
||||||
<text class="stat-icon fire-icon"></text>
|
<text class="stat-icon fire-icon"></text>
|
||||||
<text class="stat-text">热度 {{ topicData.heat }}</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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 热门锐评 -->
|
<!-- 热门锐评 -->
|
||||||
<view class="comments-section">
|
<!-- <view class="comments-section">
|
||||||
<view class="section-header">
|
<view class="section-header">
|
||||||
<text class="comment-icon"></text>
|
<text class="comment-icon"></text>
|
||||||
<text class="section-title">热门锐评</text>
|
<text class="section-title">热门锐评</text>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<view class="load-more">
|
<view class="load-more">
|
||||||
@@ -192,7 +192,8 @@ const loadDetail = async (topicId) => {
|
|||||||
title: data.title || '',
|
title: data.title || '',
|
||||||
heat: data.heat || '0',
|
heat: data.heat || '0',
|
||||||
participants: data.participants || '0',
|
participants: data.participants || '0',
|
||||||
aiSummary: data.aiSummary || '暂无总结'
|
aiSummary: data.aiSummary || '暂无总结',
|
||||||
|
participantCount: data.participantCount || '0'
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("获取主题详情失败:", e);
|
console.error("获取主题详情失败:", e);
|
||||||
|
|||||||
@@ -20,21 +20,21 @@
|
|||||||
v-model="formData.title"
|
v-model="formData.title"
|
||||||
class="topic-input"
|
class="topic-input"
|
||||||
maxlength="40"
|
maxlength="40"
|
||||||
placeholder="输入一个有争议的话题..."
|
placeholder="输入一个有趣的话题..."
|
||||||
placeholder-class="topic-placeholder"
|
placeholder-class="topic-placeholder"
|
||||||
auto-height
|
auto-height
|
||||||
/>
|
/>
|
||||||
<textarea
|
<!-- <textarea
|
||||||
v-model="formData.description"
|
v-model="formData.description"
|
||||||
class="desc-input"
|
class="desc-input"
|
||||||
maxlength="120"
|
maxlength="120"
|
||||||
placeholder="简单介绍一下这个评分话题..."
|
placeholder="简单介绍一下这个评分话题..."
|
||||||
placeholder-class="desc-placeholder"
|
placeholder-class="desc-placeholder"
|
||||||
auto-height
|
auto-height
|
||||||
/>
|
/> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="cover-card" :class="{ 'has-cover': formData.coverUrl }" @tap="chooseCover">
|
<!-- <view class="cover-card" :class="{ 'has-cover': formData.coverUrl }" @tap="chooseCover">
|
||||||
<image
|
<image
|
||||||
v-if="formData.coverUrl"
|
v-if="formData.coverUrl"
|
||||||
:src="FILE_BASE_URL + formData.coverUrl"
|
:src="FILE_BASE_URL + formData.coverUrl"
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<view class="cover-icon"></view>
|
<view class="cover-icon"></view>
|
||||||
<text class="cover-text">上传封面图</text>
|
<text class="cover-text">上传封面图</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="category-group">
|
<view class="category-group">
|
||||||
<view
|
<view
|
||||||
@@ -87,20 +87,20 @@
|
|||||||
v-model="item.name"
|
v-model="item.name"
|
||||||
class="participant-name"
|
class="participant-name"
|
||||||
maxlength="12"
|
maxlength="12"
|
||||||
placeholder="输入名字"
|
placeholder="输入评价对象"
|
||||||
placeholder-class="participant-placeholder"
|
placeholder-class="participant-placeholder"
|
||||||
/>
|
/>
|
||||||
<input
|
<!-- <input
|
||||||
v-model="item.desc"
|
v-model="item.desc"
|
||||||
class="participant-desc"
|
class="participant-desc"
|
||||||
maxlength="24"
|
maxlength="24"
|
||||||
placeholder="一句话简介"
|
placeholder="一句话简介"
|
||||||
placeholder-class="participant-placeholder"
|
placeholder-class="participant-placeholder"
|
||||||
/>
|
/> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="participant-actions">
|
<view class="participant-actions">
|
||||||
<text class="drag-icon">≡</text>
|
<!-- <text class="drag-icon">≡</text> -->
|
||||||
<text class="delete-icon" @tap="removeParticipant(item.id)">🗑</text>
|
<text class="delete-icon" @tap="removeParticipant(item.id)">🗑</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -209,7 +209,7 @@ const tagInput = ref("");
|
|||||||
const participants = ref([
|
const participants = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "秦始皇",
|
name: "",
|
||||||
desc: "一句话简介",
|
desc: "一句话简介",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
},
|
},
|
||||||
@@ -298,10 +298,10 @@ const handleSubmit = async () => {
|
|||||||
uni.showToast({ title: '请输入话题', icon: 'none' });
|
uni.showToast({ title: '请输入话题', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!formData.coverUrl) {
|
// if (!formData.coverUrl) {
|
||||||
uni.showToast({ title: '请上传封面图', icon: 'none' });
|
// uni.showToast({ title: '请上传封面图', icon: 'none' });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (!formData.categoryId) {
|
if (!formData.categoryId) {
|
||||||
uni.showToast({ title: '请选择话题分类', icon: 'none' });
|
uni.showToast({ title: '请选择话题分类', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
@@ -320,7 +320,6 @@ const handleSubmit = async () => {
|
|||||||
...formData,
|
...formData,
|
||||||
participants: participants.value,
|
participants: participants.value,
|
||||||
};
|
};
|
||||||
console.log(11111, payload)
|
|
||||||
await releaseTopic(payload);
|
await releaseTopic(payload);
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|||||||
Reference in New Issue
Block a user