Browse Source

更改课程中学授课按钮弹窗逻辑

SanHQin 1 year ago
parent
commit
3d47b99bd3
1 changed files with 16 additions and 10 deletions
  1. 16 10
      src/components/courseDetail.vue

+ 16 - 10
src/components/courseDetail.vue

@@ -1314,16 +1314,22 @@ export default {
       if (l.length > 0) {
         this.dialogVisibleSk = true;
       } else {
-				const h = this.$createElement;
-				this.$confirm("该课程尚未指定授课班级,请放回首页,使用修改功能添加授课班级。","提示",{
-					confirmButtonText: '去修改',
-          cancelButtonText: '取消',
-					type:"error",
-				}).then(() => {
-					if(this.courseDetail.state == 1 || this.courseDetail.state == 2){
-						window.parent.postMessage({ tools: "openCourseUpdate",cid:this.id }, "*");
-					}else if(this.courseDetail.state == 3){
-						window.parent.postMessage({ tools: "openCourseEUpdate",cid:this.id }, "*");
+				this.getCourseDetail1().then(_=>{
+					if(this.classList.length<=0){
+						this.$confirm("该课程尚未指定授课班级,请放回首页,使用修改功能添加授课班级。","提示",{
+							confirmButtonText: '去修改',
+        		  cancelButtonText: '取消',
+							type:"error",
+						}).then(() => {
+							if(this.courseDetail.state == 1 || this.courseDetail.state == 2){
+								window.parent.postMessage({ tools: "openCourseUpdate",cid:this.id }, "*");
+							}else if(this.courseDetail.state == 3){
+								window.parent.postMessage({ tools: "openCourseEUpdate",cid:this.id }, "*");
+							}
+
+						})
+					}else{
+						this.dialogVisibleSk = true;
 					}
         })
         // this.addUserRate(0);