Pārlūkot izejas kodu

修复测试bug

chenxiong 3 gadi atpakaļ
vecāks
revīzija
af2ff7e389

+ 1 - 1
common/request.js

@@ -4,7 +4,7 @@ import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
 
-export const BASE_URL = 'http://192.168.1.222:5055' //接口api  http://42.192.164.187:19005 http://192.168.1.222:5055
+export const BASE_URL = 'http://42.192.164.187:19005' //接口api  http://42.192.164.187:19005 http://192.168.1.222:5055
 
 
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/' //图片上传api  'https://file.xyyxt.net/

+ 1 - 1
pages/index/index.vue

@@ -5,7 +5,7 @@
 				<image  src="/static/logo2.png"></image>
 			</view>
 		</u-navbar>
-		<u-swiper :list="list" @change="e => current = e.current" :autoplay="false"></u-swiper>
+		<!-- <u-swiper :list="list" @change="e => current = e.current" :autoplay="false"></u-swiper> -->
 		<view class="content">
 			<view class="notice" v-if="infoNums">
 				<image src="/static/icon/msg_icon1.png" class="icon"></image>

+ 64 - 29
pages/wd/index.vue

@@ -2,8 +2,8 @@
 	<view>
 		<image mode="widthFix" :src="isLogin ? '/static/wd_bg_login.jpg' : '/static/wd_bg.jpg'" :class="isLogin ? 'login_full_img' : 'full_img'"></image>
 
-		<view style="text-align: center;margin-top: 60rpx;" v-if="!isLogin">
-			<view style="color: #007AFF ;font-size: 36rpx;font-weight: bold;">您还没有登录哦~</view>
+		<view class="login_wrap" v-if="!isLogin">
+			<view class="login_text">您还没有登录哦~</view>
 			<view class="loginBtn" @click="jumpLogin">立即登录/注册</view>
 		</view>
 		<view v-if="isLogin" class="loginBox">
@@ -18,13 +18,13 @@
 			</view>
 			<view style="top: 195px;position: relative;padding-bottom: 30rpx;">
 				<navigator  hover-class="none" url="/pages2/plan/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon1.png" class="my_icon"></image>
 						<view>学习计划</view>
 					</view>
-					<view>
+					<view class="box_right">
 						今天有
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.planSum }}</text>
+						<text>{{ userNums.planSum }}</text>
 						个学习任务
 					</view>
 				</navigator>
@@ -39,53 +39,53 @@
 					</navigator>
 				</view>
 				<navigator  hover-class="none" url="/pages2/learn/my_learn" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon2.png" class="my_icon"></image>
 						<view>我的学时</view>
 					</view>
-					<view>
+					<view class="box_right">
 						累计
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.periodSum }}</text>
+						<text>{{ userNums.periodSum }}</text>
 						学时未通过
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/exam/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon10.png" class="my_icon"></image>
 						<view>我的考试</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.subscribeSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.subscribeSum }}</text>
 						考试预约
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/order/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon7.png" class="my_icon"></image>
 						<view>我的订单</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.orderSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.orderSum }}</text>
 						笔待支付
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/msg/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon8.png" class="my_icon"></image>
 						<view>我的消息</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.informSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.informSum }}</text>
 						条未读
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/wd/info" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon9.png" class="my_icon"></image>
 						<view>我的资料</view>
 					</view>
 				</navigator>
-				<view style="color: #999999;text-align: center;font-size: 32rpx;margin-top: 50rpx;" @click="logout">退出</view>
+				<view class="logout" @click="logout">退出</view>
 			</view>
 		</view>
 
@@ -151,7 +151,30 @@ page {
 	background-color: #f0f1f5;
 }
 </style>
-<style scoped>
+<style scoped lang="scss">
+.login_wrap {
+	text-align: center;
+	margin-top: 60rpx;
+	
+	.login_text {
+		color: #007AFF ;
+		font-size: 36rpx;
+		font-weight: bold;
+	}
+	
+	
+	.loginBtn {
+		width: 526rpx;
+		height: 80rpx;
+		background: linear-gradient(90deg, #015eea, #00c0fa);
+		box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
+		border-radius: 40rpx;
+		color: #ffffff;
+		line-height: 80rpx;
+		margin: 0 auto;
+		margin-top: 50rpx;
+	}
+}
 .avatar {
 	height: 70rpx;
 	width: 70rpx;
@@ -168,6 +191,8 @@ page {
 	margin-top: 30rpx;
 }
 .two_menu {
+	font-size: 32rpx;
+	color:#666;
 	display: flex;
 	justify-content: space-between;
 }
@@ -187,6 +212,20 @@ page {
 	justify-content: space-between;
 	color: #666666;
 	font-size: 32rpx;
+	
+	.box_left {
+		display: flex;
+		align-items: center;
+	}
+	
+	.box_right {
+		font-size: 32rpx;
+		
+		text {
+			color: #007AFF;
+			margin: 0 5rpx;
+		}
+	}
 }
 .loginBox {
 	position: relative;
@@ -211,15 +250,11 @@ page {
 	z-index: -999;
 	top: 0;
 }
-.loginBtn {
-	width: 526rpx;
-	height: 80rpx;
-	background: linear-gradient(90deg, #015eea, #00c0fa);
-	box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
-	border-radius: 40rpx;
-	color: #ffffff;
-	line-height: 80rpx;
-	margin: 0 auto;
+
+.logout {
+	color: #999999;
+	text-align: center;
+	font-size: 32rpx;
 	margin-top: 50rpx;
 }
 </style>

+ 30 - 4
pages2/bank/questionBank.vue

@@ -301,7 +301,7 @@
 												</view>
 											</view>
 										</view>
-										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && (bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text)">
 											<view class="answerTitle">我的答案</view>
 											{{ bank.ques[ansIndex].text || ''}}
 											<view class="imgs">
@@ -424,6 +424,8 @@
 							? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
 							: cgType === 6
 							? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
+							: cgType == 9
+							? `您已完成所有题目,快去交卷吧!?` 
 							: ''
 					}}
 				</view>
@@ -439,6 +441,10 @@
 					<view class="btnsty btns1" @click="backPages()">下次继续</view>
 					<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
 				</view>
+				<view class="classFootsty" v-if="cgType === 9">
+					<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
+					<view class="btnsty btns2" @click="submit">立即交卷</view>
+				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -637,7 +643,8 @@ export default {
 									return false;
 								}
 							} else if (jsonItem.type == 5) {
-								if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
+								if (item.ques[indexs] && (item.ques[indexs].text || item.ques[indexs].imageList.length)) {
+									console.log('chil')
 									return true;
 								} else {
 									return false;
@@ -654,7 +661,8 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
+						if (item.ques && (item.ques.text || item.ques.imageList.length)) {
+							console.log(5,item)
 							count++;
 						}
 					}
@@ -663,6 +671,16 @@ export default {
 
 			return count;
 		},
+		/**
+		 * 是否做完所有题目
+		 */
+		isDoOver() {
+			let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+			if(this.questionList.length == questionOverNum) { //全部做完弹窗
+				this.cgType = 9;
+				this.showpopups = true;
+			}
+		},
 		/**
 		 * 暂不交卷
 		 */
@@ -1109,7 +1127,7 @@ export default {
 										ansArr[index] = json.answerQuestion;
 									} else if (json.type == 5) {
 										ansArr[index] = {
-											text: '',
+											text: json.answerQuestion,
 											imageList: []
 										};
 										json.ansText = {
@@ -1139,6 +1157,7 @@ export default {
 		radioSelect(optionsId, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', optionsId);
+			this.isDoOver();
 
 			// 回答错误
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
@@ -1171,6 +1190,7 @@ export default {
 		radioSelectChild(optionsId, ansIndex, bindex) {
 			if (this.questionList[bindex].ques[ansIndex]) return;
 			this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
+			this.isDoOver();
 		},
 
 		/**
@@ -1200,6 +1220,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex], 'ques', arr);
+			this.isDoOver();
 
 			let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
 				return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
@@ -1242,6 +1263,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex].ques, ansIndex, arr);
+			this.isDoOver();
 		},
 
 		/**
@@ -1252,6 +1274,7 @@ export default {
 		judgeSelect(index, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', index + '');
+			this.isDoOver();
 			// 回答错误
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
 				this.$api
@@ -1286,6 +1309,7 @@ export default {
 		judgeSelectChild(ansindex, childindex, bindex) {
 			if (this.questionList[bindex].ques[ansindex]) return;
 			this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
+			this.isDoOver();
 		},
 
 		openFooterTab() {
@@ -1752,6 +1776,7 @@ export default {
 				imageList: this.questionList[bankindex].ansText.imageList || [],
 				text: this.questionList[bankindex].ansText.text || ''
 			});
+			this.isDoOver()
 		},
 
 		/**
@@ -1773,6 +1798,7 @@ export default {
 				imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList || [],
 				text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || ''
 			});
+			this.isDoOver()
 		},
 
 		isRight(item, index) {

+ 26 - 2
pages2/bank/questionBankContinue.vue

@@ -275,7 +275,7 @@
 												</view>
 											</view>
 										</view>
-										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].text || bank.ques[ansIndex].imageList.length">
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && (bank.ques[ansIndex].text || bank.ques[ansIndex].imageList.length)">
 											<view class="answerTitle">我的答案</view>
 											{{bank.ques[ansIndex].text || ''}}
 											<view class="imgs" v-if="bank.ques[ansIndex] && bank.ques[ansIndex].imageList.length">
@@ -361,6 +361,8 @@
 							? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
 							: cgType === 6
 							? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
+							: cgType == 9
+							? `您已完成所有题目,快去交卷吧!?` 
 							: ''
 					}}
 				</view>
@@ -376,6 +378,10 @@
 					<view class="btnsty btns1" @click="backPages()">下次继续</view>
 					<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
 				</view>
+				<view class="classFootsty" v-if="cgType === 9">
+					<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
+					<view class="btnsty btns2" @click="submit">立即交卷</view>
+				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -533,7 +539,7 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
+						if (item.ques && (item.ques.text.length || item.ques.imageList.length)) {
 							count++;
 						}
 					}
@@ -550,6 +556,16 @@ export default {
 				delta: 1
 			});
 		},
+		/**
+		 * 是否做完所有题目
+		 */
+		isDoOver() {
+			let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+			if(this.questionList.length == questionOverNum) { //全部做完弹窗
+				this.cgType = 9;
+				this.showpopups = true;
+			}
+		},
 		pdsubmit() {
 			// if (this.bankType == 1) {
 				let ansCount = this.questionOverNum(true); //已答题数
@@ -602,6 +618,7 @@ export default {
 			
 			if(this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex],'ques',optionsId)
+			this.isDoOver()
 			
 		},
 		examRecordEdit() {
@@ -672,6 +689,7 @@ export default {
 			
 			if(this.questionList[bindex].ques[ansIndex]) return;
 			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			this.isDoOver()
 			
 		},
 		
@@ -868,6 +886,7 @@ export default {
 			})
 			
 			this.$set(this.questionList[bindex],'ques',arr)
+			this.isDoOver()
 			
 		},
 		
@@ -885,12 +904,14 @@ export default {
 			})
 			
 			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+			this.isDoOver()
 		},
 		
 		judgeSelect(index,bindex) {
 			
 			if(this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex],'ques',index+'')
+			this.isDoOver()
 			
 		},
 		
@@ -898,6 +919,7 @@ export default {
 			
 			if(this.questionList[bindex].ques[ansindex]) return;
 			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+			this.isDoOver()
 		},
 		
 		/**
@@ -1241,6 +1263,7 @@ export default {
 				imageList:this.questionList[bankindex].ansText.imageList,
 				text:this.questionList[bankindex].ansText.text,
 			})
+			this.isDoOver()
 			
 		},
 		
@@ -1259,6 +1282,7 @@ export default {
 				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
 				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
 			})
+			this.isDoOver()
 			
 		},