lex 1 рік тому
батько
коміт
77d9f1b6bc

+ 76 - 65
public/roll-call/css/index.css

@@ -16,6 +16,27 @@ body {
   background-size: cover;
 }
 
+.pageTitle {
+  width: 217px;
+  height: 103px;
+  background: url('../img/icon-title.png') no-repeat center;
+  background-size: contain;
+  position: fixed;
+  left: 50%;
+  transform: translateX(-50%);
+}
+
+.iconBack {
+  width: 54px;
+  height: 54px;
+  background: url('../img/icon-back.png') no-repeat center;
+  background-size: contain;
+  position: fixed;
+  left: 36px;
+  top: 30px;
+  cursor: pointer;
+}
+
 a {
   color: #ffffff;
 }
@@ -43,10 +64,8 @@ a {
   width: 100%;
 }
 .element {
-  width: 120px;
-  height: 135px;
-  /* box-shadow: 0px 0px 12px rgba(0, 255, 255, 0.5);
-  border: 1px solid rgba(127, 255, 255, 0.25); */
+  width: 152px;
+  height: 172px;
   box-shadow: 0px 3px 7px 0px rgba(99, 171, 186, 0.53);
   text-align: center;
   cursor: default;
@@ -54,95 +73,87 @@ a {
   align-items: center;
   justify-content: center;
   flex-direction: column;
+  transition: all 0.2s ease;
 }
 
-/* .element:hover {
-  box-shadow: 0px 0px 12px rgba(0, 255, 255, 0.75);
-  border: 1px solid rgba(127, 255, 255, 0.75);
-} */
-/*
-.element .number {
-  position: absolute;
-  top: 10px;
-  right: 20px;
-  font-size: 12px;
-  color: rgba(127, 255, 255, 0.75);
-} */
+.element.hide {
+  visibility: hidden;
+  opacity: 0;
+  transition: all 0.2s ease;
+}
 
 .element .symbolBox {
-  /* position: absolute;
-  top: 24px;
-  left: 15px;
-  right: 0px; */
-  /* font-size: 60px;
-        font-weight: bold;
-        color: rgba(255,255,255,0.75);  */
-  /* text-shadow: 0 0 10px rgba(0,255,255,0.95); */
-
   display: block;
-  width: 90px;
-  height: 90px;
+  width: 98px;
+  height: 98px;
   overflow: hidden;
   border-radius: 50%;
   border: 3px solid #4daaff;
 }
 .element .symbolBox img {
-  width: 90px;
-  height: 90px;
-  /* position: absolute;
-  left: 50%;
-  transform: translateX(-50%); */
+  width: 98px;
+  height: 98px;
 }
 
 .element .details {
-  /* position: absolute;
-  bottom: 6px;
-  left: 0px;
-  right: 0px; */
-  padding-top: 10px;
-  font-size: 16px;
+  padding-top: 15px;
+  font-size: 22px;
   color: #374693;
   font-weight: 500;
-}
-
-button {
-  color: rgba(127, 255, 255, 0.75);
-  background: transparent;
-  outline: 1px solid rgba(127, 255, 255, 0.75);
-  border: 0px;
-  padding: 5px 10px;
+  max-width: 100px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+#table {
+  width: 171px;
+  height: 69px;
+  background: url('../img/icon-start-btn.png') no-repeat center;
+  background-size: contain;
+  border: none;
   cursor: pointer;
 }
-button:hover {
-  background-color: rgba(0, 255, 255, 0.5);
-}
-button:active {
-  color: #000000;
-  background-color: rgba(0, 255, 255, 0.75);
+#sphere {
+  width: 171px;
+  height: 69px;
+  background: url('../img/icon-over-btn.png') no-repeat center;
+  background-size: contain;
+  border: none;
+  cursor: pointer;
 }
+
 .changeImgBoxs {
-  background-color: rgba(0, 255, 255, 0.75);
-  width: 440px;
-  height: 600px;
   position: relative;
   overflow: hidden;
+  width: 257px;
+  height: 292px;
+  background: #ffffff;
+  box-shadow: 0px 7px 16px 0px rgba(108, 200, 220, 0.53);
+  border-radius: 15px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
 }
 .changeImgBoxs .details {
-  position: absolute;
-  bottom: 26px;
-  left: 0px;
-  right: 0px;
-  font-size: 36px;
-  color: rgba(127, 255, 255, 0.75);
+  padding-top: 22px;
+  font-weight: 500;
+  font-size: 35px;
+  color: #374693;
+  line-height: 49px;
   text-align: center;
+  max-width: 200px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
 }
 .symbolBox2 {
-  width: 400px;
-  margin-left: 20px;
-  margin-top: 20px;
-  height: 500px;
+  width: 166px;
+  height: 166px;
+  border: 6px solid #4daaff;
   position: relative;
   overflow: hidden;
+  border-radius: 50%;
 }
 .symbol2 {
   position: absolute;

BIN
public/roll-call/img/icon-back.png


BIN
public/roll-call/img/icon-over-btn.png


BIN
public/roll-call/img/icon-start-btn.png


BIN
public/roll-call/img/icon-title.png


+ 146 - 112
public/roll-call/index.html

@@ -24,14 +24,16 @@
 </head>
 
 <body>
+
   <div id="container" style="pointer-events: none;"></div>
   <div id="vueBoxs">
-    <!-- @keypress.space="keyDowns()" -->
     <div class="bss">
+      <div class="pageTitle"></div>
+      <div class="iconBack" @click="onBack()"></div>
       <div id="menu">
-        <button id="table" @click="start()">开始</button>
-        <button id="sphere" @click="closes()">结束</button>
-        <button id="reset" style="margin-left:40px;" @click="resets()">照片墙</button>
+        <button id="table" v-show="!animationStatus" @click="start()"></button>
+        <button id="sphere" v-show="animationStatus" @click="closes()"></button>
+        <!-- <button id="reset" style="margin-left:40px;" @click="resets()">照片墙</button> -->
         <!-- <button id="lists" @click="listShow = true">中奖名单</button> -->
       </div>
     </div>
@@ -41,59 +43,73 @@
 </html>
 <script>
   var table = getData();
-  var tableLens = table.length / 2;
+  var tableLens = table.length;
   var camera, scene, renderer;
   var controls;
   var objects = [];
   var targets = { chaos: [], table: [], sphere: [], helix: [], grid: [] };
   var ang = 0, moving = false, objectsss, starBG, isMoving = false;  //objectsss 为切换的图片的
-  // var music = document.getElementById('music');
-  // var music2 = document.getElementById('music2');
   var cpx = 0, cpy = 0, cpz = 0, crx = 0, cry = 0, crz = 0;
 
   function init() {
-    camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 10000);
-    camera.position.z = 2000;
+    camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
+    camera.position.z = 1500;
     scene = new THREE.Scene();
     // table
-    for (var i = 0; i < table.length; i += 2) {
+    for (var i = 0; i < table.length; i++) {
       // 每个图标的盒子
       var element = document.createElement('div');
       element.className = 'element';
       element.style.backgroundColor = 'rgba(255,255,255)';
       element.style.borderRadius = '12px'
-      // 索引
-      // var number = document.createElement('div');
-      // number.className = 'number';
-      // number.textContent = (i / 2) + 1;
-      // element.appendChild(number);
+      if (i >= 32) {
+        element.className = 'element hide'
+      }
       // 图片
       var symbolBox = document.createElement('div');
       var symbol = document.createElement('img');
       symbolBox.className = 'symbolBox';
       symbol.className = 'symbol';
-      symbol.src = table[i];
+      symbol.src = table[i].img;
       symbolBox.appendChild(symbol);
       element.appendChild(symbolBox);
       // 姓名
       var details = document.createElement('div');
       details.className = 'details';
-      details.innerHTML = table[i + 1];
+      details.innerHTML = table[i].name;
       element.appendChild(details);
       // 图标变成3d内的对象,放入场景中
       var object = new THREE.CSS3DObject(element);
       object.position.x = Math.random() * 3400 - 1700;
       object.position.y = Math.random() * 3400 - 1700;
       object.position.z = Math.random() * 3400 - 1700;
-      object.name = table[i + 1];
+      object.name = table[i].name;
       scene.add(object);
       objects.push(object);
       // 根据索引,定制位置
       var object = new THREE.Object3D();
-      var iy = Math.floor((i / 2) / 8);
-      var ix = (i / 2) % 8;
-      object.position.x = (ix * 120) - 540;
-      object.position.y = - (iy * 155) + 480;
+      var ix = (i) % 8;
+      object.position.y = 300;
+      if (table.length === 1) {
+        object.position.x = 0;
+      } else if (table.length === 2) {
+        object.position.x = (ix * 172) - (172 * 1 / 2);
+      } else if (table.length === 3) {
+        object.position.x = (ix * 172) - (172 * 2 / 2);
+      } else if (table.length === 4) {
+        object.position.x = (ix * 172) - (172 * 3 / 2);
+      } else if (table.length === 5) {
+        object.position.x = (ix * 172) - (172 * 4 / 2);
+      } else if (table.length === 6) {
+        object.position.x = (ix * 172) - (172 * 5 / 2);
+      } else if (table.length === 7) {
+        object.position.x = (ix * 172) - (172 * 6 / 2);
+      } else {
+        var iy = Math.floor((i) / 8);
+        object.position.x = (ix * 172) - 600;
+        object.position.y = - (iy * 192) + 300;
+      }
+
       targets.table.push(object);
     }
 
@@ -101,21 +117,21 @@
     var elements = document.createElement('div');
     elements.className = 'changeImgBoxs';
     // element.style.backgroundImage = "url(./img/pic.png)";
-    elements.style.backgroundColor = 'rgba(0,127,127,' + (Math.random() * 0.5 + 0.25) + ')';
+    elements.style.backgroundColor = 'rgba(255,255,255)';
 
     var symbolBox = document.createElement('div');
     var symbol = document.createElement('img');
     symbol.setAttribute("id", "changeImg");
     symbolBox.className = 'symbolBox2';
     symbol.className = 'symbol2';
-    symbol.src = table[0];
+    symbol.src = table[0].img;
     symbolBox.appendChild(symbol);
     elements.appendChild(symbolBox);
 
     var details = document.createElement('div');
     details.setAttribute("id", "detailss");
     details.className = 'details';
-    details.innerHTML = table[1];
+    details.innerHTML = table[0].name;
     elements.appendChild(details);
 
     objectsss = new THREE.CSS3DObject(elements);
@@ -188,6 +204,7 @@
     for (var i = 0; i < objects.length; i++) {
       var object = objects[i];
       var target = targets[i];
+
       new TWEEN.Tween(object.position)
         .to({ x: target.position.x, y: target.position.y, z: target.position.z }, Math.random() * duration + duration)
         .easing(TWEEN.Easing.Exponential.InOut)
@@ -200,7 +217,21 @@
     new TWEEN.Tween(this)
       .to({}, duration * 2)
       .onUpdate(render)
-      .start();
+      .start()
+
+    // console.log(document.querySelectorAll('.element'), '1212')
+    setTimeout(() => {
+      if (moving) {
+        const elements = document.querySelectorAll('.element')
+        if (elements.length > 0) {
+          console.log('111')
+          elements.forEach((e) => {
+            e.classList.remove('hide')
+          })
+        }
+      }
+    }, 400);
+
   }
   // 屏幕大小适配
   function onWindowResize() {
@@ -226,14 +257,6 @@
     cry = camera.rotation.y;
     crz = camera.rotation.z;
 
-    // if (starBG.position.x + cpx * 5 / 2 > 1 || (starBG.position.x + cpx * 5 / 2 < -1)) {
-    //   starBG.position.x = -cpx * 5 / 2;
-    //   starBG.position.z = -cpz * 5 / 2;
-    //   starBG.position.y = -cpy * 5 / 2;
-    //   starBG.rotation.x = crx;
-    //   starBG.rotation.z = crz;
-    //   starBG.rotation.y = cry;
-    // }
   }
   function render() {
     renderer.render(scene, camera);
@@ -256,8 +279,8 @@
     if (numsss == tableLens) {
       numsss = tableLens - 1;
     }
-    srcss = table[numsss * 2];
-    txtsss = table[numsss * 2 + 1];
+    srcss = table[numsss].img;
+    txtsss = table[numsss].name;
     changeImg.src = srcss;
     detailss.innerHTML = txtsss;
   }
@@ -281,10 +304,20 @@
       isMoving = false;
     }).start();
   }
