fix: close the camera after scanning
This commit is contained in:
parent
8cd8840e7b
commit
49dcf1653e
@ -67,6 +67,7 @@ export default {
|
|||||||
console.log(`Code matched = ${decodedText}`, decodedResult);
|
console.log(`Code matched = ${decodedText}`, decodedResult);
|
||||||
if (decodedText in this.products){
|
if (decodedText in this.products){
|
||||||
var product = this.products[decodedText]
|
var product = this.products[decodedText]
|
||||||
|
this.scanner.clear()
|
||||||
this.productCar.push({
|
this.productCar.push({
|
||||||
'name': product['name'],
|
'name': product['name'],
|
||||||
'id': product['id'],
|
'id': product['id'],
|
||||||
@ -74,10 +75,10 @@ export default {
|
|||||||
'count': 1
|
'count': 1
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
this.scanner.clear()
|
||||||
this.msg = "商品列表中沒有這項商品:"+decodedText
|
this.msg = "商品列表中沒有這項商品:"+decodedText
|
||||||
this.warningModalStatus = true
|
this.warningModalStatus = true
|
||||||
}
|
}
|
||||||
this.scanner.clear()
|
|
||||||
},
|
},
|
||||||
scan() {
|
scan() {
|
||||||
this.scanner = new Html5QrcodeScanner(
|
this.scanner = new Html5QrcodeScanner(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user