Browse Source

容错处理

dsy 3 weeks ago
parent
commit
eeaddf167c

+ 16 - 0
src/views/book/courseware/data/richText.js

@@ -447,6 +447,21 @@ export const categoryList = {
   others: '其他',
 };
 
+export const typeList = [
+  {
+    label: '富文本',
+    value: 'richtext',
+  },
+  {
+    label: '标题',
+    value: 'title',
+  },
+  {
+    label: '其它',
+    value: 'other',
+  },
+];
+
 export function getRichTextProperty() {
   return {
     serial_number: 1, // 序号
@@ -459,6 +474,7 @@ export function getRichTextProperty() {
     pinyin_position: pinyinPositionList[0].value, // top bottom
     pinyin_overall_position: pinyinOverallPositionList[0].value, // left center right
     is_first_sentence_first_hz_pinyin_first_char_upper_case: 'true', // 句首大写
+    type: typeList[0].value, // 富文本类型
   };
 }
 

+ 3 - 3
src/views/book/courseware/preview/components/judge/JudgePreview.vue

@@ -11,7 +11,7 @@
           :class="['option-item', { active: isAnswer(mark) }]"
         >
           <div
-            :style="{ borderColor: data.unified_attrib.topic_color }"
+            :style="{ borderColor: data.unified_attrib?.topic_color }"
             :class="['option-content', computedIsJudgeRight(mark)]"
           >
             <span class="serial-number">{{ convertNumberToLetter(i) }}.</span>
@@ -196,8 +196,8 @@ export default {
           display: flex;
           align-items: center;
           justify-content: center;
-          width: 48px;
-          height: 48px;
+          width: 36px;
+          height: 36px;
           color: #000;
           cursor: pointer;
           background-color: $content-color;

+ 1 - 1
src/views/book/courseware/preview/components/select/SelectPreview.vue

@@ -11,7 +11,7 @@
         <li
           v-for="({ content, mark, multilingual, paragraph_list }, i) in data.option_list"
           :key="mark"
-          :style="{ cursor: disabled ? 'not-allowed' : 'pointer', borderColor: data.unified_attrib.topic_color }"
+          :style="{ cursor: disabled ? 'not-allowed' : 'pointer', borderColor: data.unified_attrib?.topic_color }"
           :class="['option-item', { active: isAnswer(mark) }, ...computedAnswerClass(mark)]"
           @click="selectAnswer(mark)"
         >

+ 16 - 8
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -6,15 +6,16 @@
     <div class="main">
       <div class="voice-matrix-audio">
         <div v-show="hasSelectedCell" class="audio-simple">
-          <img
-            class="audio-simple-image"
-            :src="
-              playing
-                ? require(`@/assets/voice_matrix/icon-voice-play-blue.png`)
-                : require(`@/assets/voice_matrix/icon-voice.png`)
-            "
+          <div
+            class="audio-simple-image icon-mask"
+            :style="{
+              backgroundColor: data.unified_attrib?.topic_color,
+              maskImage: playing
+                ? `url(${require(`@/assets/voice_matrix/icon-voice-play-blue.png`)})`
+                : `url(${require(`@/assets/voice_matrix/icon-voice.png`)})`,
+            }"
             @click="playAudio"
-          />
+          ></div>
           <span
             :class="['Repeat-16', 'audio-simple-repeat', isRepeat ? '' : 'disabled']"
             @click="isRepeat = !isRepeat"
@@ -614,6 +615,13 @@ $border-color: #e6e6e6;
         height: 100%;
         line-height: 46px;
 
+        .audio-simple-image {
+          width: 24px;
+          height: 24px;
+          margin-left: 12px;
+          cursor: pointer;
+        }
+
         img {
           width: 16px;
           height: 16px;

+ 4 - 4
src/views/book/courseware/preview/components/voice_matrix/components/AudioLine.vue

@@ -8,16 +8,16 @@
             v-if="audio.playing"
             size="24px"
             icon-class="pause-large-fill"
-            :style="{ color: attrib.topic_color }"
+            :style="{ color: attrib?.topic_color }"
           />
-          <SvgIcon v-else size="24px" icon-class="play-large-fill" :style="{ color: attrib.topic_color }" />
+          <SvgIcon v-else size="24px" icon-class="play-large-fill" :style="{ color: attrib?.topic_color }" />
         </div>
       </div>
 
       <template v-if="!isRepeat">
         <el-slider
           v-model="playValue"
-          :style="{ width: sliderWidth + 'px', height: '2px', '--slider-color': attrib.topic_color }"
+          :style="{ width: sliderWidth + 'px', height: '2px', '--slider-color': attrib?.topic_color }"
           :format-tooltip="formatProcessToolTip"
           @change="changeCurrentTime"
         />
@@ -58,7 +58,7 @@
     <div v-else class="audioLine2">
       <div
         class="play-icon"
-        :style="{ backgroundColor: attrib.topic_color }"
+        :style="{ backgroundColor: attrib?.topic_color }"
         :class="[
           'icon-mask',
           audio.loading ? 'loadBtn' : audio.playing ? 'playBtn-icon' : 'pauseBtn-icon',