SanHQin 12 hours ago
parent
commit
f79f99a736

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.7f974f3a50e67b317d24d129cb2467ce.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.b7212920b6e58d14a873.js></script><script type=text/javascript src=./static/js/app.e270766eab3094d1434c.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.ab727c77afa3c607972facf8c13ca70d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.b7212920b6e58d14a873.js></script><script type=text/javascript src=./static/js/app.8b1c84ce5c549ed777f1.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.ab727c77afa3c607972facf8c13ca70d.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.ab727c77afa3c607972facf8c13ca70d.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8b1c84ce5c549ed777f1.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8b1c84ce5c549ed777f1.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 11 - 4
src/components/pages/inviteLoginST/inviteLogin.vue

@@ -13,12 +13,12 @@
 							<div class="c-b-r-m-title">欢迎登录!</div>
 							<div class="c-b-r-m-smallTitle">请选择登录角色</div>
 							<div class="c-b-r-m-identity">
-								<div class="c-b-r-m-i-item" @click.stop="clickIdentity(0)">
+								<!-- <div class="c-b-r-m-i-item" @click.stop="clickIdentity(0)">
 									<div class="c-b-r-m-i-itemSvg">
 										<svg width="48" height="48" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M20.2969 5.57812C26.3288 5.57812 31.2188 10.468 31.2188 16.5C31.2188 20.3947 29.1802 23.8133 26.1118 25.7469V25.7464C29.8475 27.3133 32.8847 30.2153 34.6266 33.8555L41.5929 23.8744C42.0671 23.1951 43.0021 23.0288 43.6815 23.5028C44.354 23.9722 44.5238 24.8934 44.067 25.571L44.053 25.5914L36.0582 37.046C35.9913 37.1419 35.9136 37.2297 35.8264 37.3075C36.0935 38.485 36.2344 39.7104 36.2344 40.9688C36.2344 41.7972 35.5628 42.4688 34.7344 42.4688C33.9142 42.4688 33.2478 41.8105 33.2346 40.9936L33.2344 40.9688C33.2344 33.5129 27.1902 27.4688 19.7344 27.4688C12.3531 27.4688 6.35541 33.3926 6.2362 40.7455L6.23438 40.9688C6.23438 41.7972 5.5628 42.4688 4.73438 42.4688C3.90595 42.4688 3.23438 41.7972 3.23438 40.9688C3.23438 33.8485 7.74441 27.7817 14.0636 25.4691L14.0634 25.4695C11.2296 23.4965 9.375 20.2148 9.375 16.5C9.375 10.468 14.2649 5.57812 20.2969 5.57812ZM20.2969 8.57812C15.9218 8.57812 12.375 12.1249 12.375 16.5C12.375 20.8751 15.9218 24.4219 20.2969 24.4219C24.672 24.4219 28.2188 20.8751 28.2188 16.5C28.2188 12.1249 24.672 8.57812 20.2969 8.57812ZM43.2188 13.1719C44.0472 13.1719 44.7188 13.8435 44.7188 14.6719C44.7188 15.492 44.0605 16.1584 43.2436 16.1717L43.2188 16.1719H37.5938C36.7653 16.1719 36.0938 15.5003 36.0938 14.6719C36.0938 13.8518 36.752 13.1853 37.5689 13.1721L37.5938 13.1719H43.2188ZM43.2188 6.5625C44.0472 6.5625 44.7188 7.23408 44.7188 8.0625C44.7188 8.88263 44.0605 9.54905 43.2436 9.56231L43.2188 9.5625H33.6562C32.8278 9.5625 32.1562 8.89092 32.1562 8.0625C32.1562 7.24238 32.8145 6.57595 33.6314 6.56269L33.6562 6.5625H43.2188Z"></path></svg>
 									</div>
 									<span>教师</span>
-								</div>
+								</div> -->
 
 								<div class="c-b-r-m-i-item" @click.stop="clickIdentity(1)">
 									<div class="c-b-r-m-i-itemSvg">
@@ -74,6 +74,12 @@ export default {
 			},
 		},
 		mounted() {
+      this.$router.push({
+				name:"inviteLoginSZ",
+        query:{
+          code:this.code,
+        }
+			})
 			setInterval(() => {
 				 window.topU.postMessage({
 					tools:"getLogin"
@@ -91,6 +97,7 @@ export default {
 					}
 				}
 			})
+
 		},
 }
 </script>
