chenxiong 3 éve
szülő
commit
0936746468

+ 20 - 3
pages/login/login.vue

@@ -19,10 +19,10 @@
 					</u-form-item>
 				</u-form>
 			</view>
-			<button class="loginBtn" @click="login" v-if="current==0"> 
+			<button class="loginBtn" :class="{able:canLogin()}" @click="login" v-if="current==0"> 
 				登录
 			</button>
-			<button :disabled="isUse" class="loginBtn" @click="sms_login" v-if="current==1">
+			<button :disabled="isUse" :class="{able:canLogin()}" class="loginBtn" @click="sms_login" v-if="current==1">
 				登录
 			</button>
 			<view style="width: 100%;margin: 40rpx auto;">
@@ -82,6 +82,19 @@ export default {
 	},
 	mounted() {},
 	methods: {
+		canLogin() {
+			if(this.current == 0) {
+				if(this.form.account && this.form.pwd) {
+					return true;
+				}
+				return false;
+			} else if(this.current == 1) {
+				if(this.form.tel && this.form.code) {
+					return true;
+				}
+				return false;
+			}
+		},
 		sms_login(){
 			let that = this
 			if(!this.form.tel){
@@ -285,7 +298,7 @@ export default {
 };
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 	.wxBtn{
 		position: fixed;
 		bottom: 10%;
@@ -306,6 +319,10 @@ export default {
 		text-align: center;
 		line-height: 80rpx;
 		margin: 40rpx auto;
+		
+		&.able {
+			opacity: 1;
+		}
 	}
 	
 	

+ 1 - 1
pages/wd/index.vue

@@ -51,7 +51,7 @@
 				</navigator>
 				<navigator url="/pages2/exam/index" class="menu_box">
 					<view style="display: flex;align-items: center;">
-						<image src="/static/icon/my_icon7.png" class="my_icon"></image>
+						<image src="/static/icon/my_icon10.png" class="my_icon"></image>
 						<view>我的考试</view>
 					</view>
 					<view>

+ 26 - 7
pages2/bank/questionBank.vue

@@ -905,7 +905,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionId: this.questionList[bindex].questionId,
+						questionIds: this.questionList[bindex].questionId,
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -967,7 +967,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionId: this.questionList[bindex].questionId,
+						questionIds: this.questionList[bindex].questionId,
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -1013,7 +1013,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionId: this.questionList[bindex].questionId,
+						questionIds: this.questionList[bindex].questionId,
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -1089,7 +1089,7 @@ export default {
 			this.submit();
 		},
 		/**
-		 * 提交数据
+		 * 交卷
 		 */
 		submit() {
 			let score = 0; //计算总分
@@ -1098,15 +1098,19 @@ export default {
 			let doQuestionNum = 0;  //做过的题目数量
 			let allScore = 0;  //总分
 			let passScore = 0;
+			let doWrongQuestionIds = []; //错题和未做题id(客观题)
 			let doQuestionIds = []; //做过的题目id
 			let rightQuestionIds = []; //做对的题目id
 			this.questionList.forEach((item, index) => {
 				// passScore = item.passScore
 				if (item.type == 1) {
+					//正确
 					if (item.ques == item.ans) {
 						score += item.score;
 						number++;
 						rightQuestionIds.push(item.questionId)
+					} else { //错误
+						doWrongQuestionIds.push(item.questionId)
 					}
 					allScore += item.score;
 					if (item.ques) {
@@ -1124,6 +1128,8 @@ export default {
 						score += item.score;
 						number++;
 						rightQuestionIds.push(item.questionId)
+					} else {
+						doWrongQuestionIds.push(item.questionId)
 					}
 					allScore += item.score;
 					if (item.ques && item.ques.length) {
@@ -1135,6 +1141,8 @@ export default {
 						score += item.score;
 						number++;
 						rightQuestionIds.push(item.questionId)
+					} else {
+						doWrongQuestionIds.push(item.questionId)
 					}
 					allScore += item.score;
 					if (item.ques) {
@@ -1158,7 +1166,8 @@ export default {
 			} else {
 				reportStatus = 0
 			}
-
+			
+			//交卷
 			this.$api
 				.examRecordEdit({
 					examId: this.id,
@@ -1181,7 +1190,7 @@ export default {
 					if (res.data.code == 200) {
 						uni.showToast({
 							title: '交卷成功',
-							duration: 2000,
+							duration: 1000,
 							icon: 'none'
 						});
 
@@ -1189,9 +1198,19 @@ export default {
 							uni.redirectTo({
 								url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
 							});
-						}, 2000);
+						}, 1000);
 					}
 				});
+				
+				//错题集id提交(客观题)
+				this.$api.examWrongRecord({
+						examId: this.id,
+						goodsId: this.goodsId,
+						questionIds: doWrongQuestionIds.join(','),
+						recordId: this.recordId
+					}).then(res => { 
+						
+					});
 		},
 
 		/**

+ 5 - 4
pages2/bank/question_detail.vue

@@ -18,14 +18,15 @@
 						</view>
 						<view class="item-right">
 							<view class="up">
+								<text class="orange">已答</text>
+								<text>/未答</text>
+							</view>
+							
+							<view class="down">
 								<text class="orange">{{ goodsCount.doNum }}</text>
 								<text>/{{ goodsCount.totalNum - goodsCount.doNum }}</text>
 							</view>
 
-							<view class="down">
-								<text class="orange">已答</text>
-								<text>/未答</text>
-							</view>
 						</view>
 					</view>
 				</view>

+ 13 - 5
pages2/register/forget.vue

@@ -7,7 +7,7 @@
 				<u-form :model="form" ref="uForm" >
 					<u-form-item ><u-input  v-model="form.tel" type="number" maxlength="11" placeholder="手机号"/></u-form-item>
 					<u-form-item >
-						<u-input v-model="form.code"  placeholder="验证码"/>
+						<u-input v-model="form.code" type="number"  placeholder="验证码"/>
 						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
 					</u-form-item>
 					<u-form-item ><u-input v-model="form.pwd" type="password" placeholder="请输入新密码"/></u-form-item>
@@ -15,12 +15,10 @@
 				</u-form>
 			</view>
 			
-			<button :disabled="isUse" class="loginBtn" @click="submit">
+			<button :disabled="isUse" class="loginBtn" :class="{able:canSubmit()}" @click="submit">
 				确定
 			</button>
 			
-			
-			
 		</view>
 		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
 	</view>
@@ -44,6 +42,12 @@ export default {
 	},
 	mounted() {},
 	methods: {
+		canSubmit() {
+			if(this.form.tel && this.form.code && this.form.pwd && this.form.pwdAgain) {
+				return true;
+			}
+			return false;
+		},
 		submit(){
 			let that = this
 			if(!this.form.tel){
@@ -199,7 +203,7 @@ export default {
 };
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 	.wxBtn{
 		position: fixed;
 		bottom: 10%;
@@ -220,6 +224,10 @@ export default {
 		text-align: center;
 		line-height: 80rpx;
 		margin: 40rpx auto;
+		
+		&.able {
+			opacity: 1;
+		}
 	}
 	
 	

+ 13 - 3
pages2/register/register.vue

@@ -7,7 +7,7 @@
 				<u-form :model="form" ref="uForm" >
 					<u-form-item ><u-input  v-model="form.tel" type="number" maxlength="11" placeholder="手机号"/></u-form-item>
 					<u-form-item >
-						<u-input v-model="form.code"  placeholder="验证码"/>
+						<u-input v-model="form.code"  type="number" placeholder="验证码"/>
 						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
 					</u-form-item>
 					<u-form-item ><u-input v-model="form.pwd" type="password" placeholder="请输入登录密码"/></u-form-item>
@@ -20,7 +20,7 @@
 					<view style="color: #007AFF;">《祥粤云学堂服务协议》</view>
 				</view>
 			</view>
-			<button :disabled="isUse" class="loginBtn" @click="submit">
+			<button :disabled="isUse" class="loginBtn" :class="{able:canRegister()}" @click="submit">
 				确定
 			</button>
 			
@@ -47,6 +47,12 @@ export default {
 	},
 	mounted() {},
 	methods: {
+		canRegister() {
+			if(this.form.tel && this.form.code && this.form.pwd && this.read) {
+				return true;
+			}
+			return false;
+		},
 		submit(){
 			let that = this
 			if(!this.form.tel){
@@ -199,7 +205,7 @@ export default {
 };
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 	.wxBtn{
 		position: fixed;
 		bottom: 10%;
@@ -220,6 +226,10 @@ export default {
 		text-align: center;
 		line-height: 80rpx;
 		margin: 40rpx auto;
+		
+		&.able {
+			opacity: 1;
+		}
 	}
 	
 	

BIN
static/icon/my_icon10.png