no commit message

This commit is contained in:
annnj-company
2026-04-24 11:28:23 +08:00
parent 49476bc357
commit 522c222ae3
11 changed files with 303 additions and 47 deletions

View File

@@ -24,8 +24,33 @@
</template>
<script>
import homePage from './components/message'
import { connectSocket } from '@/libs/socket'
import { EventBus } from '@/libs/eventBus'
import { getUnreturnedPriceCount } from '@/api/businessManage/inquiry'
export default {
components: { homePage }
components: { homePage },
mounted() {
// 进入首页时启动websocket连接
connectSocket()
// 获取未回价数量
this.getUnreturnedPriceCountData()
},
methods: {
// 获取未回价数量
async getUnreturnedPriceCountData() {
try {
const response = await getUnreturnedPriceCount()
if (response && response.code === 1) {
const count = response.data.count || 0
console.log('未回价数量:', count)
// 通过事件总线传递数量给菜单组件
EventBus.$emit('updateUnreturnedCount', count)
}
} catch (error) {
console.error('获取未回价数量失败:', error)
}
}
}
}
</script>