lsc 3 年之前
父节点
当前提交
8586aaab16

+ 2 - 2
dist/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>cocoroboblockly</title><link href=/static/css/app.62189f0f43c104d7c6a36e07fe18efcb.css rel=stylesheet></head><style>@charset "utf-8";
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>cocoroboblockly</title><link href=/static/css/app.25a7fdff8114319422c65a13efe9b287.css rel=stylesheet></head><style>@charset "utf-8";
 
 
   div::-webkit-scrollbar {
   div::-webkit-scrollbar {
     /*滚动条整体样式*/
     /*滚动条整体样式*/
@@ -42,4 +42,4 @@
     height: 100%;
     height: 100%;
     width: 100%;
     width: 100%;
     background: #e6eaf0;
     background: #e6eaf0;
-  }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.8213a7c612cc589a6097.js></script><script type=text/javascript src=/static/js/app.e4b95685ca5cc355b889.js></script></body></html>
+  }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.b2aacab6810394641ae3.js></script><script type=text/javascript src=/static/js/app.d8e26287d2a4781a0422.js></script></body></html>

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.25a7fdff8114319422c65a13efe9b287.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.25a7fdff8114319422c65a13efe9b287.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.d8e26287d2a4781a0422.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.d8e26287d2a4781a0422.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.e4b95685ca5cc355b889.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.e4b95685ca5cc355b889.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/vendor.b2aacab6810394641ae3.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/vendor.b2aacab6810394641ae3.js.map


+ 18 - 3
src/components/functionFan.vue

@@ -282,13 +282,22 @@ export default {
         let jNum = 0;
         let jNum = 0;
         /**1布2石头3剪刀 */
         /**1布2石头3剪刀 */
         for (var i in array) {
         for (var i in array) {
-          if (array[i].indexOf("==(1)") != -1 && array[i].indexOf("hands") != -1) {
+          if (
+            array[i].indexOf("==(1)") != -1 &&
+            array[i].indexOf("hands") != -1
+          ) {
             buNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
             buNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
           }
           }
-          if (array[i].indexOf("==(2)") != -1 && array[i].indexOf("hands") != -1) {
+          if (
+            array[i].indexOf("==(2)") != -1 &&
+            array[i].indexOf("hands") != -1
+          ) {
             sNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
             sNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
           }
           }
-          if (array[i].indexOf("==(3)") != -1 && array[i].indexOf("hands") != -1) {
+          if (
+            array[i].indexOf("==(3)") != -1 &&
+            array[i].indexOf("hands") != -1
+          ) {
             jNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
             jNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
           }
           }
         }
         }
@@ -338,6 +347,10 @@ export default {
     },
     },
     // 调用摄像头
     // 调用摄像头
     callCamera() {
     callCamera() {
+      const loading = this.$loading.service({
+        background: "rgba(255, 255, 255, 0.7)",
+        target: document.body,
+      });
       let _this = this;
       let _this = this;
       // H5调用电脑摄像头API
       // H5调用电脑摄像头API
       window.navigator.mediaDevices
       window.navigator.mediaDevices
@@ -349,11 +362,13 @@ export default {
           _this.$refs["video"].srcObject = success;
           _this.$refs["video"].srcObject = success;
           // 实时拍照效果
           // 实时拍照效果
           _this.$refs["video"].play();
           _this.$refs["video"].play();
+          loading.close();
         })
         })
         .catch((error) => {
         .catch((error) => {
           // console.error("摄像头开启失败,请检查摄像头是否可用!");
           // console.error("摄像头开启失败,请检查摄像头是否可用!");
           _this.isC = false;
           _this.isC = false;
           _this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
           _this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
+          loading.close();
         });
         });
     },
     },
     // 拍照
     // 拍照

+ 6 - 0
src/components/functionFan2.vue

