chen 3 жил өмнө
parent
commit
32b6e63e97

+ 41 - 0
common/httpList/goods.js

@@ -62,6 +62,15 @@ export default {
 		})
 	},
 	
+	goodsBankQuestionNum(data) {
+		return myRequest({
+			url: '/goods/bank/questionNum/'+data,
+			data:data,
+			method: 'get',
+		})
+	},
+	
+	
 	examReport(data) {
 		return myRequest({
 			url: '/exam/record/'+data,
@@ -69,6 +78,13 @@ export default {
 		})
 	},
 	
+	examRecordCount(data) {
+		return myRequest({
+			url: '/exam/record/count',
+			data:data,
+			method: 'GET',
+		})
+	},
 	
 	examaperList(data) {
 		return myRequest({
@@ -182,6 +198,31 @@ export default {
 		})
 	},
 	
+	goodsBankDolist(data) {
+		return myRequest({
+			url: '/goods/bank/dolist',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	goodsChapterDolist(data) {
+		return myRequest({
+			url: '/goods/chapter/dolist',
+			method: 'get',
+			data:data
+		})
+	},
+	goodsExamDolist(data) {
+		return myRequest({
+			url: '/goods/exam/dolist',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	
+	
 	goodsCollectList(data) {
 		return myRequest({
 			url: '/collect/question/list',

+ 10 - 0
pages.json

@@ -339,6 +339,16 @@
 					}
 				}
 			},
+			{
+				"path": "bank/questionBankExplain",
+				"style": {
+					"navigationBarTitleText": "试卷解析",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "bank/questionBankTest",
 				"style": {

+ 9 - 2
pages2/bank/questionBank.vue

@@ -381,11 +381,15 @@ export default {
 			testOver:false,
 			isLastCount:false, //是否有未答题目
 			lastCount:0, //剩余没有回答的题目数
+			chapterId:0,
+			moduleId:0,
 		};
 	},
 	onLoad(option){
 		this.id = option.id;
 		this.goodsId = option.goodsid;
+		this.chapterId = option.chapterId;
+		this.moduleId = option.moduleId;
 		let isBack = option.isback;
 		
 		if(isBack) {
@@ -563,6 +567,7 @@ export default {
 				examId:this.id,
 				goodsId:this.goodsId,
 				// reportStatus:reportStatus,
+				doQuestionNum:this.questionOverNum(),
 				recordId: this.recordId,
 				rightQuestionNum:number,
 				status:1,
@@ -627,6 +632,8 @@ export default {
 		 */
 		examRecord() {
 			this.$api.examRecord({
+				chapterExamId:this.chapterId || 0,
+				moduleExamId:this.moduleId || 0,
 				examId:this.id,
 				goodsId:this.goodsId,
 				totalQuestionNum:this.questionList.length,
@@ -1257,8 +1264,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {

+ 1270 - 0
pages2/bank/questionBankExplain.vue

@@ -0,0 +1,1270 @@
+<template>
+	<view id="questionBank">
+		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
+			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
+				<view class="pageContent">
+					<view class="pad_8 titBox" >
+						<view class="firstLetter">
+							<view class="leftLetters">
+								<view class="btnType">
+									<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>
+								</view>
+								<text>{{bankIndex+1}}/{{questionList.length}}</text>
+							</view>
+							<view style="color: #666;font-size: 28rpx;"></view>
+							<view class="leftLetters"></view>
+						</view>
+						<view class="titles">
+							<rich-text :nodes="bank.content"></rich-text>
+						</view>		
+					</view>
+					<view class="pad_8 titBox">
+						<template v-if="bank.type == 1">
+							<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>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans-1]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques-1]}}</view>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						<template v-if="bank.type == 2">
+							<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>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
+								确认答案
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:
+										<text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
+									</view>
+									<view v-if="!explain">我的答案:
+										<text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
+									</view>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						<template v-if="bank.type == 3">
+							<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>
+									{{ item }}
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty">
+									<text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item }}
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques]}}</view>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						
+						<!-- 简答题 -->
+						<template v-if="bank.type == 5">
+							<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>
+									</view>
+									<view class="textarea">
+										<textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea>
+									</view>
+									<view class="imgs">
+										<view class="img" v-for="(img,imgIndex) in bank.ansText.imageList" >
+											<text @click="deleteImg(imgIndex,bankIndex)">x</text>
+											<image :src="$method.splitImgHost(img, true)"></image>
+										</view>
+									</view>
+								</view>
+								<view class="ans_submit answerInfos" v-if="bank.ques && !explain">
+									<view class="answerTitle">答案我的</view>
+									{{bank.ques.text}}
+									<view class="imgs">
+										<image class="img" v-for="ques in bank.ques.imageList" :src="$method.splitImgHost(ques,true)"></image>
+									</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						<!-- 案例题 -->
+						<template v-if="bank.type == 4">
+							<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>
+							<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
+								<view class="titles">
+									<rich-text :nodes="ansItem.content"></rich-text>
+								</view>
+								<template v-if="ansItem.type == 1">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
+											<view class="activeTI">{{ ast[childIndex] }}</view>
+											<rich-text class="textChild" :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
+											<text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childIndex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="option.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								<template v-if="ansItem.type == 2">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
+											<view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @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">{{ ast[childindex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:
+												<text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
+											</view>
+											<view v-if="!explain">我的答案:
+												<text v-for="quesItem in bank.ques[ansIndex]">{{ast[quesItem-1]}}</text>
+											</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								<template v-if="ansItem.type == 3">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
+											<view class="activeTI">{{ ast[childindex] }}</view>
+											{{ option }}
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
+											<text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childindex] }}</text>
+											{{ option }}
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+								<!-- 简答题 -->
+								<template v-if="ansItem.type == 5">
+									<view class="ans">
+										<view class="ans_input" v-if="!bank.ques[ansIndex]">
+											<view class="top flex">
+												<image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
+												<view class="progress">0/4</view>
+												<view class="submit"  @click="submitAnsChild(bankIndex,ansIndex)">确认答案</view>
+											</view>
+											<view class="textarea">
+												<textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea>
+											</view>
+											<view class="imgs">
+												<view class="img" v-for="(img,imgIndex) in ansItem.ansText.imageList" >
+													<text @click="deleteImgChild(imgIndex,bankIndex,ansIndex)">x</text>
+													<image :src="$method.splitImgHost(img, true)"></image>
+												</view>
+											</view>
+										</view>
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
+											<view class="answerTitle">答案我的</view>
+											{{bank.ques[ansIndex].text}}
+											<view class="imgs">
+												<image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="$method.splitImgHost(ques,true)"></image>
+											</view>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+							</view>
+						</template>
+						
+						
+					</view>
+					
+				
+					<view class="footer_btn" v-if="isContinue">
+						<view class="collect"></view>
+						<view @click="openFooterTab">答题卡</view>
+						<view @click="submit">交卷</view>
+					</view>
+				</view>
+			</swiper-item>
+		</swiper>
+		
+		<u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
+			<view class="popupView">
+				<view class="popupTops">
+					<view class="topIcon"></view>
+					点击编号即可跳转至对应题目
+				</view>
+				<view class="popupContent">
+					<scroll-view scroll-y="true" style="height: 506rpx;">
+						<view class="boxSty">
+							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		
+		<view class="dialog" v-if="showDialog">
+			<view class="text">左右滑动切换上下题</view>
+			<view class="btn" @click="hideDialog">我知道了</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			id:'',
+			current:0,
+			questionList:[],
+			ast: ['A', 'B', 'C', 'D','E','F','G'],
+			judge:['错误','正确'],
+			show: false,
+			showDialog:true,
+			bankList: [],
+			collectList:[],
+			goodsId:'',
+			explain:'',
+			isContinue:'',
+			chapterId:'',
+			moduleId:'',
+			isSubmit:false,
+		};
+	},
+	onLoad(option){
+		this.id = option.id;
+		this.explain = option.explain;
+		this.isContinue = option.continue;
+		this.goodsId = option.goodsid;
+		this.chapterId = option.chapterId;
+		this.moduleId = option.moduleId;
+		this.recordId = option.recordId;
+		this.goodsQuestionList();
+	},
+	onUnload() {
+		if(this.isSubmit) {
+			return
+		}
+		this.examRecordEdit();
+	},
+	methods: {
+		
+		goodsQuestionList() {
+			//继续答题
+			if(this.isContinue) {
+				this.$api.examReport(this.recordId).then(res => {
+					let json = JSON.parse(res.data.data.historyExamJson)
+					
+					this.questionList = json;
+				})
+			} else {  //解析
+				this.$api.goodsQuestionList({
+					examId:this.id
+				}).then(res => {
+					
+					res.data.data.forEach((item,index) => { 
+						if(typeof item.jsonStr == 'string') {
+							item.jsonStr = JSON.parse(item.jsonStr)
+							
+							if(item.type == 2) { //多选
+								item.jsonStr.forEach(str => {
+									str.optionsId = ''+str.optionsId;
+								})
+								let arr = item.answerQuestion.split(',');
+								arr.forEach((a,i) => {
+									arr[i] = ''+a;
+								})
+								item.ans = arr;
+								if(this.explain) {
+									item.ques = item.ans;
+								}
+								return;
+							} else if(item.type == 5) {
+								item.ansText = {
+									text: '',
+									imageList: []
+								}
+								
+								if(this.explain) {
+									item.ques = {
+										text:item.analysisContent
+									}
+									
+									return;
+								}
+								
+								
+							} else if(item.type == 4) {
+								console.log(item.jsonStr)
+								item.ques = []
+								item.current = 0;
+								let ansArr = []; 
+								item.jsonStr.forEach((json,index) => {
+									if(json.type == 1) {
+										ansArr[index] = json.answerQuestion;
+									} else if(json.type == 2) {
+										json.optionsList.forEach(str => {
+											str.optionsId = ''+str.optionsId;
+										})
+										let arr = json.answerQuestion.split(',');
+										arr.forEach((a,i) => {
+											arr[i] = ''+a;
+										})
+										ansArr[index] = arr
+									} else if(json.type == 3) {
+										ansArr[index] = json.answerQuestion;
+									} else if(json.type == 5) {
+										ansArr[index] = {
+											text: '',
+											imageList: []
+										}
+										json.ansText = {
+											text: '',
+											imageList: []
+										}
+									}
+								})
+								
+								item.ans = ansArr
+								if(this.explain) {
+									item.ques = item.ans;
+								}
+								return;
+								
+							}
+							
+							item.ans = item.answerQuestion
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+						} else {
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+						}
+						
+					})
+					
+					this.questionList = res.data.data;
+					
+				})
+			}
+			
+		},
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelect(optionsId,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',optionsId)
+			
+		},
+		examRecordEdit() {
+			if(!this.isSubmit) {
+				
+				let number = 0;
+				let score = 0;
+				this.questionList.forEach((item,index) => {
+					if(item.type == 1) {
+						if(item.ques == item.ans) { 
+							score += item.score;
+							number++
+						}
+					} else if(item.type == 2) {
+						let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
+							return item.ques[quesIndex] == item.ans[quesIndex]
+						})
+						
+						if(isRight) {
+							score += item.score;
+							number++
+						}
+					} else if(item.type == 3) {
+						if(item.ques == item.ans) {
+							score += item.score;
+							number++
+						}
+					}
+				})
+				
+				this.$api.examRecordEdit({
+					examId:this.id,
+					goodsId:this.goodsId,
+					recordId: this.recordId,
+					rightQuestionNum:number,
+					status:0,
+					historyExamJson:JSON.stringify(this.questionList)
+				}).then(res => {
+					
+				})
+			}
+		},
+		
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelectChild(optionsId,ansIndex,bindex) {
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			
+		},
+		
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelect(optionsId,bindex,index) {
+			
+			this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelectChild(bindex,ansIndex,childIndex) {
+			
+			this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
+		},
+		
+		/**
+		 * 提交数据
+		 */
+		submit() {
+			let score = 0; //计算总分
+			let reportStatus = 0;
+			let number = 0;
+			this.questionList.forEach((item,index) => {
+				if(item.type == 1) {
+					if(item.ques == item.ans) { 
+						score += item.score;
+						number++
+					}
+				} else if(item.type == 2) {
+					let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
+						return item.ques[quesIndex] == item.ans[quesIndex]
+					})
+					
+					if(isRight) {
+						score += item.score;
+						number++
+					}
+				} else if(item.type == 3) {
+					if(item.ques == item.ans) {
+						score += item.score;
+						number++
+					}
+				}
+			})
+			
+			// if(score >= 60) {
+			// 	reportStatus = 1
+			// } else {
+			// 	reportStatus = 0
+			// }
+			
+			this.$api.examRecordEdit({
+				examId:this.id,
+				goodsId:this.goodsId,
+				// reportStatus:reportStatus,
+				recordId: this.recordId,
+				rightQuestionNum:number,
+				status:1,
+				score:score,
+				historyExamJson:JSON.stringify(this.questionList)
+			}).then(res => {
+				this.isSubmit = true;
+				if(res.data.code == 200) {
+					
+					uni.showToast({
+						title: '交卷成功',
+						duration: 2000,
+						icon:'none'
+					});
+					
+					setTimeout(() => {
+						uni.redirectTo({
+							url:'/pages2/bank/question_report?id='+this.recordId
+						})
+					},2000)
+				}
+			})
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmit(bindex) {
+			
+			if(this.questionList[bindex].ques) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex],'ques',arr)
+			
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmitChild(bindex,ansIndex) {
+			
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+		},
+		
+		judgeSelect(index,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',index+'')
+			
+		},
+		
+		judgeSelectChild(ansindex,childindex,bindex) {
+			if(this.questionList[bindex].ques[ansindex]) return;
+			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+		},
+		
+		openFooterTab() {
+			this.show = true;
+		},
+		hideDialog() {
+			this.showDialog = false
+		},
+		changeIndex(index) {
+			this.current = index
+		},
+		
+		swiperChange(e) {
+			this.current = e.detail.current;
+		},
+		
+		
+		deleteImg(imgIndex,bankIndex) {
+			
+			
+			this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		
+		deleteImgChild(imgIndex,bankIndex,ansIndex) {
+			
+			
+			this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		chooseImg(bankindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		chooseImgChild(bankindex,ansindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		uploadFile(options, int) {
+			var self = this;
+			return new Promise((resolve, reject) => {
+				var data = {
+					imageStatus: int
+				};
+				self.$api.aliyunpolicy(data).then(res => {
+					console.log(res.data,6)
+					if(res.data.code!=200){
+						self.$method.showToast('签名错误'+JSON.stringify(res.data))
+						return
+					}
+					var ossToken = res.data.data.resultContent;
+					if(ossToken.host==null||ossToken.host==undefined){
+						self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
+						return
+					}
+					uni.uploadFile({
+						url: ossToken.host,
+						name: 'file',
+						filePath: options,
+						fileType: 'image',
+						header: {
+							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
+						},
+						formData: {
+							key: ossToken.dir,
+							OSSAccessKeyId: ossToken.accessid,
+							policy: ossToken.policy,
+							Signature: ossToken.signature,
+							callback: ossToken.callback,
+							success_action_status: 200
+						},
+						success: result => {
+							if (result.statusCode === 200) {
+								resolve(ossToken.dir);
+							} else {
+								uni.showToast({
+									title: '上传失败',
+									icon: 'none'
+								});
+								return;
+							}
+						},
+						fail: error => {
+							uni.showToast({
+								title: '上传接口报错'+error,
+								icon: 'none'
+							});
+							return;
+						}
+					});
+				});
+			});
+		},
+		submitAns(bankindex) {
+				
+			console.log(this.questionList[bankindex])
+			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.questionList[bankindex],'ques',{
+				imageList:this.questionList[bankindex].ansText.imageList,
+				text:this.questionList[bankindex].ansText.text,
+			})
+			
+		},
+		
+		submitAnsChild(bankindex,ansindex) {
+				
+			if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.questionList[bankindex].ques,ansindex,{
+				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
+				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
+			})
+			
+		},
+		
+		isRight(item,index) {
+			//单选
+			if(this.questionList[index].ques) {
+				if(item.type == 1) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.every((item,i) => {
+						console.log(item == this.questionList[index].ans[i])
+						return item == this.questionList[index].ans[i];
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		
+		right(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
+					return true
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		wrong(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
+					return true;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
+		
+		isWrong(item,index) {
+			if(this.questionList[index].ques) {
+				//单选
+				if(item.type == 1) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.some((item,i) => {
+						return item != this.questionList[index].ans[i];
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		tabSelect(index,bankindex) {
+			
+			this.$set(this.questionList[bankindex],'current',index)
+			
+		},
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.swiper {
+	width:100%;
+	height:100vh;
+}
+.lisSty {
+	margin-bottom: 16rpx;
+	display: flex;
+	
+	.flex_auto {
+		flex:1;
+	}
+}
+.activeTI {
+	vertical-align: middle;
+	display: inline-block;
+	border: 1rpx solid #eee;
+	border-radius: 50rpx;
+	height: 48rpx;
+	line-height: 46rpx;
+	text-align: center;
+	width: 48rpx;
+	margin-right: 15rpx;
+	color: #666;
+	font-size: 30rpx;
+	
+	
+	&.right {
+		color:#fff;
+		background:green;
+	}
+	
+	&.wrong {
+		color:#fff;
+		background:red;
+	}
+	
+	&.checked {
+		color:#fff;
+		background:blue;
+	}
+}
+
+.submit_checkbox {
+	margin:20rpx auto;
+	width: 526rpx;
+	height: 80rpx;
+	background: rgba(0, 122, 255, 1);
+	color:#fff;
+	text-align: center;
+	line-height: 80rpx;
+	font-size: 30rpx;
+	border-radius: 40rpx;
+}
+.titles {
+	overflow: hidden;
+	margin-bottom: 24rpx;
+}
+.titBox {
+	padding: 41rpx 25rpx 24rpx 25rpx;
+}
+
+.tabs {
+	margin:10rpx;
+	display: flex;
+	.tab {
+		margin:0 10rpx;
+		width: 96rpx;
+		height: 48rpx;
+		line-height: 48rpx;
+		text-align: center;
+		color:#007AFF;
+		font-size: 28rpx;
+		border-radius: 16rpx;
+		
+		&.current {
+			color:#fff;
+			background: #007AFF;
+		}
+	}
+}
+
+.ans {
+	margin:8rpx 8rpx 8rpx;
+	
+	.ans_input {
+	    border-radius: 16rpx;
+		background:#fff;
+		.top {
+			border-bottom:1rpx solid #EEEEEE;
+			padding: 16rpx;
+			display: flex;
+			align-items: center;
+			
+			.icon {
+				margin-right:20rpx;
+				width: 40rpx;
+				height: 38rpx;
+			}
+			
+			.progress {
+				flex:1;
+			}
+			
+			.submit {
+				width: 168rpx;
+				height: 48rpx;
+				line-height: 48rpx;
+				text-align: center;
+				color:#fff;
+				font-size: 30rpx;
+				background: #007AFF;
+				border-radius: 24rpx;
+			}
+		}
+		
+		.textarea {
+			textarea {
+				width:100%;
+				height:287rpx;
+				padding:10rpx;
+			}
+		}
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				
+				text {
+					position:absolute;
+					right:-15rpx;
+					top:-15rpx;
+					width:30rpx;
+					height:30rpx;
+					text-align: center;
+					line-height: 30rpx;
+					color:#fff;
+					background:red;
+					border-radius:50%;
+				}
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+	
+	.ans_submit {
+		padding:16rpx;
+		border-radius: 16rpx;
+		background:#fff;
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+}
+.firstLetter {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin-bottom: 30rpx;
+	.leftLetters {
+		display: flex;
+		align-items: center;
+		width: 220rpx;
+		.btnType {
+			padding: 5rpx 10rpx;
+			border: 1rpx solid #007aff;
+			border-radius: 10rpx;
+			background-color: rgba(0, 122, 255, 0.1);
+			font-size: 28rpx;
+			color: #007aff;
+			margin-right: 15rpx;
+		}
+	}
+}
+.popupView {
+	height: 100%;
+	padding-bottom: 100rpx;
+	.popupTops {
+		height: 77rpx;
+		border-bottom: 1rpx solid #eee;
+		text-align: center;
+		line-height: 77rpx;
+		font-size: 24rpx;
+		color: #999;
+		position: relative;
+		.topIcon {
+			position: absolute;
+			top: 10rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			width: 80rpx;
+			height: 8rpx;
+			background-color: #999;
+			border-radius: 4rpx;
+		}
+	}
+	.popupContent {
+	}
+}
+.pageContent {
+	position:relative;
+	background-color: #eaeef1;
+	min-height: 100vh;
+	padding-top: 8rpx;
+	padding-bottom: 100rpx;
+}
+.pad_8 {
+	background-color: #fff;
+	margin: 0rpx 8rpx 8rpx;
+	border-radius: 16rpx;
+}
+.answer {
+	height: 80rpx;
+	line-height: 80rpx;
+	padding: 0rpx 24rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	color: #666;
+	font-size: 30rpx;
+}
+.footer_btn {
+	background-color: #fff;
+	z-index: 10078;
+	position: fixed;
+	bottom: 0rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	width: 100%;
+	height: 98rpx;
+	padding: 0rpx 38rpx;
+	border-top: 1rpx solid #eee;
+	
+	.collect {
+		visibility: hidden;
+		
+		&.show {
+			visibility: visible;
+		}
+	}
+}
+.boxSty {
+	padding: 44rpx 41rpx 0rpx;
+}
+.liListSty {
+	border:1rpx solid #EEEEEE;
+	width: 88rpx;
+	height: 88rpx;
+	border-radius: 32rpx;
+	text-align: center;
+	line-height: 88rpx;
+	color: #333;
+	font-size: 32rpx;
+	float: left;
+	margin: 20rpx 23rpx;
+	
+	&.isRight {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: green;
+	}
+	
+	&.isWrong {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: red;
+	}
+}
+.answerInfos {
+	padding: 25rpx 25rpx 25rpx 23rpx;
+}
+.answerTitle {
+	margin-bottom: 28rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.answerContent {
+	font-size: 30rpx;
+	color: #666;
+}
+
+.textChild {
+	display: inline-block;
+	vertical-align: middle;
+}
+
+.dialog {
+	position: fixed;
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	background-color: rgba(0,0,0,0.8);
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	z-index: 20000;
+	
+	.text {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
+	
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #FFFFFF;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin:41rpx auto;
+		color:#fff;
+		font-size: 32rpx;
+	}
+}
+</style>

+ 2 - 2
pages2/bank/questionBankTest.vue

@@ -769,8 +769,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {

+ 59 - 19
pages2/bank/question_detail.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="top">
-			<navigator url="/pages2/bank/question_statistics">
+			<navigator :url="'/pages2/bank/question_statistics?id='+id">
 				<view class="left">
 					<view class="title">做题统计</view>
 					<view class="progress">
@@ -10,14 +10,14 @@
 								<text>总进度</text>
 							</view>
 							<view class="percent">
-								68
+								{{goodsCount.doNum/goodsCount.totalNum * 100}}
 								<text class="per">%</text>
 							</view>
 						</view>
 						<view class="item-right">
 							<view class='up'>
-								<text class="orange">58</text>
-								<text>/100</text>
+								<text class="orange">{{goodsCount.doNum}}</text>
+								<text>/{{goodsCount.totalNum - goodsCount.doNum}}</text>
 							</view>
 							
 							<view class='down'>
@@ -34,7 +34,7 @@
 							错题集 <u-icon name="arrow-right"></u-icon>
 						</view>
 						<view class="number">
-							{{wrongTotal}}
+							{{goodsCount.wrongNum}}
 						</view>
 				</view>
 			</navigator>
@@ -44,7 +44,7 @@
 						收藏集 <u-icon name="arrow-right"></u-icon>
 					</view>
 					<view class="number">
-							{{collectTotal}}
+							{{goodsCount.collectNum}}
 					</view>
 				</view>
 			</navigator>
@@ -71,9 +71,7 @@
 								<view  v-if="item2.showList">
 									<view class="article" :class="{active:index3 == 0}"  v-for="(article,index3) in item2.list" :key="index3">
 										<view class="flex_auto">{{article.examName}}</view>
-										<navigator :url="'/pages2/bank/questionBank?id='+article.examId+'&goodsid='+goodsData.goodsId">
-											<view class="btn">做题</view>
-										</navigator>
+										<view class="btn" @click="toDo(article.examId,goodsData.goodsId,item1.majorId,item2.chapterExamId)">做题</view>
 									</view>
 								</view>
 								<u-line></u-line>
@@ -92,9 +90,7 @@
 						<view v-if="item1.showList" >
 							<view class="article" :class="{active:index2 == 0}"  :key="index3" v-for="(article,index2) in item1.list">
 								<view class="flex_auto">{{item1.name}}</view>
-								<navigator :url="'/pages2/bank/questionBank?id='+article.majorId+'&goodsid='+goodsData.goodsId">
-									<view class="btn">做题</view>
-								</navigator>
+									<view class="btn"  @click="toDo(article.majorId,goodsData.goodsId,0,item1.majorId)">做题</view>
 								
 							</view>
 						</view>
@@ -103,9 +99,7 @@
 					<template v-if="item1.type ==3">
 						<view class="article active" >
 							<view class="flex_auto">{{item1.name}}</view>
-							<navigator :url="'/pages2/bank/questionBank?id='+item1.majorId+'&goodsid='+goodsData.goodsId">
-								<view class="btn">做题</view>
-							</navigator>
+								<view class="btn" @click="toDo(item1.majorId,goodsData.goodsId,0,0)">做题</view>
 							
 						</view>
 					</template>
@@ -123,8 +117,7 @@ export default {
 			goodsData:{},
 			bankList:[],
 			id:'',
-			collectTotal:0,
-			wrongTotal:0
+			goodsCount:{}
 		};
 	},
 	onUnload() {
@@ -135,8 +128,9 @@ export default {
 		this.id = option.id
 		this.getDetail();
 		this.goodsBankList();
-		this.getCollectNum();
-		this.getWrongNum()
+		// this.getCollectNum();
+		// this.getWrongNum()
+		this.goodsBankQuestionNum();
 	},
 	onShow() {
 		
@@ -150,6 +144,52 @@ export default {
 			})
 		},
 		
+		/**
+		 * 去做题
+		 */
+		async toDo(id,goodsId,moduleId = 0, chapterId = 0) {
+			
+			if(this.goodsData.examConfigList) {
+				let count = await this.examRecordCount(id);
+				//超过答题次数
+				if(count >= this.goodsData.examConfigList) {
+					uni.showToast({
+						title:'该试卷只能答题'+this.goodsData.examConfigList+'次!'
+					})
+					return
+				}
+			}
+			
+			uni.navigateTo({
+				url:'/pages2/bank/questionBank?id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
+			})
+		},
+		
+		/**
+		 * 查询试卷历史做题次数
+		 */
+		examRecordCount(examId) {
+			return new Promise(resolve => {
+				
+				this.$api.examRecordCount({
+					examId:examId,
+					goodsId:this.id
+				}).then(res => {
+					
+					resolve(res.data.data)
+				})
+			})
+		},
+		
+		/**
+		 * 获取用户商品统计数据
+		 */
+		goodsBankQuestionNum(){
+			this.$api.goodsBankQuestionNum(this.id).then(res => {
+				this.goodsCount = res.data.data
+			})
+		},
+		
 		goodsBankList() {
 			this.$api.goodsBankList({
 				goodsId:this.id

+ 64 - 8
pages2/bank/question_record.vue

@@ -20,15 +20,24 @@
 					</view>
 				</view>
 				<view class="btns">
-					<view class="btn">
+					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId,record.goodsId,record.moduleExamId,record.chapterExamId)">
 						重做
 					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn" v-if="record.status == 1">
-						报告
-					</view>
+					<navigator :url="'/pages2/bank/questionBankExplain?explain=1&id='+record.examId+'&goodsid='+record.goodsId+'&moduleId='+record.moduleExamId+'&chapterId='+record.chapterExamId+''">
+						<view class="btn" v-if="record.status == 1">
+							解析
+						</view>
+					</navigator>
+					<navigator :url="'/pages2/bank/question_report?id='+record.recordId">
+						<view class="btn" v-if="record.status == 1">
+							报告
+						</view>
+					</navigator>
+					<navigator :url="'/pages2/bank/questionBankExplain?continue=1&recordId='+record.recordId+'&id='+record.examId+'&goodsid='+record.goodsId+'&moduleId='+record.moduleExamId+'&chapterId='+record.chapterExamId+''">
+						<view class="btn" v-if="record.status == 0">
+							继续
+						</view>
+					</navigator>
 				</view>
 			</view>
 		</view>
@@ -63,7 +72,8 @@
 				index:0,
 				list:[],
 				list1:[],
-				recordList:[]
+				recordList:[],
+				goodsData:{}
 			}
 		},
 		onLoad(option) {
@@ -78,6 +88,52 @@
 			
 		},
 		methods: {
+			/**
+			 * 去做题
+			 */
+			async doRepeat (id,goodsId,moduleId = 0, chapterId = 0) {
+				await this.getDetail()
+				if(this.goodsData.examConfigList) {
+					let count = await this.examRecordCount(id);
+					//超过答题次数
+					if(count >= this.goodsData.examConfigList) {
+						uni.showToast({
+							title:'该试卷只能答题'+this.goodsData.examConfigList+'次!'
+						})
+						return
+					}
+				}
+				
+				uni.navigateTo({
+					url:'/pages2/bank/questionBankExplain?id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
+				})
+			},
+			/**
+			 * 查询试卷历史做题次数
+			 */
+			examRecordCount(examId) {
+				return new Promise(resolve => {
+					
+					this.$api.examRecordCount({
+						examId:examId,
+						goodsId:this.id
+					}).then(res => {
+						
+						resolve(res.data.data)
+					})
+				})
+			},
+			
+			getDetail(){
+				return new Promise(resolve => {
+					
+					this.$api.goodsDetail(this.id).then(res => {
+						this.goodsData = res.data.data;
+						 
+						 resolve()
+					})
+				})
+			},
 			testClick(item) {
 				this.index = 0
 				this.$api.examRecordList({

+ 1 - 1
pages2/bank/question_report.vue

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

+ 269 - 98
pages2/bank/question_statistics.vue

@@ -17,8 +17,8 @@
 						<view class="text">做题进度</view>
 					</view>
 					<view class="numbers">
-						<view class="blue">已答  65</view>
-						<view>总数  650</view>
+						<view class="blue">已答  {{goodsCount.doNum}}</view>
+						<view>总数  {{goodsCount.totalNum}}</view>
 					</view>
 				</view>
 			</view>
@@ -27,37 +27,104 @@
 		
 		<view class="title-list">
 			<view class="content">
-				<view class="list" v-for="(item1,index) in outline">
-					<view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
-						2Z106010 施工承发包的模式-2Z106020 施工合同...
-					</view>
-					<view class="article" v-if="item1.showList" v-for="(article,index1) in item1.list">
-						<view class="flex-auto">
-							<view class="tit">施工承发包模式-施工合同与物资采购合同二</view>
-							<view class="desc">
-								<view class="flex-auto">
-									正确率
-									<text class="green">65%</text>
+				<view class="list" v-for="(item1,index1) in bankList" :key="index1">
+					<template v-if="item1.type==1">
+						<view class="moduleItem" @click="clickModule(item1.majorId,index1)">
+							<view class="courseName">{{item1.name}}</view>
+							<view>
+								<image src="/static/icon/up.png" class="icon_up" v-if="!item1.showList"></image>
+								<image src="/static/icon/down.png" class="icon_up" v-if="item1.showList"></image>
+							</view>
+						</view>
+						
+						<template v-if="item1.showList">
+							<view v-for="(item2,index2) in item1.list" :key="index2" >
+								<view class="section" @click="changeItem(index1,item2.chapterExamId,item1.type)">
+									<image src="/static/icon/up1.png" class="icon_up" v-if="!item2.showList"></image>
+									<image src="/static/icon/down1.png" class="icon_up" v-if="item2.showList"></image>
+									{{item2.name}}
 								</view>
-								<view class="flex-auto">
-									已完成
-									<text class="blue">65%</text>
+								<view  v-if="item2.showList">
+									<view class="article"  v-for="(article,index3) in item2.list" :key="index3">
+										<view class="flex-auto">
+											<view class="tit">{{article.examName}}</view>
+											<view class="desc">
+												<view class="flex-auto">
+													正确率
+													<text class="green">65%</text>
+												</view>
+												<view class="flex-auto">
+													已完成
+													<text class="blue">65%</text>
+												</view>
+											</view>
+										</view>
+										<navigator :url="'/pages2/bank/questionBankExplain?continue=1&recordId='+article.recordId+'&id='+article.examId+'&goodsid='+article.goodsId+'&moduleId='+article.moduleExamId+'&chapterId='+article.chapterExamId+''">
+											<view class="btn"  v-if="article.recordStatus == 0">继续</view>
+										</navigator>
+									</view>
 								</view>
+								<u-line></u-line>
 							</view>
-						</view>
+						</template>
+						
 						
-						<navigator url="/pages2/bank/questionBank">
-							<view v-if="index1 == 0" class="btn">
-								做题
+					</template>
+					
+					<template v-if="item1.type ==2">
+						<view class="section" @click="changeItem(index1,item1.majorId,item1.type)">
+							<image src="/static/icon/up1.png" class="icon_up" v-if="!item1.showList"></image>
+							<image src="/static/icon/down1.png" class="icon_up" v-if="item1.showList"></image>
+							{{item1.name}}
+						</view>
+						<view v-if="item1.showList" >
+							<view class="article" :key="index3" v-for="(article,index2) in item1.list">
+								<view class="flex-auto">
+									<view class="tit">{{article.name}}</view>
+									<view class="desc">
+										<view class="flex-auto">
+											正确率
+											<text class="green">65%</text>
+										</view>
+										<view class="flex-auto">
+											已完成
+											<text class="blue">65%</text>
+										</view>
+									</view>
+								</view>
+								<navigator :url="'/pages2/bank/questionBankExplain?continue=1&recordId='+article.recordId+'&id='+article.examId+'&goodsid='+article.goodsId+'&moduleId=0&chapterId='+article.chapterExamId+''">
+									<view class="btn" v-if="article.recordStatus == 0">继续</view>
+								</navigator>
+								
 							</view>
-							<view v-if="index1 == 1" class="btn">
-								继续
+						</view>
+					</template>
+					
+					<template v-if="item1.type ==3">
+						<view class="article" >
+							<view class="flex-auto">
+								<view class="tit">{{item1.name}}</view>
+								<view class="desc">
+									<view class="flex-auto">
+										正确率
+										<text class="green">65%</text>
+									</view>
+									<view class="flex-auto">
+										已完成
+										<text class="blue">65%</text>
+									</view>
+								</view>
 							</view>
-						</navigator>
-					</view>
+							<navigator :url="'/pages2/bank/questionBankExplain?continue=1&recordId='+item1.recordId+'&id='+item1.majorId+'&goodsid='+item1.goodsId+'&moduleId=0&chapterId=0'">
+								<view class="btn" v-if="item1.recordStatus == 0">继续</view>
+							</navigator>
+							
+						</view>
+					</template>
 				</view>
 			</view>
 		</view>
+		
 	</view>
 </template>
 
@@ -66,19 +133,13 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
-			outline:[{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			}]
+			bankList:[],
+			goodsCount:{},
+			id:'',
+			context1:null,
+			context2:null,
+			caculateX:0,
+			caculateY:0,
 		};
 	},
 	onUnload() {
@@ -86,32 +147,26 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-
-	},
-	onShow() {
+		 this.id = option.id;
 		uni.getSystemInfo({
 			success:(res) => {
 				var winW = res.screenWidth;
 				var winH = res.screenHeight;
 				 uni.createSelectorQuery().in(this).select('.canvas').boundingClientRect().exec((newRes)=>{  
+					 
+					 this.goodsBankQuestionNum();
+						this.goodsBankDolist();
+					// this.goodsBankList();
+					 
 					  var width = newRes[0].width;
 					  var height = newRes[0].height;
-					  var caculateX = winW/750;
-					  var caculateY = winH/1334;
-					  console.log(caculateX)
+					  this.caculateX = winW/750;
+					  this.caculateY = winH/1334;
 					  var context1 = uni.createCanvasContext('Canvas1')
+					  this.context1 = context1;
 					  context1.setStrokeStyle("#EEEEEE")
-					  context1.setLineWidth(caculateX * 20)
-					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true)
-					  context1.stroke()
-						context1.beginPath()
-					  context1.setStrokeStyle("#32D74B")
-					  context1.setFillStyle('#32D74B')
-					  context1.setTextAlign('center')
-					  context1.setLineCap('round')
-					  context1.setFontSize(caculateX * 32)
-					  context1.fillText('10%', caculateX * 90, caculateX * 90, caculateX * 180)
-					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0,  Math.PI, true)
+					  context1.setLineWidth(this.caculateX * 20)
+					  context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, true)
 					  context1.stroke()
 					  context1.draw()
 					  
@@ -119,34 +174,125 @@ export default {
 					  
 					  
 					  var context2 = uni.createCanvasContext('Canvas2')
+					  this.context2 = context2;
 					  context2.setStrokeStyle("#EEEEEE")
-					  context2.setLineWidth(caculateX * 20)
-					  context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true)
-					  context2.stroke()
-						context2.beginPath()
-					  context2.setStrokeStyle("#007AFF")
-					  context2.setFillStyle("#007AFF")
-					  context2.setTextAlign('center')
-					  context2.setLineCap('round')
-					  context2.setFontSize(caculateX * 32)
-					  context2.fillText('10%', caculateX * 90, caculateX * 90, caculateX * 180)
-					  context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0,  Math.PI, true)
+					  context2.setLineWidth(this.caculateX * 20)
+					  context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, false)
 					  context2.stroke()
 					  context2.draw()
 				})  
 				
 			}
 		})
+	},
+	onShow() {
+		
 		
 	},
 	methods: {
-		changeItem(e) {
-			let index = e.currentTarget.dataset.index
-			this.outline.forEach((arrItem,i) => {
-				if(i == index) {
-					arrItem.showList = !arrItem.showList
-				}
+		goodsBankDolist() {
+			this.$api.goodsBankDolist({
+				goodsId:this.id
+			}).then(res => {
+				console.log(res)
+				this.bankList = res.data.data;
+			})
+		},
+		goodsBankList() {
+			this.$api.goodsBankList({
+				goodsId:this.id
+			}).then(res => {
+				console.log(res)
+				this.bankList = res.data.data;
+			})
+		},
+		goodsBankQuestionNum(){
+			this.$api.goodsBankQuestionNum(this.id).then(res => {
+				this.goodsCount = res.data.data
+				
+				this.context1.beginPath()
+				this.context1.setStrokeStyle("#32D74B")
+				this.context1.setFillStyle('#32D74B')
+				this.context1.setTextAlign('center')
+				this.context1.setLineCap('round')
+				this.context1.setFontSize(this.caculateX * 32)
+				this.context1.fillText((this.goodsCount.rightNum / this.goodsCount.totalNum * 100).toFixed(2)+'%', this.caculateX * 90, this.caculateX * 90, this.caculateX * 180)
+				this.context2.save()
+				this.context2.translate(this.caculateX * 90, this.caculateX * 90)
+				this.context2.rotate(-90 * Math.PI/180);
+				this.context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.rightNum / this.goodsCount.totalNum) * 2 * Math.PI, false)
+				this.context2.restore()
+				this.context1.stroke()
+				this.context1.draw()
+				
+				this.context2.beginPath()
+				this.context2.setStrokeStyle("#007AFF")
+				this.context2.setFillStyle("#007AFF")
+				this.context2.setTextAlign('center')
+				this.context2.setLineCap('round')
+				this.context2.setFontSize(this.caculateX * 32)
+				this.context2.fillText((this.goodsCount.doNum / this.goodsCount.totalNum * 100).toFixed(2)+'%', this.caculateX * 90, this.caculateX * 90, this.caculateX * 180)
+				this.context2.save()
+				this.context2.translate(this.caculateX * 90, this.caculateX * 90)
+				this.context2.rotate(-90 * Math.PI/180);
+				this.context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.doNum / this.goodsCount.totalNum) * 2 * Math.PI, false)
+				this.context2.restore()
+				this.context2.stroke()
+				this.context2.draw()
+			})
+		},
+		clickModule(id,index) {
+			
+			
+			if(this.bankList[index].list) {
+				this.$set(this.bankList[index],'showList',!this.bankList[index].showList)
+				return;
+			}
+			
+			this.$api.goodsChapterDolist({
+				moduleExamId:id
+			}).then(res => {
+				this.$set(this.bankList[index],'showList',true)
+				this.$set(this.bankList[index],'list',res.data.data)
+				 
 			})
+		},
+		changeItem(index1,id,type) {
+			
+			if(type == 1) {
+				if(this.bankList[index1].list[index2].list) {
+					this.$set(this.bankList[index1].list[index2],'showList',!this.bankList[index1].list[index2].showList)
+					return;
+				}
+				
+				this.$api.goodsExamList({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1].list[index2],'showList',true)
+					this.$set(this.bankList[index1].list[index2],'list',res.data.data)
+					
+					 
+				})
+				
+			} else if(type == 2) {
+				if(this.bankList[index1].list) {
+					this.$set(this.bankList[index1],'showList',!this.bankList[index1].showList)
+					return;
+				}
+				
+				this.$api.goodsExamDolist({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1],'showList',true)
+					this.$set(this.bankList[index1],'list',res.data.data)
+					
+					 
+				})
+			}
+			
+			
 			
 		}
 	}
@@ -215,6 +361,29 @@ export default {
 		}
 	}
 	
+	.courseName{
+		white-space:nowrap;
+		overflow:hidden;
+		text-overflow:ellipsis; 
+	}
+	
+	
+	.moduleItem{
+		height: 80rpx;
+		color: #333333;
+		font-size: 32rpx;
+		line-height: 80rpx;
+		font-weight: bold;
+		display: flex;
+		justify-content: space-between;
+	
+	}
+	
+	.icon_up{
+		width: 32rpx;
+		height: 32rpx;
+	}
+	
 	.title-list {
 		background: #EAEEF1;
 		padding:16rpx 16rpx 124rpx;
@@ -226,40 +395,48 @@ export default {
 				overflow: hidden;
 				border-radius: 16rpx;
 				padding:10rpx 16rpx;
-				 
-				.section {
-					padding:30rpx 0;
-					border-bottom: 1rpx solid #EEEEEE;
-					font-size: 24rpx;
-					color: #666666;
-					
-					&::before {
-						content:'^';
-						display: inline-block;
-						margin-right:20rpx;
-					}
+				
+				.module {
+					font-size: 30rpx;
+					color: #333333;
 					
-					&.up {
-						border:0;
-						&::before {
-							transform: rotate(180deg);
-						}
+					.icon {
+						margin-right:10rpx;
 					}
 				}
+				 
+				.section {
+					font-size: 30rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #333333;
+					white-space:nowrap;
+					overflow:hidden;
+					text-overflow:ellipsis; 
+					margin: 20rpx 0;
+					display: flex;
+					align-items: center;
+				}
 				
 				.article {
-					padding:24rpx 0 10rpx;
+					padding:14rpx 0 10rpx;
 					display: flex;
 					align-items: center;
-					margin-left:88rpx;
+					margin-left:40rpx;
 					font-size: 24rpx;
 					color: #666666;
 					border-bottom: 1rpx solid #EEEEEE;
 					
 					.flex-auto {
+						font-size: 26rpx;
 						flex:1;
 						margin-right:30rpx;
 						
+						
+						&:nth-last-of-type(1) {
+							border:0;
+						}
+						
 						.desc {
 							width: 480rpx;
 							padding:0 14rpx;
@@ -282,6 +459,7 @@ export default {
 						}
 					}
 					
+						
 					.btn {
 						width: 96rpx;
 						height: 48rpx;
@@ -291,16 +469,9 @@ export default {
 						font-size: 30rpx;
 						border-radius:24rpx;
 						background: #007AFF;
+						// margin-left:36rpx;
 						border-radius: 24rpx;
 					}
-					
-					&:nth-last-of-type(1) {
-						border:0;
-					}
-					
-					&.active {
-						color:#007AFF;
-					}
 				}
 			}
 		}

+ 1 - 1
pages2/subject/collect.vue

@@ -41,7 +41,7 @@
 							<!-- <view class="btn">解析</view> -->
 						</view>
 					</view>
-				</view>
+				</view> 
 			</view>
 			
 			<view class="wrongList" v-if="type == 2">

+ 3 - 3
pages2/subject/collectBank.vue

@@ -673,7 +673,7 @@ export default {
 				});
 			});
 		},
-		submitAns(type,bankindex) {
+		submitAns(bankindex) {
 				
 			console.log(this.questionList[bankindex])
 			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
@@ -718,8 +718,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {

+ 3 - 3
pages2/subject/collectTypeBank.vue

@@ -673,7 +673,7 @@ export default {
 				});
 			});
 		},
-		submitAns(type,bankindex) {
+		submitAns(bankindex) {
 				
 			console.log(this.questionList[bankindex])
 			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
@@ -718,8 +718,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {

+ 3 - 3
pages2/subject/wrongBank.vue

@@ -719,7 +719,7 @@ export default {
 				});
 			});
 		},
-		submitAns(type,bankindex) {
+		submitAns(bankindex) {
 				
 			console.log(this.questionList[bankindex])
 			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
@@ -764,8 +764,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {

+ 3 - 3
pages2/subject/wrongTypeBank.vue

@@ -719,7 +719,7 @@ export default {
 				});
 			});
 		},
-		submitAns(type,bankindex) {
+		submitAns(bankindex) {
 				
 			console.log(this.questionList[bankindex])
 			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
@@ -764,8 +764,8 @@ export default {
 				//多选
 				} else if(item.type == 2) {
 					//每一项都相等
-					return this.questionList[index].ques.every((item,index) => {
-						return item == this.questionList[index].ans;
+					return this.questionList[index].ques.every((item,i) => {
+						return item == this.questionList[index].ans[i];
 					})
 				//判断
 				} else if(item.type == 3) {