Commit aad79c52 by xiaowenfeng

1、添加了一个人脸登记模块;

2、添加了一个人脸识别模块
parent 3b5d958f
......@@ -83,7 +83,9 @@ export default {
.catch(this.error);
},
error(err) {
alert(`访问用户媒体设备失败!\n${err.name},${err.message}!`);
alert(
`打开摄像头失败!\n如设备不支持,可使用手机APP\n${err.name},${err.message}!`
);
},
success(stream) {
// Older browsers may not have srcObject
......
......@@ -199,7 +199,7 @@ export default {
left: 50%;
transform: translate(-50%, -50%);
.detector-box {
width: 400px;
width: 900px;
display: inline-block;
}
h4 {
......
......@@ -198,7 +198,7 @@ export default {
left: 50%;
transform: translate(-50%, -50%);
.detector-box {
width: 400px;
width: 900px;
display: inline-block;
}
h4 {
......
......@@ -170,6 +170,7 @@ export default {
pageIndex: 1, // pdf页码
pageLength: null, // 总页码
startTime: null,
is404: false,
scale: 2, // 缩放比例
borderSize: 9, // viewerContainer容器border大小
shouldRenderHtml: false, // pdf预览时是否需要渲染成html
......@@ -210,15 +211,27 @@ export default {
methods: {
async preview() {
if (this.pdf === null) {
let pdf = await pdfJs.getDocument(
this.pdfUrl === ""
? "http://b2b-flv.qida.com/product/20191105/23386fd7-5551-4fa2-81cc-025945a75eeb/out.pdf"
: this.pdfUrl
);
console.log("获取PDF", pdf);
this.pdf = pdf;
let that = this;
try {
let pdf = await pdfJs.getDocument(
this.pdfUrl === ""
? "https://qida-videos.oss-cn-shenzhen.aliyuncs.com/404.pdf"
: this.pdfUrl
);
console.log("获取PDF", pdf);
this.pdf = pdf;
} catch (error) {
console.log(error);
that.pdfUrl = "";
that.is404 = true;
that.preview();
return;
}
}
this.pageLength = this.pdf._pdfInfo.numPages;
if (!this.is404) {
this.isOnePage();
}
let page = await this.pdf.getPage(this.pageIndex);
const devicePixelRatio = window.devicePixelRatio;
const scale = this.pageSize * this.scale * devicePixelRatio;
......@@ -272,6 +285,15 @@ export default {
});
return { bufferCanvas, textLayerDiv: textLayerDiv[0], bodyHeight };
},
isOnePage() {
if (this.pageLength === 1) {
this.LMSSetLocationPoint();
this.LMSSetLessProgress();
this.LMSSetSessionTime();
this.LMSSetLessonStatus("completed");
this.LMSCommit();
}
},
async renderCanvas(bufferCanvas, viewport, page) {
let bufferContext = bufferCanvas.getContext("2d");
let renderContext = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment