From c13d33d0d20b6b0080d5f076456a01e8e94cf77e Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Tue, 24 Sep 2024 15:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=8F=AF=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/user/userCourse.vue | 72 +++++++++++++++++---------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/src/views/modules/user/userCourse.vue b/src/views/modules/user/userCourse.vue index 060ed50..83005b4 100644 --- a/src/views/modules/user/userCourse.vue +++ b/src/views/modules/user/userCourse.vue @@ -169,20 +169,26 @@ -
+ +
-
+ + {{item.title}} + +
+
@@ -220,6 +226,7 @@ export default { key: "", expire: "", userInfo: "" + }, statusOptions: [ { @@ -297,15 +304,25 @@ export default { dataListSelections: [], youVisible: false, - + linshiids:[], + youForm: { courseId: null, cate: [], - catalogueId: null, + catalogueId: '', days: "", come:"" //管理员开通(原因) - } + } , + linshilist:[{ + title:'1' + }, + { + title:'2', + + }, + { title:'3'} + ], }; }, components: { @@ -346,7 +363,7 @@ export default { method: "post", data: this.$http.adornData(data) }).then(({ data }) => { - if (data && data.code === 0) { + if (data && data.code == 0) { this.$message.success('操作成功!') this.getDataList() } else { @@ -385,6 +402,7 @@ export default { }, submit() { console.log(this.youForm, "youForm"); + this.youForm.catalogueId = this.linshiids.join(',') this.$refs['youForm'].validate(valid => { if (valid) { let data = { @@ -399,6 +417,7 @@ export default { data: this.$http.adornData(data) }) .then(({ data }) => { + if(data.code!== 0) return this.$message.error(data.msg) this.$message.success('开课成功!') this.getDataList() this.dialogClose() @@ -411,20 +430,18 @@ export default { }, dialogClose() { this.youVisible = false; + this.linshiids = [] this.$nextTick(() => { this.youForm.cate = []; this.options = []; + this.$refs["youForm"].resetFields(); console.log(this.youForm, "youForm"); }); console.log(this.youForm, "youForm"); }, selectChange(val) { - // console.log('val',val) - console.log("options", this.options); - // const _obj = this.options.find(item => item.id == val); - // this.youForm.cate = _obj.courseCatalogueEntityList; - // console.log(this.youForm.cate, "this.youForm.cate"); + console.log("options", this.options); this.getCate(val) }, remoteMethod(query) { @@ -444,13 +461,14 @@ export default { url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"), method: "post", data: this.$http.adornData(data) - }).then(({ data }) => { + }).then(({ data }) => { if (data && data.code === 0) { this.options = data.list; } else { this.options = []; } this.totalLaoding = false; + if(data.code !== 0) return this.$message.error(data.msg) }); } else { this.options = []; @@ -458,6 +476,8 @@ export default { } }, showAddD() { + this.linshiids = [] + this.youVisible = true; }, @@ -472,17 +492,10 @@ export default { method: "get", params: this.$http.adornParams() }).then(({ data }) => { - if (data && data.code === 0) { + if(data && data.code!== 0) return this.$message.error(data.msg) + this.user = data.user; - this.getDataList(); - // if (data.user.avatar && data.user.avatar != "") { - // var img = { - // name: '', - // url: data.user.avatar - // } - - // } - } + this.getDataList(); }); }, // 获取数据列表 @@ -495,20 +508,21 @@ export default { data: this.$http.adornData({ "current": this.pageIndex, "limit": this.pageSize, - "userInfo": this.userId,//姓名 电话 邮箱 + "userInfo": '',//姓名 电话 邮箱 + "userId": this.userId,//用户id "courseName": this.dataForm.key,//课程名 "come":"", //开课来源 "expire": this.dataForm.expire//状态 0有效 -1 过期 }) }) - .then(({ data }) => { - if (data && data.code === 0) { + .then(({ data }) => { + if(data && data.code!== 0) return this.$message.error(data.msg) console.log(data,'data') this.dataList = data.result.records; this.totalPage = data.result.pages; this.total = data.result.total; this.dataListLoading = false; - } + }); }, @@ -534,6 +548,8 @@ export default { // this.pointForm.pointType == 0 }, getCate(id) { + this.linshiids = [] + this.$http({ url: this.$http.adornUrl("/master/userManage/catalogueListByCourse"), method: "post", @@ -547,6 +563,8 @@ export default { // this.youForm.cate }else{ this.youForm.cate = [] + this.linshiids = [] + } }).catch(e => { console.log('数据报错')