浏览代码

修改测试反馈

chenxiong 3 年之前
父节点
当前提交
fe02b17941
共有 6 个文件被更改,包括 186 次插入65 次删除
  1. 16 16
      pages/shopping/shoppingCart.vue
  2. 57 23
      pages2/bank/questionBank.vue
  3. 102 22
      pages2/bank/questionBankExplain.vue
  4. 1 1
      pages2/bank/question_report.vue
  5. 10 3
      pages2/order/index.vue
  6. 二进制
      static/camera.png

+ 16 - 16
pages/shopping/shoppingCart.vue

@@ -216,22 +216,22 @@ export default {
 				});
 				return false;
 			}
-			if (this.provinceList.length == 0) {
-				uni.showModal({
-					title: '提示',
-					content: '请选择报考地区',
-					showCancel: false
-				});
-				return false;
-			}
-			if (this.cityList.length == 0) {
-				uni.showModal({
-					title: '提示',
-					content: '请选择报考地区',
-					showCancel: false
-				});
-				return false;
-			}
+			// if (this.provinceList.length == 0) {
+			// 	uni.showModal({
+			// 		title: '提示',
+			// 		content: '请选择报考地区',
+			// 		showCancel: false
+			// 	});
+			// 	return false;
+			// }
+			// if (this.cityList.length == 0) {
+			// 	uni.showModal({
+			// 		title: '提示',
+			// 		content: '请选择报考地区',
+			// 		showCancel: false
+			// 	});
+			// 	return false;
+			// }
 			return true;
 		},
 		checkData() {

+ 57 - 23
pages2/bank/questionBank.vue

@@ -11,8 +11,8 @@
 									<text v-if="bank.type == 1">单选</text>
 									<text v-if="bank.type == 2">多选</text>
 									<text v-if="bank.type == 3">判断</text>
-									<text v-if="bank.type == 4">案例</text>
-									<text v-if="bank.type == 5">简答</text>
+									<text v-if="bank.type == 4">案例</text>
+									<text v-if="bank.type == 5">简答</text>
 								</view>
 								<text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
 							</view>
@@ -21,8 +21,9 @@
 						</view>
 						<view class="titles"><rich-text :nodes="bank.content"></rich-text></view>
 					</view>
-					<view class="pad_8 titBox">
-						<template v-if="bank.type == 1">
+					
+					<template v-if="bank.type == 1">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId, bankIndex)">
 									<view class="activeTI">{{ ast[index] }}</view>
@@ -50,9 +51,11 @@
 									<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 
-						<template v-if="bank.type == 2">
+					<template v-if="bank.type == 2">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId, bankIndex, index)">
 									<view :class="{ checked: item.checked }" class="activeTI">{{ ast[index] }}</view>
@@ -90,9 +93,11 @@
 									<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 
-						<template v-if="bank.type == 3">
+					<template v-if="bank.type == 3">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
 									<view class="activeTI">{{ ast[index] }}</view>
@@ -117,16 +122,18 @@
 									<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 
-						<!-- 简答题 -->
-						<template v-if="bank.type == 5">
+					<!-- 简答题 -->
+					<template v-if="bank.type == 5">
+						<view class="pad_8 titBox">
 							<view class="ans">
 								<view class="ans_input" v-if="!bank.ques">
 									<view class="top flex">
-										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
-										<view class="progress">0/4</view>
-										<view class="submit" @click="submitAns(bankIndex)">确认答案</view>
+										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
+										<view class="progress">{{bank.ansText.imageList.length}}/4</view>
+										<view class="submit" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @click="submitAns(bankIndex)">确认答案</view>
 									</view>
 									<view class="textarea"><textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea></view>
 									<view class="imgs">
@@ -148,10 +155,12 @@
 									<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 
-						<!-- 案例题 -->
-						<template v-if="bank.type == 4">
+					<!-- 案例题 -->
+					<template v-if="bank.type == 4">
+						<view class="pad_8 titBox">
 							<view class="tabs">
 								<view
 									class="tab"
@@ -308,8 +317,8 @@
 									</view>
 								</template>
 							</view>
-						</template>
-					</view>
+						</view>
+					</template>
 
 					<view class="footer_btn">
 						<view class="collect" :class="{ show: goodsId ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
