Browse Source

fix(Student): 调整作业提交按钮位置并优化截图配置

修改作业提交按钮和刷新按钮的底部位置,避免遮挡重要内容
优化html2canvas配置,添加缩放比例和跨域处理参数
lsc 1 day ago
parent
commit
2c1cf33d15
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/views/Student/index.vue

+ 3 - 3
src/views/Student/index.vue

@@ -2083,7 +2083,7 @@ const handleHomeworkSubmit = async () => {
           '_js.onload = function(){\n' +
           ' var a = document.getElementsByTagName("img")\n' +
           ' for(var i = 0;i<a.length;i++){a[i].crossOrigin="anonymous"}\n' +
-          ' html2canvas(document.body).then(canvas => {\n' +
+          ' html2canvas(document.body, {scale: 2,allowTaint: false,useCORS: true,logging: true,}).then(canvas => {\n' +
           '  var base64Url = canvas.toDataURL("image/png");\n' +
           'var base64 = "<img src=" + base64Url + " />"\n' +
           'var file = dataURLtoFile_shishi(base64Url, "截图")\n' +
@@ -4891,7 +4891,7 @@ const clearTimerState = () => {
 /* 作业提交按钮样式 */
 .homework-submit-btn {
   position: fixed;
-  bottom: 60px;
+  bottom: 160px;
   z-index: 100;
   background: #191a19;
   color: white;
@@ -4951,7 +4951,7 @@ const clearTimerState = () => {
 /* 刷新网页按钮样式 */
 .refresh-page-btn {
   position: fixed;
-  bottom: 60px;
+  bottom: 160px;
   z-index: 100;
   color: #000;
   padding: 5px 20px;