natasha 1 سال پیش
والد
کامیت
a1c04ca207

+ 32 - 2
src/icons/svg/hanzi-writer-bg.svg

@@ -1,3 +1,33 @@
-<svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path id="&#232;&#190;&#185;&#230;&#161;&#134;" d="M0 31H62M31 62V0" stroke="currentColor" stroke-dasharray="3 6"/>
+<svg width="69" height="69" viewBox="0 0 69 69" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_2206_19367)">
+<rect y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="6" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="12" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="18" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="24" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="30" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="36" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="42" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="48" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="54" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="60" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="66" y="34" width="3" height="1" rx="0.5" fill="currentColor"/>
+<rect x="35" width="3" height="1" rx="0.5" transform="rotate(90 35 0)" fill="currentColor"/>
+<rect x="35" y="6" width="3" height="1" rx="0.5" transform="rotate(90 35 6)" fill="currentColor"/>
+<rect x="35" y="12" width="3" height="1" rx="0.5" transform="rotate(90 35 12)" fill="currentColor"/>
+<rect x="35" y="18" width="3" height="1" rx="0.5" transform="rotate(90 35 18)" fill="currentColor"/>
+<rect x="35" y="24" width="3" height="1" rx="0.5" transform="rotate(90 35 24)" fill="currentColor"/>
+<rect x="35" y="30" width="3" height="1" rx="0.5" transform="rotate(90 35 30)" fill="currentColor"/>
+<rect x="35" y="36" width="3" height="1" rx="0.5" transform="rotate(90 35 36)" fill="currentColor"/>
+<rect x="35" y="42" width="3" height="1" rx="0.5" transform="rotate(90 35 42)" fill="currentColor"/>
+<rect x="35" y="48" width="3" height="1" rx="0.5" transform="rotate(90 35 48)" fill="currentColor"/>
+<rect x="35" y="54" width="3" height="1" rx="0.5" transform="rotate(90 35 54)" fill="currentColor"/>
+<rect x="35" y="60" width="3" height="1" rx="0.5" transform="rotate(90 35 60)" fill="currentColor"/>
+<rect x="35" y="66" width="3" height="1" rx="0.5" transform="rotate(90 35 66)" fill="currentColor"/>
+</g>
+<defs>
+<clipPath id="clip0_2206_19367">
+<rect width="69" height="69" fill="white"/>
+</clipPath>
+</defs>
 </svg>

+ 20 - 14
src/views/exercise_questions/preview/ChinesePreview.vue

@@ -8,8 +8,8 @@
     <div v-if="isEnable(data.property.is_enable_description)" class="description">{{ data.description }}</div>
 
     <!-- 笔画学习 -->
-    <div class="words-box">
-      <div v-for="(item, index) in data.option_list" :key="index" class="words-item">
+    <div :class="['words-box', 'words-box-' + data.property.learn_type]">
+      <div v-for="(item, index) in data.option_list" :key="index" :class="['words-item']">
         <template v-if="item.content.trim()">
           <template v-if="data.property.learn_type === 'paint'">
             <!-- 描红 -->