@@ -498,6 +507,13 @@ export default {
 		}
 	},
 	methods: {
+		/**
+		 * 是否有上传图片
+		 */
+		hasImgs(bank) {
+			
+			return bank.ansText.imageList.length == 0;
+		},
 		/**
 		 * 获取试卷类型2考试,1练习
 		 */
@@ -905,7 +921,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionIds: this.questionList[bindex].questionId,
+						questionIds: [this.questionList[bindex].questionId],
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -967,7 +983,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionIds: this.questionList[bindex].questionId,
+						questionIds: [this.questionList[bindex].questionId],
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -1013,7 +1029,7 @@ export default {
 					.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionIds: this.questionList[bindex].questionId,
+						questionIds:[this.questionList[bindex].questionId],
 						recordId: this.recordId
 					})
 					.then(res => {});
@@ -1206,7 +1222,7 @@ export default {
 				this.$api.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
-						questionIds: doWrongQuestionIds.join(','),
+						questionIds: doWrongQuestionIds,
 						recordId: this.recordId
 					}).then(res => { 
 						
@@ -1234,6 +1250,7 @@ export default {
 								duration: 2000,
 								icon: 'none'
 							});
+							this.getCollectInfo(index)
 						}
 					});
 			} else {
@@ -1275,6 +1292,13 @@ export default {
 		 * 选择上传图片
 		 */
 		chooseImg(bankindex) {
+			if(this.questionList[bankindex] && this.questionList[bankindex].ansText && this.questionList[bankindex].ansText.imageList.length >= 4) {
+				uni.showToast({
+					icon:'none',
+					title:'最多选择4张'
+				})
+				return;
+			}
 			uni.chooseImage({
 				count: 1, //默认9
 				sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
@@ -1640,6 +1664,10 @@ export default {
 				font-size: 30rpx;
 				background: #007aff;
 				border-radius: 24rpx;
+				
+				&.disabled {
+					opacity: 0.6;
+				}
 			}
 		}
 
@@ -1764,6 +1792,11 @@ export default {
 	background-color: #fff;
 	margin: 0rpx 8rpx 8rpx;
 	border-radius: 16rpx;
+	
+	&.no-margin {
+		margin-top:-16rpx;
+		border-radius: 0 0 16rpx 16rpx;
+	}
 }
 .answer {
 	height: 80rpx;
@@ -1812,6 +1845,7 @@ export default {
 	}
 	.collect {
 		visibility: hidden;
+		width:100rpx;
 
 		&.show {
 			visibility: visible;

+ 102 - 22
pages2/bank/questionBankExplain.vue

@@ -10,8 +10,8 @@
 									<text v-if="bank.type==1">单选</text>
 									<text v-if="bank.type==2">多选</text>
 									<text v-if="bank.type==3">判断</text>
-									<text v-if="bank.type==4">案例</text>
-									<text v-if="bank.type==5">简答</text>
+									<text v-if="bank.type==4">案例</text>
+									<text v-if="bank.type==5">简答</text>
 								</view>
 								<text>{{bankIndex+1}}/{{questionList.length}}</text>
 							</view>
@@ -22,8 +22,8 @@
 							<rich-text :nodes="bank.content"></rich-text>
 						</view>		
 					</view>
-					<view class="pad_8 titBox">
-						<template v-if="bank.type == 1">
+					<template v-if="bank.type == 1">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
 									<view class="activeTI">{{ ast[index] }}</view>
@@ -48,9 +48,11 @@
 									</view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 						
-						<template v-if="bank.type == 2">
+					<template v-if="bank.type == 2">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
 									<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
@@ -82,9 +84,11 @@
 									</view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 						
-						<template v-if="bank.type == 3">
+					<template v-if="bank.type == 3">
+						<view class="pad_8 titBox no-margin">
 							<view v-if="!bank.ques">
 								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
 									<view class="activeTI">{{ ast[index] }}</view>
@@ -109,16 +113,18 @@
 									</view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 						
 						
-						<!-- 简答题 -->
-						<template v-if="bank.type == 5">
+					<!-- 简答题 -->
+					<template v-if="bank.type == 5">
+						<view class="pad_8 titBox">
 							<view class="ans">
 								<view class="ans_input" v-if="!bank.ques">
 									<view class="top flex">
-										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
-										<view class="progress">0/4</view>
+										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
+										<view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
 										<view class="submit"  @click="submitAns(bankIndex)" >确认答案</view>
 									</view>
 									<view class="textarea">
@@ -147,10 +153,12 @@
 									</view>
 								</view>
 							</view>
-						</template>
+						</view>
+					</template>
 						
-						<!-- 案例题 -->
-						<template v-if="bank.type == 4">
+					<!-- 案例题 -->
+					<template v-if="bank.type == 4">
+						<view class="pad_8 titBox">
 							<view class="tabs">
 								<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
 							</view>
@@ -286,21 +294,30 @@
 								
 								
 							</view>
-						</template>
+						</view>	
+					</template>
 						
 						
-					</view>
 					
 				
 					<view class="footer_btn" v-if="isContinue || !isHistory">
-						<view class="collect"></view>
+						<view class="collect" :class="{ show: goodsId ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
+							<view v-if="collectList[bankIndex]">
+								<image src="/static/icon/collected.png" mode=""></image>
+								<view>取消收藏</view>
+							</view>
+							<view v-if="!collectList[bankIndex]">
+								<image src="/static/icon/collect.png" mode=""></image>
+								<view>收藏</view>
+							</view>
+						</view>
 						<view class="flex_center" @click="openFooterTab">
 							<view class="up-icon">
 								<image src="/static/up.png"></image>
 							</view>
 							答题卡
 						</view>
-						<view class="collect show" @click="submit">
+						<view class="collect"  :class="{ show: explain ? false : true }" @click="submit">
 							<view>
 								<image src="/static/jj.png" mode=""></image>
 								<view>交卷</view>
@@ -374,7 +391,44 @@ export default {
 		this.examRecordEdit();
 	},
 	methods: {
-		
+		/**
+		 * @param {Object} state
+		 * @param {Object} index
+		 * 收藏
+		 */
+		collect(state, index) {
+			if (!state) {
+				this.$api
+					.collectQuestion({
+						examId: this.id,
+						questionId: this.questionList[index].questionId,
+						goodsId: this.goodsId || ''
+					})
+					.then(res => {
+						if (res.data.code == 200) {
+							this.$set(this.collectList, index, true);
+							uni.showToast({
+								title: '收藏成功',
+								duration: 2000,
+								icon: 'none'
+							});
+							this.getCollectInfo(index)
+						}
+					});
+			} else {
+				this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
+					if (res.data.code == 200) {
+						this.$set(this.collectList, index, false);
+						uni.showToast({
+							title: '取消收藏成功',
+							duration: 2000,
+							icon: 'none'
+						});
+					}
+				});
+			}
+			return;
+		},
 		goodsQuestionList() {
 			//继续答题
 			if(this.isContinue || this.isHistory) {
@@ -474,13 +528,33 @@ export default {
 					})
 					
 					this.questionList = res.data.data;
-					
+					this.getCollectInfo(this.current);
 					console.log(this.questionList)
 					
 				})
 			}
 			
 		},
+		
+		/**
+		 * @param {Object} current
+		 * 获取收藏信息
+		 */
+		getCollectInfo(current) {
+			this.$api
+				.getCollectInfo({
+					examId: this.id,
+					questionId: this.questionList[current].questionId,
+					goodsId: this.goodsId
+				})
+				.then(res => {
+					if (res.data.code == 500) {
+						this.$set(this.collectList, current, false);
+					} else if (res.data.code == 200) {
+						this.$set(this.collectList, current, res.data.data);
+					}
+				});
+		},
 		/**
 		 * @param {Object} e单选点击
 		 */
@@ -1182,6 +1256,11 @@ export default {
 	background-color: #fff;
 	margin: 0rpx 8rpx 8rpx;
 	border-radius: 16rpx;
+	
+	&.no-margin {
+		margin-top:-16rpx;
+		border-radius: 0 0 16rpx 16rpx;
+	}
 }
 .answer {
 	height: 80rpx;
@@ -1232,6 +1311,7 @@ export default {
 	
 	.collect {
 		visibility: hidden;
+		width:100rpx;
 	
 		&.show {
 			visibility: visible;

+ 1 - 1
pages2/bank/question_report.vue

@@ -9,7 +9,7 @@
 
 			<view class="box">
 				<view class="left">
-					<view>{{ ((reportdata.rightQuestionNum / reportdata.totalQuestionNum) * 100).toFixed(0) }}%</view>
+					<view>{{ ((reportdata.rightQuestionNum / (reportdata.rightQuestionNum + wrongRecordWrongNum)) * 100).toFixed(0) }}%</view>
 					<view>正确率</view>
 					<view>不含简答/案例题</view>
 				</view>

+ 10 - 3
pages2/order/index.vue

@@ -102,9 +102,16 @@ export default {
 		goCourse(item,orderStatus) {
 			if(orderStatus == 1 || orderStatus == 2) {
 				
-				uni.navigateTo({
-					url:'/pages2/wd/course?id='+item.goodsId
-				})
+				if(item.goodsType == 1) { //网课
+					uni.navigateTo({
+						url:'/pages2/wd/course?id='+item.goodsId
+					})
+				} else if(item.goodsType == 2) { //题库
+					uni.navigateTo({
+						url:'/pages2/bank/question_detail?id='+item.goodsId
+					})
+				}
+				
 			}
 		},
 		resumeOrder(item){

二进制
static/camera.png