+
+  // 初始化数据
+  function renderData(data) {
+    table = data
+    tableLens = data.length
+    init();
+    animate();
+  }
+
   //点击事件及部分判断
   var vm = new Vue({
     el: '#vueBoxs',
     data: {
+      animationStatus: false,
       listShow: false,
       spic: {
         img: '',
@@ -301,41 +334,42 @@
         this.closes();
       },
       //判断奖品登记
-      ckPrice: function () {
-        var res = '三等奖';
-        var len1 = this.price1.length;
-        var len2 = this.price2.length;
-        var len3 = this.price3.length;
-        var lens = this.lens;
-        if (lens[2] <= len3) {
-          if (lens[1] <= len2) {
-            if (lens[0] <= len1) {
-              if (this.spic.img != '') {
-                res = '特等奖';
-              } else {
-                res = '特等奖';
-              }
-            } else {
-              res = '一等奖';
-            }
-          } else {
-            res = '二等奖';
-          }
-        }
-        this.priceNow = res;
-      },
+      // ckPrice: function () {
+      //   var res = '三等奖';
+      //   var len1 = this.price1.length;
+      //   var len2 = this.price2.length;
+      //   var len3 = this.price3.length;
+      //   var lens = this.lens;
+      //   if (lens[2] <= len3) {
+      //     if (lens[1] <= len2) {
+      //       if (lens[0] <= len1) {
+      //         if (this.spic.img != '') {
+      //           res = '特等奖';
+      //         } else {
+      //           res = '特等奖';
+      //         }
+      //       } else {
+      //         res = '一等奖';
+      //       }
+      //     } else {
+      //       res = '二等奖';
+      //     }
+      //   }
+      //   this.priceNow = res;
+      // },
       //开始
       start: function () {
-        if (vm.spic.img != '') {
-          alert("抽完咯~~~完咯~~~咯~~~,在中奖名单中清空,再来一次?");
-          return;
-        }
+        // if (vm.spic.img != '') {
+        //   alert("抽完咯~~~完咯~~~咯~~~,在中奖名单中清空,再来一次?");
+        //   return;
+        // }
         moving = true;
+        this.animationStatus = true;
         objectsss.position.y = 0;
         transform(targets.sphere, 1000);
         objDeal(objectsss, 1);
         // music.play();
-        this.ckPrice();
+        // this.ckPrice();
       },
       //结束
       closes: function () {
@@ -345,14 +379,15 @@
         }
         // music2.play();
         moving = false;
-        this.choosePerson();
+        this.animationStatus = false;
+        // this.choosePerson();
         transform(targets.chaos, 250, 1);
         objDeal(objectsss, 1.8);
       },
       //回到照片墙的状态
       resets: function () {
         moving = false;
-        camera.position.z = 2000;
+        camera.position.z = 1500;
         camera.position.x = 0;
         camera.position.y = 0;
         camera.up.x = 0;//相机以哪个方向为上方
@@ -366,59 +401,58 @@
         // 星空背景图重置
         transform(targets.table, 400);
         // music.pause();
-        this.ckPrice();
+        // this.ckPrice();
       },
       // 储存得奖名单
-      choosePerson: function () {
-        var img = document.getElementById('changeImg').src;
-        var txt = document.getElementById("detailss").innerHTML;
-
-        var img2 = document.getElementById('changeImg');
-        var txt2 = document.getElementById("detailss");
+      // choosePerson: function () {
+      //   var img = document.getElementById('changeImg').src;
+      //   var txt = document.getElementById("detailss").innerHTML;
 
-        var obj = {
-          img: img,
-          name: txt
-        };
-        var len3 = this.price3.length;
-        var len2 = this.price2.length;
-        var len1 = this.price1.length;
-        if (len3 < this.lens[2]) {
-          this.price3.push(obj);
-        } else {
-          if (len2 < this.lens[1]) {
-            this.price2.push(obj);
-          } else {
-            if (len1 < this.lens[0]) {
-              this.price1.push(obj);
-            } else {
-              if (this.spic.img == '') {
-                this.spic = obj;
-              } else {
-                alert("抽完咯,完咯~~咯~~~");
-              }
-            }
-          }
-        }
-        var json = JSON.stringify([this.price1, this.price2, this.price3, this.spic]);
-        localStorage.setItem('pricesListm', json);
-      },
+      //   var img2 = document.getElementById('changeImg');
+      //   var txt2 = document.getElementById("detailss");
 
+      //   var obj = {
+      //     img: img,
+      //     name: txt
+      //   };
+      //   var len3 = this.price3.length;
+      //   var len2 = this.price2.length;
+      //   var len1 = this.price1.length;
+      //   if (len3 < this.lens[2]) {
+      //     this.price3.push(obj);
+      //   } else {
+      //     if (len2 < this.lens[1]) {
+      //       this.price2.push(obj);
+      //     } else {
+      //       if (len1 < this.lens[0]) {
+      //         this.price1.push(obj);
+      //       } else {
+      //         if (this.spic.img == '') {
+      //           this.spic = obj;
+      //         } else {
+      //           alert("抽完咯,完咯~~咯~~~");
+      //         }
+      //       }
+      //     }
+      //   }
+      //   var json = JSON.stringify([this.price1, this.price2, this.price3, this.spic]);
+      //   localStorage.setItem('pricesListm', json);
+      // },
+      onBack() {
+        // 返回时先结束
+        this.closes()
+        window.parent.postMessage({
+          api: 'callBack',
+          loading: false,
+        }, '*');
+      }
     },
     created: function () {
-      var json = localStorage.getItem('pricesListm');
-      if (json) {
-        var attrs = JSON.parse(json);
-        this.price1 = attrs[0];
-        this.price2 = attrs[1];
-        this.price3 = attrs[2];
-        this.spic = attrs[3];
-      }
-      init();
-      // getStar();
-      animate();
+      // init();
+      // animate();
 
-      this.ckPrice();
+      // getStar();
+      // this.ckPrice();
     }
   })
 </script>

