Browse Source

新订单增加提示音

pull/97/head
rainbro 1 month ago
parent
commit
02ef500870
  1. BIN
      src/assets/msg.wav
  2. 28
      src/views/agent/checkOrderList.vue

BIN
src/assets/msg.wav

Binary file not shown.

28
src/views/agent/checkOrderList.vue

@ -306,14 +306,37 @@ export default {
donwReportNameFormat: [],
reportNameFormat: 0,
intervalId: null,
}
},
mounted() {
this.pageTab = this.$route.query.list
this.getOrderList()
this.getConfig()
this.startTimer();
},
beforeDestroy() {
this.stopTimer();
},
methods: {
startTimer() {
this.intervalId = setInterval(() => {
this.getOrderList()
// 5
console.log('这个操作每隔5秒执行一次');
}, 10000);
},
stopTimer() {
if (this.intervalId) {
clearInterval(this.intervalId);
}
},
playSound() {
//const audio = new Audio('/assets/msg.wav'); //
//audio.play();
console.log('播放声音');
},
getFilterParams(){
var stime = '';
var etime = '';
@ -392,6 +415,10 @@ export default {
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
if (this.intervalId && response.data.maxid && this.orderListPrevMaxId && response.data.maxid>this.orderListPrevMaxId) {
console.log('有新订单了');
this.playSound();
}
this.orderList = response.data.list
this.searchStatusList = response.data.search_check_status
this.orderListTotalRecords = response.data.total_records
@ -411,6 +438,7 @@ export default {
// this.end_page = 1;
}
// console.log(this.isHasNextPage, 'isHasNextPage')
})
}).catch(error => {
console.error(error, 'error')

Loading…
Cancel
Save