lsc 3 years ago
parent
commit
ae5912a18a

+ 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.f40c245d656c8eefbcc7d24afa840453.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.621f2a37032b207ebbbdcff5afeae17b.css rel=stylesheet></head><style>@charset "utf-8";
 
   div::-webkit-scrollbar {
     /*滚动条整体样式*/
@@ -42,4 +42,4 @@
     height: 100%;
     width: 100%;
     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.5ce11ad096b2e94d85e6.js></script><script type=text/javascript src=/static/js/app.86137aef0cef0115eaa7.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.5ce11ad096b2e94d85e6.js></script><script type=text/javascript src=/static/js/app.00e16c6471712fbb1d4d.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.621f2a37032b207ebbbdcff5afeae17b.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.621f2a37032b207ebbbdcff5afeae17b.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.f40c245d656c8eefbcc7d24afa840453.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.00e16c6471712fbb1d4d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.00e16c6471712fbb1d4d.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.86137aef0cef0115eaa7.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.86137aef0cef0115eaa7.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map


+ 3 - 2
src/App.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="app">
-    <div class="head">
+    <div class="head" v-if="false">
       <div class="logo">
         <!-- <img
           style="height: 40px; margin-top: 10px"
@@ -29,7 +29,8 @@
       </div>
     </div>
 
-    <div style="background: #e5e5e5; height: calc(100% - 67.5px); width: 100%">
+    <!-- <div style="background: #e5e5e5; height: calc(100% - 67.5px); width: 100%"> -->
+    <div style="background: #e5e5e5; height: 100% ; width: 100%">
       <!-- main 内容 -->
       <keep-alive v-if="$route.meta.keepAlive">
         <!-- 这里是会被缓存的视图组件 -->

+ 11 - 2
src/components/blockly.vue

@@ -1,6 +1,9 @@
 <template>
   <div class="ablockly">
-    <el-button type="primary" @click="go" class="btnPosition">下一步</el-button>
+    <div class="btnPosition">
+       <el-button type="primary" @click="go">下一步</el-button>
+       <el-button type="primary" @click="returnA" >上一步</el-button>
+    </div>
     <div id="blocklyDiv"></div>
     <xml id="toolbox" style="display: none">
       <category name="逻辑" colour="%{BKY_LOGIC_HUE}">
@@ -94,7 +97,7 @@ export default {
     // 代码生成器
     myUpdateFunction(event) {
       var code = Blockly.JavaScript.workspaceToCode(this.workspace);
-            // debugger;
+      // debugger;
       return code;
     },
     // 获取blockly工作区中的code和xml结构
@@ -115,6 +118,9 @@ export default {
     },
     //下一步
     go() {
+      //       var xmlText =
+      //   '<xml xmlns="https://developers.google.com/blockly/xml"><block type="iot_lcd_screeninit" id="{3nwI]%M1OB@v~%c^GJ*" x="270" y="150"><next><block type="controls_repeat_forever" id="%RwQN-vn~S,Qz:U%Dp2C"><statement name="DO"><block type="controls_if" id="tTNBMMPITBf)yE@hA}Lt"><value name="IF0"><block type="logic_compare" id="kW(af5I*_dMR|37aEHA8"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Msy)DT1[/[pA7vU$u2BD"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="F7nQ+Rn{h=Z-:`nxfOV{"><field name="number">布</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="9=+m`N)^mOs;,8?7ZZ:K"><field name="motor">M1</field><field name="speed">100</field></block></statement><next><block type="controls_if" id="~ykQvxBR]wnz6FHIGc^s"><value name="IF0"><block type="logic_compare" id="+v0*1:oG$.+wMFe_g_F@"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id=",|{9@1In%8:74vXPPn{O"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="[J4:1z-D*iz3){K$v[gM"><field name="number">石头</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="XIVuWHcKb[O5|0*HC_Em"><field name="motor">M1</field><field name="speed">0</field></block></statement><next><block type="controls_if" id="bNZCd.Zj2arimcA^dZvc"><value name="IF0"><block type="logic_compare" id="ul/^s*@P{HkWe6(^9fgn"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Wd)15h0yyFb`)Sy:H}0w"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="1f0Wep9dlC0i-})rTiqN"><field name="number">剪刀</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="bY;.J)_PvmP5TAD/KDs,"><field name="motor">M1</field><field name="speed">50</field></block></statement></block></next></block></next></block></statement></block></next></block></xml>';
+      // this.setBlockData(xmlText);
       //update修改   function state里的参数
       var a = this.myUpdateFunction();
       this.$store.commit("update", ["function", a]);
@@ -125,6 +131,9 @@ export default {
         this.$router.push("function");
       }
     },
+    returnA() {
+      this.$router.go(-1)
+    },
   },
 
   mounted() {

+ 32 - 19
src/components/functionFan.vue

@@ -1,5 +1,8 @@
 <template>
   <div style="width: 100%; height: calc(100%); background: #fff">
+    <el-button type="primary" @click="returnA" class="btnPosition"
+      >上一步</el-button
+    >
     <div class="img">
       <div class="left" style="width: 380px"></div>
       <div class="controlZ">
@@ -21,22 +24,22 @@
         <div id="screan">
           <img :src="img[4]" alt />
           <!--图片展示-->
-         <video
-              ref="video"
-              id="video_cam"
-              width="118.666"
-              height="94.933"
-              class="face"
-              autoplay
-              v-show="isCamera"
-            ></video>
-            <canvas
-              ref="canvasDOM"
-              width="118.666"
-              height="94.933"
-              class="kuang"
-              v-show="isCamera"
-            ></canvas>
+          <video
+            ref="video"
+            id="video_cam"
+            width="118.666"
+            height="94.933"
+            class="face"
+            autoplay
+            v-show="isCamera"
+          ></video>
+          <canvas
+            ref="canvasDOM"
+            width="118.666"
+            height="94.933"
+            class="kuang"
+            v-show="isCamera"
+          ></canvas>
         </div>
         <div id="line">
           <img :src="img[5]" alt />
@@ -218,6 +221,9 @@ export default {
     };
   },
   methods: {
+    returnA() {
+      this.$router.go(-1);
+    },
     cancel() {
       this.updateMessage = false;
       this.sampleArr[this.sampleArr.length - 1].name = "编号:" + this.number;
@@ -316,19 +322,19 @@ export default {
         /**1布2石头3剪刀 */
         for (var i in array) {
           if (
-            array[i].indexOf("==(1)") != -1 &&
+            array[i].indexOf("==()") != -1 &&
             array[i].indexOf("hands") != -1
           ) {
             buNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
           }
           if (
-            array[i].indexOf("==(2)") != -1 &&
+            array[i].indexOf("==(石头)") != -1 &&
             array[i].indexOf("hands") != -1
           ) {
             sNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
           }
           if (
-            array[i].indexOf("==(3)") != -1 &&
+            array[i].indexOf("==(剪刀)") != -1 &&
             array[i].indexOf("hands") != -1
           ) {
             jNum = parseInt(array[i].split("motor=")[1].split("}")[0]);
@@ -874,4 +880,11 @@ body {
   display: flex;
   flex-direction: column;
 }
+
+.btnPosition {
+  position: fixed;
+  right: 35px;
+  bottom: 35px;
+  z-index: 999999;
+}
 </style>

+ 12 - 1
src/components/functionFan3.vue

@@ -1,5 +1,6 @@
 <template>
   <div style="width: 100%; height: calc(100%); background: #fff; display: flex">
+    <el-button type="primary" @click="goto('/fan')" class="btnPosition">返回</el-button>
     <div class="ablockly">
       <div id="blocklyDiv"></div>
       <xml id="toolbox" style="display: none">
@@ -234,6 +235,9 @@ export default {
     };
   },
   methods: {
+        goto(path) {
+      this.$router.push(path);
+    },
     cancel() {
       this.updateMessage = false;
       this.sampleArr[this.sampleArr.length - 1].name = "编号:" + this.number;
@@ -762,7 +766,7 @@ export default {
     this.videoEl = this.$refs.video;
     this.canvasEL = this.$refs.canvasDOM;
     var xmlText =
-      '<xml xmlns="https://developers.google.com/blockly/xml"><block type="iot_lcd_screeninit" id="{3nwI]%M1OB@v~%c^GJ*" x="270" y="150"><next><block type="controls_repeat_forever" id="%RwQN-vn~S,Qz:U%Dp2C"><statement name="DO"><block type="controls_if" id="tTNBMMPITBf)yE@hA}Lt"><value name="IF0"><block type="logic_compare" id="kW(af5I*_dMR|37aEHA8"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Msy)DT1[/[pA7vU$u2BD"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="F7nQ+Rn{h=Z-:`nxfOV{"><field name="number">1</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="9=+m`N)^mOs;,8?7ZZ:K"><field name="motor">M1</field><field name="speed">100</field></block></statement><next><block type="controls_if" id="~ykQvxBR]wnz6FHIGc^s"><value name="IF0"><block type="logic_compare" id="+v0*1:oG$.+wMFe_g_F@"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id=",|{9@1In%8:74vXPPn{O"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="[J4:1z-D*iz3){K$v[gM"><field name="number">2</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="XIVuWHcKb[O5|0*HC_Em"><field name="motor">M1</field><field name="speed">0</field></block></statement><next><block type="controls_if" id="bNZCd.Zj2arimcA^dZvc"><value name="IF0"><block type="logic_compare" id="ul/^s*@P{HkWe6(^9fgn"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Wd)15h0yyFb`)Sy:H}0w"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="1f0Wep9dlC0i-})rTiqN"><field name="number">3</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="bY;.J)_PvmP5TAD/KDs,"><field name="motor">M1</field><field name="speed">50</field></block></statement></block></next></block></next></block></statement></block></next></block></xml>';
+      '<xml xmlns="https://developers.google.com/blockly/xml"><block type="iot_lcd_screeninit" id="{3nwI]%M1OB@v~%c^GJ*" x="270" y="150"><next><block type="controls_repeat_forever" id="%RwQN-vn~S,Qz:U%Dp2C"><statement name="DO"><block type="controls_if" id="tTNBMMPITBf)yE@hA}Lt"><value name="IF0"><block type="logic_compare" id="kW(af5I*_dMR|37aEHA8"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Msy)DT1[/[pA7vU$u2BD"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="F7nQ+Rn{h=Z-:`nxfOV{"><field name="number"></field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="9=+m`N)^mOs;,8?7ZZ:K"><field name="motor">M1</field><field name="speed">100</field></block></statement><next><block type="controls_if" id="~ykQvxBR]wnz6FHIGc^s"><value name="IF0"><block type="logic_compare" id="+v0*1:oG$.+wMFe_g_F@"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id=",|{9@1In%8:74vXPPn{O"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="[J4:1z-D*iz3){K$v[gM"><field name="number">石头</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="XIVuWHcKb[O5|0*HC_Em"><field name="motor">M1</field><field name="speed">0</field></block></statement><next><block type="controls_if" id="bNZCd.Zj2arimcA^dZvc"><value name="IF0"><block type="logic_compare" id="ul/^s*@P{HkWe6(^9fgn"><field name="OP">EQ</field><value name="A"><block type="ai_gesture" id="Wd)15h0yyFb`)Sy:H}0w"><field name="ID">ID</field></block></value><value name="B"><block type="logic_number" id="1f0Wep9dlC0i-})rTiqN"><field name="number">剪刀</field></block></value></block></value><statement name="DO0"><block type="ai_motor" id="bY;.J)_PvmP5TAD/KDs,"><field name="motor">M1</field><field name="speed">50</field></block></statement></block></next></block></next></block></statement></block></next></block></xml>';
     this.setBlockData(xmlText);
   },
 };
@@ -1061,4 +1065,11 @@ body {
   height: 100%;
   min-width: 700px;
 }
+
+.btnPosition {
+  position: fixed;
+  right: 35px;
+  bottom: 35px;
+  z-index: 999999;
+}
 </style>

Some files were not shown because too many files changed in this diff