+ 11 - 34
public/roll-call/js/data.js

@@ -1,34 +1,11 @@
-function getData(){
-    return data = [
-        "./img/1.webp", "小白",
-        "./img/2.webp", "小黑",
-        "./img/3.webp", "小明", 
-        "./img/4.webp", "晓得", 
-        "./img/5.webp", "小李",
-        "./img/6.webp", "小胡", 
-        "./img/7.webp", "小黄", 
-        "./img/8.webp", "小智",
-        "./img/9.webp", "小新",
-        "./img/10.webp", "汪仔",
-        "./img/1.webp", "小白",
-        "./img/2.webp", "小黑",
-        "./img/3.webp", "小明", 
-        "./img/4.webp", "晓得", 
-        "./img/5.webp", "小李",
-        "./img/6.webp", "小胡", 
-        "./img/7.webp", "小黄", 
-        "./img/8.webp", "小智",
-        "./img/9.webp", "小新",
-        "./img/10.webp", "汪仔",
-        "./img/1.webp", "小白",
-        "./img/2.webp", "小黑",
-        "./img/3.webp", "小明", 
-        "./img/4.webp", "晓得", 
-        "./img/5.webp", "小李",
-        "./img/6.webp", "小胡", 
-        "./img/7.webp", "小黄", 
-        "./img/8.webp", "小智",
-        "./img/9.webp", "小新",
-        "./img/10.webp", "汪仔",
-    ];
-}
+function getData() {
+  return (data = [
+    { name: '小白', img: './img/1.webp' },
+    { img: './img/2.webp', name: '小黑' },
+    { img: './img/2.webp', name: '小黑' },
+    { img: './img/3.webp', name: '小明' },
+    { img: './img/4.webp', name: '晓得' },
+    { img: './img/4.webp', name: '晓得' },
+    { img: './img/5.webp', name: '小李' }
+  ]);
+}

