123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <template>
- <ModuleBase :type="data.type">
- <template #content>
- <UploadFile
- :id="id"
- ref="audioUploadFile"
- :module-data="data"
- :label-text="labelText"
- :accept-file-type="acceptFileType"
- :upload-tip="uploadTip"
- :icon-class="iconClass"
- @saveDate="saveDate"
- />
- <!-- <ul>
- <li v-for="(file, i) in file_list" :key="i">
- <audio
- :id="file.file_id"
- :src="file.file_url"
- controls
- @error=""
- @play=""
- @pause=""
- @timeupdate=""
- @ended=""
- ></audio>
- </li>
- </ul> -->
- </template>
- </ModuleBase>
- </template>
- <script>
- import { getAudioData } from '@/views/book/courseware/data/audio';
- import { GetCoursewareComponentContent_View } from '@/api/book';
- import ModuleMixin from '../../common/ModuleMixin';
- import UploadFile from '../common/UploadFile.vue';
- export default {
- name: 'AudioPage',
- components: { UploadFile },
- mixins: [ModuleMixin],
- data() {
- return {
- data: getAudioData(),
- componentId: this.id,
- coursewareId: this.courseware_id,
- file_list: [
- {
- file_id: '1',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '2',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '3',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '4',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '5',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '6',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '7',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '8',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- {
- file_id: '9',
- file_url:
- 'https://file-kf.helxsoft.cn/CSFileServer/URL/002/69F3878866F2A1B7DF04C4EFE9ACD04120240402145413PKA8LLFPXRT1BKURSBNIFXGK8EV5VCBIVL9WGCFB_00201-20240402-14-UAG696HY.mp3',
- },
- ],
- labelText: '音频',
- acceptFileType: '.mp3,.acc,.wma',
- uploadTip: '支持上传mp3、acc、wma,等格式音频文件,单个文件最大100MB,总文件体积不超1G。',
- iconClass: 'note',
- };
- },
- created() {
- this.getCoursewareComponentContent_View();
- },
- methods: {
- saveDate(file) {
- this.data.id = this.componentId;
- this.data.file_list.push(file);
- this.data.file_id_list.push(file.file_id);
- },
- getCoursewareComponentContent_View() {
- GetCoursewareComponentContent_View({ courseware_id: this.coursewareId, component_id: this.componentId }).then(
- ({ content }) => {
- if (content) this.data = JSON.parse(content);
- },
- );
- },
- },
- };
- </script>
- <style lang="scss" scoped></style>
|