no commit message
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user