+ 120 - 0
src/views/attend-class/component/roll-call/pen.module.less

@@ -0,0 +1,120 @@
+.pen {
+  position: fixed;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  top: 0;
+  z-index: 501;
+}
+
+.open {
+  display: block;
+}
+
+.whiteboard {
+  background: #fff !important;
+}
+
+.hide {
+  display: none;
+}
+
+.iframe {
+  display: block;
+  width: 100%;
+  height: 100%;
+  border: 0;
+}
+
+.dely {
+  opacity: 0;
+}
+
+.rightItem {
+  position: absolute;
+  right: 30px;
+  bottom: 0;
+  bottom: constant(safe-area-inset-bottom);
+  bottom: env(safe-area-inset-bottom);
+  height: 78Px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+
+  svg {
+    width: 28Px;
+    height: 28Px;
+  }
+
+  // position: absolute;
+  // top: 40px;
+  // left: 40px;
+  // width: 187px;
+  // height: 65px;
+  // cursor: pointer;
+  // transition: all 0.5s;
+
+  // img {
+  //   width: 100%;
+  //   height: 100%;
+  //   -moz-user-select: none;
+  //   /* 火狐浏览器 */
+  //   -webkit-user-drag: none;
+  //   /* 谷歌、Safari和Opera浏览器 */
+  //   -webkit-user-select: none;
+  //   /* 谷歌、Safari和Opera浏览器 */
+  //   -ms-user-select: none;
+  //   /* IE10+浏览器 */
+  //   user-select: none;
+  //   /* 通用 */
+  //   -webkit-touch-callout: none;
+  //   /* iOS Safari */
+  // }
+
+}
+
+.img {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  display: block;
+}
+
+
+.removeVisiable {
+  width: 432px;
+
+  :global {
+    .n-card-header {
+      font-size: max(22px, 16Px);
+    }
+  }
+
+  .studentRemove {
+    padding: 20px 40px 0;
+
+    p {
+      font-size: max(18px, 14Px);
+      color: #777777;
+      line-height: 30px;
+      text-align: center;
+
+      span {
+        color: #EA4132;
+      }
+    }
+  }
+
+  .btnGroupModal {
+    padding: 32px 0;
+
+    :global {
+      .n-button {
+        height: 47px;
+        min-width: 156px;
+      }
+    }
+  }
+}

