|
|
@@ -20,6 +20,7 @@
|
|
|
:font-family="data?.unified_attrib?.font"
|
|
|
:pinyin-padding="data.property.pinyin_padding"
|
|
|
:is-preview="isPreview"
|
|
|
+ :body-styles="getBodyStyles()"
|
|
|
/>
|
|
|
<div v-else>
|
|
|
<AudioPlay
|
|
|
@@ -58,7 +59,6 @@ import PreviewMixin from '../common/PreviewMixin';
|
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
|
import PinyinText from '@/components/PinyinText.vue';
|
|
|
import AudioPlay from '../character_base/components/AudioPlay.vue';
|
|
|
-import { getRandomNumber } from '@/utils';
|
|
|
|
|
|
export default {
|
|
|
name: 'RichTextPreview',
|
|
|
@@ -145,6 +145,24 @@ export default {
|
|
|
|
|
|
return noTextContentData;
|
|
|
},
|
|
|
+
|
|
|
+ getBodyStyles() {
|
|
|
+ const styles = {};
|
|
|
+ const unifiedAttrib = this.data?.unified_attrib || {};
|
|
|
+
|
|
|
+ // 从统一属性中获取样式
|
|
|
+ if (unifiedAttrib.font) {
|
|
|
+ styles['font-family'] = unifiedAttrib.font;
|
|
|
+ }
|
|
|
+ if (unifiedAttrib.font_size) {
|
|
|
+ styles['font-size'] = unifiedAttrib.font_size;
|
|
|
+ }
|
|
|
+ if (unifiedAttrib.text_color) {
|
|
|
+ styles['color'] = unifiedAttrib.text_color;
|
|
|
+ }
|
|
|
+
|
|
|
+ return styles;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|