From e205530df2d0e45248bcdeeabee090ad26e33080 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期一, 30 九月 2024 09:20:27 +0800 Subject: [PATCH] ll --- screen/src/views/PlatformCall.vue | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/screen/src/views/PlatformCall.vue b/screen/src/views/PlatformCall.vue index bca3c16..cc73a73 100644 --- a/screen/src/views/PlatformCall.vue +++ b/screen/src/views/PlatformCall.vue @@ -6,6 +6,7 @@ import duration from 'dayjs/plugin/duration' dayjs.extend(duration) +const qrcode = ref('') const contentList = ref([]) const contentTempList = ref([]) const page = ref(1) @@ -31,28 +32,35 @@ 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 + if (length <= 16) { // 2 return 30 * 1000 - }else if(length <= 24 ){ // 3 + } else if (length <= 24) { // 3 return 20 * 1000 - }else if( length <= 32 ){// 4 + } else if (length <= 32) {// 4 return 15 * 1000 - }else if( length <= 48 ){// 6 + } else if (length <= 48) {// 6 return 10 * 1000 - }else if( length <= 60 ){// 10 + } else if (length <= 60) {// 10 return 6 * 1000 - }else{ + } 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 = () => { @@ -83,18 +91,21 @@ 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() -- Gitblit v1.9.3