| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635 |
- <template>
- <div class="opkDialogHeader">
- <el-dialog v-model="show" :show-close="false">
- <template #header>
- <div class="b_head">
- <span>{{ lang.ssSelTeachClass }}</span>
- <svg
- @click="close()"
- t="1748587270371"
- class="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5023"
- width="200"
- height="200"
- >
- <path
- d="M0 0h1024v1024H0z"
- fill="#FF0033"
- fill-opacity="0"
- p-id="5024"
- ></path>
- <path
- d="M240.448 168l2.346667 2.154667 289.92 289.941333 279.253333-279.253333a42.666667 42.666667 0 0 1 62.506667 58.026666l-2.133334 2.346667-279.296 279.210667 279.274667 279.253333a42.666667 42.666667 0 0 1-58.005333 62.528l-2.346667-2.176-279.253333-279.253333-289.92 289.962666a42.666667 42.666667 0 0 1-62.506667-58.005333l2.154667-2.346667 289.941333-289.962666-289.92-289.92a42.666667 42.666667 0 0 1 57.984-62.506667z"
- fill="#fff"
- p-id="5025"
- ></path>
- </svg>
- </div>
- </template>
- <div class="b_main" v-loading="loading">
- <template v-for="item in classList">
- <div
- class="b_m_classItem"
- :class="{ b_m_classItem_active: selectId == item.id }"
- :key="item.id"
- v-if="item.name"
- @click="
- selectId == item.id ? (selectId = '') : (selectId = item.id)
- "
- >
- <div>{{ item.name }}</div>
- <span v-if="item.studentNum >= 0"
- >{{ lang.ssStuCount.replace(/\*/g, item.studentNum) }}
- </span>
- </div>
- </template>
- <div
- class="b_m_classItem"
- @click="editClass"
- >
- <div>
- <span>+</span>
- <svg
- t="1756867649445"
- class="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="10274"
- width="200"
- height="200"
- >
- <path
- d="M417.664 921.6l317.184-824.32h-63.616L353.152 921.6z"
- fill="#999999"
- p-id="10275"
- ></path>
- </svg>
- <span>-</span>
- </div>
- <div>{{ lang.ssAddEditClass }}</div>
- </div>
- </div>
- <div class="b_bottom">
- <div @click="close()">{{ lang.ssCancel }}</div>
- <div class="b_b_submit" @click="selectClassSuccess()">{{selectId ? lang.ssConfirm : lang.ssEnterDirect}}</div>
- </div>
- </el-dialog>
-
- </div>
- <addClassDialog
- ref="addClassDialogRef"
- :courseDetail="courseDetail"
- @success="getCourseList"
- />
- </template>
- <script setup>
- import { ref, inject } from "vue";
- import { userInfoStore } from "../../stores/counter";
- import addClassDialog from "./addClassDialog.vue";
- const emit = defineEmits(["success", "changeClassList", "openCourse"]);
- import axios from '@/services/config'
- import { addOp3 } from '@/mixins/mixin'
- const lang = inject('lang')
- const checkStage = ref('0');
- const courseDetail = ref({});
- const loading = ref(false);
- 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) => {
- courseDetail.value = JSON.parse(JSON.stringify(options));
- getCourseList();
- loading.value = true;
- show.value = true;
- };
- const getCourseList = () => {
- axios.get('https://pbl.cocorobo.cn/api/pbl/selectCourseDetail2',{
- params: { courseId: courseDetail.value.courseId }
- })
- .then(res => {
- console.log(res);
- classList.value = res[3]
- selectId.value = classList.value.length > 0 ? classList.value[0].id : ''
- loading.value = false
- })
- .catch(err=>{
- console.log(err);
- 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")
- let url = '';
- if (lang.lang == 'hk') {
- url = "https://pbl.cocorobo.hk"
- }else if (lang.lang == 'en') {
- url = "https://pbl.cocorobo.com"
- }else{
- url = "https://pbl.cocorobo.cn"
- }
- if (courseDetail.value.state == 1) {
- if (classList.value.length) {
- goto(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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(
- url + "/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=" +
- '2' +
- "&tcid=" +
- id
- );
- }else {
- goto(
- url + "/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=" +
- '2'
- );
- }
- }
- 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) => {
- emit('openCourse', val)
- }
- 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 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 });
- };
- defineExpose({
- getClasslist,
- });
- </script>
- <style scoped>
- .opkDialogHeader >>> .el-dialog {
- width: 900px !important;
- border-radius: 8px;
- padding: 0;
- background-color: #fff;
- overflow: hidden;
- border-radius: 8px !important;
- }
- .opkDialogHeader >>> .el-dialog__body {
- padding: 0 !important;
- background: #fafafa !important;
- }
- .opkDialogHeader >>> .el-dialog__header { /* 注意这里没有 :deep,因为是全局 */
- /* background: #2575fc !important; */
- padding: 0 !important;margin: 0 !important;
- }
- .box {
- width: 900px;
- height: auto;
- background: #fafafa;
- border-radius: 15px;
- box-shadow:
- 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
- 0px 16px 24px 2px rgba(0, 0, 0, 0.04),
- 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
- }
- .b_head {
- width: 100%;
- height: 50px;
- /* border-radius: 15px 15px 0 0; */
- background: #1a1a1a;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- padding: 0 20px;
- color: #fff;
- }
- .b_head > span {
- font-size: 18px;
- font-weight: bold;
- color: #fff;
- }
- .b_head > img {
- width: 20px;
- height: 20px;
- cursor: pointer;
- }
- .b_head > svg {
- width: 20px;
- height: 20px;
- cursor: pointer;
- }
- .b_main {
- width: 100%;
- height: 400px;
- background: #fafafa;
- padding: 20px 20px 20px 20px;
- box-sizing: border-box;
- overflow: auto;
- }
- .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;
- }
- .b_m_classItem {
- width: 32%;
- height: 85px;
- float: left;
- margin-bottom: 20px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background: #fff;
- box-shadow:
- 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
- 0px 16px 24px 2px rgba(0, 0, 0, 0.04),
- 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
- border-radius: 12px;
- cursor: pointer;
- transition: 0.2s;
- }
- .b_m_classItem > div {
- color: #000;
- font-size: 16px;
- margin: 4px 0;
- display: flex;
- flex-wrap: wrap;
- align-content: center;
- }
- .b_m_classItem > div > span {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 25px;
- height: 25px;
- border-radius: 4px;
- border: solid 1px #b0b0b0;
- }
- .b_m_classItem > div > svg {
- width: 20px;
- height: 25px;
- margin: 0 5px;
- }
- .b_m_classItem > span {
- color: #a3a3a3;
- font-size: 14px;
- }
- .b_main > div:nth-child(3n-1) {
- margin: 0 2%;
- }
- .b_m_classItem_active {
- background-color: #FCCF00;
- color: #000 !important;
- /* box-shadow: 4px 4px 4px 0px rgba(138, 238, 138, 0.555); */
- }
- .b_m_noClassMsg {
- width: 100%;
- height: 100%;
- display: flex;
- 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>
|