【类 型】:refactor
【主 题】:取消用户选项卡的‘首页’导航;订单声音 放弃并改用 新的声音播放模式 【描 述】: [原因]: [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
c3e407327b
commit
e44d78cded
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 订单音效 -->
|
||||
<audio controls="controls" hidden src="@/assets/sound/newMsg.mp3" ref="newMsg"></audio>
|
||||
<audio controls="controls" hidden src="@/assets/sound/rebackMsg.mp3" ref="rebackMsg"></audio>
|
||||
<!-- menu缩进按钮 -->
|
||||
<div class="w-50px h-50px fc l" id="menuTabB" @click="handleCollapse">
|
||||
<i class="iconfont f-s-26" :class="isCollapse ? 'icon-a-yousuojin3x' : 'icon-a-zuosuojin3x'"></i>
|
||||
@ -19,11 +16,6 @@
|
||||
<i class="el-icon-caret-bottom" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<el-dropdown-item divided>
|
||||
<RouterLink to="/">
|
||||
主控
|
||||
</RouterLink>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided @click.native="logout">
|
||||
<span style="display:block;">退出登录</span>
|
||||
</el-dropdown-item>
|
||||
@ -93,6 +85,7 @@ import mqtt from '@/utils/mqtt'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import QuestTabs from '@/components/QuestTabs'
|
||||
import SelectionShopId from '@/components/SelectionShopId'
|
||||
import { speakText } from '@/utils/index'
|
||||
|
||||
export default {
|
||||
name: 'Headbar',
|
||||
@ -154,6 +147,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
speakText,
|
||||
/**
|
||||
* @description: 切换侧边栏 显隐
|
||||
*/
|
||||
@ -172,10 +166,10 @@ export default {
|
||||
const processing = list.filter(item => item.status === 'processing' && item.back === 'normal')// 过滤 备货中订单
|
||||
const requested = list.filter(item => item.back === 'requested')// 过滤退款订单
|
||||
if (this.pendingCount < pending.length && this.pendingCount != null) { // 有新的数据 播放提示声音
|
||||
this.playMusic('newMsg')// 新消息 声音播放
|
||||
this.speakText('有新的付款订单')
|
||||
}
|
||||
if (this.requestedCount < requested.length && this.requestedCount != null) { // 有新的数据 播放提示声音
|
||||
this.playMusic('rebackMsg')// 退款 声音播放
|
||||
this.speakText('有申请退款订单')
|
||||
}
|
||||
this.pendingCount = pending.length// 处理中 订单总数
|
||||
this.processingCount = processing.length// 备货中 订单总数
|
||||
@ -184,25 +178,6 @@ export default {
|
||||
this.animationTrumpet = !this.animationTrumpet// 面包条订单图标跳动
|
||||
}, 500)
|
||||
},
|
||||
// 新消息 声音播放
|
||||
playMusic (domId) {
|
||||
const audioElement = this.$refs[domId]
|
||||
if (!audioElement) {
|
||||
console.error(`音频元素 ${domId} 不存在`)
|
||||
return
|
||||
}
|
||||
audioElement.currentTime = 0 // 从头开始播放
|
||||
audioElement.play()
|
||||
.then(() => {
|
||||
console.log('音频播放成功')
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('音频播放失败', error)
|
||||
})
|
||||
setTimeout(() => {
|
||||
audioElement.pause() // 停止
|
||||
}, 11000)
|
||||
},
|
||||
/**
|
||||
* @description: 刷新当前页面
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user