@@ -161,7 +168,7 @@ export default {
 	top: -45px;
 	border-radius: 50%;
 	background-color: #3681FC;
-	
+
 }
 
 .c-b-r-ca-btn{
@@ -226,4 +233,4 @@ export default {
 	font-size: 18px;
 }
 
-</style>
+</style>

+ 48 - 2
src/components/pages/inviteLoginSZ/inviteLogin.vue

@@ -1,5 +1,8 @@
 <template>
     <div class="container" v-loading="loading">
+      <div class="loginOut" v-show="showLoadingOut">
+					<span @click="loginOut">退出登录</span>
+				</div>
         <!-- <div class="i_box" v-if="steps == 1">
             <div class="i_box_top">
                 <div><span>请输入随机码进入项目课程</span></div>
@@ -82,7 +85,8 @@ export default {
             courseId:"",
 						showErrMsg:false,
 						errMsg:"",
-						chooseData:{}
+						chooseData:{},
+            showLoadingOut:false,
         }
     },
 		computed:{
@@ -179,8 +183,32 @@ export default {
 				setErrMsg(msg){
 					this.showErrMsg = true;
 					this.errMsg = msg;
-				}
+				},
+        loginOut(){
+				 window.topU.postMessage({
+					tools:"logout"
+				},"*")
+			},
     },
+    mounted(){
+      setInterval(() => {
+				 window.topU.postMessage({
+					tools:"getLogin"
+				},"*")
+				console.log("获取getLogin")
+			}, 2000);
+			window.addEventListener("message",(e)=>{
+				let data = e.data;
+				console.log("message",e)
+				if(data.tools && data.tools=='getLogin'){
+					if(data.type===2){
+						this.showLoadingOut = false;
+					}else if(data.type===1){
+						this.showLoadingOut = true;
+					}
+				}
+			})
+    }
 }
 </script>
 
@@ -458,4 +486,22 @@ export default {
     justify-content: center !important;
     margin: 0 !important;
 } */