@@ -295,6 +295,10 @@ export default {
     },
     },
     // 调用摄像头
     // 调用摄像头
     callCamera() {
     callCamera() {
+      const loading = this.$loading.service({
+        background: "rgba(255, 255, 255, 0.7)",
+        target: document.body,
+      });
       let _this = this;
       let _this = this;
       // H5调用电脑摄像头API
       // H5调用电脑摄像头API
       window.navigator.mediaDevices
       window.navigator.mediaDevices
@@ -306,11 +310,13 @@ export default {
           _this.$refs["video"].srcObject = success;
           _this.$refs["video"].srcObject = success;
           // 实时拍照效果
           // 实时拍照效果
           _this.$refs["video"].play();
           _this.$refs["video"].play();
+          loading.close();
         })
         })
         .catch((error) => {
         .catch((error) => {
           // console.error("摄像头开启失败,请检查摄像头是否可用!");
           // console.error("摄像头开启失败,请检查摄像头是否可用!");
           _this.isC = false;
           _this.isC = false;
           _this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
           _this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
+          loading.close();
         });
         });
     },
     },
     // 拍照
     // 拍照

+ 28 - 27
src/main.js

@@ -5,44 +5,45 @@ import App from './App'
 import router from './router'
 import router from './router'
 import store from './config/config'
 import store from './config/config'
 import ajax from './common/axios.config'
 import ajax from './common/axios.config'
-import { Message } from 'element-ui'
+import { Message, Loading } from 'element-ui'
 
 
 
 
 Vue.config.productionTip = false
 Vue.config.productionTip = false
 import { Form } from 'element-ui'
 import { Form } from 'element-ui'
-Vue.prototype.$store = store;// 将store实例挂在vue原型上
+Vue.prototype.$store = store; // 将store实例挂在vue原型上
 Vue.prototype.ajax = ajax
 Vue.prototype.ajax = ajax
 Vue.prototype.$message = Message
 Vue.prototype.$message = Message
+Vue.prototype.$loading = Loading
 
 
 
 
 /* eslint-disable no-new */
 /* eslint-disable no-new */
 new Vue({
 new Vue({
-  el: '#app',
-  router,
-  components: { App },
-  template: '<App/>'
+    el: '#app',
+    router,
+    components: { App },
+    template: '<App/>'
 })
 })
 router.beforeEach((to, from, next) => {
 router.beforeEach((to, from, next) => {
-  console.log('1');
-  ajax
-    .get(`${store.state.server}getcookieuserid`)
-    .then((res) => {
-      var userid = res.data[0][0].userid
-      store.commit("update", ["userId", userid]);
-      ajax
-        .get(
-          `${store.state.edu}admin/userinfo/userinfoById/${userid}/`
-        )
-        .then((r) => {
-          let data = r.data[0][0];
-          console.log(data);
-          store.commit("update", ["userName", data.alias || data.username]);
+    console.log('1');
+    ajax
+        .get(`${store.state.server}getcookieuserid`)
+        .then((res) => {
+            var userid = res.data[0][0].userid
+            store.commit("update", ["userId", userid]);
+            ajax
+                .get(
+                    `${store.state.edu}admin/userinfo/userinfoById/${userid}/`
+                )
+                .then((r) => {
+                    let data = r.data[0][0];
+                    console.log(data);
+                    store.commit("update", ["userName", data.alias || data.username]);
+                });
+        })
+        .catch((err) => {
+            // window.location.href = "https://edu.cocorobo.cn/course/login?type=1";
+            var type = localStorage.getItem("type")
+                // window.location.href = "https://edu.cocorobo.cn/course/login?type=1&UnityType=" + type;
         });
         });
-    })
-    .catch((err) => {
-      // window.location.href = "https://edu.cocorobo.cn/course/login?type=1";
-      var type = localStorage.getItem("type")
-      // window.location.href = "https://edu.cocorobo.cn/course/login?type=1&UnityType=" + type;
-    });
-  next();
+    next();
 })
 })

部分文件因为文件数量过多而无法显示