@@ -107,7 +107,11 @@ export default {
     // 初始化数据
     handleData() {
       if (document.getElementsByClassName('preview-content') && document.getElementsByClassName('preview-content')[0]) {
-        this.writer_number = Math.floor(document.getElementsByClassName('preview-content')[0].clientWidth / 64);
+        this.writer_number =
+          Math.floor((document.getElementsByClassName('preview-content')[0].clientWidth - 128) / 64) - 1;
+      }
+      if (this.data.property.learn_type === 'paint') {
+        this.writer_number -= 5;
       }
       this.data.option_list.forEach((item) => {
         if (item.content.trim()) {
@@ -119,9 +123,6 @@ export default {
           GetStaticResources(MethodName, data).then((res) => {
             this.$set(item, 'strokes', res);
           });
-          if (this.data.property.learn_type === 'paint') {
-            this.writer_number -= 5;
-          }
           for (let i = 0; i < this.writer_number; i++) {
             arr.push(null);
           }
@@ -140,12 +141,11 @@ export default {
       this.$forceUpdate();
     },
     freeWrite(imgUrl, index, indexs) {
-      let _this = this;
-      _this.if_free_show = true;
-      _this.active_index = index;
-      _this.active_col_index = indexs;
-      _this.current_hz = _this.data.option_list[index].content;
-      _this.current_hz_data = imgUrl;
+      this.if_free_show = true;
+      this.active_index = index;
+      this.active_col_index = indexs;
+      this.current_hz = this.data.option_list[index].content;
+      this.current_hz_data = imgUrl;
     },
     // 删除记录
     deleteWriteRecord(rowIndex, colIndex, current_hz) {
@@ -156,6 +156,7 @@ export default {
         strokes_image_url: '',
       };
       this.changeCurQue(answer, colIndex);
+      this.current_hz_data = null;
       this.$forceUpdate();
     },
     changeCurQue(answer, colIndex) {
@@ -176,10 +177,10 @@ export default {
   @include preview;
 
   .words-box {
-    display: flex;
-    column-gap: 24px;
+    row-gap: 24px;
 
     .words-item {
+      display: flex;
       min-width: 64px;
     }
 
@@ -242,6 +243,11 @@ export default {
         z-index: 1;
       }
     }
+
+    &-learn {
+      display: flex;
+      column-gap: 24px;
+    }
   }
 
   .practiceBox {

+ 1 - 2
src/views/exercise_questions/preview/ChooseTonePreview.vue

@@ -106,8 +106,7 @@ export default {
   },
   methods: {
     chooseTone(item, value, i) {
-      if (this.select_item_index !== i && this.data.property.answer_mode === 'label') return;
-      if (!this.active_letter && this.data.property.answer_mode === 'label') return;
+      if ((!this.active_letter || this.select_item_index !== i) && this.data.property.answer_mode === 'label') return;
       item.user_answer[item.item_active_index].select_tone = value;
       if (this.data.property.answer_mode === 'label') {
         item.user_answer[item.item_active_index].select_letter = this.active_letter;

+ 20 - 141
src/views/exercise_questions/preview/components/common/FreewriteLettle.vue

@@ -1,8 +1,9 @@
 <!--  -->
 <template>
   <div class="practice practiceSingleNPC">
-    <img class="close-icon" @click="changePraShow()" />
+    <i class="el-icon-close close-icon" @click="changePraShow()"></i>
     <div class="right-content">
+      <SvgIcon icon-class="hanzi-writer-bg" class="character-target-bg" />
       <div class="right-strockred">
         <template v-if="!hasPlay && data && data.strokes_image_url">
           <img class="img" :src="data.strokes_image_url" alt="" />
@@ -18,7 +19,9 @@
           :width="width"
           class="vueEsign"
         />
-        <a class="clean-btn" @click="resetHuahua"></a>
+        <a class="clean-btn" @click="resetHuahua">
+          <SvgIcon icon-class="reset" class="reset-btn" />
+        </a>
       </div>
       <ul class="nav-list">
         <li :class="currenHzData && currenHzData.history ? '' : 'disabled'" @click="play()">播放</li>
@@ -34,7 +37,6 @@ export default {
   components: {
     FreeWriteQP,
   },
-  // props: ['currentTreeID', 'currentHz', 'currenHzData', 'closeifFreeShow', 'rowIndex', 'colIndex'],
   props: {
     currentTreeID: {
       type: String,
@@ -106,7 +108,7 @@ export default {
   methods: {
     play() {
       let _this = this;
-      if (this.currenHzData.history) {
+      if (this.currenHzData && this.currenHzData.history) {
         if (this.hasPlay) {
           this.$message.warning('请等待播放完成');
           return;
@@ -142,11 +144,6 @@ export default {
       let color = _this.colorsList[index];
       _this.hanzicolor = color;
     },
-    // changePen(index) {
-    //   let _this = this;
-    //   _this.penIndex = index;
-    //   _this.hanziweight = _this.weightList[_this.penIndex];
-    // },
     changeLearnMode(mode) {
       this.learn_mode = mode;
     },
@@ -180,6 +177,7 @@ export default {
     },
     // 不保存到记录列表
     handleWriteImg() {
+      if (this.$refs.esign.history.length === 0) return;
       this.$refs.esign.generate().then((res) => {
         let Book_img = res.replace('data:image/png;base64,', '');
         let write_img = `data:image/png;base64,${Book_img}`;
@@ -213,14 +211,6 @@ export default {
           };
           this.$emit('changeCurQue', answer, this.colIndex);
 
-          // let data = {
-          //   courseware_id: this.currentTreeID,
-          //   hz: this.currentHz,
-          //   strokes_content: JSON.stringify(this.$refs.esign.history),
-          //   strokes_image_base64: Book_img,
-          // };
-          // let MethodName = 'teaching-practice_manager-SaveMyHZHandwrittenRecord';
-          // LearnWebSI(MethodName, data).then((res) => {
           this.$message.success('保存成功!');
           let obj = {
             hz_handwritten_record_id: res.hz_handwritten_record_id,
@@ -228,7 +218,6 @@ export default {
             strokes_image_url: write_img,
           };
           this.$emit('closeIfFreeShow', obj, this.rowIndex, this.colIndex);
-          // });
         })
         .catch(() => {
           this.$message.warning('请先书写在保存');
@@ -257,15 +246,12 @@ export default {
     width: 16px;
     height: 16px;
     margin: 0 4px;
+    color: $text-color;
     cursor: pointer;
 
-    // background: url('../../../../assets/icon/Undo-16-disable-Black.png') center no-repeat;
-    // background-size: cover;
-    // display: block;
-    // &:hover {
-    //   background: url('../../../../assets/icon/Undo-16-normal-Black.png') center no-repeat;
-    //   background-size: cover;
-    // }
+    &:hover {
+      color: #000;
+    }
   }
 
   .close-icon {
@@ -354,33 +340,25 @@ export default {
       }
     }
 
+    .character-target-bg {
+      position: absolute;
+      top: 30px;
+      left: 16px;
+      width: 256px;
+      height: 250px;
+      color: #dedede;
+    }
+
     .right-strockred {
       position: relative;
       width: 256px;
       height: 256px;
       overflow: hidden;
-
-      // background: #fff url('../../../../assets/NPC/chinaTianRed.png') center no-repeat;
-      background-size: 100% 100%;
       border-radius: 8px;
 
       .img {
         position: absolute;
       }
-
-      // .strock-play-box {
-      //   position: absolute;
-      //   width: 32px;
-      //   height: 32px;
-      //   background: #fff
-      //     url("../../../../assets/NPC/strock-play-red-click-big.png") center
-      //     no-repeat;
-      //   background-size: 100% 100%;
-      //   cursor: pointer;
-      //   right: 0;
-      //   top: 0;
-      //   z-index: 2;
-      // }
     }
 
     .footer {
@@ -391,99 +369,6 @@ export default {
       justify-content: flex-end;
       width: 100%;
       padding-right: 40px;
-
-      .pen-colors {
-        display: flex;
-        align-items: center;
-        justify-content: flex-start;
-
-        .write-icon-3 {
-          width: 20px;
-          height: 20px;
-          margin-right: 12px;
-        }
-
-        .colors-list {
-          display: flex;
-          align-items: center;
-          justify-content: flex-start;
-          padding: 0;
-          margin: 0;
-
-          > li {
-            box-sizing: border-box;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            width: 20px;
-            height: 20px;
-            margin: 0 4px;
-            cursor: pointer;
-            background: #fff;
-            border: 2px solid #fff;
-            border-radius: 50%;
-
-            > span {
-              width: 14px;
-              height: 14px;
-              border-radius: 100%;
-
-              &.color-item0 {
-                background: #404040;
-              }
-
-              &.color-item1 {
-                background: #f65d4d;
-              }
-
-              &.color-item2 {
-                background: #19b068;
-              }
-
-              &.color-item3 {
-                background: #52a1ea;
-              }
-
-              &.color-item4 {
-                background: #ff8c49;
-              }
-            }
-
-            &.color-item-active0 {
-              border: 2px solid #404040;
-            }
-
-            &.color-item-active1 {
-              border: 2px solid #f65d4d;
-            }
-
-            &.color-item-active2 {
-              border: 2px solid #19b068;
-            }
-
-            &.color-item-active3 {
-              border: 2px solid #52a1ea;
-            }
-
-            &.color-item-active4 {
-              border: 2px solid #ff8c49;
-            }
-          }
-        }
-      }
-
-      .pen {
-        display: flex;
-        align-items: center;
-        justify-content: flex-start;
-
-        > img {
-          width: 21px;
-          height: 19px;
-          margin-left: 4px;
-          cursor: pointer;
-        }
-      }
     }
   }
 }
@@ -524,9 +409,6 @@ export default {
     border: 1px solid rgba(0, 0, 0, 10%);
     border-radius: 4px;
 
-    // &:nth-child(2) {
-    //   margin: 0 24px;
-    // }
     img {
       width: 24px;
       height: 24px;
@@ -546,9 +428,6 @@ export default {
     font-weight: 600;
     line-height: 34px;
     color: #ba7d21;
-
-    /* identical to box height */
-
     text-align: center;
   }
 }