diff --git a/config/index.js b/config/index.js index 7d3a216..bec3ded 100644 --- a/config/index.js +++ b/config/index.js @@ -23,7 +23,7 @@ module.exports = { }, // Various Dev Server settings - host: '192.168.110.157', // can be overwritten by process.env.HOST + host: '192.168.110.162', // can be overwritten by process.env.HOST port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/components/imgPrev.vue b/src/components/imgPrev.vue new file mode 100644 index 0000000..9562b7c --- /dev/null +++ b/src/components/imgPrev.vue @@ -0,0 +1,98 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 4b11c0d..fbe8184 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -64,6 +64,8 @@ const mainRoutes = { { path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } }, { path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } }, { path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } }, + { path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } }, + { path: '/workOrder', component: _import('modules/workOrderLIst'), name: 'workOrder', meta: { title: '工单列表', isTab: true } }, ], beforeEnter (to, from, next) { let token = Vue.cookie.get('token') diff --git a/src/utils/imgPre.js b/src/utils/imgPre.js new file mode 100644 index 0000000..0cbc199 --- /dev/null +++ b/src/utils/imgPre.js @@ -0,0 +1,25 @@ +var modal = document.getElementById("modal"); + +var modalImg = document.getElementById("modalImage"); + +var images = document.querySelectorAll(".zoomable"); + +// 遍历为每个图片元素添加事件监听器 +images.forEach(function (image) { + image.addEventListener("click", function () { + modal.style.display = "block"; + modalImg.src = this.src; + }); +}); + +var span = document.querySelector(".close"); + +span.addEventListener("click", function () { + modal.style.display = "none"; +}); + +modal.addEventListener("click", function (event) { + if (event.target == modal) { + modal.style.display = "none"; + } +}); diff --git a/src/views/main-navbar.vue b/src/views/main-navbar.vue index c683d1f..677ef0d 100644 --- a/src/views/main-navbar.vue +++ b/src/views/main-navbar.vue @@ -28,7 +28,7 @@ 官方社区 - + 前端 @@ -59,12 +59,12 @@ export default { data () { return { - updatePassowrdVisible: false + updatePassowrdVisible: false } }, components: { UpdatePassword - }, + }, computed: { navbarLayoutType: { get () { return this.$store.state.common.navbarLayoutType } @@ -82,7 +82,7 @@ } }, methods: { - // 修改密码 + // 修改密码 updatePasswordHandle () { this.updatePassowrdVisible = true this.$nextTick(() => { diff --git a/src/views/modules/book/talkBook-add-or-update.vue b/src/views/modules/book/talkBook-add-or-update.vue index f85192c..f5668e1 100644 --- a/src/views/modules/book/talkBook-add-or-update.vue +++ b/src/views/modules/book/talkBook-add-or-update.vue @@ -36,12 +36,15 @@ - + + :action="baseUrl + '/oss/fileoss'" :file-list="videoList" + :on-error="onvideoEror" + :before-upload="beforeuploadVideo" + :on-success="videoSuccess" accept=".mp4" + :on-remove="videoRemove" :show-file-list="true"> 上传文件 @@ -161,7 +164,7 @@ trigger: "blur" }] }, - + VideoLoadingFlag:false, // 富文本编辑器配置 editorOption: { modules: { @@ -462,7 +465,22 @@ // setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条 } }, - + // 上传失败 + onvideoEror(err, file, fileList){ + console.log(err,'err') + this.VideoLoadingFlag = false + // this.$message.error('上传失败') + this.$notify.error({ + title: '错误', + message: '上传失败', + duration: 0 + }); + + }, + // 视频上传成功前 + beforeuploadVideo(){ + this.VideoLoadingFlag = true + }, videoSuccess(res, file) { console.log(res, 'res') if (res.msg == "success") { @@ -483,6 +501,7 @@ } else { this.$message.error("上传失败"); } + this.VideoLoadingFlag = false }, videoRemove(file, fileList) { diff --git a/src/views/modules/course/chapter-add-or-update.vue b/src/views/modules/course/chapter-add-or-update.vue index 0ce95e6..1d208e6 100644 --- a/src/views/modules/course/chapter-add-or-update.vue +++ b/src/views/modules/course/chapter-add-or-update.vue @@ -66,7 +66,6 @@ :inactive-value="0" active-text="是" inactive-text="否" - > @@ -91,8 +90,57 @@ > + + +
+
+
视频/音频ID:
+
+ +
+
+ 排序: + +
+
+ + + + + + +
+ 删除 +
+ +
+
+ 添加一条音/视频 +
取消 @@ -169,6 +217,21 @@ export default { dictType: "", dictValue: "" }, + typeList: [ + //类型0普通1加密 + { + dictType: 0, + dictValue: "普通" + }, + { + dictType: 1, + dictValue: "加密" + }, + { + dictType: 2, + dictValue: "mp3" + } + ], gushuList: [], authorList: [], restaurants: [], @@ -185,10 +248,18 @@ export default { title: "", imgUrl: "", content: "", - sort: 1 - }, + sort: 1, + // video_audio_url: [ + // {url:'454545',type:0} + // ] + }, + video_audio_url: [ + { video: "" ,type:1,id:0,sort:0} + ], + obj:{ video: "" ,type:1,id:0,sort:0}, splitsTypeList: [], - dataRule: {} + dataRule: {}, + chapterId:null, }; }, components: { @@ -197,6 +268,16 @@ export default { created() {}, mounted() {}, methods: { + delItem(index){ + this.video_audio_url.splice(index, 1) + // console.log(this.video_audio_url,'删除后的') + }, + addItem() { + // var jj = {...this.obj} + console.log(this.video_audio_url.length,'this.dataForm.video_audio_url--------') + this.video_audio_url.push({'chapterId':this.chapterId, ...this.obj}); + console.log(this.video_audio_url,'this.dataForm.video_audio_url') + }, contentUploadSuccess(res, file) { // console.log(res) let quill = this.$refs.myQuillEditor.quill; @@ -231,6 +312,13 @@ export default { this.dataForm.courseId = courseid ? courseid : ""; this.dataForm.catalogueId = catalogue_id ? catalogue_id : ""; this.visible = true; + this.chapterId = this.dataForm.id + if(this.dataForm.videoList && this.dataForm.videoList.length > 0){ + this.video_audio_url = [...this.dataForm.videoList] + console.log('dedao',this.video_audio_url) + }else{ + this.video_audio_url = [] + } if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") { var img = { name: "", @@ -265,9 +353,11 @@ export default { content: this.dataForm.content, sort: this.dataForm.sort, isAudition: this.dataForm.isAudition, + videoList:this.video_audio_url, }) }).then(({ data }) => { if (data && data.code === 0) { + // this.video_audio_url = [] this.$message({ message: "操作成功", type: "success", @@ -303,7 +393,8 @@ export default { console.log(file); }, handlereset() { - (this.fileList = []), (this.fileListNovel = []), (this.visible = false); + // this.video_audio_url = [] + (this.fileList = []), (this.fileListNovel = []), (this.visible = false),(this.video_audio_url = []); }, handlePreview(file) { console.log(file); @@ -343,3 +434,11 @@ export default { } }; + diff --git a/src/views/modules/course/course-add-or-update.vue b/src/views/modules/course/course-add-or-update.vue index 4cf78a3..235cf5b 100644 --- a/src/views/modules/course/course-add-or-update.vue +++ b/src/views/modules/course/course-add-or-update.vue @@ -45,6 +45,43 @@ +
+ + + + + + + + + + +
+
添加关联书籍
{ + console.log('获得列表',data) + if(data && data.length > 0){ + this.relationProducts = this.relationProducts.concat(data) + } + }) }, methods: { + delPro(i){ + console.log('i',i) + // this.$emit('delPro',i) + this.relationProducts.splice(i,1) + console.log('处理后的',this.relationProducts) + }, + showProTable(){ + this.$emit('showProTable',true) + }, contentUploadSuccess(res, file) { // console.log(res) let quill = this.$refs.myQuillEditor.quill; @@ -319,6 +373,7 @@ export default { init(row) { console.log("11111", row); if (row && row.id) { + this.courseId = row.id this.$http .request({ url: this.$http.adornUrl(this.urlList.info), @@ -337,7 +392,11 @@ export default { if (res && res.data.code === 0) { var data = res.data.course; console.log("data at line 357:", data); - + if(res.data.shopProductList && res.data.shopProductList.length > 0){ + this.relationProducts = res.data.shopProductList + }else{ + this.relationProducts = [] + } if (data.image != "" && data.image != null) { var img = { name: "", @@ -365,6 +424,15 @@ export default { // this.$message.error("请选择图书类型"); // return // } + let _relationProductIds = '' + if(this.relationProducts.length > 0){ + let _list = [...this.relationProducts] + _list = _list.map(item => item.productId) + _relationProductIds = _list.join() + // console.log(_relationProductIds, _list,'_relationProductIds') + } + // console.log(_relationProductIds, _list,'_relationProductIds') + this.$refs["dataForm"].validate(valid => { if (valid) { this.$http({ @@ -381,7 +449,8 @@ export default { title: this.dataForm.title, sort: this.dataForm.sort, image: this.dataForm.image, - content: this.dataForm.content + content: this.dataForm.content, + relationProductIds : _relationProductIds }) }).then(({ data }) => { if (data && data.code === 0) { @@ -391,6 +460,8 @@ export default { duration: 1500, onClose: () => { this.visible = false; + this.relationProductIds = [] + this.relationProducts = [] this.$emit("refreshDataList"); } }); @@ -429,6 +500,9 @@ export default { }, handlereset() { (this.fileList = []), (this.fileListNovel = []), (this.visible = false); + this.$emit('pclose') + this.relationProducts = [] + this.courseId = undefined }, handlePreview(file) { console.log(file); diff --git a/src/views/modules/course/courseCatalogue.vue b/src/views/modules/course/courseCatalogue.vue index 9d60ff2..6a8ae24 100644 --- a/src/views/modules/course/courseCatalogue.vue +++ b/src/views/modules/course/courseCatalogue.vue @@ -31,6 +31,12 @@ align="center" label="目录名称" > + - + + 创建商品 + 迁移本部
@@ -158,6 +174,11 @@ ref="addOrUpdate" @refreshDataList="getDataList" > + + \ No newline at end of file diff --git a/src/views/modules/course/medicalLabel.vue b/src/views/modules/course/medicalLabel.vue index 1d71d53..fa78b41 100644 --- a/src/views/modules/course/medicalLabel.vue +++ b/src/views/modules/course/medicalLabel.vue @@ -116,6 +116,7 @@ :action="baseUrl + '/oss/fileoss'" :on-remove="audioHandleRemove" :on-success="audioUploadSuccess" + :before-upload="onprogress" accept=".mp3" :limit="1" :file-list="audioFileList" @@ -611,6 +612,9 @@ export default { this.getDataList(); }, methods: { + onprogress(){ + this.$message('上传中,请勿关闭或进行其他操作'); + }, audioHandleRemove(file, fileList) { console.log(file, fileList); this.audioFileList = [] @@ -619,6 +623,7 @@ export default { audioUploadSuccess(res, file) { this.audioFileList = [] this.audioFileList.push(file) + this.$message.success('上传成功'); console.log(this.audioFileList,res, "上传成功"); this.addForm.media = res.url diff --git a/src/views/modules/course/moveCourse.vue b/src/views/modules/course/moveCourse.vue new file mode 100644 index 0000000..231c182 --- /dev/null +++ b/src/views/modules/course/moveCourse.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/views/modules/course/shopproductTable.vue b/src/views/modules/course/shopproductTable.vue new file mode 100644 index 0000000..56c954d --- /dev/null +++ b/src/views/modules/course/shopproductTable.vue @@ -0,0 +1,361 @@ + + + + \ No newline at end of file diff --git a/src/views/modules/course/sociologyList.vue b/src/views/modules/course/sociologyList.vue index 4dd6b0b..d304b4d 100644 --- a/src/views/modules/course/sociologyList.vue +++ b/src/views/modules/course/sociologyList.vue @@ -450,6 +450,7 @@ export default { this.$message.error("请输入标签名称"); return false; } + this.addForm.content = '' await this.$refs[formName].validate(async valid => { if (valid) { await this.$http({ diff --git a/src/views/modules/course/video-add-or-update.vue b/src/views/modules/course/video-add-or-update.vue index 25c14b7..6f9df2f 100644 --- a/src/views/modules/course/video-add-or-update.vue +++ b/src/views/modules/course/video-add-or-update.vue @@ -84,6 +84,10 @@ { dictType: 1, dictValue: "加密" + }, + { + dictType: 2, + dictValue: "mp3" } ], props: { diff --git a/src/views/modules/user/user.vue b/src/views/modules/user/user.vue index 296adb9..6cbd84d 100644 --- a/src/views/modules/user/user.vue +++ b/src/views/modules/user/user.vue @@ -13,10 +13,10 @@ :disabled="dataListSelections.length <= 0">批量删除 -->
- - - + - +