+ 131 - 0
src/views/attend-class/component/roll-call/pen.tsx

@@ -0,0 +1,131 @@
+import { defineComponent, toRefs, ref, PropType, reactive } from 'vue';
+import styles from './pen.module.less';
+import { ToolType } from '../../index';
+import { NButton, NModal, NSpace } from 'naive-ui';
+
+export default defineComponent({
+  name: 'pen-page',
+  props: {
+    show: {
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String as PropType<ToolType>,
+      default: 'pen'
+    },
+    close: {
+      type: Function,
+      default: () => ({})
+    }
+  },
+  setup(props) {
+    const { show, type } = toRefs(props);
+    // const modelAttendStatus = ref(false);
+    const modal = reactive({
+      status: false,
+      title: type.value === 'pen' ? '退出批注' : '退出白板',
+      content:
+        type.value === 'pen' ? '确认是否退出批注?' : '确认是否退出白板?'
+    });
+    const firstRender = ref(true);
+    const origin = /(localhost|192)/.test(location.host)
+      ? // ? 'https://test.lexiaoya.cn/'
+        'http://localhost:5002/'
+      : location.origin;
+    let src = `${origin}/classroom-whiteboard?t=${+new Date()}`;
+
+    console.log(props.type, '121212');
+    if (props.type === 'call') {
+      src = `${origin}/roll-call/index.html?t=${+new Date()}`;
+    }
+    return () => (
+      <div
+        class={[
+          styles.pen,
+          type.value === 'whiteboard' ? styles.whiteboard : '',
+          firstRender.value ? styles.dely : '',
+          show.value ? styles.open : styles.hide
+        ]}>
+        <iframe
+          class={styles.iframe}
+          frameborder="0"
+          width="100vw"
+          height="100vh"
+          src={src}
+          onLoad={() => {
+            firstRender.value = false;
+          }}></iframe>
+        <div class={styles.rightItem} onClick={() => (modal.status = true)}>
+          <svg
+            width="28px"
+            height="28px"
+            viewBox="0 0 34 34"
+            version="1.1"
+            xmlns="http://www.w3.org/2000/svg">
+            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+              <g
+                transform="translate(-1842.000000, -1016.000000)"
+                stroke="#FFFFFF">
+                <g transform="translate(980.000000, 1006.000000)">
+                  <g transform="translate(862.000000, 10.000000)">
+                    <g transform="translate(4.000000, 5.000000)">
+                      <g
+                        transform="translate(8.058241, 5.009812)"
+                        fill="#FFFFFF"
+                        fill-rule="nonzero"
+                        stroke-width="0.3">
+                        <path d="M11.6084252,-0.15 C11.9880433,-0.15 12.3676614,-0.00518057514 12.6573002,0.284458275 L12.6573002,0.284458275 L18.3141545,5.94131252 C18.6037933,6.23095137 18.7486128,6.61056948 18.7486128,6.99018758 C18.7486128,7.36980569 18.6037933,7.74942379 18.3141545,8.03906264 L18.3141545,8.03906264 L12.6573002,13.6959169 C12.3676614,13.9855557 11.9880433,14.1303752 11.6084252,14.1303752 C11.2288071,14.1303752 10.849189,13.9855557 10.5595501,13.6959169 C10.2699113,13.406278 10.1250918,13.0266599 10.1250918,12.6470418 C10.1250918,12.2674237 10.2699113,11.8878056 10.5595368,11.5981801 L10.5595368,11.5981801 L13.6839174,8.47301484 L1.33333333,8.47352092 C0.923722144,8.47352092 0.552888811,8.30749318 0.284458275,8.03906264 C0.0160277386,7.77063211 -0.15,7.39979877 -0.15,6.99018758 C-0.15,6.61194961 -0.00841906355,6.26678575 0.224608408,6.00476938 C0.462154637,5.73767211 0.794779811,5.55707713 1.16932931,5.51583101 L1.16932931,5.51583101 L13.6841044,5.50627626 L10.5595501,2.38220839 C10.2699113,2.09256954 10.1250918,1.71295144 10.1250918,1.33333333 C10.1250918,0.953715229 10.2699113,0.574097124 10.5595501,0.284458275 C10.849189,-0.00518057514 11.2288071,-0.15 11.6084252,-0.15 Z"></path>
+                      </g>
+                      <path
+                        d="M15,24 L3,24 C1.34314575,24 -1.1293615e-15,22.6568542 0,21 L0,3 C-2.02906125e-16,1.34314575 1.34314575,3.04359188e-16 3,0 L15,0 L15,0"
+                        stroke-width="3.5"
+                        stroke-linecap="round"
+                        stroke-linejoin="round"></path>
+                    </g>
+                  </g>
+                </g>
+              </g>
+            </g>
+          </svg>
+        </div>
+
+        {/* 布置作业 */}
+        <NModal
+          transformOrigin="center"
+          v-model:show={modal.status}
+          preset="card"
+          // class={styles.attendClassModal}
+          title={modal.title}
+          class={['modalTitle', styles.removeVisiable]}>
+          <div class={styles.studentRemove}>
+            <p>{modal.content}</p>
+            {/* <div class={styles.modelAttendContent}>
+              {data.modalAttendMessage}
+            </div> */}
+            <NSpace class={styles.btnGroupModal} justify="center">
+              <NButton
+                type="default"
+                round
+                onClick={() => {
+                  modal.status = false;
+                }}>
+                取消
+              </NButton>
+              <NButton
+                type="primary"
+                round
+                onClick={() => {
+                  // data.modelTrainStatus = true;
+                  modal.status = false;
+                  props.close();
+                }}>
+                确认
+              </NButton>
+            </NSpace>
+          </div>
+        </NModal>
+      </div>
+    );
+  }
+});

