hookehuyr

refactor(消息功能): 移除留言相关功能并简化消息类型

移除留言标签页及相关消息类型处理逻辑
将消息类型简化为仅聊天和通知两种
更新空状态显示图标为Notice组件
......@@ -148,7 +148,7 @@ const messages = ref([])
* 初始化聊天消息
*/
const initChatMessages = () => {
if (props.conversation?.type === 'message' || props.conversation?.type === 'chat') {
if (props.conversation?.type === 'chat') {
// 模拟历史消息
messages.value = [
{
......
......@@ -33,9 +33,6 @@
@click="setActiveTab('notification')">
通知
</view>
<view class="tab-item" :class="{ active: activeTab === 'message' }" @click="setActiveTab('message')">
留言
</view>
</view>
</nut-sticky>
......@@ -73,7 +70,7 @@
<!-- 空状态提示 -->
<view v-if="filteredConversations.length === 0 && !loading && !hasMore"
class="empty-state py-8 text-center">
<Message size="48" color="#9ca3af" class="mb-4" />
<Notice size="48" color="#9ca3af" class="mb-4" />
<text class="text-gray-500 text-base block mb-2">暂无消息</text>
<text class="text-gray-400 text-sm">当前筛选条件下没有找到相关消息</text>
</view>
......@@ -100,7 +97,7 @@
<script setup>
import { ref, computed, onMounted, markRaw } from 'vue'
import { Search2, Notice, Message } from '@nutui/icons-vue-taro'
import { Search2, Notice } from '@nutui/icons-vue-taro'
import TabBar from '@/components/TabBar.vue'
import MessageDetail from '@/components/MessageDetail.vue'
import { $ } from '@tarojs/extend'
......@@ -149,15 +146,15 @@ const initData = () => {
// 生成更多初始数据确保可以滚动
for (let i = 1; i <= 15; i++) {
const types = ['chat', 'notification', 'message']
const type = types[i % 3]
const types = ['chat', 'notification']
const type = types[i % 2]
mockData.push({
id: i,
name: type === 'notification' ? '系统通知' : type === 'message' ? '客服留言' : `用户${i}`,
name: type === 'notification' ? '系统通知' : `用户${i}`,
avatar: type === 'chat' ? `https://randomuser.me/api/portraits/men/${(i % 50) + 1}.jpg` : '',
icon: type === 'notification' ? markRaw(Notice) : type === 'message' ? markRaw(Message) : null,
lastMessage: type === 'notification' ? '您有新的系统通知' : type === 'message' ? '感谢您的反馈' : `这是第${i}条消息内容`,
icon: type === 'notification' ? markRaw(Notice) : null,
lastMessage: type === 'notification' ? '您有新的系统通知' : `这是第${i}条消息内容`,
time: i <= 5 ? `${i * 5}分钟前` : i <= 10 ? `${i}小时前` : `${i - 10}天前`,
unread: Math.random() > 0.5,
type: type
......@@ -176,8 +173,6 @@ const filteredConversations = computed(() => {
filtered = filtered.filter(conv => conv.unread)
} else if (activeTab.value === 'notification') {
filtered = filtered.filter(conv => conv.type === 'notification')
} else if (activeTab.value === 'message') {
filtered = filtered.filter(conv => conv.type === 'message')
}
// 根据搜索关键词过滤
......