|
@@ -115,7 +115,7 @@ export default {
|
|
return {
|
|
return {
|
|
user: JSON.parse(localStorage.getItem('xm-user') || '{}'),
|
|
user: JSON.parse(localStorage.getItem('xm-user') || '{}'),
|
|
linkUrl: 'http://localhost:3000/#/index',
|
|
linkUrl: 'http://localhost:3000/#/index',
|
|
- audioUrl: '@/assets/audio/提示音.mp3',
|
|
|
|
|
|
+ audioUrl: require('@/assets/audio/提示音.mp3'),
|
|
ordersCount:null,
|
|
ordersCount:null,
|
|
timer:null,
|
|
timer:null,
|
|
}
|
|
}
|
|
@@ -125,11 +125,13 @@ export default {
|
|
this.$message.error("请登陆后重试!")
|
|
this.$message.error("请登陆后重试!")
|
|
this.$router.push('/login')
|
|
this.$router.push('/login')
|
|
}
|
|
}
|
|
- // TODO 计时器
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- this.timer = setInterval(this.getUnfinishedNums, 1000)
|
|
|
|
|
|
|
|
- },500)
|
|
|
|
|
|
+ },
|
|
|
|
+ mounted(){
|
|
|
|
+ // TODO 计时器
|
|
|
|
+ // setTimeout(()=>{
|
|
|
|
+ // },2000)
|
|
|
|
+ this.timer = setInterval(this.getUnfinishedNums, 1000)
|
|
},
|
|
},
|
|
unmounted() {
|
|
unmounted() {
|
|
clearTimeout(this.timer)
|
|
clearTimeout(this.timer)
|
|
@@ -150,7 +152,7 @@ export default {
|
|
this.$request.get("/orders/getnums/"+this.user?.storeId).then(res=>{
|
|
this.$request.get("/orders/getnums/"+this.user?.storeId).then(res=>{
|
|
if(res.data>this.ordersCount){
|
|
if(res.data>this.ordersCount){
|
|
// console.log(this.$refs.audioPlayer)
|
|
// console.log(this.$refs.audioPlayer)
|
|
- this.$refs.audioPlayer.play(); // 播放音效
|
|
|
|
|
|
+ // this.$refs.audioPlayer.play(); // 播放音效
|
|
// this.$emit("UpdateShopData")
|
|
// this.$emit("UpdateShopData")
|
|
}
|
|
}
|
|
this.ordersCount = res.data==0?null:res.data
|
|
this.ordersCount = res.data==0?null:res.data
|