|
|
@ -6,6 +6,10 @@
|
|
|
|
<title>模拟接口</title>
|
|
|
|
<title>模拟接口</title>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
body {
|
|
|
|
|
|
|
|
margin:0;
|
|
|
|
|
|
|
|
padding:0;
|
|
|
|
|
|
|
|
border:none;
|
|
|
|
|
|
|
|
outline:none;
|
|
|
|
width: 100vw;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -19,6 +23,13 @@
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
display: inline-block;
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
width:960px;
|
|
|
|
|
|
|
|
height:540px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.videoWrapper video{
|
|
|
|
|
|
|
|
width:100%;
|
|
|
|
|
|
|
|
height:100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.range {
|
|
|
|
.range {
|
|
|
@ -71,13 +82,17 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<canvas id="canvas" width="358" height="441"></canvas>
|
|
|
|
<canvas id="canvas" width="358" height="441"></canvas>
|
|
|
|
<img id="idCard" alt="" />
|
|
|
|
<img id="img" alt="" width="358" height="441" />
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
<img id="idCard" width="102" height="126" alt="" />
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
var appBasePath = navigator.userAgent.split('|')[1];
|
|
|
|
var appBasePath = navigator.userAgent.split('|')[1];
|
|
|
|
window.chrome.webview.postMessage({ command: "setStatus", message: `app at ${appBasePath}` });
|
|
|
|
window.chrome.webview.postMessage({ command: "setStatus", message: `app at ${appBasePath}` });
|
|
|
|
|
|
|
|
|
|
|
|
function onIdCardRead(card) {
|
|
|
|
function onIdCardRead(card) {
|
|
|
|
document.getElementById('idCard').src = card.image;
|
|
|
|
var img = document.getElementById('idCard');
|
|
|
|
|
|
|
|
img.src = card.image;
|
|
|
|
|
|
|
|
img.title = result.name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//文件夹浏览
|
|
|
|
//文件夹浏览
|
|
|
@ -106,7 +121,7 @@
|
|
|
|
alert(result.message);
|
|
|
|
alert(result.message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
document.getElementById('idCard').src = `data:image/webp;base64,${result.base64}`;
|
|
|
|
document.getElementById('img').src = `data:image/webp;base64,${result.base64}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -213,9 +228,9 @@
|
|
|
|
video.addEventListener("loadedmetadata", function (e) {
|
|
|
|
video.addEventListener("loadedmetadata", function (e) {
|
|
|
|
video.width = e.srcElement.videoWidth;
|
|
|
|
video.width = e.srcElement.videoWidth;
|
|
|
|
video.height = e.srcElement.videoHeight;
|
|
|
|
video.height = e.srcElement.videoHeight;
|
|
|
|
var wrapper = document.querySelector('.videoWrapper');
|
|
|
|
//var wrapper = document.querySelector('.videoWrapper');
|
|
|
|
wrapper.style.width = video.width + 'px';
|
|
|
|
//wrapper.style.width = video.width + 'px';
|
|
|
|
wrapper.style.height = video.height + 'px';
|
|
|
|
//wrapper.style.height = video.height + 'px';
|
|
|
|
video.play();
|
|
|
|
video.play();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, function (err) {
|
|
|
|
}, function (err) {
|
|
|
|