chenxiong 3 жил өмнө
parent
commit
490df43f0f

+ 13 - 4
components/course/courseChapter.vue

@@ -6,7 +6,7 @@
 		<text style="margin-left: 30rpx;">{{menuItem.name}}</text>
 		</view>
 		<view v-if="!down">
-			<view v-for="(itemM,indexM) in list" >
+			<view v-for="(itemM,indexM) in list" :key="indexM">
 				<view v-if="itemM.type!=2">
 					<courseSection :courseId="courseId"  :goodsId="goodsId" :isBuy="isBuy" :nextMenuItem="findNextSection(indexM)" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
 					<u-line v-if="indexM<list.length-1"></u-line>
@@ -85,14 +85,21 @@ export default {
 			list:[],
 			examList:{},
 			canLearn:false, //是否全部视频看完可以练习、测试
-	
+			clickItem:'',
 		};
 	},
 	onLoad() {},
 	created() {
-		
 	},
 	mounted() {
+		
+	},
+	onPageShow() {
+		
+		if(this.clickItem) {
+			let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
+			this.getBuySectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
+		}
 	},
 	methods: {
 		findNextSection(index){
@@ -105,7 +112,9 @@ export default {
 		 * 去做题
 		 */
 		async toDo(id,goodsId =0,moduleId = 0, chapterId = 0,item,index) {
-			this.$emit('toDo',index)
+			this.clickItem = item;
+			
+			console.log(this.clickItem,'clickItem')
 			if(this.learningOrder == 1) {
 				if(this.canLearn) {
 					

+ 4 - 4
components/course/courseModule.vue

@@ -6,7 +6,7 @@
 		<text style="margin-left: 10rpx;">{{menuItem.name}}</text>
 		</view>
 		<view v-if="!down">
-			<view v-for="(itemM,indexM) in list" >
+			<view v-for="(itemM,indexM) in list" :key="indexM">
 				<courseChapter @toDo="toDo($event)" :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
@@ -58,7 +58,7 @@ export default {
 	data() {
 		return {
 			 down:true,
-			 list:[]
+			 list:[],
 		};
 	},
 	onLoad() {},
@@ -69,8 +69,8 @@ export default {
 		
 	},
 	methods: {
-		toDo(index) {
-			this.$emit('toDo',index)
+		toDo(item) {
+			this.$emit('toDo',item)
 		},
 		openModule(item){
 			this.down = !this.down

+ 10 - 3
pages2/bank/questionBankContinue.vue

@@ -596,7 +596,7 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ques && (item.ques.text.length || item.ques.imageList.length)) {
+						if (item.ques && (item.ques.text || item.ques.imageList.length)) {
 							count++;
 						}
 					}
@@ -683,6 +683,7 @@ export default {
 				let number = 0;
 				let score = 0;
 				let doQuestionNum = 0;
+				let doQuestionIds = []; //做过的题目id
 				this.questionList.length && this.questionList.forEach((item,index) => {
 					if(item.type == 1) {
 						if(item.ques == item.ans) { 
@@ -691,6 +692,7 @@ export default {
 						}
 						if (item.ques) {
 							doQuestionNum++;
+							doQuestionIds.push(item.questionId)
 						}
 					} else if(item.type == 2) {
 						let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
@@ -703,6 +705,7 @@ export default {
 						}
 						if (item.ques && item.ques.length) {
 							doQuestionNum++;
+							doQuestionIds.push(item.questionId)
 						}
 					} else if(item.type == 3) {
 						if(item.ques == item.ans) {
@@ -711,14 +714,17 @@ export default {
 						}
 						if (item.ques) {
 							doQuestionNum++;
+							doQuestionIds.push(item.questionId)
 						}
 					} else if (item == 4) {
 						if (item.ques.length) {
 							doQuestionNum++;
+							doQuestionIds.push(item.questionId)
 						}
 					} else if (item.type == 5) {
-						if (item.ques) {
+						if (item.ques && (item.ques.imageList.length || item.ques.text)) {
 							doQuestionNum++;
+							doQuestionIds.push(item.questionId)
 						}
 					}
 				})
@@ -727,6 +733,7 @@ export default {
 					moduleExamId:this.moduleId || 0,
 					chapterExamId:this.chapterId || 0,
 					examId:this.id,
+					doQuestionIds:doQuestionIds.join(''),
 					goodsId:this.goodsId,
 					recordId: this.recordId,
 					rightQuestionNum:number,
@@ -875,7 +882,7 @@ export default {
 					}
 				} else if (item.type == 5) {
 					allScore += item.score;
-					if (item.ques && (item.ques.imageList || item.ques.text)) {
+					if (item.ques && (item.ques.imageList.length || item.ques.text)) {
 						doQuestionNum++;
 						doQuestionIds.push(item.questionId)
 					}

+ 2 - 7
pages2/class/questionBank.vue

@@ -255,7 +255,7 @@
 											
 										</view>
 									</view>
-									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" :class="{disabled:!isCheckboxChecked(bank.jsonStr)}" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
+									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" :class="{disabled:!isCheckboxChecked(ansItem.optionsList)}" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
 									<view v-if="bank.ques && bank.ques[ansIndex]">
 										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
 											<text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
@@ -1110,10 +1110,8 @@ export default {
 				let number = 0;
 				let score = 0;
 				let doQuestionNum = 0;
-				let passScore = 0;
 				let reportStatus = 0;
 				this.questionList.forEach((item, index) => {
-					passScore = item.passScore
 					if (item.type == 1) {
 						if (item.ques == item.ans) {
 							score += item.score;
@@ -1194,11 +1192,8 @@ export default {
 					}
 				});
 				
-				//大于分及格
-				if(score >= passScore) {
+				if(score >= 60) {
 					reportStatus = 1
-				} else {
-					reportStatus = 0
 				}
 
 				this.$api

+ 12 - 3
pages3/polyv/detail.vue

@@ -69,7 +69,7 @@
 						{{courseHandoutsData.handoutsName}}
 						<!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
 					</view>
-					<view class="btn" v-if="courseHandoutsData.handoutsUrl" @click="openDocument">
+					<view class="btn" @click="openDocument">
 						<u-icon name="download" color="#007AFF" size="40"></u-icon>
 					</view>
 				</view>
@@ -1275,9 +1275,10 @@ export default {
 		},
 		openDocument() {
 			let self = this;
-			// console.log(this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl))
+			let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl)
+			console.log(url)
 			uni.downloadFile({
-			  url: this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl),
+			  url: url,
 			  success: function (res) {
 				  console.log(999)
 			    var filePath = res.tempFilePath;
@@ -1288,12 +1289,20 @@ export default {
 			        console.log(res,'打开文档成功');
 			      },
 				  fail:function(err) {
+					  console.log(err)
 					uni.showToast({
 						icon:'none',
 						title:'文档地址错误'
 					})
 				  }
 			    });
+			  },
+			  fail:(err) => {
+				  uni.showModal({
+				  	title:'提示',
+					content:'文档错误,'+err.errMsg,
+					showCancel:false
+				  })
 			  }
 			});
 		}