reserve/public/info.js
2023-09-24 14:31:12 +08:00

26 lines
820 B
JavaScript

//<div>钱宇航 <span class="badge bg-secondary">干事</span></div>
// <div>tel:16643416659</div>
function flush_reserve_info() {
$.get('/get_reserve_info', (data, status)=> {
let json = JSON.parse(data)
for(let day=1; day<=7; day++) {
for(let time=1; time<=6; time++) {
let info = json[`${day}-${time}`]
console.log(info)
if(info.name != "") {
$(`#table${day}-${time}`).html(`<div>${info.name} <span class="badge bg-secondary">${info.type}</span></div><div>tel:${info.phone}</div>`)
} else {
$(`#table${day}-${time}`).html('')
}
}
}
})
}
flush_reserve_info()
const intervalId = setInterval(flush_reserve_info, 1000);