|
|
@@ -3,7 +3,7 @@
|
|
|
<el-dialog v-model="show" :show-close="false">
|
|
|
<template #header>
|
|
|
<div class="b_head">
|
|
|
- <span>添加班级</span>
|
|
|
+ <span>选择授课班级</span>
|
|
|
<svg
|
|
|
@click="close()"
|
|
|
t="1748587270371"
|
|
|
@@ -36,10 +36,10 @@
|
|
|
:class="{ b_m_classItem_active: selectId == item.id }"
|
|
|
:key="item.id"
|
|
|
v-if="item.name"
|
|
|
- >
|
|
|
- <!-- @click="
|
|
|
+ @click="
|
|
|
selectId == item.id ? (selectId = '') : (selectId = item.id)
|
|
|
- " -->
|
|
|
+ "
|
|
|
+ >
|
|
|
<div>{{ item.name }}</div>
|
|
|
<span v-if="item.studentNum >= 0"
|
|
|
>{{ item.studentNum }} 名学生
|
|
|
@@ -74,6 +74,11 @@
|
|
|
<div>添加或修改班级</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="b_bottom">
|
|
|
+ <div @click="close()">取消</div>
|
|
|
+ <div class="b_b_submit" @click="selectClassSuccess()">{{selectId ? '确定' : '直接进入'}}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
@@ -90,7 +95,7 @@ import { userInfoStore } from "../../stores/counter";
|
|
|
import addClassDialog from "./addClassDialog.vue";
|
|
|
const emit = defineEmits(["success", "changeClassList"]);
|
|
|
import axios from '@/services/config'
|
|
|
-
|
|
|
+const checkStage = ref('0');
|
|
|
|
|
|
const courseDetail = ref({});
|
|
|
const loading = ref(false);
|
|
|
@@ -98,6 +103,7 @@ const show = ref(false);
|
|
|
const classList = ref([]);
|
|
|
const selectId = ref("");
|
|
|
const userInfo = userInfoStore();
|
|
|
+console.log('userInfo',userInfo.user)
|
|
|
const addClassDialogRef = ref(null);
|
|
|
|
|
|
const getClasslist = (options) => {
|
|
|
@@ -112,8 +118,8 @@ const getCourseList = () => {
|
|
|
})
|
|
|
.then(res => {
|
|
|
console.log(res);
|
|
|
-
|
|
|
classList.value = res[3]
|
|
|
+ selectId.value = classList.value.length > 0 ? classList.value[0].id : ''
|
|
|
loading.value = false
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
@@ -121,10 +127,372 @@ const getCourseList = () => {
|
|
|
loading.value = false
|
|
|
})
|
|
|
};
|
|
|
+async function selectClassSuccess(){
|
|
|
+ let data = await addInviteCodeOne(selectId.value)
|
|
|
+ console.log("addInviteCodeOne",data)
|
|
|
+ gotoCourse(selectId.value);
|
|
|
+ close();
|
|
|
+}
|
|
|
+const gotoCourse = (id) => {
|
|
|
+ // 埋点
|
|
|
+ if(!id){
|
|
|
+ insertMemorandum(`开始为<span class='variable'>全部班级</span>授课`)
|
|
|
+ }else{
|
|
|
+ let _classData = classList.value.find(item=>item.id == id)
|
|
|
+ insertMemorandum(`开始为<span class='variable'>${_classData.name}</span>授课`,id)
|
|
|
+ }
|
|
|
+
|
|
|
+ addOp3('1', "", { courseid: courseDetail.value.courseId,classIdL: !id ? 'ssAll' : id ,type: "course_class_open" }, "success")
|
|
|
+
|
|
|
+ if (courseDetail.value.state == 1) {
|
|
|
+ if (classList.value.length) {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studyStudent?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1' +
|
|
|
+ "&tcid=" +
|
|
|
+ id
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studyStudent?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (courseDetail.value.state == 2 || courseDetail.value.state == 5) {
|
|
|
+ if (classList.value.length) {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studystudentE2?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1' +
|
|
|
+ "&tcid=" +
|
|
|
+ id
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studystudentE2?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (courseDetail.value.state == 3 || courseDetail.value.state == 4) {
|
|
|
+ if (classList.value.length) {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studystudentE3?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1' +
|
|
|
+ "&tcid=" +
|
|
|
+ id
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studystudentE3?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (courseDetail.value.state == 6) {
|
|
|
+ if (classList.value.length) {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studySutdentClass?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1' +
|
|
|
+ "&tcid=" +
|
|
|
+ id
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/studySutdentClass?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (courseDetail.value.state == 7) {
|
|
|
+ if(classList.value.length){
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/pptEasyClass?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1' +
|
|
|
+ "&tcid=" +
|
|
|
+ id
|
|
|
+ );
|
|
|
+ }else {
|
|
|
+ goto(
|
|
|
+ "https://pbl.cocorobo.cn/pbl-student-table/dist/#/pptEasyClass?type=" +
|
|
|
+ checkStage.value +
|
|
|
+ "&courseId=" +
|
|
|
+ courseDetail.value.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ userInfo.user.userid +
|
|
|
+ "&oid=" +
|
|
|
+ userInfo.user.organizeid +
|
|
|
+ "&org=" +
|
|
|
+ userInfo.user.org +
|
|
|
+ "&cid=" +
|
|
|
+ id +
|
|
|
+ "&tType=" +
|
|
|
+ userInfo.user.type +
|
|
|
+ "&screenType=" +
|
|
|
+ '1'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ courseId: courseDetail.value.courseId,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ axios.post("https://pbl.cocorobo.cn/api/pbl/addOpenCoursenum", params)
|
|
|
+ .then((res) => {})
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const goto = (val) => {
|
|
|
+ console.log('val',val)
|
|
|
+ window.topU.U.MD.D.I.openInApplication('setUrl',{url:val,title:'课程详情',id:new Date().getTime()})
|
|
|
+}
|
|
|
|
|
|
- const close = () => {
|
|
|
- show.value = false;
|
|
|
- }
|
|
|
+const insertMemorandum = (_html,tcid="") => {//保存行为操作
|
|
|
+ //variable
|
|
|
+ //btn
|
|
|
+ let params = [{
|
|
|
+ uid:userInfo.user.userid,
|
|
|
+ courseId:courseDetail.value.courseId + tcid,
|
|
|
+ content:_html
|
|
|
+ }]
|
|
|
+ // console.log('params',params);
|
|
|
+
|
|
|
+
|
|
|
+ axios.post("https://pbl.cocorobo.cn/api/pbl/insert_systemOperation_countdownBehavior", params).then(res=>{
|
|
|
+ console.log('res',res);
|
|
|
+ if(res == 1){
|
|
|
+ console.log("保存行为操作成功")
|
|
|
+ }else{
|
|
|
+ console.log("保存行为操作失败")
|
|
|
+ }
|
|
|
+ }).catch(e=>{
|
|
|
+ console.log("保存行为操作失败")
|
|
|
+ console.log(e)
|
|
|
+ })
|
|
|
+ }
|
|
|
+const detectBrowser = () => {
|
|
|
+ const ua = navigator.userAgent;
|
|
|
+
|
|
|
+ // 按优先级顺序检测
|
|
|
+ if (ua.includes("Edg/") || ua.includes("Edge/")) {
|
|
|
+ return "Microsoft Edge";
|
|
|
+ } else if (ua.includes("Firefox")) {
|
|
|
+ return "Mozilla Firefox";
|
|
|
+ } else if (ua.includes("Trident") || ua.includes("MSIE")) {
|
|
|
+ return "Internet Explorer";
|
|
|
+ } else if (ua.includes("360EE")) {
|
|
|
+ return "360 Browser (极速模式)";
|
|
|
+ } else if (ua.includes("360SE")) {
|
|
|
+ return "360 Browser (安全模式)";
|
|
|
+ } else if (ua.includes("SLBrowser")) {
|
|
|
+ return "QQ Browser";
|
|
|
+ } else if (ua.includes("UCBrowser")) {
|
|
|
+ return "UC Browser";
|
|
|
+ } else if (ua.includes("Opera") || ua.includes("OPR/")) {
|
|
|
+ return "Opera";
|
|
|
+ } else if (ua.includes("Chrome") && !ua.includes("Edg/")) {
|
|
|
+ return "Google Chrome";
|
|
|
+ } else if (ua.includes("Safari/") && !ua.includes("Chrome")) {
|
|
|
+ return "Safari";
|
|
|
+ } else {
|
|
|
+ return "Other Browser";
|
|
|
+ }
|
|
|
+}
|
|
|
+const addOp3 = async (userTime, loadTime, object, status) => {
|
|
|
+ if (!userInfo.user.userid) return
|
|
|
+ // try {
|
|
|
+ // if(!userInfo.user || !userInfo.user.accountNumber){
|
|
|
+ // let res = await axios.get("https://pbl.cocorobo.cn/api/pbl/selectUser?userid="+userInfo.user.userid)
|
|
|
+ // userInfo.user = res[0][0]
|
|
|
+ // }
|
|
|
+ // } catch (e) {
|
|
|
+ // console.log(e);
|
|
|
+ // return addOp3(userTime, loadTime, object, status);
|
|
|
+ // }
|
|
|
+ let _time = new Date()
|
|
|
+ .toLocaleString("zh-CN", { hour12: false, timeZone: "Asia/Shanghai" })
|
|
|
+ .replace(/\//g, "-");
|
|
|
+ let browser = detectBrowser();
|
|
|
+ let params = {
|
|
|
+ userid: userInfo.user.userid,
|
|
|
+ username: userInfo.user.username,
|
|
|
+ accountNumber: userInfo.user.accountNumber,
|
|
|
+ org: userInfo.user.orgName,
|
|
|
+ school: userInfo.user.schoolName,
|
|
|
+ role: userInfo.user.type =='1'?'老师':'学生',
|
|
|
+ browser: browser,
|
|
|
+ userTime: userTime == "1" ? _time : userTime, // 使用时间 1次的就1 其次传秒
|
|
|
+ loadTime: loadTime, //load的时间没有就""
|
|
|
+ object: JSON.stringify(object), //执行信息传json
|
|
|
+ status: status //成功返回success。失败返回error的信息
|
|
|
+ };
|
|
|
+ console.log('params',params);
|
|
|
+
|
|
|
+ axios
|
|
|
+ .post("https://pbl.cocorobo.cn/api/mongo/updateUserData2", [params])
|
|
|
+ .then(res => {
|
|
|
+ console.log('res',res);
|
|
|
+ if (res.status == 1) {
|
|
|
+ console.log("保存成功");
|
|
|
+ } else {
|
|
|
+ console.log("保存失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log("保存失败");
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+}
|
|
|
+const close = () => {
|
|
|
+ show.value = false;
|
|
|
+}
|
|
|
+ // 添加随机码接口
|
|
|
+async function addInviteCodeOne(cid) {
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ courseId: courseDetail.value.courseId,
|
|
|
+ inviteCode: cid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ axios.post("https://pbl.cocorobo.cn/api/pbl/add_courseInviteCode2", params)
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res.data)
|
|
|
+ resolve(res.data)
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ resolve(err.messages)
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+}
|
|
|
const editClass = () => {
|
|
|
addClassDialogRef.value.open({ classList: classList.value });
|
|
|
};
|
|
|
@@ -296,4 +664,33 @@ defineExpose({
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+.b_bottom {
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.b_bottom>div{
|
|
|
+ padding: 10px 25px;
|
|
|
+ background: #fff;
|
|
|
+ color: #000;
|
|
|
+ border-radius: 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border: solid 1px #EEEEEE;
|
|
|
+ margin-left: 15px;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.b_bottom>.b_b_submit{
|
|
|
+ background: #1A1A1A;
|
|
|
+ color: #D4D4D4;
|
|
|
+ border-color: #1A1A1A;
|
|
|
+}
|
|
|
</style>
|