Browse Source

feat: 二维码变疏、返回首页判断条件更新

v1.0.1
jiannibang 3 years ago
parent
commit
a721fcecf8
  1. 20474
      package-lock.json
  2. 3
      package.json
  3. 9300
      pnpm-lock.yaml
  4. 22
      src/components/QRCodeFromText/QRCodeFromText.vue
  5. 4
      src/composables/useHandleScreen.js
  6. 6286
      yarn.lock

20474
package-lock.json

File diff suppressed because it is too large

3
package.json

@ -13,12 +13,13 @@
"@better-scroll/observe-image": "^2.4.2", "@better-scroll/observe-image": "^2.4.2",
"@better-scroll/scroll-bar": "^2.4.2", "@better-scroll/scroll-bar": "^2.4.2",
"@vueuse/core": "^9.9.0", "@vueuse/core": "^9.9.0",
"@vueuse/integrations": "^9.12.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^0.26.0", "axios": "^0.26.0",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"lottie-web": "^5.9.6", "lottie-web": "^5.9.6",
"pinia": "^2.0.11", "pinia": "^2.0.11",
"qrcodejs2": "^0.0.2",
"qrcode": "^1.5.1",
"swiper": "^8.0.7", "swiper": "^8.0.7",
"vconsole": "^3.15.0", "vconsole": "^3.15.0",
"vue": "^3.2.13", "vue": "^3.2.13",

9300
pnpm-lock.yaml

File diff suppressed because it is too large

22
src/components/QRCodeFromText/QRCodeFromText.vue

@ -1,23 +1,11 @@
<template> <template>
<div ref="domRef"></div>
<div>
<img :src="qrcode" alt="QR Code" :style="`width: ${size}px;height: ${size}px`" />
</div>
</template> </template>
<script setup> <script setup>
import QRCode from 'qrcodejs2'
import { ref, watch } from 'vue'
const domRef = ref(null)
import { useQRCode } from '@vueuse/integrations/useQRCode'
const props = defineProps({ size: Number, text: String }) const props = defineProps({ size: Number, text: String })
watch(domRef, nxt => {
if (nxt) {
nxt.innerHTML = ''
const { size, text } = props
new QRCode(nxt, {
width: size,
height: size,
text,
colorDark: '#000',
colorLight: '#fff'
})
}
})
const qrcode = useQRCode(props.text, { errorCorrectionLevel: 'L', margin: 0 })
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

4
src/composables/useHandleScreen.js

@ -142,11 +142,11 @@ export const useHandleScreen = callback => {
state.isWall = false state.isWall = false
state.autoTimer = setTimeout(async () => { state.autoTimer = setTimeout(async () => {
if (state.times[0] !== 0) { if (state.times[0] !== 0) {
if (router.currentRoute.value.fullPath !== '/index') {
if (router.currentRoute.value.fullPath !== '/billboard') {
await indexPromise() await indexPromise()
} }
if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/index') || (state.times[0] === 0 && state.times[1] === 0)) {
if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/billboard') || (state.times[0] === 0 && state.times[1] === 0)) {
await rootPromise() await rootPromise()
callback && callback() callback && callback()
} }

6286
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save