| | |
| | | import duration from 'dayjs/plugin/duration' |
| | | dayjs.extend(duration) |
| | | |
| | | const qrcode = ref('') |
| | | const contentList = ref([]) |
| | | const contentTempList = ref([]) |
| | | const page = ref(1) |
| | |
| | | if (res.data && res.data.waitWorkList) { |
| | | callList.value = res.data.waitWorkList |
| | | } |
| | | qrcode.value = res.data.qrCode |
| | | initQrcode() |
| | | clearInterval(timerCall.value) |
| | | setInitCall() |
| | | }) |
| | | } |
| | | initData() |
| | | // setInterval(() => { |
| | | // initData() |
| | | // }, 60 * 1000) |
| | | |
| | | const frequencyFn = (length) => { |
| | | if(length <= 16){ // 2 |
| | |
| | | return 6 * 1000 |
| | | }else{ |
| | | return 4 * 1000 |
| | | } |
| | | } |
| | | const frequencyCallFn = (length) => { |
| | | if (length <= 10) { // 2 |
| | | return 6 * 1000 |
| | | } else if (length <= 20) { // 3 |
| | | return 3 * 1000 |
| | | } else { |
| | | return 2 * 1000 |
| | | } |
| | | } |
| | | const setInitContent = () => { |
| | |
| | | pageCall.value++ |
| | | } |
| | | activeCall.value = callList.value[pageCall.value] |
| | | }, 6 * 1000) |
| | | }, frequencyCallFn(callList.value.length)) |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | initQrcode() |
| | | initData() |
| | | setInterval(() => { |
| | | initData() |
| | | }, 60 * 1000) |
| | | }) |
| | | |
| | | const initQrcode = () => { |
| | | var qr = new UQRCode() |
| | | // 设置二维码内容 |
| | | qr.data = "https://uqrcode.cn/doc" |
| | | qr.data = qrcode.value |
| | | qr.size = 254 |
| | | // 调用制作二维码方法 |
| | | qr.make() |