Browse Source

活体检测框的百度统计事件

Michael Wang 6 years ago
parent
commit
175d13146c
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/features/OnlineExam/Examing/FaceId.vue

+ 18 - 0
src/features/OnlineExam/Examing/FaceId.vue

@@ -69,6 +69,7 @@ export default {
   },
   mounted() {
     console.debug("startFaceVerify");
+    window._hmt.push(["_trackEvent", "活体检测弹出框", "弹出框"]);
     this.startFaceVerify();
   },
   beforeDestroy() {
@@ -122,6 +123,11 @@ export default {
       return null;
     },
     iframeLoadSuccess() {
+      window._hmt.push([
+        "_trackEvent",
+        "活体检测弹出框",
+        "FaceID页面iframe加载成功"
+      ]);
       try {
         var iframe = document.getElementById("myFrame");
         var app = iframe.contentWindow.document.getElementById("app");
@@ -185,6 +191,17 @@ export default {
           .then(() => {
             if (result != "SUCCESS") {
               this.logout("?LogoutReason=人脸检测失败");
+              window._hmt.push([
+                "_trackEvent",
+                "活体检测弹出框",
+                "活体检测失败"
+              ]);
+            } else {
+              window._hmt.push([
+                "_trackEvent",
+                "活体检测弹出框",
+                "活体检测成功"
+              ]);
             }
           })
           .catch(() => {
@@ -308,6 +325,7 @@ export default {
             //检测达到20次
             clearInterval(iframeLoadTime);
             this.showRedo("网络异常,请手动点击重试");
+            window._hmt.push(["_trackEvent", "活体检测弹出框", "网络异常"]);
           }
         } else if (iframeLoadMsg.indexOf("error_message") > -1) {
           clearInterval(iframeLoadTime);