Parcourir la source

汉字展示及书写模式显示图片 且图片不配置描红和书写格

natasha il y a 2 jours
Parent
commit
88ae08beb4

+ 2 - 2
src/views/book/courseware/create/components/question/character/Character.vue

@@ -59,14 +59,14 @@
           </template>
           <div class="option-item">
             <template v-if="data.property.model === 'miao'">
-              <span>显示本体:</span>
+              <span>书写示范:</span>
               <el-radio-group v-model="item.is_show_ben">
                 <el-radio :label="true">是</el-radio>
                 <el-radio :label="false">否</el-radio>
               </el-radio-group>
             </template>
             <template v-if="data.property.model === 'write'">
-              <span>需要间距:</span>
+              <span>字格分开:</span>
               <el-radio-group v-model="item.is_margin">
                 <el-radio :label="true">是</el-radio>
                 <el-radio :label="false">否</el-radio>

+ 23 - 5
src/views/book/courseware/preview/components/character/CharacterPreview.vue

@@ -242,7 +242,21 @@
                           ? data.unified_attrib.topic_color
                           : '#346cda',
                     }"
+                    v-if="items && items.type === 'hanzi'"
                   />
+                  <template v-if="items && items.type === 'img'">
+                    <el-image
+                      v-if="items.file_list[0]"
+                      class="items-image"
+                      :class="['frame-size-' + data.property.frame_size]"
+                      :src="items.file_list[0].file_url"
+                      fit="contain"
+                      :style="{
+                        borderColor:
+                          data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '',
+                      }"
+                    />
+                  </template>
                 </div>
               </template>
 
@@ -544,15 +558,19 @@ export default {
           if (item.content.trim()) {
             for (let i = 0; i < this.data.property.write_number; i++) {
               item.content_list.forEach((items) => {
-                arr.push({ imgArr: null, flag: null });
+                if (items.type === 'hanzi') {
+                  arr.push({ imgArr: null, flag: null });
+                }
               });
             }
             for (let i = 0; i < this.data.property.miao_number; i++) {
               item.content_list.forEach((items) => {
-                miao_arr.push({
-                  strokes: items && items.hz_info && items.hz_info[0] ? items.hz_info[0].hzDetail.hz_json : null,
-                  length: item.content_list.length,
-                });
+                if (items && items.hz_info && items.hz_info[0]) {
+                  miao_arr.push({
+                    strokes: items && items.hz_info && items.hz_info[0] ? items.hz_info[0].hzDetail.hz_json : null,
+                    length: item.content_list.length,
+                  });
+                }
               });
             }
             item.imgArr = arr;