diff --git a/src/views/modules/commonNews/course-add-or-update.vue b/src/views/modules/commonNews/course-add-or-update.vue
new file mode 100644
index 0000000..2a818f7
--- /dev/null
+++ b/src/views/modules/commonNews/course-add-or-update.vue
@@ -0,0 +1,459 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/commonNews/newsList.vue b/src/views/modules/commonNews/newsList.vue
new file mode 100644
index 0000000..603f646
--- /dev/null
+++ b/src/views/modules/commonNews/newsList.vue
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 新增
+
+
+
+
+
+
+
+
+ 疯子读书
+ 吴门医述
+ 众妙之门
+
+
+
+
+
+
+ 外链
+ 富文本
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/courseSettings/chapter-add-or-update.vue b/src/views/modules/courseSettings/chapter-add-or-update.vue
index d855d64..dfede43 100644
--- a/src/views/modules/courseSettings/chapter-add-or-update.vue
+++ b/src/views/modules/courseSettings/chapter-add-or-update.vue
@@ -24,7 +24,9 @@
- 保存
+ 保存
@@ -62,7 +64,7 @@ const toolbarOptions = [
["link", "image"] // 上传图片、上传视频
];
export default {
- props:['dataInfo'],
+ props: ["dataInfo", "type"],
data() {
return {
baseUrl: global.baseUrl,
@@ -90,7 +92,7 @@ export default {
}
}
},
- placeholder: "请输入"+this.dataInfo.label
+ placeholder: "请输入" + this.dataInfo.label
},
visible: false,
props: {
@@ -107,12 +109,9 @@ export default {
dialogImageUrl: "",
dialogVisible: false,
dataForm: {
- courseId: 0,
- catalogueId: 0,
- title: "",
- imgUrl: "",
+
content: "",
- sort: 1
+
},
splitsTypeList: [],
dataRule: {}
@@ -152,61 +151,37 @@ export default {
onEditorReady(quill) {
// console.log('editor ready!', quill)
},
- init(row, catalogue_id, courseid) {
- console.log("row21", row);
- this.dataForm = row ? JSON.parse(JSON.stringify(row)) : {};
- this.dataForm.courseId = courseid ? courseid : "";
- this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
- this.visible = true;
- if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
- var img = {
- name: "",
- url: this.dataForm.imgUrl
- };
- var attr = [];
- attr.push(img);
- this.fileList = attr;
- } else {
- this.fileList = [];
- }
+ init(content) {
+ console.log("row21", content);
+ this.dataForm.content=content
+
+ },
+ getContent(){
+
},
// 表单提交
dataFormSubmit() {
- this.$refs["dataForm"].validate(valid => {
- if (valid) {
- this.$http({
- url: this.$http.adornUrl(
- `${
- !this.dataForm.id
- ? "/master/course/addCourseCatalogueChapter"
- : "/master/course/editCourseCatalogueChapter"
- }`
- ),
- method: "post",
- data: this.$http.adornData({
- id: this.dataForm.id || undefined,
- courseId: this.dataForm.courseId || undefined,
- catalogueId: this.dataForm.catalogueId || undefined,
- title: this.dataForm.title,
- imgUrl: this.dataForm.imgUrl,
- content: this.dataForm.content,
- sort: this.dataForm.sort
- })
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.visible = false;
- this.$emit("refreshDataList");
- }
- });
- } else {
- this.$message.error(data.msg);
+ this.$http({
+ url: this.$http.adornUrl("/master/course/editCourseRecord"),
+ method: "post",
+ data: this.$http.adornData({
+ type: this.type,
+ recordType: this.dataInfo.id, //0 buy_record , 1 use_record , 2 study_record, 3 vip_record
+ content: this.dataForm.content
+ })
+ }).then(({ data }) => {
+ if (data && data.code === 0) {
+ this.$message({
+ message: "操作成功",
+ type: "success",
+ duration: 1500,
+ onClose: () => {
+ this.visible = false;
+ this.$emit("refreshDataList");
}
});
+ } else {
+ this.$message.error(data.msg);
}
});
},
diff --git a/src/views/modules/courseSettings/medicalCourseDescription.vue b/src/views/modules/courseSettings/medicalCourseDescription.vue
index 2fd9282..e008687 100644
--- a/src/views/modules/courseSettings/medicalCourseDescription.vue
+++ b/src/views/modules/courseSettings/medicalCourseDescription.vue
@@ -1,11 +1,18 @@
-
-
-
+
+
@@ -20,11 +27,13 @@ import AddOrUpdate from "./chapter-add-or-update";
export default {
data() {
return {
+ currentTab: 0,
+ type: 0,
setList: [
- { label: "购买须知", id: 1 },
- { label: "使用须知", id: 2 },
- { label: "学习次序", id: 3 },
- { label: "超V用户", id: 4 }
+ { label: "购买须知", id: 0 },
+ { label: "使用须知", id: 1 },
+ { label: "学习次序", id: 2 },
+ { label: "超V用户", id: 3 }
],
dataForm: {
key: ""
@@ -60,33 +69,53 @@ export default {
this.getDataList();
},
methods: {
+ handleClick(tab, event) {
+ this.getDataList()
+ },
// 获取数据列表
getDataList() {
this.dataListLoading = true;
- this.$http({
- url: this.$http.adornUrl(
- "/master/course/getCourseCatalogueChapterList"
- ),
- method: "post",
- data: this.$http.adornData({
- id: this.catalogue_id,
- page: this.pageIndex,
- limit: this.pageSize
- // "type": this.query.type||0, //类型0全部,1:医学,2:国学
- // "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
- // "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
- // "keywords": this.query.keywords //关键字
+ this.$http
+ .request({
+ url: this.$http.adornUrl(`/master/course/getCourseRecord`),
+ method: "POST",
+ data: {
+ type: this.type
+ },
+ header: {
+ //默认 无 说明:请求头
+ "Content-Type": "application/json"
+ }
})
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.dataList = data.page.records;
- this.totalPage = data.page.total;
- } else {
- this.dataList = [];
- this.totalPage = 0;
- }
- this.dataListLoading = false;
- });
+ .then(({ data }) => {
+ var that=this
+ console.log("data at line 86:", data);
+ if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
+ var content=''
+ switch (that.currentTab) {
+
+ case "0":
+ content=data.result.buyRecord
+ break;
+ case "1":
+ content=data.result.useRecord
+ break;
+ case "2":
+ content=data.result.studyRecord
+
+ break;
+ case "3":
+ content=data.result.vipRecord
+
+ break;
+ }
+ that.$nextTick(()=>{
+ that.$refs[`addOrUpdate${that.currentTab}`][0].init(content);
+})
+
+ }
+ this.dataListLoading = false;
+ });
},
// 每页数
sizeChangeHandle(val) {
@@ -244,7 +273,7 @@ export default {
-webkit-box-orient: vertical;
}
-::v-deep .mod-config .el-tabs .el-tabs__content {
+::v-deep .mod-config .el-tabs .el-tabs__content {
height: 100% !important;
}
diff --git a/src/views/modules/courseSettings/nationalStudiesCourseDescription.vue b/src/views/modules/courseSettings/nationalStudiesCourseDescription.vue
index 2fd9282..2d3dbf8 100644
--- a/src/views/modules/courseSettings/nationalStudiesCourseDescription.vue
+++ b/src/views/modules/courseSettings/nationalStudiesCourseDescription.vue
@@ -1,11 +1,18 @@
-
-
-
+
+
@@ -20,11 +27,14 @@ import AddOrUpdate from "./chapter-add-or-update";
export default {
data() {
return {
+ content: '',
+ currentTab: 0,
+ type: 1,
setList: [
- { label: "购买须知", id: 1 },
- { label: "使用须知", id: 2 },
- { label: "学习次序", id: 3 },
- { label: "超V用户", id: 4 }
+ { label: "购买须知", id: 0 },
+ { label: "使用须知", id: 1 },
+ { label: "学习次序", id: 2 },
+ { label: "超V用户", id: 3 }
],
dataForm: {
key: ""
@@ -60,33 +70,55 @@ export default {
this.getDataList();
},
methods: {
+ handleClick(tab, event) {
+
+ this.getDataList()
+ },
// 获取数据列表
getDataList() {
this.dataListLoading = true;
- this.$http({
- url: this.$http.adornUrl(
- "/master/course/getCourseCatalogueChapterList"
- ),
- method: "post",
- data: this.$http.adornData({
- id: this.catalogue_id,
- page: this.pageIndex,
- limit: this.pageSize
- // "type": this.query.type||0, //类型0全部,1:医学,2:国学
- // "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
- // "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
- // "keywords": this.query.keywords //关键字
+ this.$http
+ .request({
+ url: this.$http.adornUrl(`/master/course/getCourseRecord`),
+ method: "POST",
+ data: {
+ type: this.type
+ },
+ header: {
+ //默认 无 说明:请求头
+ "Content-Type": "application/json"
+ }
})
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.dataList = data.page.records;
- this.totalPage = data.page.total;
- } else {
- this.dataList = [];
- this.totalPage = 0;
- }
- this.dataListLoading = false;
- });
+ .then(({ data }) => {
+ var that=this
+ console.log("data at line 86:", data);
+ if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
+ var content=''
+ switch (that.currentTab) {
+
+ case "0":
+ content=data.result.buyRecord
+ break;
+ case "1":
+ content=data.result.useRecord
+ break;
+ case "2":
+ content=data.result.studyRecord
+
+ break;
+ case "3":
+ content=data.result.vipRecord
+
+ break;
+ }
+ that.$nextTick(()=>{
+ this.content=content
+ that.$refs[`addOrUpdate${that.currentTab}`][0].init(content);
+})
+
+ }
+ this.dataListLoading = false;
+ });
},
// 每页数
sizeChangeHandle(val) {
@@ -244,7 +276,7 @@ export default {
-webkit-box-orient: vertical;
}
-::v-deep .mod-config .el-tabs .el-tabs__content {
+::v-deep .mod-config .el-tabs .el-tabs__content {
height: 100% !important;
}