add bar code

This commit is contained in:
lq 2024-07-19 16:39:17 +08:00
parent a2b981a72e
commit 3b23ffaf0c

View File

@ -1134,43 +1134,23 @@ export default {
], ],
onConfirm: payload => { onConfirm: payload => {
_this.flag = true _this.flag = true
//console.log('eeeee', payload);
const type = payload.find(p => p.name === 'type')?.value const type = payload.find(p => p.name === 'type')?.value
_this.imageType = type _this.imageType = type
//console.log('type', type)
_this.gageImage() _this.gageImage()
_this.startTimer()
} }
}) })
}, },
startTimer() {
this.count = 9
this.timer = setInterval(() => {
// Vuecomputed
this.count--
if(this.count <= 0) {
this.clearTimer()
}
}, 1000);
},
clearTimer() {
clearInterval(this.timer)
this.timer = null
this.count = ''
this.flag = false
},
gageImage() { gageImage() {
const imageFileDom = document.querySelector('#image') const imageFileDom = document.querySelector('#image')
imageFileDom.click(function(event){ imageFileDom.click()
event.stopPropagation()
})
}, },
getSelectQrCode() { getSelectQrCode() {
const imageFileDom = document.querySelector('#qrCode') const imageFileDom = document.querySelector('#qrCode')
imageFileDom.click() imageFileDom.click()
}, },
selectImage(event) { selectImage(event) {
event.stopPropagation()
let _this = this let _this = this
//console.log(event.target.files[0]) //console.log(event.target.files[0])
const imageFileDom = document.querySelector('#image') const imageFileDom = document.querySelector('#image')
@ -1192,7 +1172,6 @@ export default {
imageFileDom.value = '' imageFileDom.value = ''
} }
} }
this.clearTimer()
}, },
selectQrCode(event) { selectQrCode(event) {
let _this = this let _this = this