zhengyiming
2025-02-10 958b79ed89b9e742540f714a80261d222c0fc09b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<template>
  <div class="rich-edit-content">
    <template v-for="(item, index) in props.content" :key="index">
      <ReadAbleImage v-if="item.type === EditorType.Image" :src="setOSSLink(item.path)" />
      <video-player
        v-else-if="item.type === EditorType.Video"
        class="video-player-box"
        playsinline
        :options="{
          aspectRatio: '16:9',
          autoplay: false,
          muted: false,
          language: 'en',
          fluid: false,
          poster: '', // 封面地址
          controls: true,
          controlBar: {
            timeDivider: false, // 当前时间和持续时间的分隔符
            durationDisplay: false, // 显示持续时间
            remainingTimeDisplay: false, // 是否显示剩余时间功能
            fullscreenToggle: true, // 是否显示全屏按钮
          },
          sources: [
            {
              type: 'video/mp4', // 类型
              src: setOSSLink(item.path), // url地址
            },
          ],
        }"
        src="/src/assets/boleclound.png"
      />
      <RichEditorContent
        v-else-if="item.type === EditorType.Rich"
        :content="item.content"
      ></RichEditorContent>
      <FieldTextArea v-else v-model="item.content" style="width: 700px" isItemRead></FieldTextArea>
    </template>
  </div>
</template>
 
<script setup lang="ts">
import { EditorType } from '@/constants';
import { setOSSLink } from '@/utils';
import { ReadAbleImage, FieldTextArea } from '@bole-core/components';
import { VideoPlayer } from '@videojs-player/vue';
import RichEditorContent from '../RichEditor/RichEditorContent.vue';
 
defineOptions({
  name: 'RichContent',
});
 
type Props = {
  content: API.IntroInfo[];
};
 
const props = withDefaults(defineProps<Props>(), {});
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
 
.rich-edit-content {
  .video-player-box {
    margin-bottom: 14px;
    padding-top: 0 !important;
    width: 400px;
    height: 150px;
  }
 
  :deep(.pro-from-item-read-content-wrapper) {
    margin-bottom: 10px;
  }
}
</style>