+
+.loginOut{
+	position: absolute;
+	right: 30px;
+	top: 30px;
+	width: auto;
+	height: auto;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.loginOut>span{
+	font-size: 24px;
+	color: #fff;
+	font-weight: bold;
+	cursor: pointer;
+}
 </style>

+ 394 - 23
src/components/pages/workPage/components/choiceQuestion.vue

@@ -1,44 +1,415 @@
 <template>
   <div class="choiceQuestion">
-    {{ work }}
+    <div class="cq_title" v-if="work.testJson[showIndex]">
+      <span>{{ work.testJson[showIndex].teststitle }}</span>
+
+      <div class="cq_changeBtnArea" v-if="work.testJson.length>1">
+        <span :class="{cq_cba_disabled: showIndex == 0}" @click="changeQuestion('prev')">上一题</span>
+        <span :class="{cq_cba_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">下一题</span>
+      </div>
+    </div>
+
+
+    <img class="cq_image" v-if="work.testJson[showIndex].timuList.length>0" :src="work.testJson[showIndex].timuList[0].src" @click="$hevueImgPreview(work.testJson[showIndex].timuList[0].src)">
+
+    <div class="cq_type" v-if="work.testJson[showIndex]">
+      {{ work.testJson[showIndex].type == 1 ? "单选题" : "多选题" }}
+      <span v-if="work.testJson.length>1">({{showIndex+1}}/{{work.testJson.length}})</span>
+
+    </div>
+    <div class="cq_checkListArea">
+      <div
+        class="cq_ca_type1"
+        v-if="
+          work.testJson[showIndex] && work.testJson[showIndex].showType == '1'
+        "
+      >
+        <div
+          class="cq_ca_t1_item"
+          :class="{
+            cq_ca_t1_item_active:
+              work.testJson[showIndex].type == '1'
+                ? work.testJson[showIndex].userAnswer === index
+                : work.testJson[showIndex].userAnswer.includes(index)
+          }"
+          v-for="(item, index) in work.testJson[showIndex].checkList"
+          :key="showIndex + '_' + index"
+          @click="choiceAnswer(index)"
+        >
+          <div>
+            <span>{{ options[index] }}</span>
+          </div>
+          <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="$hevueImgPreview(item.src)">
+          <span v-else>{{ item }}</span>
+        </div>
+      </div>
+
+      <div class="cq_ca_type2" v-if="
+          work.testJson[showIndex] && work.testJson[showIndex].showType == '2'
+        ">
+        <div
+          class="cq_ca_t2_item"
+          :class="{
+            cq_ca_t2_item_active:
+              work.testJson[showIndex].type == '1'
+                ? work.testJson[showIndex].userAnswer === index
+                : work.testJson[showIndex].userAnswer.includes(index)
+          }"
+          v-for="(item, index) in work.testJson[showIndex].checkList"
+          :key="showIndex + '_' + index"
+          @click="choiceAnswer(index)"
+        >
+          <div>
+            <span>{{ options[index] }}</span>
+          </div>
+          <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="$hevueImgPreview(item.src)">
+          <span v-else>{{ item }}</span>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
-   export default {
-    props:{
-      workData:{
-        type:Object,
-        default:()=>{return {}}
-      },
-    },
-
-    data(){
-      return{
-        work:{},
+export default {
+  props: {
+    workData: {
+      type: Object,
+      default: () => {
+        return {};
       }
+    }
+  },
+
+  data() {
+    return {
+      work: {
+        testJson: []
+      },
+      showIndex: 0,
+      options: [
+        "A",
+        "B",
+        "C",
+        "D",
+        "E",
+        "F",
+        "G",
+        "H",
+        "I",
+        "J",
+        "K",
+        "L",
+        "M",
+        "N",
+        "O",
+        "P",
+        "Q",
+        "R",
+        "S",
+        "T",
+        "U",
+        "V",
+        "W",
+        "X",
+        "Y",
+        "Z"
+      ]
+    };
+  },
+  watch: {
+    work: {
+      handler(newValue) {
+        if (JSON.stringify(newValue) != JSON.stringify(this.workData.json)) {
+          this.changeWorkData(newValue);
+        }
+      },
+      deep: true
+    }
+  },
+  methods: {
+    changeWorkData(newValue) {
+      this.$emit("changeWorkData", JSON.stringify(newValue));
     },
-    watch:{
-      work(newValue){
-        if(JSON.stringify(newValue) != JSON.stringify(this.workData.json)){
-          this.changeWorkData(newValue)
+    //选择题目
+    choiceAnswer(index) {
+      if (this.work.testJson[this.showIndex].type == "1") {
+        this.work.testJson[this.showIndex].userAnswer = index;
+      } else {
+        if (this.work.testJson[this.showIndex].userAnswer.includes(index)) {
+          this.work.testJson[this.showIndex].userAnswer = this.work.testJson[
+            this.showIndex
+          ].userAnswer.filter(i => i != index);
+        } else {
+          this.work.testJson[this.showIndex].userAnswer.push(index);
         }
       }
     },
-    methods:{
-      changeWorkData(newValue){
-        this.$emit("changeWorkData",JSON.stringify(newValue))
+    //切换题目
+    changeQuestion(type){
+      if(type == 'prev'){
+        if(this.showIndex == 0) return;
+        this.showIndex--;
+      }else{
+        if(this.showIndex == this.work.testJson.length - 1) return;
+        this.showIndex++;
       }
-    },
-    mounted(){
-      this.work = JSON.parse(JSON.stringify(this.workData.json))
     }
+
+  },
+  mounted() {
+    this.work = JSON.parse(JSON.stringify(this.workData.json));
+    this.work.testJson.forEach(i => {
+      let maxLength = i.checkList.reduce((pre, cur) => {
+        if (pre < cur.length) return cur.length;
+        return pre;
+      }, 0);
+
+      if (maxLength <= 6 && i.checkList.length <= 4) {
+        i.showType = "1";
+      } else {
+        i.showType = "2";
+      }
+    });
   }
+};
 </script>
 
 <style scoped>
-.choiceQuestion{
+
+
+.choiceQuestion {
   width: 100%;
   height: 100%;
+  display: flex;
+  align-items: center;
+  /* justify-content: center; */
+  flex-direction: column;
+  box-sizing: border-box;
+  padding: 50px 10%;
+  overflow: auto;
+  position: relative;
+}
+
+.cq_title {
+  font-size: 35px;
+  font-weight: bold;
+  text-align: center;
+  width: 70%;
+  position: relative;
+}
+
+.cq_image{
+  width: auto;
+  height: 300px;
+  object-fit: cover;
+  margin: 20px 0;
+  cursor: pointer;
+}
+
+.cq_changeBtnArea {
+  position: absolute;
+  top: 0px;
+  right: -200px;
+  width: 200px;
+  height: auto;
+  display: flex;
+  justify-content: flex-end;
+  align-items: flex-start;
+}
+
+.cq_changeBtnArea > span{
+  width: 100px;
+  height: 40px;
+  background: #3681FC;
+  border-radius: 8px;
+  color: #fff;
+  font-size: 16px;
+  text-align: center;
+  font-weight: 500;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+  margin-left: 20px;
+  transition: .2s;
+}
+
+.cq_changeBtnArea > span:hover{
+  background: #5893FF;
+}
+
+.cq_cba_disabled{
+  background: #D9D9D9 !important;
+  cursor: not-allowed !important;
+}
+
+.cq_type {
+  margin: 20px 0 40px 0;
+  font-size: 22px;
+  color: #808080;
+}
+
+.cq_checkListArea {
+  width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.cq_ca_type1 {
+  width: auto;
+  height: auto;
+  display: grid;
+  grid-template-columns: repeat(2, 1fr);
+  grid-template-rows: repeat(2, 1fr);
+  gap: 30px; /* 可根据需要调整间距 */
+  justify-content: center;
+  align-items: center;
+  margin: 40px 20px;
+}
+
+.cq_ca_t1_item {
+  width: 100%;
+  max-width: 400px;
+  min-width: 300px;
+  height: 100px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+
+  background: #fff;
+  box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
+  border-radius: 12px;
+  margin: auto;
+  cursor: pointer;
+  transition: 0.3s;
+  font-size: 20px;
+  color: #000;
+  user-select: none;
+  /* 不可选中 */
+  /* box-sizing: border-box;
+  padding: 20px 40px; */
+}
+
+.cq_ca_t1_item_active {
+  box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
+}
+
+.cq_ca_t1_item > div {
+  color: #fff;
+  position: relative;
+  margin-right: 20px;
+}
+
+.cq_ca_t1_item>img{
+  width: 80px;
+  height: 80px;
+  cursor: pointer;
+  object-fit: cover;
+}
+
+.cq_ca_t1_item > div > span {
+  position: relative;
+  z-index: 2;
+  color: #fff;
+  font-size: 20px;
+}
+
+.cq_ca_t1_item > div::after {
+  content: "";
+  width: 25px;
+  height: 25px;
+  background: rgba(252, 207, 0, 1);
+  border-radius: 50%;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1; /* after在内容下方 */
+  pointer-events: none;
+}
+
+.cq_ca_type2{
+  width: 100%;
+  height: auto;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.cq_ca_t2_item{
+  width: 100%;
+  height: 72px;
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  box-sizing: border-box;
+  padding-left: 40px;
+  padding-right: 20px;
+  margin-bottom: 20px;
+  background: #fff;
+  box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
+  border-radius: 12px;
+  cursor: pointer;
+  transition: 0.3s;
+  font-size: 20px;
+  color: #000;
+  user-select: none;
+  overflow: auto;
+  overflow-y: hidden;
+}
+
+.cq_ca_t2_item>div{
+  color: #fff;
+  position: relative;
+  margin-right: 20px;
+}
+
+.cq_ca_t2_item>span{
+  display: flex;
+  align-items: center;
+  white-space: nowrap;
+}
+
+.cq_ca_t2_item>img{
+  width: 70px;
+  height: 70px;
+  cursor: pointer;
+  object-fit: cover;
+}
+
+
+.cq_ca_t2_item_active {
+  box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
+}
+
+.cq_ca_t2_item > div {
+  color: #fff;
+  position: relative;
+  margin-right: 20px;
+}
+.cq_ca_t2_item > div > span {
+  position: relative;
+  z-index: 2;
+  color: #fff;
+  font-size: 20px;
+}
+
+.cq_ca_t2_item > div::after {
+  content: "";
+  width: 25px;
+  height: 25px;
+  background: rgba(252, 207, 0, 1);
+  border-radius: 50%;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 1; /* after在内容下方 */
+  pointer-events: none;
 }
 </style>

Some files were not shown because too many files changed in this diff