Forráskód Böngészése

修改coconote跳转

11wqe1 1 hete
szülő
commit
41f158e5a8
1 módosított fájl, 54 hozzáadás és 51 törlés
  1. 54 51
      src/views/HomeView.vue

+ 54 - 51
src/views/HomeView.vue

@@ -346,6 +346,59 @@ export default {
 				this.imgA = require("../assets/img/drgB.png");
 			}
 		},
+		async cocoNoteif(){
+			if (this.cocoNoteType && this.courseId) {
+				let params = {
+					cid: this.courseId,
+					classid: '1',
+				};
+				
+				try {
+					let res = await getCourseGroup(params);
+					if (res.data && res.data[1].length) {
+						let groupPerson = res.data[1]
+						let groupCid = ''
+						for (var i = 0; i < groupPerson.length; i++) {
+							if (groupPerson[i].userid == this.roleUser.userid) {
+								groupCid = groupPerson[i].groupCid
+								break;
+							}
+						}
+						if (groupCid) {
+							this.openApp3({
+								stateL: true,
+								toolId: "synergyCourse",
+								clearL: true,
+							});
+							window.topU.postMessage(
+								{
+									tools: "opencCscl",
+									cid: this.courseId,
+									gid: groupCid,
+								},
+								"*"
+							);
+							this.addOp3('1', "", { courseid: this.courseId , type: (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, "success")
+						} else {
+							this.$message.error("没有加入分组请先加入分组");
+							this.goToCourse3(this.courseId)
+							this.addOp3('1', "", { courseid: this.courseId , type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, '没有加入分组请先加入分组')
+						}
+					} else {
+						this.$message.error("没有加入分组请先加入分组");
+						this.goToCourse3(this.courseId)
+						this.addOp3('1', "", { courseid: this.courseId , type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, '没有加入分组请先加入分组')
+					}
+				} catch (error) {
+					this.addOp3(
+						"1",
+						"",
+						{ courseid: this.courseId ,type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" },
+						error
+					)
+				}	
+			}
+		},
 		// 跳转
 		async goMsg(){
 				console.log('去通知页');
@@ -469,52 +522,6 @@ export default {
 		async handleLoad(){
 			this.loading = false;
 			console.log('iframe加载完成');
-			if (this.cocoNoteType && this.courseId) {
-				let params = {
-					cid: this.courseId,
-					classid: '1',
-				};
-				
-				try {
-					let res = await getCourseGroup(params);
-					if (res.data && res.data[1].length) {
-						let groupPerson = res.data[1]
-						let groupCid = ''
-						for (var i = 0; i < groupPerson.length; i++) {
-							if (groupPerson[i].userid == this.roleUser.userid) {
-								groupCid = groupPerson[i].groupCid
-								break;
-							}
-						}
-						if (groupCid) {
-							window.topU.postMessage(
-								{
-									tools: "opencCscl",
-									cid: this.courseId,
-									gid: groupCid,
-								},
-								"*"
-							);
-							this.addOp3('1', "", { courseid: this.courseId , type: (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, "success")
-						} else {
-							this.$message.error("没有加入分组请先加入分组");
-							this.goToCourse3(this.courseId)
-							this.addOp3('1', "", { courseid: this.courseId , type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, '没有加入分组请先加入分组')
-						}
-					} else {
-						this.$message.error("没有加入分组请先加入分组");
-						this.goToCourse3(this.courseId)
-						this.addOp3('1', "", { courseid: this.courseId , type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" }, '没有加入分组请先加入分组')
-					}
-				} catch (error) {
-					this.addOp3(
-						"1",
-						"",
-						{ courseid: this.courseId ,type:  (this.roleUser.type == 1 ? '_teacher' : '_student') +  "CocoNote_open" },
-						error
-					)
-				}	
-			}
 		},
 		goToCourse3() {
 
@@ -813,11 +820,7 @@ export default {
 		}
 		// this.getMsg()
 		if(this.cocoNoteType){
-			this.openApp3({
-				stateL: true,
-				toolId: "synergyCourse",
-				clearL: true,
-			});
+			this.cocoNoteif()
 			return
 		}else if (this.courseId) {
 			this.openApp2({