+ 50 - 32
src/views/attend-class/component/tools/pen.tsx

@@ -17,6 +17,10 @@ export default defineComponent({
     close: {
       type: Function,
       default: () => ({})
+    },
+    callStudents: {
+      type: Array,
+      default: () => []
     }
   },
   setup(props) {
@@ -30,10 +34,14 @@ export default defineComponent({
     });
     const firstRender = ref(true);
     const origin = /(localhost|192)/.test(location.host)
-      ? 'https://test.lexiaoya.cn/'
-      : // 'http://localhost:3000/'
-        location.origin;
-    const src = `${origin}/classroom-whiteboard?t=${+new Date()}`;
+      ? // ? 'https://test.lexiaoya.cn/'
+        'http://localhost:5002/'
+      : location.origin;
+    let src = `${origin}/classroom-whiteboard?t=${+new Date()}`;
+
+    if (props.type === 'call') {
+      src = `${origin}/roll-call/index.html?t=${+new Date()}`;
+    }
 
     return () => (
       <div
@@ -45,46 +53,56 @@ export default defineComponent({
         ]}>
         <iframe
           class={styles.iframe}
+          id="penIframeRef"
           frameborder="0"
           width="100vw"
           height="100vh"
           src={src}
           onLoad={() => {
             firstRender.value = false;
+
+            if (props.type === 'call') {
+              const iframeRef: any = document.getElementById('penIframeRef');
+              if (iframeRef && iframeRef.contentWindow.renderData) {
+                iframeRef.contentWindow.renderData(props.callStudents);
+              }
+            }
           }}></iframe>
-        <div class={styles.rightItem} onClick={() => (modal.status = true)}>
-          <svg
-            width="28px"
-            height="28px"
-            viewBox="0 0 34 34"
-            version="1.1"
-            xmlns="http://www.w3.org/2000/svg">
-            <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-              <g
-                transform="translate(-1842.000000, -1016.000000)"
-                stroke="#FFFFFF">
-                <g transform="translate(980.000000, 1006.000000)">
-                  <g transform="translate(862.000000, 10.000000)">
-                    <g transform="translate(4.000000, 5.000000)">
-                      <g
-                        transform="translate(8.058241, 5.009812)"
-                        fill="#FFFFFF"
-                        fill-rule="nonzero"
-                        stroke-width="0.3">
-                        <path d="M11.6084252,-0.15 C11.9880433,-0.15 12.3676614,-0.00518057514 12.6573002,0.284458275 L12.6573002,0.284458275 L18.3141545,5.94131252 C18.6037933,6.23095137 18.7486128,6.61056948 18.7486128,6.99018758 C18.7486128,7.36980569 18.6037933,7.74942379 18.3141545,8.03906264 L18.3141545,8.03906264 L12.6573002,13.6959169 C12.3676614,13.9855557 11.9880433,14.1303752 11.6084252,14.1303752 C11.2288071,14.1303752 10.849189,13.9855557 10.5595501,13.6959169 C10.2699113,13.406278 10.1250918,13.0266599 10.1250918,12.6470418 C10.1250918,12.2674237 10.2699113,11.8878056 10.5595368,11.5981801 L10.5595368,11.5981801 L13.6839174,8.47301484 L1.33333333,8.47352092 C0.923722144,8.47352092 0.552888811,8.30749318 0.284458275,8.03906264 C0.0160277386,7.77063211 -0.15,7.39979877 -0.15,6.99018758 C-0.15,6.61194961 -0.00841906355,6.26678575 0.224608408,6.00476938 C0.462154637,5.73767211 0.794779811,5.55707713 1.16932931,5.51583101 L1.16932931,5.51583101 L13.6841044,5.50627626 L10.5595501,2.38220839 C10.2699113,2.09256954 10.1250918,1.71295144 10.1250918,1.33333333 C10.1250918,0.953715229 10.2699113,0.574097124 10.5595501,0.284458275 C10.849189,-0.00518057514 11.2288071,-0.15 11.6084252,-0.15 Z"></path>
+        {props.type !== 'call' && (
+          <div class={styles.rightItem} onClick={() => (modal.status = true)}>
+            <svg
+              width="28px"
+              height="28px"
+              viewBox="0 0 34 34"
+              version="1.1"
+              xmlns="http://www.w3.org/2000/svg">
+              <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+                <g
+                  transform="translate(-1842.000000, -1016.000000)"
+                  stroke="#FFFFFF">
+                  <g transform="translate(980.000000, 1006.000000)">
+                    <g transform="translate(862.000000, 10.000000)">
+                      <g transform="translate(4.000000, 5.000000)">
+                        <g
+                          transform="translate(8.058241, 5.009812)"
+                          fill="#FFFFFF"
+                          fill-rule="nonzero"
+                          stroke-width="0.3">
+                          <path d="M11.6084252,-0.15 C11.9880433,-0.15 12.3676614,-0.00518057514 12.6573002,0.284458275 L12.6573002,0.284458275 L18.3141545,5.94131252 C18.6037933,6.23095137 18.7486128,6.61056948 18.7486128,6.99018758 C18.7486128,7.36980569 18.6037933,7.74942379 18.3141545,8.03906264 L18.3141545,8.03906264 L12.6573002,13.6959169 C12.3676614,13.9855557 11.9880433,14.1303752 11.6084252,14.1303752 C11.2288071,14.1303752 10.849189,13.9855557 10.5595501,13.6959169 C10.2699113,13.406278 10.1250918,13.0266599 10.1250918,12.6470418 C10.1250918,12.2674237 10.2699113,11.8878056 10.5595368,11.5981801 L10.5595368,11.5981801 L13.6839174,8.47301484 L1.33333333,8.47352092 C0.923722144,8.47352092 0.552888811,8.30749318 0.284458275,8.03906264 C0.0160277386,7.77063211 -0.15,7.39979877 -0.15,6.99018758 C-0.15,6.61194961 -0.00841906355,6.26678575 0.224608408,6.00476938 C0.462154637,5.73767211 0.794779811,5.55707713 1.16932931,5.51583101 L1.16932931,5.51583101 L13.6841044,5.50627626 L10.5595501,2.38220839 C10.2699113,2.09256954 10.1250918,1.71295144 10.1250918,1.33333333 C10.1250918,0.953715229 10.2699113,0.574097124 10.5595501,0.284458275 C10.849189,-0.00518057514 11.2288071,-0.15 11.6084252,-0.15 Z"></path>
+                        </g>
+                        <path
+                          d="M15,24 L3,24 C1.34314575,24 -1.1293615e-15,22.6568542 0,21 L0,3 C-2.02906125e-16,1.34314575 1.34314575,3.04359188e-16 3,0 L15,0 L15,0"
+                          stroke-width="3.5"
+                          stroke-linecap="round"
+                          stroke-linejoin="round"></path>
                       </g>
-                      <path
-                        d="M15,24 L3,24 C1.34314575,24 -1.1293615e-15,22.6568542 0,21 L0,3 C-2.02906125e-16,1.34314575 1.34314575,3.04359188e-16 3,0 L15,0 L15,0"
-                        stroke-width="3.5"
-                        stroke-linecap="round"
-                        stroke-linejoin="round"></path>
                     </g>
                   </g>
                 </g>
               </g>
-            </g>
-          </svg>
-        </div>
+            </svg>
+          </div>
+        )}
 
         {/* 布置作业 */}
         <NModal

BIN
src/views/attend-class/image/right_icon10.png


+ 75 - 4
src/views/attend-class/index.tsx

@@ -81,6 +81,7 @@ import rightIconWhiteboard from './image/right_icon4.png';
 import rightIconMetronome from './image/right_icon5.png';
 import rightIconTuner from './image/right_icon6.png';
 import rightIconTimer from './image/right_icon7.png';
+import rightIconCall from './image/right_icon10.png';
 import rightIconPackUp from './image/right_icon8.png';
 import rightIconMusic from './image/right_icon9.png';
 import bottomIconSwitch from './image/bottom_icon1.png';
@@ -89,11 +90,11 @@ import bottomIconPre from './image/bottom_icon3.png';
 import bottomIconNext from './image/bottom_icon4.png';
 import rightHideIcon from './image/right_hide_icon.png';
 import SelectResources from '../prepare-lessons/model/select-resources';
-import { getStudentAfterWork } from '../studentList/api';
+import { getStudentAfterWork, getStudentList } from '../studentList/api';
 import TheNoticeBar from '/src/components/TheNoticeBar';
 import ClassWork from './model/class-work';
 
-export type ToolType = 'init' | 'pen' | 'whiteboard';
+export type ToolType = 'init' | 'pen' | 'whiteboard' | 'call';
 export type ToolItem = {
   type: ToolType;
   name: string;
@@ -291,6 +292,11 @@ export default defineComponent({
         }
       }
 
+      // 点名返回
+      if (ev.data?.api === 'callBack') {
+        closeStudyTool();
+      }
+
       if (ev.data?.api === 'onLogin') {
         const documentDom: any = document;
         documentDom.exitFullscreen
@@ -853,7 +859,6 @@ export default defineComponent({
       }
     };
     document.body.addEventListener('keyup', (e: KeyboardEvent) => {
-      console.log(e, 'e');
       if (e.code === 'ArrowLeft') {
         // if (popupData.activeIndex === 0) return;
         setModalOpen();
@@ -928,7 +933,9 @@ export default defineComponent({
     const studyData = reactive({
       type: '' as ToolType,
       penShow: false,
-      whiteboardShow: false
+      whiteboardShow: false,
+      callShow: false,
+      callStudentList: [] as any // 学生列表
     });
 
     /** 打开教学工具 */
@@ -944,6 +951,10 @@ export default defineComponent({
           break;
         case 'whiteboard':
           studyData.whiteboardShow = true;
+          break;
+        case 'call':
+          studyData.callShow = true;
+          break;
       }
     };
 
@@ -1152,6 +1163,11 @@ export default defineComponent({
         id: 7
       },
       {
+        name: '点名',
+        icon: rightIconCall,
+        id: 10
+      },
+      {
         name: '收起',
         icon: rightIconPackUp,
         id: 8
@@ -1267,11 +1283,55 @@ export default defineComponent({
           handleStop(false);
           data.selectResourceStatus = true;
           break;
+        case 10:
+          //  点名
+          await rollCallStudentList();
+          break;
         default:
           break;
       }
     };
 
+    // 点名学生列表
+    const rollCallStudentList = async () => {
+      //
+      try {
+        if (studyData.callStudentList.length > 0) {
+          openStudyTool({
+            type: 'call',
+            icon: iconWhite,
+            name: '点名'
+          });
+          return;
+        }
+        const res = await getStudentList({
+          classGroupId: data.classGroupId,
+          page: 1,
+          rows: 999
+        });
+        const result = res.data || {};
+        if (Array.isArray(result.rows) && result.rows.length > 0) {
+          const tempStudents: any = [];
+          result.rows.forEach((row: any) => {
+            tempStudents.push({
+              name: row.nickname,
+              img: row.avatar
+            });
+          });
+          studyData.callStudentList = [...tempStudents];
+          openStudyTool({
+            type: 'call',
+            icon: iconWhite,
+            name: '点名'
+          });
+        } else {
+          message.error('班级中暂无学员');
+        }
+      } catch {
+        //
+      }
+    };
+
     // 底部悬浮按钮操作
     const operateBottomBtn = (id: number) => {
       switch (id) {
@@ -1666,6 +1726,15 @@ export default defineComponent({
           />
         )}
 
+        {studyData.callShow && (
+          <Pen
+            callStudents={studyData.callStudentList}
+            show={studyData.type === 'call'}
+            type={studyData.type}
+            close={() => closeStudyTool()}
+          />
+        )}
+
         {/* 布置作业 */}
         <NModal
           transformOrigin="center"
@@ -1841,3 +1910,5 @@ export default defineComponent({
     );
   }
 });
+
+// roll-call/index.html