|
@@ -134,8 +134,16 @@ export default {
|
|
|
// .catch(err => {
|
|
|
// this.msg += err
|
|
|
// })
|
|
|
- this.cameras = new Html5Qrcode('reader')
|
|
|
- this.cameras.start({ facingMode: { exact: 'environment' } }, { fps: 10 }, this.CamerasSuccess)
|
|
|
+ this.cameras = new Html5Qrcode('reader', {
|
|
|
+ fps: 10,
|
|
|
+ videoConstraints: {
|
|
|
+ width: { ideal: 1280 },
|
|
|
+ height: { ideal: 720 },
|
|
|
+ // 或尝试 facingMode
|
|
|
+ facingMode: 'environment' // 后置摄像头
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.cameras.start({ facingMode: { exact: 'environment' }}, { fps: 10 }, this.CamerasSuccess)
|
|
|
},
|
|
|
CamerasSuccess(decodedText, decodedResult) {
|
|
|
console.log(decodedResult)
|