ll
liukangdong
2024-09-30 e205530df2d0e45248bcdeeabee090ad26e33080
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()