Added camera capture in ocr
This commit is contained in:
@@ -51,11 +51,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
|
||||||
<x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button>
|
<x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button>
|
||||||
</div>
|
</div>
|
||||||
{{--
|
|
||||||
<input type="hidden" name="{{ $getName() }}" x-ref="hiddenInput"> --}}
|
|
||||||
{{-- <input type="hidden" name="photo_data" x-ref="hiddenInput"> --}}
|
|
||||||
<input type="hidden" x-ref="hiddenInput" x-model="photo1">
|
|
||||||
|
|
||||||
|
<input type="hidden" name="{{ $getName() }}" x-ref="hiddenInput">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -106,17 +103,13 @@ function cameraCapture() {
|
|||||||
snapshot.classList.remove('hidden');
|
snapshot.classList.remove('hidden');
|
||||||
this.photoTaken = true;
|
this.photoTaken = true;
|
||||||
|
|
||||||
@this.set('photo1', dataUrl);
|
this.$refs.hiddenInput.value = dataUrl;
|
||||||
|
|
||||||
// this.$refs.hiddenInput.value = dataUrl;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async retakePhoto() {
|
async retakePhoto() {
|
||||||
this.photoTaken = false;
|
this.photoTaken = false;
|
||||||
this.$refs.snapshot.classList.add('hidden');
|
this.$refs.snapshot.classList.add('hidden');
|
||||||
this.$refs.video.classList.remove('hidden');
|
//this.$refs.video.classList.remove('hidden');
|
||||||
await this.initCamera();
|
await this.initCamera();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user