xionghaojie пре 3 година
родитељ
комит
351fcc47ac
2 измењених фајлова са 18 додато и 39 уклоњено
  1. 12 15
      pages/selectTest/selectTest.vue
  2. 6 24
      pages/test/test.vue

+ 12 - 15
pages/selectTest/selectTest.vue

@@ -193,21 +193,18 @@
 					content:`确定开始 ${item.title}?`,
 					success: (res) => {
 						if(res.confirm){
-							if(this.IsPC()){
-								// 如果进行身份验证
-								this.item = item
-								this.open()
-							}else{
-								// 直接考试,是否允许考试
-								uni.navigateTo({
-									// url: '/pages/test/test?paperId='+this.paperId,
-									url: '/pages/test/test?paperId='+item.id+'&testId='+this.paperId,
-									success:()=> {
-										this.close()
-									}
-								});
-								
-							}
+							// 如果进行身份验证
+							this.item = item
+							this.open()
+							
+							// 直接考试,是否允许考试
+							// uni.navigateTo({
+							// 	// url: '/pages/test/test?paperId='+this.paperId,
+							// 	url: '/pages/test/test?paperId='+item.id+'&testId='+this.paperId,
+							// 	success:()=> {
+							// 		this.close()
+							// 	}
+							// });
 							
 						}else{
 							

+ 6 - 24
pages/test/test.vue

@@ -236,13 +236,11 @@
 			this.paperId = options.paperId;
 			this.testId = options.testId
 			
-			if(this.IsPC()){
-				// 摄像头
-				const query = uni.createSelectorQuery().in(this);
-				this.video = query.select('#video')
-				this.canvas = query.select('#canvas');
-				await this.test()
-			}
+			// 摄像头
+			const query = uni.createSelectorQuery().in(this);
+			this.video = query.select('#video')
+			this.canvas = query.select('#canvas');
+			await this.test()
 
 			console.log(this.userInfo)
 			// 需要先判断用户是否还能考试
@@ -261,20 +259,6 @@
 				clearTimeout(this.ptime);
 		},
 		methods: {
-			IsPC() {
-			    var userAgentInfo = navigator.userAgent;
-			    var Agents = ["Android", "iPhone",
-			                "SymbianOS", "Windows Phone",
-			                "iPad", "iPod"];
-			    var flag = true;
-			    for (var v = 0; v < Agents.length; v++) {
-			        if (userAgentInfo.indexOf(Agents[v]) > 0) {
-			            flag = false;
-			            break;
-			        }
-			    }
-			    return flag;
-			},
 			// 考试信息
 			getUserInfo(){
 				req.getRequest('/api/v3/exam/user/manager/info',{},res=>{
@@ -393,9 +377,7 @@
 					
 					
 					if(((_ts.paper.time*60)-(_ts.time))%(_ts.takePhotoTime)==0){
-						if(_ts.IsPC()){
-							_ts.takePhoto()
-						}
+						_ts.takePhoto()
 					}
 					_ts.setTime();
 				}, 1000);