Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复二维码花屏无法扫码 #127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"mockjs2": "1.0.8",
"moment": "^2.24.0",
"nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"vue-qrcode2": "^0.0.1",
"quill": "^1.3.7",
"store": "^2.0.12",
"v-distpicker": "^1.2.12",
Expand Down
15 changes: 15 additions & 0 deletions dashboard/src/components/qrcode/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import view from './index.vue'
import Vue from 'vue'

const Constructor = Vue.extend(view)

export default class {
constructor (el, options) {
const instance = new Constructor({
data: options
})
instance.id = '_qrcode_' + Math.random()
instance.$mount()
el.appendChild(instance.$el)
}
}
24 changes: 24 additions & 0 deletions dashboard/src/components/qrcode/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>
<qrcode :value="text" :background="colorLight" :foreground="colorDark" :level="correctLevel" :size="width"></qrcode>
</div>
</template>

<script>
import Vue from 'vue'
import qrcode from 'vue-qrcode2'

Vue.use(qrcode)

export default {
data () {
return {
width: 120,
colorDark: '#000000',
colorLight: '#ffffff',
text: '',
correctLevel: 'H'
}
}
}
</script>
2 changes: 1 addition & 1 deletion dashboard/src/views/lottery/components/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</template>
<script>
import { share } from '@/api/lottery'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'

export default {
data () {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/views/radar/components/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ import {
storeChannelLinkApi,
indexChannelLinkApi
} from '@/api/radar'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'
export default {
data () {
return {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/views/roomClockIn/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<script>
import { getList, delList, publicIndexApi } from '@/api/roomClockIn'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'
export default {
data () {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
// eslint-disable-next-line no-unused-vars
import { infoApi, department } from '@/api/roomFission'
// eslint-disable-next-line no-unused-vars
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'
export default {
data () {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</template>

<script>
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'

export default {
data () {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/views/roomInfinitePull/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<script>
import { getList, del } from '@/api/roomInfinitePull'
import Details from '@/views/roomInfinitePull/components/details'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'

export default {
data () {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/views/shopCode/employeeIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ import {
// eslint-disable-next-line no-unused-vars
updateEmployeeApi, showApi, showContactApi, showShopApi, shareApi, updateApi, workRoomIndexApi, updateQrcodeApi
} from '@/api/shopCode'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'
import shopkeeperUpdate from '@/views/shopCode/components/shopkeeperUpdate'
import shopkeeperCreate from '@/views/shopCode/components/shopkeeperCreate'
import shopkeeperSetup from '@/views/shopCode/components/shopkeeperSetup'
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/views/workFission/components/details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

<script>
import { getDetails } from '@/api/workFission'
import QRCode from 'qrcodejs2'
import QRCode from '@/components/qrcode'

export default {
data () {
Expand Down