<template>
  <div class="chatArea">
		<bar @cutPage="back()" :num="1" tit="课堂"/>
		<iframe ref="iframeRef" class="ca_iframe" allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="src"></iframe>
  </div>
</template>

<script>
import bar from './component/bar.vue';
export default {
	components:{
		bar
	},
  data() {
    return {
			userId: this.$store.state.user.userinfo.userid,
      org: this.$store.state.user.userinfo.org,
      oid: this.$store.state.user.userinfo.organizeid,
			type:this.$route.query.type,
			src:"https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=798c3511-6b32-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=merenduihua444"
    };
  },
  methods: {
		back(){
			this.$router.go(-1)
		}
  },
  mounted() {
    if (this.type == 1) {
			// 2.1
			console.log("2.1课程")
      this.src = `https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=798c3511-6b32-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=${this.userId}-21`;
			console.log("5")
    } else if (this.type == 2) {
			//2.2
			console.log("2.2课程")
      this.src = `https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=a9883cc4-6c3d-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=${this.userId}-22`;
			console.log(3)
    }
		window.localStorage.setItem("showDialog",JSON.stringify({type:1,time:new Date().getTime()}))
  }
};
</script>

<style scoped>
.chatArea{
	width: 100vw;
	height: 100vh;
	box-sizing: border-box;
	padding-top: 40px;
	overflow: hidden;
}

.ca_iframe{
	width: 100%;
	height: 100%;
}
</style>
